Expand description
provide functions to parse information provided by grub multiboot see docs/multiboot.txt
Structs§
- reference to the multiboot info blob provided by the bootloader. This reference should be acquired via the get_mb_info() function, otherwise MUST manually call the check() function before using.
- all fields MUST be acquired via unsafe getters, because the MB magic and reserved bits in flags must be checked for validity before using. It does not suffice to check the corresponding present bits in the getters. Some fields are marked as padding because we don’t need them (for now)
- the MultibootInfoFlags indicate which fields are valid in the MultibootInfo atm we only need the MEM and MMAP flags for memory management info.
- describes amount of lower and upper memory. Lower memory starts from 0, maximum 640 Kib. Upper memory starts from 1MiB, size maximum is addr of the first upper memory hole minus 1MiB (not guaranteed) Both sizes have 1KiB unit.
- present in MultibootInfo struct, if the corresponding flag is set. This describes the mmap buffer (do not confuse with the mmap struct itself)
- describes a a physical memory block.
Functions§
- example code to query physical memory maps: traverse the mmap structs provided by bootloader.
- this must be called before any MB info fields are used: the mb_magic should be correctly set and all reserved bits in mbinfo flags should be 0.