From: Duje Mihanović Date: Sat, 12 Mar 2022 12:28:35 +0000 (+0100) Subject: Fix keyboard interrupts X-Git-Tag: 0.1.0~14 X-Git-Url: http://git.dujemihanovic.xyz/html/%7B%7B%20%28.OutputFormats.Get?a=commitdiff_plain;h=0b02cbac466992423caa450f9659b18d251a4158;p=nameless-os.git Fix keyboard interrupts --- diff --git a/boot/x86/boot.s b/boot/x86/boot.s index 572ef74..a7fe3c3 100644 --- a/boot/x86/boot.s +++ b/boot/x86/boot.s @@ -15,7 +15,7 @@ KERNEL_OFFSET equ 1000h ; where we will load our kernel jc reset_error ; halt if controller reset fails mov ah, 2 ; instruct BIOS's interrupt 13h to read sectors - mov al, 10 ; load 10 sectors, might be excessive (for now) but it's still good to do so + mov al, 30 ; load 30 sectors, might be excessive (for now) but it's still good to do so xor ch, ch ; read from 1st cylinder mov cl, 2 ; start reading from 2nd sector, right after the boot sector xor dh, dh ; read from 1st head diff --git a/kernel/arch/x86/irq/sample_handler.c b/kernel/arch/x86/irq/sample_handler.c index c8bddfe..d9bd8f9 100644 --- a/kernel/arch/x86/irq/sample_handler.c +++ b/kernel/arch/x86/irq/sample_handler.c @@ -1,5 +1,6 @@ #include #include +#include #include typedef uint32_t uword_t; @@ -17,6 +18,7 @@ void keyb_handler(struct interrupt_frame *frame) { pic_send_eoi(1); kprint("Got a keyboard interrupt!\n", 0); + inb(0x60); } @@ -26,5 +28,6 @@ void double_fault(struct abort_frame *frame) *(volatile char *) (0xb8000) = ":"; *(volatile char *) (0xb8002) = "("; asm volatile ("cli; hlt"); + while(1); }