module metal.boot.multiboot2

Code Map

module metal.boot.multiboot2;


enum MAGIC;

enum TagType
{
	END,
	CMDLINE,
	BOOT_LOADER_NAME,
	MODULE,
	BASIC_MEMINFO,
	BOOTDEV,
	MMAP,
	VBE,
	FRAMEBUFFER,
	ELF_SECTIONS,
	APM,
	EFI32,
	EFI64,
	SMBIOS,
	ACPI_OLD,
	ACPI_NEW,
	NETWORK,
	EFI_MMAP,
	EFI_BS,
}

enum Memory
{
	AVAILABLE,
	RESERVED,
	ACPI_RECLAIMABLE,
	NVS,
	BADRAM,
}

enum FramebufferType
{
	INDEXED,
	RGB,
	VGA,
}

struct Info
{
public:
	total_size: u32;
	reserved: u32;
}

struct Tag
{
public:
	type: TagType;
	size: u32;
}

struct TagMmap
{
public:
	type: TagType;
	size: u32;
	entry_size: u32;
	entry_version: u32;
}

struct MmapEntry
{
public:
	base_addr: u64;
	length: u64;
	type: Memory;
	zero: u32;
}

struct TagFramebuffer
{
public:
	type: TagType;
	size: u32;
	framebuffer_addr: u64;
	framebuffer_pitch: u32;
	framebuffer_width: u32;
	framebuffer_height: u32;
	framebuffer_bpp: u8;
	framebuffer_type: u8;
	reserved: u8;
}

struct TagEFI32
{
public:
	type: TagType;
	size: u32;
	pointer: u32;
}

struct TagEFI64
{
public:
	type: TagType;
	size: u32;
	pointer: u64;
}

struct TagOldACPI
{
public:
	type: TagType;
	size: u32;


public:
	fn rsdp() RSDPDescriptor* { }
}

struct TagNewACPI
{
public:
	type: TagType;
	size: u32;


public:
	fn rsdp() RSDPDescriptor20* { }
}

struct TagEFIMMAP
{
public:
	type: TagType;
	size: u32;
	descr_size: u32;
	descr_vers: u32;


public:
	fn mmap() void* { }
}

global tagNames: immutable(immutable(string)[20]);

fn dump(magic: u32, info: Info*) { }