StuBS
Multiboot Namespace Reference

Interface for Multiboot. More...

Classes

struct  Framebuffer.__unnamed6__.__unnamed10__
 For RGB type. More...
 

Functions

ModulegetModule (unsigned i)
 Retrieve a certain boot module.
 
unsigned getModuleCount ()
 Get the number of modules.
 
MemorygetMemoryMap ()
 Retrieve the first entry of the memory map.
 
char * getCommandLine ()
 Get the kernel command line.
 
char * getBootLoader ()
 Get the name of the boot loader.
 
VBEgetVesaBiosExtensionInfo ()
 Get pointer to Vesa BIOS Extension information.
 
FramebuffergetFramebufferInfo ()
 Get pointer to framebuffer information.
 
 assert_size (Module, 16)
 
 assert_size (Memory, 24)
 
 assert_size (VBE, 16)
 
 assert_size (Framebuffer, 28)
 

Detailed Description

Interface for Multiboot.

Due to historical reasons, a normal BIOS allows you to do quite an egg dance until you finally reach the actual kernel (especially with only 512 bytes available in the master boot record...). Fortunately, there are boot loaders that (partly) do this ungrateful job for you: They load your kernel into memory, switch (the bootstrap processor) to protected mode (32 bit) and jump to the entry point of our kernel – saving you a lot of boring (or enlightening?) work: reading ancient systems documentation. One of the most famous representatives is the Grand Unified Bootloader (GRUB), which is also the reference implementation of the Multiboot Specification.

A Multiboot compliant boot loader will prepare the system according to your needs and can hand you a lot of useful information (e.g. references to initial ramdisks).

However, you have to inform the loader that you are also compliant to the specification, and (if required) instruct the loader to adjust specific settings (e.g. the graphics mode).

For this purpose you have to configure the beginning of the kernel (the first 8192 bytes of the kernel binary) accordingly (see compiler/section.ld) – this is were the boot loader will search for a magic header and parse the subsequent entries containing the desired system configuration. In StuBS these flags are set in boot/multiboot/config.inc and the header structure is generated in boot/multiboot/header.asm.

The first step in your kernel entry function is saving the pointer to the struct with the information from the boot loader (transferred via register ebx) – and Multiboot provides you the interface to comfortably access its contents!


Class Documentation

◆ Multiboot::Framebuffer.__unnamed6__.__unnamed10__

struct Multiboot::Framebuffer.__unnamed6__.__unnamed10__

For RGB type.

Class Members
uint8_t offset_red Offset of red value.
uint8_t bits_red Bits used in red value.
uint8_t offset_green Offset of green value.
uint8_t bits_green Bits used in green value.
uint8_t offset_blue Offset of blue value.
uint8_t bits_blue Bits used in blue value.

Function Documentation

◆ getModule()

Module * Multiboot::getModule ( unsigned  i)

Retrieve a certain boot module.

Parameters
iboot module number
Returns
Pointer to structure with boot module information

◆ getModuleCount()

unsigned Multiboot::getModuleCount ( )

Get the number of modules.

Returns
Pointer to structure with boot module information

◆ getMemoryMap()

Memory * Multiboot::getMemoryMap ( )

Retrieve the first entry of the memory map.

◆ getCommandLine()

char * Multiboot::getCommandLine ( )

Get the kernel command line.

Returns
pointer to zero terminated string

◆ getBootLoader()

char * Multiboot::getBootLoader ( )

Get the name of the boot loader.

Returns
pointer to zero terminated string

◆ getVesaBiosExtensionInfo()

VBE * Multiboot::getVesaBiosExtensionInfo ( )

Get pointer to Vesa BIOS Extension information.

Note
Only available if the MULTIBOOT_VIDEO_MODE flag was explicitly set in the multiboot header (see boot/multiboot/config.inc)!

◆ getFramebufferInfo()

Framebuffer * Multiboot::getFramebufferInfo ( )

Get pointer to framebuffer information.

Note
Only available if the MULTIBOOT_VIDEO_MODE flag was explicitly set in the multiboot header (see boot/multiboot/config.inc)!

◆ assert_size() [1/4]

Multiboot::assert_size ( Module  ,
16   
)

◆ assert_size() [2/4]

Multiboot::assert_size ( Memory  ,
24   
)

◆ assert_size() [3/4]

Multiboot::assert_size ( VBE  ,
16   
)

◆ assert_size() [4/4]

Multiboot::assert_size ( Framebuffer  ,
28   
)