diff --git a/.gitignore b/.gitignore index 53b3cb2..a683549 100644 --- a/.gitignore +++ b/.gitignore @@ -51,3 +51,4 @@ Module.symvers Mkfile.old dkms.conf .vscode/* +TODO.md \ No newline at end of file diff --git a/kernel/cpu/interrupts.asm b/kernel/cpu/interrupts.asm index 23970a1..2c77459 100644 --- a/kernel/cpu/interrupts.asm +++ b/kernel/cpu/interrupts.asm @@ -15,7 +15,7 @@ extern irq_handler ; Defined in drivers/isr.h isr%1: cli ; Disable interrupts push byte 0 ; Push dummy error code - push byte 1 ; Push interrupt number + push byte %1 ; Push interrupt number jmp isr_common ; goto ISR handler %endmacro diff --git a/kernel/drivers/gdt.c b/kernel/drivers/gdt.c index 0fb13dc..c675d4b 100644 --- a/kernel/drivers/gdt.c +++ b/kernel/drivers/gdt.c @@ -65,7 +65,7 @@ static void init_gdt() { static gdt_entry_t construct_entry(gdt_access_t access) { gdt_entry_t entry = (struct gdt_entry_struct) { .base_low = GDT_BASE & 0xFFFF, - .base_middle = (GDT_BASE >> 16) % 0xFF, + .base_middle = (GDT_BASE >> 16) & 0xFF, .base_high = (GDT_BASE >> 24) & 0xFF, .limit_low = (GDT_LIMIT & 0xFFFF), .access = access, diff --git a/kernel/drivers/gdt.h b/kernel/drivers/gdt.h index d0092b3..0e31ade 100644 --- a/kernel/drivers/gdt.h +++ b/kernel/drivers/gdt.h @@ -49,8 +49,8 @@ #define GDT_DATA_TYPE_READ_WRITE_ACCESSED 0x3 #define GDT_DATA_TYPE_READ_ONLY_EXPAND_DOWN 0x4 #define GDT_DATA_TYPE_READ_ONLY_EXPAND_DOWN_ACCESSED 0x5 -#define GDT_DATA_TYPE_READ_WRITE_EXPAND_DATA 0x6 -#define GDT_DATA_TYPE_READ_WRITE_EXPAND_DATA_ACCESSED 0x7 +#define GDT_DATA_TYPE_READ_WRITE_EXPAND_DOWN 0x6 +#define GDT_DATA_TYPE_READ_WRITE_EXPAND_DOWN_ACCESSED 0x7 #define GDT_DATA_TYPE_EXEC_ONLY 0x8 #define GDT_CODE_TYPE_EXEC_ONLY_ACCESSED 0x9 #define GDT_CODE_TYPE_EXEC_READ 0xA diff --git a/kernel/drivers/isr.c b/kernel/drivers/isr.c index ea44170..7e30c4e 100644 --- a/kernel/drivers/isr.c +++ b/kernel/drivers/isr.c @@ -1,7 +1,7 @@ #include #include "isr.h" -#include "../libc/string.h" #include "tty.h" +#include "../libc/string.h" #include "ports.h" #define PIC1 0x20 // I/O address for master PIC @@ -70,7 +70,7 @@ void ack_irq(uint32_t int_num) { // Send and End Of Interrupt(EOF) at the PICs. if(int_num >= 40) outb(PIC2_COMMAND, PIC_EOI); // Send reset signal to slave - outb(PIC2_COMMAND, PIC_EOI); // In any case, reset the master + outb(PIC1_COMMAND, PIC_EOI); // In any case, reset the master } void irq_handler(registers_t regs) { diff --git a/kernel/kernel_main.c b/kernel/kernel_main.c index cd1e50c..819ad12 100644 --- a/kernel/kernel_main.c +++ b/kernel/kernel_main.c @@ -1,7 +1,6 @@ #include "drivers/tty.h" #include "drivers/gdt.h" #include "drivers/idt.h" -#include "drivers/isr.h" #include "libc/stdio.h" void kernel_main() {