Hack44.Reduce the Boot Time of Your in-Car Computer


Hack 44. Reduce the Boot Time of Your in-Car Computer

There are dozens of tricks you can use to reduce the boot time of your in-car PC.

In 1980, if you turned on a car stereo, it turned on. Instantly. If you left the volume up from the last time you'd used it, the sound would come blaring out as quickly as the tape could start spinning and the analog amplifier circuits could charge their capacitors.

Nowadays, when you turn on your car radio, it boots up just like a computer. Since it only loads a tiny bit of microcode out of nonvolatile memory, though, it boots too quickly for most people to really notice. And by saving a bit of state information, it usually returns to the last radio station or CD track you were listening to.

NAV systems also have to boot up. When you turn on your modern navigation screen in a luxury car, you may have to wait a few seconds for everything to settle down, but the splash screen comes up almost instantly, and it feels more like starting an appliance than like booting a computer.

User-interface designers have often been critical of the modern PC boot process. Every modern operating system usually takes several minutes to boot up and load its graphical user interface. But why? You'd think that an operating system would be able to figure out what hardware is in the machine and, barring any changes, simply snap right back to where it was the last time the machine was shut down.

The general solution to the lengthy boot process has been to create energy-saving modes. Instead of shutting the machines off when not in use and then making them boot faster, the simpler approach is to allow the computers to sleep, by turning off some of the most power-hungry devices during down time (i.e., the monitor and the CPU) and supplying power only to keep the OS and programs paused in memory.

Another energy-saving mode is hibernation, where the contents of memory are quickly saved to the hard disk, and the computer is shut down completely. Then, when it boots up again, it restores the memory from the hard disk and picks up where it left off.

Hibernation is one of the most common tricks used for getting a car PC to boot a bit quicker. Most PCs can be configured to hibernate when the power button is pressed, instead of shutting down. This can cut boot times down to 30 seconds or so, but awakening from hibernation still takes a long time because hundreds of megabytes of memory have to be refilledand the more memory you have, the more Windows will fill, and thus the longer it will take to restore. A trick for quicker hibernation wake-ups is to reduce the amount of RAM to the minimum you really need.

4.5.1. Breaking It Down

It isn't just the operating system that contributes to boot time. The BIOS power-on self-test (POST) and device detection, the hard drive spin up, and the boot loader delays are all factors, not to mention the multi-second delays added by startup/shutdown controllers [Hack #43] in an attempt to stabilize the car power.

Figure 4-11 breaks down the boot process into all the steps, from turning the key to hearing the audio resume where it left off when the computer last shut down.

Figure 4-11. The steps of an in-car computer boot process


4.5.1.1 Stabilizing power.

The power stabilization step is just how long it takes for the voltage to level out in the car. When you start to crank the engine, the 1214V suddenly drops to 8V or lower. Your computer's startup process will be reset unless its power supply can deal with this much of a voltage drop. "Keep Your Computer on During Engine Cranking" [Hack #45] discusses how to alleviate this problem. You're pretty much stuck with the delays built into your chosen hardware and power supplies, but having a good alternator and a good strong battery can save a little time.

Once the power has stabilized in both the car and the power supply, whatever on/off circuit you are using will "press" the power switch to turn on the computer. The computer's POST takes a few seconds at a minimum, just to test the memory. If you're adventurous you can actually replace the computer's BIOS (http://sourceforge.net/projects/freebios) to reduce the boot time, but normally you'll only be able to optimize the BIOS by changing settings, as outlined next.

4.5.1.2 Optimizing the BIOS settings.

There are several simple setting changes that can greatly reduce boot time. For one, setting the desired boot device as the only boot option simplifies the process of looking for CD-ROMs and floppy disks to boot from. Eliminate legacy devices and settings such as floppy disks, floppy seek at boot, the floppy controller, and any other setting having to do with floppy disks to prevent hardware detection delays. Definitely disable any LAN boot, as this is useful only when booting from a server (i.e., quite useless for a car PC). Set the BIOS error setting on the main page to not stop on any errorsyou want the car PC to boot even if no keyboard is attached.

Whether you are using Linux or Windows, you can gain time by disabling onboard devices. If you aren't using the onboard Ethernet for anything, disable it. If you aren't using serial ports or parallel ports, disable those as well. Every device that must be auto-detected and configured takes a few milliseconds to a few seconds. If you aren't using the second IDE channel for hard disks, disable thatand definitely disable any unused onboard SCSI cards, as this setting consumes a lot of time during boot.

