hazel/include/kernel/multiboot.h
2024-07-03 15:42:01 -04:00

59 lines
1.8 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef HAZEL_MULTIBOOT_H_
#define HAZEL_MULTIBOOT_H_
#include <stdint.h>
typedef struct {
uint32_t flags; //required
uint32_t memlower; //if bit 0 in flags are set
uint32_t memupper; //if bit 0 in flags are set
uint32_t bootdevice; //if bit 1 in flags are set
uint32_t commandline; //if bit 2 in flags are set
uint32_t modulecount; //if bit 3 in flags are set
uint32_t moduleaddress; //if bit 3 in flags are set
uint32_t syms[4]; //if bits 4 or 5 in flags are set
uint32_t memmaplength; //if bit 6 in flags is set
uint32_t memmapaddress; //if bit 6 in flags is set
uint32_t driveslength; //if bit 7 in flags is set
uint32_t drivesaddress; //if bit 7 in flags is set
uint32_t configtable; //if bit 8 in flags is set
uint32_t apmtable; //if bit 9 in flags is set
uint32_t vbecontrolinfo; //if bit 10 in flags is set
uint32_t vbemodeinfo; //if bit 11 in flags is set
uint32_t vbemode; // all vbe_* set if bit 12 in flags are set
uint32_t vbeinterfaceseg;
uint32_t vbeinterfaceoff;
uint32_t vbeinterfacelength;
} multiboot_info_t;
struct multiboot_mmap_entry
{
uint32_t size;
uint64_t addr;
uint64_t len;
#define MULTIBOOT_MEMORY_AVAILABLE 1
#define MULTIBOOT_MEMORY_RESERVED 2
#define MULTIBOOT_MEMORY_ACPI_RECLAIMABLE 3
#define MULTIBOOT_MEMORY_NVS 4
#define MULTIBOOT_MEMORY_BADRAM 5
uint32_t type;
} __attribute__((packed));
typedef struct multiboot_mmap_entry multi_mmap_t;
struct multiboot_mod_list
{
/* the memory used goes from bytes mod_start to mod_end-1 inclusive */
uint32_t mod_start;
uint32_t mod_end;
/* Module command line */
uint32_t cmdline;
/* padding to take it to 16 bytes (must be zero) */
uint32_t pad;
};
typedef struct multiboot_mod_list multi_mod_t;
#endif