diff --git a/build.zig b/build.zig index ec943d5..602c13f 100644 --- a/build.zig +++ b/build.zig @@ -132,6 +132,8 @@ pub fn build(b: *std.Build) void { }), }); + rtl_tests.root_module.addImport("rtl", rtl_tests.root_module); + const run_tests = b.addRunArtifact(rtl_tests); const test_step = b.step("test", "Run tests"); @@ -174,8 +176,7 @@ fn addKernel(b: *std.Build, plat: config.Platform, optimize: std.builtin.Optimiz switch (bl) { .Limine => "limine", } - else - @tagName(plat.arch); + else if (plat.os == .linux) "um" else @tagName(plat.arch); const root_source_file = b.fmt("src/platform/{s}/entry.zig", .{platform_name}); diff --git a/build/config.zig b/build/config.zig index ae505c0..21040bb 100644 --- a/build/config.zig +++ b/build/config.zig @@ -89,7 +89,7 @@ pub fn getPlatform(config: Config) !Platform { return error.NoArchConfigured; }; - if (ret.arch == .x86_64 or ret.arch == .aarch64) { + if (ret.os == .freestanding and (ret.arch == .x86_64 or ret.arch == .aarch64)) { ret.bootloader = blk: { if (config.get("CONFIG_BOOT_LIMINE")) |val| { if (std.mem.eql(u8, val, "y")) break :blk .Limine; diff --git a/src/rtl/bst.zig b/src/rtl/bst.zig index e506d40..12cf1a1 100644 --- a/src/rtl/bst.zig +++ b/src/rtl/bst.zig @@ -1,10 +1,10 @@ -const tagged_ptr = @import("tagged_ptr.zig"); +const rtl = @import("rtl"); const std = @import("std"); pub const Node = struct { left: *Node, right: *Node, - parent: tagged_ptr.TaggedPtr(Node), + parent: rtl.TaggedPtr(Node), }; /// Base struct for binary search trees. diff --git a/src/rtl/root.zig b/src/rtl/root.zig index 71631d0..5c9a91f 100644 --- a/src/rtl/root.zig +++ b/src/rtl/root.zig @@ -8,6 +8,7 @@ pub const pairing_heap = @import("pairing_heap.zig"); pub const PairingHeap = pairing_heap.PairingHeap; pub const TaggedPtr = @import("tagged_ptr.zig").TaggedPtr; pub const bst = @import("bst.zig"); +pub const BST = bst.BST; test { std.testing.refAllDecls(@This());