Cross-architecture test suite

This commit is contained in:
2026-07-03 12:39:26 +01:00
parent 9cf135302d
commit c8e89e8115
10 changed files with 500 additions and 8 deletions
+8
View File
@@ -21,6 +21,13 @@ pub fn build(b: *std.Build) void {
// jumps/calls that Zig inline asm can't express (see the file's header).
arch_mod.addAssemblyFile(b.path("src/arch/x86_64/isr.s"));
// Compile-time config the kernel reads as `@import("build_options")`. The
// QEMU test harness sets -Dtest-case=<name> to run one self-test at boot.
const test_case = b.option([]const u8, "test-case", "Kernel self-test case to run at boot (see src/tests.zig)");
const build_options = b.addOptions();
build_options.addOption(?[]const u8, "test_case", test_case);
const build_options_mod = build_options.createModule();
// --- Kernel: freestanding x86_64 ELF, jumped to by the bootloader ---
// SSE2 is part of the x86_64 baseline and UEFI leaves it enabled at handoff,
// so we keep it: disabling it forces soft-float and makes the compiler unable
@@ -46,6 +53,7 @@ pub fn build(b: *std.Build) void {
.imports = &.{
.{ .name = "danos", .module = mod },
.{ .name = "arch", .module = arch_mod },
.{ .name = "build_options", .module = build_options_mod },
},
}),
});