diff options
Diffstat (limited to 'boot/boot.zig')
| -rw-r--r-- | boot/boot.zig | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/boot/boot.zig b/boot/boot.zig new file mode 100644 index 0000000..0f6c92c --- /dev/null +++ b/boot/boot.zig @@ -0,0 +1,22 @@ +const std = @import("std"); +const limine = @import("limine.zig"); + +// We need a panic handler otherwise zig won't be happy, +// std usually formats a message through std.Io.Writer which +// emits SSE instructions which I haven't enabled. For now +// we just halt. +pub const panic = std.debug.FullPanic(struct { + fn halt(_: []const u8, _: ?usize) noreturn { + while (true) asm volatile ("hlt"); + } +}.halt); + +// Check `linker.ld` +export var base_revision: limine.BaseRevision linksection(".limine_requests") = limine.BaseRevision.init(3); +export var requests_start: limine.RequestsStartMarker linksection(".limine_requests_start") = .{}; +export var requests_end: limine.RequestsEndMarker linksection(".limine_requests_end") = .{}; + +// ENTRY(_start) +export fn _start() callconv(.c) noreturn { + while (true) asm volatile ("hlt"); +} |
