[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

How are CHRP bootinfo icons formatted?



Hello,

Every Linux bootinfo file I've seen for PowerMacs has had either the GNU logo for GRUB or the Tux for yaboot. Here's an example of the Tux:

<OS-BADGE-ICONS>
1010
000000000000F8FEACF6000000000000
0000000000F5FFFFFEFEF50000000000
00000000002BFAFEFAFCF70000000000
0000000000F65D5857812B0000000000
0000000000F5350B2F88560000000000
0000000000F6335708F8FE0000000000
00000000005600F600F5FD8100000000
00000000F9F8000000F5FAFFF8000000
000000008100F5F50000F6FEFE000000
000000F8F700F500F50000FCFFF70000
00000088F70000F50000F5FCFF2B0000
0000002F582A00F5000008ADE02C0000
00090B0A35A62B0000002D3B350A0000
000A0A0B0B3BF60000505E0B0A0B0A00
002E350B0B2F87FAFCF45F0B2E090000
00000007335FF82BF72B575907000000
000000000000ACFFFF81000000000000
000000000081FFFFFFFF810000000000
0000000000FBFFFFFFFFAC0000000000
000000000081DFDFDFFFFB0000000000
000000000081DD5F83FFFD0000000000
000000000081DDDF5EACFF0000000000
0000000000FDF981F981FFFF00000000
00000000FFACF9F9F981FFFFAC000000
00000000FFF98181F9F981FFFF000000
000000ACACF981F981F9F9FFFFAC0000
000000FFACF9F981F9F981FFFFFB0000
00000083DFFBF981F9F95EFFFFFC0000
005F5F5FDDFFFBF9F9F983DDDD5F0000
005F5F5F5FDD81F9F9E7DF5F5F5F5F00
0083DD5F5F83FFFFFFFFDF5F835F0000
000000FBDDDFACFBACFBDFDFFB000000
000000000000FFFFFFFF000000000000
0000000000FFFFFFFFFFFF0000000000
0000000000FFFFFFFFFFFF0000000000
0000000000FFFFFFFFFFFF0000000000
0000000000FFFFFFFFFFFF0000000000
0000000000FFFFFFFFFFFF0000000000
0000000000FFFFFFFFFFFFFF00000000
00000000FFFFFFFFFFFFFFFFFF000000
00000000FFFFFFFFFFFFFFFFFF000000
000000FFFFFFFFFFFFFFFFFFFFFF0000
000000FFFFFFFFFFFFFFFFFFFFFF0000
000000FFFFFFFFFFFFFFFFFFFFFF0000
00FFFFFFFFFFFFFFFFFFFFFFFFFF0000
00FFFFFFFFFFFFFFFFFFFFFFFFFFFF00
00FFFFFFFFFFFFFFFFFFFFFFFFFF0000
000000FFFFFFFFFFFFFFFFFFFF000000
</OS-BADGE-ICONS>

It seems like there are three different tuxes here, each one being 16x16 pixels and each pixel getting a byte in hex. The third tux seems to only have two pixel values, 0x00 and 0xFF.

The GNU logo is formatted a bit differently. I won't post the whole thing here, but an example can be found at [1]. It also has three different bitmaps with each pixel getting a byte in hex, but now each one is 52x52 instead of 16x16, and the two-byte value above the bitmaps is 3434 instead of 1010. It seems that the difference between these is that the 52x52 GNU logo takes up the entire boot icon, while the 16x16 Tux appears in the bottom right corner of an HDD icon, similar to OS X.

I spent a while searching for information on how exactly these icons are formatted so I can make a custom one with the Debian logo, and the best I could find is [2] which describes the original CHRP standard without any changes from Apple. It shows that the byte for each pixel can be calculated by giving the first three bits to red, the next three to green, and the last two to blue. Example: #008080 -> rgb(0, 128, 128) -> 00010010 -> 0x12. I created a Python script [3] that generates this bitmap from a 16x16 image file.

The only problem is that the original CHRP standard doesn't have those second and third bitmaps, only the first one, and I can't find any resources explaining what the second and third ones are for and how they are formatted. I think that the third one might carry information about transparency, e.g. 0xFF for any pixel that should be drawn and 0x00 for transparent ones, but I have no idea what the second one is supposed to be and how I can create it. Since I can find absolutely no information about this anywhere, I'm asking here if anyone has any idea of how to format a CHRP icon. The developers of yaboot and GRUB must know, since they include the logos in the bootinfo files in their source code. Does anyone have any information that could point me in the right direction?

Thanks,
--
Ben Westover

[1] https://wiki.gentoo.org/wiki/GRUB_on_Open_Firmware_(PowerPC)#CHRP_boot_script
[2] https://www.devicetree.org/open-firmware/bindings/chrp/chrp1_8a.ps
[3] https://gist.github.com/benthetechguy/e31fb541c49a57f5f44c4c7cca79770c

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


Reply to: