diff options
| author | hachem <im@hachem.wtf> | 2026-09-25 21:21:09 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2026-09-25 21:21:09 +0200 |
| commit | 09982d80c45805715984cc1cae96c37e4fc148c3 (patch) | |
| tree | f711d6e7f4d4cb2d4dcb555d6a139aae343d7334 /boot/pic.zig | |
| parent | fd3f51eecaecc12806a573c38263df1de43ee8c2 (diff) | |
feat: scheduler + cleanup
Diffstat (limited to 'boot/pic.zig')
| -rw-r--r-- | boot/pic.zig | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/boot/pic.zig b/boot/pic.zig index 0bec4a8..365fa2f 100644 --- a/boot/pic.zig +++ b/boot/pic.zig @@ -1,7 +1,7 @@ -// this is just a 8259 PIC thing in zig, kinda defines only the constants the -// IDT needs cause the actual remapping and masking is done in the kernel level -// which is pretty cool.EOI has to stay here cause it runs inside the ISR tho, -// so somewhere the VM cant really do much. +// this is just a 8259 pic thing in zig, kinda defines only the constants the +// idt needs cause the actual remapping and masking is done in the kernel level +// which is pretty cool.eoi has to stay here cause it runs inside the isr tho, +// so somewhere the vm cant really do much // // see: https://wiki.osdev.org/8259_PIC @@ -9,13 +9,13 @@ const port = @import("port.zig"); const MASTER_CMD: u16 = 0x20; const SLAVE_CMD: u16 = 0xA0; -const EOI: u8 = 0x20; // end-of-interrupt command +const EOI: u8 = 0x20; // end of interrupt command -pub const MASTER_OFFSET: u8 = 0x20; // IRQ0..7 -> vectors 0x20..0x27 -pub const SLAVE_OFFSET: u8 = 0x28; // IRQ8..15 -> vectors 0x28..0x2F +pub const MASTER_OFFSET: u8 = 0x20; // irq0..7 -> vectors 0x20..0x27 +pub const SLAVE_OFFSET: u8 = 0x28; // irq8..15 -> vectors 0x28..0x2f -// tell the PIC we're done. the slave's interrupts also need the master EOI'd -// since they arrive via the cascade. +// tell the pic were done. the slaves interrupts also need the master eoid +// since they arrive via the cascade pub fn eoi(irq: u4) void { if (irq >= 8) port.outb(SLAVE_CMD, EOI); port.outb(MASTER_CMD, EOI); |
