Reducing OS Boot Times for In-Car Computer Applications, Part III

The final installment in this series--did they meet their goal of a five-second boot?
How to Install an Experimental BIOS
  1. Power down. With a Sharpie marker, mark your good BIOS with a G and the experimental BIOS chip with an X so you can tell them apart. Grab the chip tweezers tool. If there is enough clearance, put the hooks through the slots provided at the corners of the socket, press the tool against the socket and squeeze. If there isn't enough clearance to get both hooks in, unfold the tool, place one hook under one corner, press the tool against the socket and squeeze gently until the chip starts to come up. Then, move on to the other corner, then back to the first and so on. You want the chip to come out straight or it bends up the contacts.

  2. Press the good BIOS in--make sure it is oriented correctly. It is possible to stick it in upside-down, which fries the chip. You don't have to push the chip all the way into the bottom of the socket.

  3. Boot. You want to make sure your distro or Flash or what-not boots before you flash the BIOS.

  4. As soon as it starts booting, you can pull the good BIOS, as it's been copied into shadow RAM. Pull it out as described above, being careful not to short out the board or break anything.

  5. Push in the experimental BIOS.

  6. Grab your fixed BIOS, however you choose to do that, and burn it with flash_rom from the FreeBIOS flash_and_burn directory. I found I often had to burn twice or, at least, had to wake the chip up by running flash_rom with no arguments to make it do the chip-ID stuff; I don't know why.

  7. Reboot and see if it works.

Creating the Faster Boot Image

The steps go in this order: power-up loads FreeBIOS, FreeBIOS loads a bootloader (FILO), the bootloader loads the kernel and so on. First, then, you have to build the bootloader. The FreeBIOS people like to use Etherboot, but Etherboot currently is broken as far as booting from disk goes. So, FILO is the thing to use. FILO is like GRUB, but it has no need for the BIOS.

Unpack FILO, switch to the FILO directory and run make. This creates a default config file. Edit config, then run make again to create filo.elf, which is what we use for the LinuxBIOS payload. Here's my FILO config.

Next, we need to add a video BIOS. Actually, the video BIOS on the Epia-M is pretty useless (more on this later), but it serves to let X know that we have built-in video, so in it goes.

Because the video BIOS is copyrighted by VIA and cannot be distributed independently, you have to grab it from your original BIOS. Do so in one of two ways. Either boot Linux and enter:

dd if=/dev/mem of=vgabios.bin skip=1536 count=128

or extract it from the BIOS distribution image, if you can find the offset. Cat the two together, like so:

cat vgabios.bin filo.elf > vfilo.elf

Therefore, vfilo.elf is our payload--a bootloader plus a video BIOS.

The traditional LinuxBIOS now is called FreeBIOS, as it can load things other than Linux. A new rewrite, called FreeBIOS2, doesn't appear to be ready yet. I therefore used FreeBIOS, which is available only from CVS. To get it, type:

cvs login
cvs -z3 co freebios

FreeBIOS builds and configures in a separate directory, so doing a CVS update doesn't hose your existing config files. So, in the same directory as where you have /linuxbios, make a build directory by issuing mkdir build. Then, create an epia-config file; here's our epia-config file.

Notice all the full paths in that file? LinuxBIOS likes full paths. To build the BIOS, do this:

python /home/jamesh/linuxbios/freebios/util/config/

where /home/jamesh/linuxbios/freebios is where I put FreeBIOS. Then run make, which should produce a file called romimage. This is what you burn to your BIOS chip.

You also are going to need some utilities from the FreeBIOS folks. cd into freebios/util/mkelfImage and issue

./configure && make && make install

to get mkelfImage, which should end up in /usr/local/sbin. Then, cd into ../flash_and_burn and do make to get flash_rom. This is what you will flash your ROM with.

On a side note, some other tools are available to produce ELF kernels--don't use them. Most of them are broken, including the one from the Etherboot project that is mentioned in the HOWTOs.



Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

LinuxBIOS on EPIA V8000

