u

I am sitting here at my desk experiencing some local network problems and thought I would take this time to discuss creating and using a splash screen in a bootloader.  My target OS is Windows CE, but this applies to any code that needs to draw to a display without the use of an OS since this is a bootloader.

What is a bootloader splash screen?  The bootloader is a small peice of code that runs when the reset vector is processed.  This code's primary purpose is the initialize some hardware and look for OS updates.  This shouldn't take much time, but if you include the time that it takes for the OS to boot to the desktop there is a long pause before the user sees activity.  A long pause in  user time can be one second or more.  So it is nice to show the user that the device is doing something.  To do this many devices show a graphic on the display, this is commonly known as a splash screen.

I am going to keep this as generic as I can.  So that means no code and nothing specific to any CPU, Display Controller or anything else.  But instead I hope to inspire you to think about a splash screen for your device and give you enough information to do some research and get a splash screen working.

What needs to be done to add a splash screen:

    1. Find a good place in your existing code to add splash screen support
      This can be anyplace that works.  Probably best to do it after you get out of the assembly code and after you have done some basic initialization of other hardware and software.
    2. Initialize your Display Controller
      The most common question that I see asked about this is how do I do that?  The good news is that in most cases you probably already have some code doing it in your display driver.  So it is a matter of porting that code to build and run in your bootloader.    If you don't have that code, then hopefully you have a datasheet for your display controller and can figure out from it how to initialize the display controller.  Just keep in mind that what you don't have is an operating system, so no threads, no events, not syncronization objects, no interrupts.
    3. Add a graphic to your system
      This one can be fun.  Of course the first thing to do is figure out which graphic you will be able to decode to display from your bootloader.  I suggest keeping it simple.  A Windows Bitmap (BMP) or a just a blob of data works well.  Here are some thoughts on what you can do:
      - Add a structure to your code that includes the binarly data.  Of course creating the binary data can be challenging and may require that you write a desktop application to do it.
      - Add a file to your system.  This can be done by putting the file in an unused region of your ROM, on a CompactFlash or SD card, or in your persistent flash file system.  But, it will require that you have some way to read it from your bootloader.
      - Add the file to your bootloader .bib file.  You will need to figure out how to get it from the bootloader image then.
    4. Draw a graphic and maybe a background color
      By now you have initalized the display controller and should have a frame buffer that you will write to.  So the rest is down hill.  You will need to write some code to read the graphic, this is where keeping it simple will come in handy.  A quick internet search for "file format bmp" should yeild enough information to decode a Windows Bitmap file.
    5. Turn on the backlight
      Only you know how to do this.
    6. Modify your display driver so that it doesn't clear the splash screen
      If you have a splash screen, you will now notice that the display driver probably will clear the screen.  This can cause a blank screen for short time before the desktop or your application starts.  If you remove the clearing of the display it will make it a smoother transition.

You may also be interested in Platform Builder: Creating a CEPC Splash Screen.  This discussed setting up a splash screen with the CEPC BIOSLoader.

Copyright © 2008 – Bruce Eitman
All Rights Reserved