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.

-- 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.

KernelNewbies: ThirtyTwoBitInitialization (last edited 2017-12-30 01:30:00 by localhost)