aboutsummaryrefslogtreecommitdiff
path: root/src/bootstrap/boot.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/bootstrap/boot.zig')
-rw-r--r--src/bootstrap/boot.zig28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/bootstrap/boot.zig b/src/bootstrap/boot.zig
new file mode 100644
index 0000000..fcb60eb
--- /dev/null
+++ b/src/bootstrap/boot.zig
@@ -0,0 +1,28 @@
+comptime {
+ asm (@embedFile("boot64.s"));
+ asm (@embedFile("boot32.s"));
+}
+
+const MAGIC = 0xE85250D6;
+const ARCHITECTURE = 0;
+
+const MultibootHeader = extern struct {
+ magic: u32,
+ architecture: u32,
+ header_len: u32,
+ checksum: u32,
+
+ tag0: u16,
+ tag1: u16,
+ tag2: u32,
+};
+
+export const multiboot2 align(4) linksection(".multiboot") = MultibootHeader{
+ .magic = MAGIC,
+ .architecture = ARCHITECTURE,
+ .header_len = 24,
+ .checksum = 0x100000000 - (MAGIC + ARCHITECTURE + 24),
+ .tag0 = 0,
+ .tag1 = 0,
+ .tag2 = 8,
+};