Bryan Rittmeyer's picture

Here are some aditional notes for LinuxBIOS on the older EPIA V8000:

- Use LinuxBIOSv1. LinuxBIOSv2 is still pre-alpha.

- You can in theory use many different PLCC32 flash ICs. I am using
an AT49F040A-55JI (512kB) from DigiKey ($1.68 qty 1) in place of the
SST39F020A (256kB) VIA installed. The AT49F040A required some minor
hacking inside flash_and_burn/

- If you do use a 512kB flash device, set PAYLOAD_SIZE to 458752,
VGABIOS_START to 0xfff80000, and ZKERNEL_START to 0xfff90000.

- You MUST edit src/northbridge/via/vt8601/ to configure
the DRAM (specifically "DIMM_PC133" and "DIMM_CL2"). If these
options are incorrect, LinuxBIOS will freeze immediately after the
initial banner.

- hints that you must set the FSB jumpers to 133 MHz.
Fortunately that is not the case. The V8000 runs LinuxBIOS fine at
66MHz (which reduces heat output enough to safely disconnect the CPU

- See HOWTO/EPIA for VGA BIOS support on the V8000. The extraction
procedure differs from the newer EPIA-M.

- You will probably need "ideN=noprobe" on the Linux kernel command
line to prevent IDE probe delays.

- If you need the parallel port, add "parport_init_mode=spp" on the
kernel command line to enable it.

- CONFIG_COMPRESS is responsible for the huge 3+ second delay after
"Copying LinuxBIOS to ram" and before "Jumping to LinuxBIOS". The
decompression is extremely slow, and is unnecessary, as LinuxBIOS
easily fits in the 64KB area without it.

Add "option CONFIG_COMPRESS=0" to the LinuxBIOS config file and
it will disable compression in favor of a fast, plain memory copy.
With this option, LinuxBIOS transfers control to Linux 2-3 seconds
after power on (even at 66MHz FSB with VGA enabled)!


Anonymous's picture

Don't you mean LILO? :P

I'm a computer engineer, and

Anonymous's picture

I'm a computer engineer, and I would strongly advise against hot-swapping BIOS flash chips. It might work, but you risk frying your motherboard sooner or later.

bios flashing device

Anonymous's picture

There's a device called an
"IOSS RD1" that will simplify the flashing of a bios
that allows you to switch bioses without having to pull
chips on a live system.

Might be easier than the process you describe.

I've never tried it so I don't know if it works or not.

search google on "ioss rd1" or look at

linux oracle

joe's picture

if we have Linux, which database between oracle and mysql will work better

Re: Reducing OS Boot Times for In-Car Computer Applications, Par

Anonymous's picture

Something is wrong with your linuxBIOS setup. I'm the maintainer of the Intel 440bx port for LinuxBIOS V1. I've got 2 different 440BX boards with 400Mhz Celerons that get to your 9 second mark in under a second.

Oh and FYI. The proper name of LinuxBIOS is indeed LinuxBIOS. Not FreeBIOS. FreeBIOS is the project that LinuxBIOS came from. The reason its still in CVS as freebios is historcial and that its a real PITA to change the CVS setup.

0.334 LinuxBIOS-1.0.0 Sat Aug 21 14:48:58 PDT 2004 starting...

Here's the first clue something is wrong. The only thing that LB does between reset and this message is enable the RAM. Taking 300mS to turn on your RAM is _WAY_ slow.

3.492 Copying LinuxBIOS to ram.
6.292 Jumping to LinuxBIOS.

2.8 seconds to copy the code into RAM?! Thats crazy. You need to subscribe up to the LinuxBIOS mailing list and post your time stamped serial log there and ask for help to get your settings correct. Something is very hosed.

Richard Smith

CE Linux Forum work in bootup time reduction

tbird20d's picture

You may want to check out the work that has been done by the
CE Linux Forum on bootup time reduction. I presented a paper
at the 2004 Ottawa Linux Symposium, listing some techniques
for bootup time reduction.

These resources are available at: