LinuxBIOS at Four
LinuxBIOS is a GPLed program that replaces the BIOS found on many computers, including AMD64, x86, Alpha and PowerPC systems. LinuxBIOS is a vendor-independent, architecture-neutral BIOS, more than 95% of which is written in C. LinuxBIOS is four years old. Some of the largest Linux clusters in the world use LinuxBIOS, and some of the smallest embedded systems in the world do too. LinuxBIOS has been used in robots searching for survivors in the World Trade Center, as well as robots used in Afghanistan and Iraq. LinuxBIOS is supported by many vendors, including AMD and Tyan. It now is possible, for example, to order LinuxBIOS motherboards from Tyan.
In this article I describe the basic structure of LinuxBIOS, the origins of LinuxBIOS and how it evolved to its current state. I also cover the platforms it supports and the lessons we have learned about trying to marry a GPL project to some of the lowest-level, most heavily guarded secrets that vendors possess.
Before we can explain LinuxBIOS structure we need to provide a quick overview of modern PC architectures. PCs consist of a set of chips, including the CPU, graphics and keyboard controller, all connected by buses. A bus is a set of one or more wires that can be used to interconnect two or more chips. Some buses have two wires, signal and ground, and other buses have tens or hundreds of wires.
A highly simplified diagram of PC architecture is shown in Figure 1. The different types of buses cannot be wired to one another directly, so chips known as bridges are used to connect one bus to another. The first bus is the front-side bus, and on most PCs it connects CPUs to one another and to the north bridge. The north bridge connects CPUs to both the memory bus and the PCI bus. In our diagram we show only one north bridge, but there are many variations on this theme. The AMD Opteron, for example, uses a north bridge for each CPU, and the front-side bus connects only each Opteron CPU to its own north bridge. In other words, there is no shared front-side bus on the Opteron. Nevertheless, the north bridge is an identifiable device in the Opteron chipset.
The south bridge, which almost always resides on PCI bus 0, is the next bridge in line. The south bridge interfaces from the PCI bus to legacy devices, namely the set of devices found on PCs ca. 1981. The south bridge also drives the BIOS Flash part.

Figure 1. A simplified view of a basic PC architecture. Bridges are chips that connect one bus to another.
When the PC is turned on or reset, the CPUs start fetching from a known address, which traditionally has been from the top of memory (TOM) minus 16 bytes. In the original 8086, this was address 0xffff0; on newer PCs, it is address 0xfffffff0. This initial instruction fetch has to be supported by the hardware somehow, even before it has been configured. A lot of the hardware has to work for that first instruction fetch.
Nevertheless, when first turned on the PC hardly is ready to run C code and barely is ready to run assembly code. The motherboard has to be brought to life in stages. As a result, LinuxBIOS has a sequence of bootstraps, each bootstrap being invoked when additional CPU resources are activated. Each bootstrap assumes that certain resources have been enabled and that the machine has a well-defined set of resources available.
These LinuxBIOS pieces are:
The first 10 or 15 instructions that enable the CPU, enable a minimal virtual memory capability (at minimum, 32-bit addresses) and enable other resources needed to turn on memory (such as the I2C bus). They also set the internal CPU state to clean up things, such as instruction pipelines.
Memory startup code, which requires a sane CPU and a working I2C bus for interrogating memory parameters.
Code that loads object code originally written in C from Flash to memory. The object code optionally can be compressed.
Code that can be run once memory is working. This code scans all the hardware resources and initializes them.
One or more payloads that perform any custom final configuration work and boot an OS.
We show all the phases in Figure 2.
LinuxBIOS supports an optional fallback BIOS in the event of BIOS problems. The fallback support is built in to the BIOS when it is compiled. Additional code checks flags in the CMOS and determines whether the CMOS is corrupted, whether the previous BIOS failed to start correctly or whether the user wishes to boot in to the fallback CMOS. The fallback BIOS is a complete LinuxBIOS image, and its capabilities are not limited in any way.
The fallback capability is useful for unattended BIOS updates. Consider the case of updating the BIOS on 1,024 or more nodes—what if it fails halfway through? For most systems, you now have a very expensive, very heavy paperweight. With LinuxBIOS, one simply resets the nodes and they come back up automatically in fallback mode.
The Magazine
Linux Journal is the premier source for how-tos, projects, product reviews, expert advice and opinions for everything Linux.
| Linux Mint Debian Edition Released | Sep 08, 2010 |
| Spotlight on Linux: Zenwalk Linux 6.4 "Live" | Sep 08, 2010 |
| Old Generals Never Die - They just Wear a Red Hat | Sep 07, 2010 |
| Alien - Use Any Package On Any Distribution | Sep 07, 2010 |
| Clonezilla Live | Sep 03, 2010 |
| No Steam for Linux - Right Now | Sep 02, 2010 |
- Linux Mint Debian Edition Released
- Boot with GRUB
- Chess Software for Linux
- New Issue
- Old Generals Never Die - They just Wear a Red Hat
- Building a Two-Node Linux Cluster with Heartbeat
- Spotlight on Linux: Zenwalk Linux 6.4 "Live"
- VLANs on Linux
- Alien - Use Any Package On Any Distribution
- Clonezilla Live
- Sneak Peek
44 min 31 sec ago - just want to get to windows!!
2 hours 7 min ago - Author's Comment
5 hours 6 min ago - Java executable jar to create xml file
5 hours 17 min ago - real economy
6 hours 11 min ago - I cannot agree with you
7 hours 38 min ago - Elite Army division?
8 hours 27 min ago - Quote by Groucho Marx
11 hours 11 min ago - Get a legal high with brainwave entrainment
11 hours 20 min ago - Correction.
11 hours 22 min ago













Comments
Itsy Bitsy Diagrams
I know this article is five years old but, please if you are going to put small diagrams on to use SVG, Please.
Clickee
Click on the images/diagrams to see larger versions.
Mitch Frazier is an Associate Editor for Linux Journal and the Web Editor for linuxjournal.com.
The smallest mini pc in the world, which is good for your system
I found this manufacturer (Sd-Omega Electronics Industry CO., Ltd.) is selling the smallest pc in the world!!! Even CAR PC, Amazing products!!!
(Small form factor Pc, mini pc, world's smallest pc)
Hope you guys enjoy it!!!
http://www.sd-omega.com
Re: LinuxBIOS at Four
Thanks,
this article gives a very good summary, what linuxbios can do.
Nevertheless it's helpfull to know, what it n o t does:
1.) no provides bios-API (important for non-linux OS)
2.) no ACPI information.
3.) to show a boot-logo VGA must be organised first, this is not primary goal of linuxbios.
BTW: Any hint to access / address the normal bios in RAM of a normal booted Linux-X86-PC? Are there "Standards" where ROM is mirrored?
Bernhard
what use of boot-logo? just
what use of boot-logo? just unnecessary bells-and-whistles
Post new comment