next up previous contents index
Next: 10.14.8 multiboot_main: general MultiBoot Up: (X86 PC) MultiBoot Startup Previous: 10.14.6 multiboot.h: Definitions of

10.14.7 boot_info: MultiBoot information structure

   

SYNOPSIS

#include <oskit/x86/pc/base_multiboot.h>

extern struct multiboot_info boot_info ;

DESCRIPTION

The first thing that multiboot_main does on entry from the minimal startup code in multiboot.o is copy the MultiBoot information structure passed by the boot loader into a global variable in the kernel's bss segment. Copying the information structure this way allows it to be accessed more conveniently by the kernel, and makes it unnecessary for the memory initialization code (base_multiboot_init_mem; see Section 10.14.9) to carefully ``step over'' the information structure when determining what physical memory is available for general use.

After the OS has received control in its main routine, it is free to examine the boot_info structure and use it to locate other data passed by the boot loader, such as the boot modules. The client OS must not attempt to access the original copy of the information structure passed by the boot loader, since that copy of the structure may be overwritten as memory is dynamically allocated and used. However, this should not be a problem, since a pointer to the original copy of the multiboot_info structure is never even passed to the OS by the MultiBoot startup code; it is only accessible to the OS if it overrides the multiboot_main function.



University of Utah Flux Research Group