You can sometimes also disable the summary screens and graphical splash screens of the BIOSalthough these don't add much time (if any), they add visuals you probably don't need to see in a car PC.

4.5.1.3 Optimizing boot loading.

Once you have trimmed down the BIOS, you should have a computer that hits the boot loader screen within a few seconds. Many boot loaders for either Linux or Windows sit there for several seconds to give you the option of pressing keys to change the booting process. Since your car computer system is supposed to boot the same way each time, you can disable these optionsyou want the OS to start booting immediately. Depending on the boot loader, this change can save another two or more seconds in the boot process.

4.5.1.4 Trimming the operating system.

If you are going to rely on hibernation to decrease your boot times, you need to actually reduce your total system memory. Counterintuitive as it is, less memory makes for faster resumption from hibernation. The more memory there is, the more the operating system uses, and thus the more "stuff" there is in memory that must be saved to disk and later restored. Since the multitasking demands of a car PC can be less than those of a desktop, you should be able to get by with less memory than you might thinkeven 128 MB might be sufficient.

If you are going to do a full OS boot instead of restoring from hibernation, however, you should trim down services and disable anything not needed that tries to find and dynamically configure devices. While this is fairly easy to do on Linux, Windows has less granular control over the boot process.

An excellent reference for optimizing boot times on Windows XP, titled "Beginners Guides: 99 Performance Tips for Windows XP," is located at http://www.pcstats.com/articleview.cfm?articleid=1590.

Optimizing Linux can vary by distribution, but the complete configurability of the sequence of boot processes offers many more options than Windows for tuning the system. An article I wrote, "Reducing Boot Times in Linux" (available at http://www.linuxjournal.com/article.php?sid=7594), summarizes several of these options.

4.5.1.5 Giving the user something to see and hear.

One of the ways to make a user interface appear to be "working" is to make sure that video is on the screen and sound is coming out of the speakers. The Windows boot loader normally briefly shows the Windows 98 or Windows XP screen. If you're working with Linux, with either the GRUB or LILO boot loaders, you can get a splash screen up almost instantly, and it can show animation throughout the boot process. You can find GRUB and LILO boot resources at http://ruslug.rutgers.edu/~mcgrof/grub-images/ and http://www.gamers.org/~quinet/lilo/help.html, respectively.

In Linux, if you load the sound drivers early on in the boot process, you can activate a "splash sound" to let the user know that the car PC is booting. You can even put your MP3 player as an extremely early-running service, so that MP3 playback from the last-known position in the playlist resumes before the rest of the software (for instance, an X Windows environment) boots. (However, if you run a new GUI MP3 player, once the GUI boots it will interrupt that command-line MP3 player.)

4.5.2. More Hardware Approaches

After doing everything possible to the software, you'll still be stuck at 2030 seconds for booting up. How do you get it down from there? If you are willing to try a brute-force solution, there's some more hardware you can throw at the problem.

4.5.2.1 Using faster hard drives.

The 2.5" IDE drives that come in many in-car computers and laptops are usually 4,200-or 5,400-RPM drives. You can upgrade to a 7,200-RPM drive in the laptop form factor, such as the Hitachi Travel-star 7K60. You can also use 3.5" drives, and get a 10,000-RPM drive such as a Western Digital Raptor WD740GD. But these faster hard drives are power hungry, so why not go for a solid-state solution? You can get a multigigabyte drive such as M-Systems's (http://www.m-systems.com) Fast Flash Disk (FFD) 2.5" Ultra ATA or BitMicro's (http://www.bitmicro.com) E-Disk. Designed for use in fighter planes, these drives essentially eliminate seek times, reducing them to microseconds. Of course, be prepared for sticker shocksolid-state hard drives can be hundreds of times costlier per megabyte than mechanical hard drives.

4.5.2.2 Starting the computer earlier.

Another way to "reduce" the boot time is to have the computer already on when you get to your car.

Why should the computer start booting only when you turn the key? One user read an article I wrote and suggested that the car PC should start booting as soon as you open the car door. Another approach is to start the computer with your remote keyless entry system [Hack #46].

But why wait until you're near your car? If you drive on a schedule, there's no reason not to boot your car PC minutes before you get to your car, with your email and traffic information already downloaded and your music queued up. You can set up this solution using "Boot Your Car Computer on a Schedule" [Hack #47].

Note that these "early-bird" booting approaches only work if your computer can stay on during engine cranking [Hack #45].



    Car PC Hacks
    Car PC Hacks
    ISBN: 0596008716
    EAN: 2147483647
    Year: 2005
    Pages: 131

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net