Add runtime testing harness

This commit is contained in:
Sam Tebbs 2019-06-29 23:50:44 +01:00 committed by SamTebbs33
parent f8f7e40535
commit 35cfbd1686
9 changed files with 103 additions and 13 deletions

View file

@ -305,4 +305,5 @@ pub fn init() void {
// Load the TSS
arch.ltr();
log.logInfo("Done\n");
}

View file

@ -122,4 +122,5 @@ pub fn closeInterruptGate(index: u8) void {
pub fn init() void {
log.logInfo("Init idt\n");
arch.lidt(&idt_ptr);
log.logInfo("Done\n");
}

View file

@ -273,6 +273,7 @@ pub fn getFrequency() u32 {
/// Initialise the PIT with a handler to IRQ 0.
///
pub fn init() void {
log.logInfo("Init pit\n");
// Set up counter 0 at 1000hz in a square wave mode counting in binary
const f: u32 = 10000;
setupCounter(OCW_SELECT_COUNTER_0, f, OCW_MODE_SQUARE_WAVE_GENERATOR | OCW_BINARY_COUNT_BINARY);
@ -281,4 +282,5 @@ pub fn init() void {
// Installs 'pitHandler' to IRQ0 (pic.IRQ_PIT)
irq.registerIrq(pic.IRQ_PIT, pitHandler);
log.logInfo("Done\n");
}

View file

@ -32,10 +32,11 @@ pub export fn kmain(mb_info: *multiboot.multiboot_info_t, mb_magic: u32) void {
log.logInfo("Init arch " ++ @tagName(builtin.arch) ++ "\n");
arch.init(&mem_profile, &fixed_allocator.allocator);
log.logInfo("Arch init done\n");
vga.init();
tty.init();
log.logInfo("Finished init\n");
log.logInfo("Init done\n");
tty.print("Hello Pluto from kernel :)\n");
}
}

View file

@ -644,6 +644,7 @@ pub fn init() void {
printLogo();
displayPageNumber();
updateCursor();
log.logInfo("Done\n");
}
fn resetGlobals() void {