In Part 1, we discussed BootX, and it's drawing of the grey apple logo at startup, and how to change it. Once BootX (or in the case of intel users, boot.efi) has done its drawing, it decodes the kernel, and gets it started up. From there, the kernel takes over, and starts loading things. One of the kernel's jobs is to draw the spinning progress wheel on the gray screen with the apple.
Now, if you've ever dumped the kernel into a RAW editor with the right settings, (most people haven't), it would have been immediately apparent where the spinning image is stored... it's a raw image in the kernel, just like the apple was in BootX. One 8-bit channel containing 24 frames, each 32x32, comes to $6000 bytes, starting at $3489DC in the file /mach_kernel. Unfortunately, there's a catch... about changing it, you know...
Well, you can change the image all you want, but the kernel is funny about how it draws it... First I should note that the image is actually drawn two times. It is of course drawn during boot, as mentioned above. But it is also drawn (at least occasionally) at shutdown. At boot time, it is drawn on the grey background, in 8-bit mode. At shutdown it is drawn on a blue background - the windowserver's background - in whatever mode the display's in. Oh, and, on occasion, it's drawn on top of your desktop when you do weird things like kill the login task and stuff... again, in whatever mode the display's in. Let me describe the two modes of drawing.
This mode is the nicer of the two modes, but it's still not very nice. The image is interpreted as an alpha channel with no data channel - that means the data is considered black. SO, what you'll see is a result that's black where the image is black and transparent (i.e. the background color) when the image is white. Pretty straightforward to understand. And reasonable, if not very flexible. No colored images, but at least it comes through and matches the background.
The drawing in 8-bit mode is not only more complicated, but also more restrictive. The kernel starts by constructing a reverse color lookup table. First it maps each luminosity of the progress meter image to a luminosity between 0 (black) and the luminosity of the red channel of the background (recall that at boot, this is the second color in your color table from BootX - the kernel has imported the color table to its environment). Then it searches your color table (from BootX again) to see if it can find a gray color with that luminosity - (i.e. Red, Green, and Blue channels all have that luminosity). If it finds one, it maps that value from the progress meter image to that color on your color table. If it doesn't find a matching gray, it maps it to whatever color is at the index that matches the red luminosity of the background. So, if the backround color is $123456, then it'll map to whatever color is at $12 in your color table. Keep in mind color table indexes are 0 based, so that would be the 19th color in the table.
Now, this is REALLY limiting. First, you're limited to colors between your background color and black. That means if you've picked a black background, it will be black anyway. Second, you're limited to grays in your color table + whatever color is at a special index. So you probably don't have much to work with. If you have a colored background (as opposed to gray), the best you can hope for is an aliased grayscale image on a colored background, and that's the best... You might also opt to just fill it in with the background color. Whatever. But you don't have a lot of choice. If you happen to have used a gray background, you're a little better off, but only if you've got all the grays between that and black in your color table. If you're really really lucky, you used a full grayscale color table for your image in BootX, in which case, you can expect your image to work almost normally (i.e. as it would in 32-bit mode).
From here, you have a number of options... well, I guess...
If you've used a full grayscale color table in your BootX file, you can just pretend that the gear image is a mask for a black matte over whatever screen. Edit to your heart's content. Editing is exactly like for the BootX image, except that the Raw image width is 32, the height is 768 and you won't be loading a color table. Cheers.
This will be less straight forward. The first thing you will want to do is to make your background color be the default color for the spinning progress meter image (called spinny from here to save me time). To do this, you will need to reedit your BootX file.
Open your modified image for BootX in hex edit. If necessary load the color table. Now, go to the color table window, and click on the second color (i.e. the second one from the left in the top row). This should open a color picker. In the RGB section, look at the red value. It should be an integer from 0 to 255 inclusive. Let's call that number n. Now, close that color picker, and locate the (n+1)th color in the color table. For example, if n was 48, you'd want the 49th color, which would be the first one on the fourth row down. (the rows have 16 colors each). Change this color to match the background color. **Note that some may prefer creative uses of this in a different color** You may want to remember what the old color was. Now, you can close the color table. However, if you look at the image, there'll be a few spots that are now the background color, but shouldn't be. You'll need to go through and re-color them (with the paint bucket or something) to be a color close to what they were before. Then, re-save the image and color table, and inject them into BootX as before, and check to make sure that they worked right.
Now we're ready to work on the kernel image. First, we want to figure out what colors we have to work with. Load up the color table from BootX again, and see what you have to work with. The colors available to you are: grays that are darker than the red component of your background and in your color table, and now that we've done that process above, your background color is an option as well. That's it. So, construct your spinny image (all 24 frames) using only those colors. It may help to look through your color table in hex edit, and prune it down to just that, and then apply said color table to your image... or something.
Once you're ready to go, we need construct a table in a spreadsheet app. Three columns. Column A has a value of n all the way down. Column B has a value increasing from 0 to 255. Column C should be equal to int(((A*B) +255)/256) entered in whatever mode your spreadsheet requires... All three columns should extend for 256 rows.
You may wish to minimize the color table by changing the mode to RGB and then back to indexed and selecting "Exact" in the palette popup in the Indexing options window. Then of course open the color table to see/edit colors. Locate your one special color (i.e. the background color), and change it to a value of gray that's darker than it's red component, and doesn't match any of the other grays in the table already. This may be tricky. Now, for each color in your color table (just the one's you've used for the spinny image - I hope it's kinda short by now), you'll need to do the following steps:
Now, close the color table, and go to Image -> Mode -> Grayscale. Save as a raw image, reinject into mach_kernel, and you're done. Reboot and admire.
Ah... how right you are.
But I'm not going to recommend it.
You could always recompile the kernel... to draw in a better way...
I'm not going to tell you how to do that though... I'll give you a little pointer, but that's it. First, go to Apple's Darwin source code page and download the xnu package (the kernel). The code for drawing the progress meter is in a file called video_console.c and the progress meter image is stored in the file GearImage.h. I'm not going to help you compile it. I haven't even tried myself. And don't say I recommended it, cause I don't.