View Single Post
raandoom's Avatar
Posts: 46 | Thanked: 131 times | Joined on Jul 2011 @ Russia, Moscow area
#32
Exuse me, that i am so long don't post the FAQ and sorry for my not so good english
FAQ: Changing boot logo
* All in this FAQ tested on N900 with hw-revision = 2101, but all offsets are the same for other revisions (thanks to hxka for this info).
If you don't know your revision - "flasher-3.5 -i" will help you.

1. What you need
- RX-51_2009SE_20.2010.36-2_PR_COMBINED_MR0_ARM.bin
- flasher-3.5
- logo_compress.elf (attached to post)
- image file you want to use (it should be 416x72 pixels)

You need to unpack RX-51_2009SE_20.2010.36-2_PR_COMBINED_MR0_ARM.bin. There will be a lot of unpacked files - better if you will make this in some empty folder. Unpacking:
Code:
flasher-3.5 -F RX-51_2009SE_20.2010.36-2_PR_COMBINED_MR0_ARM.bin -u
Find files "secondary..." and "xloader..." for your revision and rename them to some more shorter For example let's rename them to "secondary.bin" and "xloader.bin".
And try to don't forget this files, we will need them later.

2. Preparing source image
Better if you convert your image to 16bpp BMP image. In this step you can see how your logo will look like You can convert your image using this:
Linux: ImageMagick
Windows: PixelFormer
Check yourself: in this step your image must be ~59970 bytes.

Then you need to cut off the header, because elf need raw rgb565 as input file. You can do it with any hex editor (but you need to be sure that your BMP is "top-down row order", NOT "bottom-up row order") or using this in Linux:
Code:
ffmpeg -vcodec bmp -i mylogo.bmp -vcodec rawvideo -f rawvideo -pix_fmt rgb565 rawbmp.bin
* You can make this with any format, but with BMP you can already see the result logo and edit it for decreasing size of result logo.
Check yourself: in this step your "rawbmp.bin" must be 59904 bytes.

3. Creating compressed logo
Put "logo_compress.elf" and your "rawbmp.bin" somewhere into your phone. (For example: /home/user/logo)
And all you need is run this elf:
Code:
cd /home/user/logo
./logo_compress.elf
You will see something like this:
Code:
./logo_compress.elf 
Size of 'rawbmp.bin' is 59904 bytes
fread: 59904 bytes succesfully readed
fopen: 'logo.bin' created
It is mean that all ok and your logo successfully compressed in "logo.bin".

4. Check "logo.bin"
There is some limitations for result logo. The maximum size for "logo.bin" is 6646 bytes.
If size of your "logo.bin" is more than needed, you must go to step 2. Preparing source image and edit your BMP. You must reduce the number of groups with non-recurring pixels. It is mean you must make smooth transitions of colors more sharper, for example.
If size of your "logo.bin" is less than needed, you can go to the next step.

5. Patching "secondary.bin"
Do you remember your "secondary.bin" and "xloader.bin". Put them in some folder with. Upload your "logo.bin" from your phone and put it in this folder too. Now we can start patching.
Patch "secondary.bin" with your "logo.bin":
Code:
cd /path/to/some/folder
dd if=logo.bin of=secondary.bin bs=1 seek=75940 conv=notrunc
Now better if we patch data with new lenght for image too:
* In this example image size is 6646 bytes (in hex it is 0x19F6), you must write your size in the command.
Code:
echo -ne '\xBF\xF8\x3E\x61' | dd of=secondary.bin bs=1 seek=33240 conv=notrunc
echo -ne '\xF6\x19' | dd of=secondary.bin bs=1 seek=33562 conv=notrunc
And a little bonus You can change the background color too:
In first command change bytes '\xFF\xFF\xFF\xFF' to needed color. Color must be 16 bit depth and bytes must be reversed and doubled Example:
0xF800 is RED , it is meen you must write '\x00\xF8\x00\xF8'
0x07E0 is GREEN , it is meen you must write '\xE0\x07\xE0\x07'
0x001F is BLUE , it is meen you must write '\x1F\x00\x1F\x00'
Code:
echo -ne '\xFF\xFF\xFF\xFF' | dd of=secondary.bin bs=1 seek=36836 conv=notrunc
echo -ne '\x17\xE0' | dd of=secondary.bin bs=1 seek=36834 conv=notrunc
echo -ne '\xC0\x46\x40\x4A' | dd of=secondary.bin bs=1 seek=36574 conv=notrunc
6. Flash your "secondary.bin"
And finally all we need is flash your new "secondary.bin" to device.
Code:
flasher-3.5 -s "secondary.bin" -x "xloader.bin" -f
Don't forget reboot your phone:
Code:
flasher-3.5 -R
And after all you can see your new boot screen

If somethings go wrong and your phone bricked, remember about Cold Flashing.
Attached Files
File Type: zip logo_compress.elf.zip (2.3 KB, 195 views)

Last edited by raandoom; 2012-02-16 at 16:57.
 

The Following 6 Users Say Thank You to raandoom For This Useful Post: