Add logging

This commit is contained in:
Sam Tebbs 2019-06-22 10:00:57 +01:00 committed by SamTebbs33
parent 1b8244adfa
commit 7e5b7b2331
6 changed files with 45 additions and 3 deletions

View file

@ -5,6 +5,7 @@ const gdt = @import("gdt.zig");
const idt = @import("idt.zig");
const irq = @import("irq.zig");
const isr = @import("isr.zig");
const log = @import("../../log.zig");
pub const InterruptContext = struct {
// Extra segments
@ -165,4 +166,4 @@ pub fn haltNoInterrupts() noreturn {
disableInterrupts();
halt();
}
}
}

View file

@ -1,6 +1,7 @@
// Zig version: 0.4.0
const arch = @import("arch.zig");
const log = @import("../../log.zig");
const NUMBER_OF_ENTRIES: u16 = 0x06;
const TABLE_SIZE: u16 = @sizeOf(GdtEntry) * NUMBER_OF_ENTRIES - 1;
@ -295,6 +296,7 @@ pub fn setTssStack(esp0: u32) void {
/// Initialise the Global Descriptor table
///
pub fn init() void {
log.logInfo("Init gdt\n");
// Initiate TSS
gdt_entries[TSS_INDEX] = makeEntry(@ptrToInt(&tss), @sizeOf(TtsEntry) - 1, TSS_SEGMENT, 0);

View file

@ -2,6 +2,7 @@
const gdt = @import("gdt.zig");
const arch = @import("arch.zig");
const log = @import("../../log.zig");
const NUMBER_OF_ENTRIES: u16 = 256;
const TABLE_SIZE: u16 = @sizeOf(IdtEntry) * NUMBER_OF_ENTRIES - 1;
@ -119,5 +120,6 @@ pub fn closeInterruptGate(index: u8) void {
/// Initialise the Interrupt descriptor table
///
pub fn init() void {
log.logInfo("Init idt\n");
arch.lidt(&idt_ptr);
}
}