Let's contrast booting an Intel PC with booting an embedded system, which, typically, has some other, lower-power-requirement chip set.
In very coarse outline, when you start up an Intel PC,
- the hardware jumps to a certain location in memory
- that location says "run the BIOS"
- the BIOS says "run the bootloader"
- the bootloader says "bring up the OS."
If it were a car, the BIOS would be the ignition, the bootloader would be the starter motor, and the OS would be the engine. Just as the starter motor is an engine, the bootloader is an OS -- it's just a very simple OS which knows only enough to bring up the "real" OS.
- The BIOS isn't very powerful, but knows some basic things about the Intel architecture.
- The bootloader is more powerful than the BIOS, and knows enough to load the operating system into memory including enough of a faked-up filesystem and drivers to let the OS start up.
- The OS is then up far enough that it can take over and start everything else.
Other systems are roughly the same, but the division of labor for the first steps changes. On Intel boxes, the BIOS can be pretty smart, and the bootloader pretty dumb, because the BIOS knows it's running on a well-standardized Intel platform.
Other embedded devices are more varied, so the bootloader needs to be smarter and more flexible. For Android, as for many other embedded systems, the bootloader of choice is Wolfgang Denk's powerful Das U-Boot. The problem that it faces, however, is that its sophistication and ability to run on many chipsets and boot many operating systems requires a lot of code. U-boot is so big that it can't fit into the boot ROM of typical TI chips. For these chipsets (like the one on the Beaglebone, or in the OMAP-based smartphone from aircell), u-boot is a second-stage bootloader, which is started by an earlier, first-stage bootloader, called x-loader or omap (and no, I don't yet know why it has two names).
The x-loader is a chopped-down version of u-boot, small enough to fit in the TI boot ROM, and that knows just enough about the TI architecture to be able to bring up u-boot.
No comments:
Post a Comment