Renaissance: the startup_32( ) Functions

There are two different startup_32( ) functions; the one we refer to here is coded in the arch/i386/boot/compressed/head.S file. After setup( ) terminates, the function has been moved either to physical address 0x00100000 or to physical address 0x00001000, depending on whether the kernel image was loaded high or low in RAM.

This function performs the following operations:

  1. Initializes the segmentation registers and a provisional stack.

  2. Clears all bits in the eflags register.

  3. Fills the area of uninitialized data of the kernel identified by the _edata and _end symbols with zeros (see the section "Physical Memory Layout" in Chapter 2).

  4. Invokes the decompress_kernel( ) function to decompress the kernel image. The “Uncompressing Linux...” message is displayed first. After the kernel image is decompressed, the “O K, booting the kernel.” message is shown. If the kernel image was loaded low, the decompressed kernel is placed at physical address 0x00100000. Otherwise, if the kernel image was loaded high, the decompressed kernel is placed in a temporary buffer located after the compressed image. The decompressed image is then moved into its final position, which starts at physical address 0x00100000.

  5. Jumps to physical address 0x00100000.

The decompressed kernel image begins with another startup_32( ) function included in the arch/i386/kernel/head.S file. Using the same name for both the functions does not create any problems (besides confusing our readers), ...

Get Understanding the Linux Kernel, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.