x
Loading
 Loading
Hello, Guest | Login | Register

Linux and the BIOS

The x86 kernel has direct and indirect dependencies on the system BIOS. Here’s a look at some of the guts.

Parts of the x86 kernel, such as Advanced Power Management (APM) and the video framebuffer driver, vesafb, explicitly use BIOS services to realize certain features. Other sections of the kernel like the serial driver, implicitly depend on the BIOS to initialize I/O base addresses and interrupt levels, and real-mode kernel code makes extensive use of BIOS calls during boot up to perform tasks like assembling the system memory map. (On BIOS-less embedded architectures, similar responsibilities — for example, waking the kernel from suspend on ARM Linux — rest with the bootloader.)
In this month’s “Gearheads” column, let’s learn to interact with the BIOS using some examples. But first, let’s look at the different facets of assembly programming on Linux.

A Peek into Linux Assembly

Figure One shows the Linux boot sequence on an x86-based desktop or laptop. The firmware components in the figure are usually implemented using different assembly syntaxes:
*The BIOS is typically wholly written in assembly. Some of the popular BIOSes are coded using assemblers like the Microsoft Macro Assembler (MASM).
*Linux bootloaders like LILO and GRUB are implemented using a mix of C and assembly. The SYSLINUX bootloader is written entirely in assembly using the Netwide Assembler (NASM).
*Real-mode Linux startup code uses the GNU Assembler (GAS).
*Protected-mode BIOS invocations are done in inline assembly, which is a construct supported by the GNU Compiler Collection (GCC) to insert assembly in…

Please log in to view this content.

Not Yet a Member?

Register with LinuxMagazine.com and get free access to the entire archive, including:

  • Hands-on Content
  • White Papers
  • Community Features
  • And more.
Already a Member?
Log in!
Username

Password

Remember me

Forgotten your password?
Forgotten your username?
Read More
  1. Got Security? You're in Denial
  2. KDE 4.4: Does It Work Yet?
  3. Writing Custom Nagios Plugins with Python
  4. Power Up Linux GUI Apps
  5. Tweeting from the Command Line with Twyt
Follow Linux Magazine
Rackspace