The k project

Multiboot Specification

The Mutliboot Specification is a specification allowing to forward important informations from a bootloader (such as Grub) to the kernel. It also specifies how a bootloader should load a kernel.

The multiboot header

A According to the multiboot specification, an OS image must contain a Multiboot Header within the first 8192 bytes of the file and must be aligned on 4 bytes.

A Multiboot compliant bootloader must be able to load ELF binaries, such as K.

In the Multiboot Header, you should have the following fields:

State

The state of the system when the kernel starts to be executed is the following:

The multiboot information structure

The bootloader fills a structure called Multiboot infortmation structure. It is described in multiboot.h by multiboot_info_t.

You should check if the flag field advertise that the informations you need are available.

You will find in this structure the fields mods_count and mods_addr. mods_addr contains the address of an array of informations about the loaded modules, such as the address where it is loaded and the size of the module. This structure is defined in multiboot.h as module_t. The modules to load are specified in the grub.cfg. For K, the first module is the rom you should load.

You will need the command line passed to your kernel. You can find its address in the cmdline field of your Multiboot information structure.

Ressources