• Immutable Page
  • Info
  • Attachments

ThirtyTwoBitInitialization

Linux 0.01 32-bit initialization code.

Back to Kernel001WalkThrough. This code is in Linux 0.01 boot/head.s. Read Linus's HeadComments if you like. This code is bootstrapped by and executed from the BootStrapFromPcBios code.

The boot device motor has been turned off, the code base is address 0 (which is also where the memory management system's page directory will eventually exist.) The process is executing in protected (32-bit) mode.

A suitable IDT (interrupt descriptor table) and GDT (global descriptor table) are assigned. Suitable values are loaded into all frame, segment and stack pointer registers and whatnot (spot the lost 68000/VAX programmer!), a FPU is checked for and if not found the processor is set up to expect software emulation of floating point instructions (this would apply to, for instance, the 386SX processor, which was designed for laptops but became popular in entry-level consumer machines in the early '90s). All of the foregoing code would be overwritten by the page tables. The code then performs a jump to the first address after these tables, where a c-style call to _main is performed. We're entering the territory of init/main.c, which is described in InitTask.


  • Suggested correction: My recollection is that neither the 386DX nor the 386SX had a floating-point co-processor. The major differences between them were that the DX had both 32-bit address and data buses, whereas the SX had a 24-bit address bus and a 16-bit data bus.

-- FWIW, it was the 486SX that lacked the built-in FPU, in order to conserve power and make for a cheaper processor. The 486DX had a built-in FPU.

Tell others about this page:

last edited 2006-06-21 18:55:14 by bas1-montreal42-1177928303