Features in my bootloader not present in the Mb v1 specification:
* Support for x86_64 images
* Long mode setup upon request in the Mb header
* Paging and higher half setup upon request
* Pic can be mapped by the boot loader
* PCI, ACPI, MPTables (maybe something other) are detected and enumerated and their pointers passed to the os image
* Cpuid informations for the BSP are read and passed to the os
* Any suggestion is appreciated
The multiboot info structure I'm planning to create is like this:
Code: Select all
struct MultibootInfo
{
uint32 Flags;
uint32 MemLower;
uint32 MemUpper;
/* other Mb v1 fields */
uint16 VbeInterfaceLen;
/* Additional fields */
uint64 MemTotal; // Total size of Memory in bytes, rounded down the nearest page-boundary
/* Flags[13] == true */
uint64 PciDevices; // A table containing all the PCI devices on the machine. This way the Os is not required to perform the time-consuming pci-enumeration
uint32 PciDevicesCount;
/* Flags[14] == true */
uint64 AcpiTables;
uint32 AcpiTablesCount; // A table with pointers to all the ACPI tables found on the system. 0 if no ACPI.
/* Flags[15] == true */
uint64 Processors; // A table containing informations about the processors on the system (Num of cores, number of threads, apic id, lapic address, etc)
uint32 ProcessorsCount;
uint64 MPTable; // A pointer to the MP table structure
/* Flags[16] == true */
uint64 Cr3Value; // If the loader was requested to setup paging, here is the (Pml4, Pdpt, PageDirectory) pointer
/* Flags[17] == true */
uint64 Cpuid; // A pointer to a structure with Cpuid-extracted data for the BSP
};
Code: Select all
struct MultibootHeader
{
uint32 Magic;
uint32 Flags;
uint32 Checksum;
/* Flags[16] == true */
uint32 HeaderAddr;
uint32 LoadAddr;
uint32 LoadEndAddr;
uint32 BssEndAddr;
/* Flags[2] == true */
uint32 ModeType;
uint32 Width;
uint32 Height;
uint32 Depth;
/* Flags[13] == true */
uint32 PicBaseInt; // Where the master pic should be mapped. The slave is mapped at PicBaseInt + 8
/* Flags[14] == true */
uint64 VirtualBase; // If paging is requested, this is the base address to map (0xC0000000 and 0xFFFFFFFF80000000 are just examples)
};
Anyone is interested into this project?