Make serial arch-dependent

This commit is contained in:
Sam Tebbs 2020-06-04 14:39:37 +01:00
parent e7770d0051
commit ecc3de413c
6 changed files with 264 additions and 202 deletions

View file

@ -6,6 +6,7 @@ const gdt = @import("gdt_mock.zig");
const idt = @import("idt_mock.zig");
const vmm = @import("vmm_mock.zig");
const paging = @import("paging_mock.zig");
const Serial = @import("../../../src/kernel/serial.zig").Serial;
const mock_framework = @import("mock_framework.zig");
pub const initTest = mock_framework.initTest;
@ -101,6 +102,10 @@ pub fn haltNoInterrupts() noreturn {
while (true) {}
}
pub fn initSerial() Serial {
return .{ .write = undefined };
}
pub fn initMem(payload: BootPayload) std.mem.Allocator.Error!mem.MemProfile {
return MemProfile{
.vaddr_end = @ptrCast([*]u8, &KERNEL_VADDR_END),