Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
. That change alone won't resolve the issue. You create all those stubs but you have to set the IDT entries for them. So you'd need to change this in idt.c from:
. Of course your `exception_handler` will need to properly deal with the IRQs as well. I'd even recommend changing the name `exception_handler` to `isr_handler` if one were to handle exceptions and IRQs in the same function.
Part of the problem is that we don't know if you are printing the right value from the stack frame or whether there is a problem in your printing code. Can you update your Github repo with the latest version of the code so we can take a look?
You don't need LDTs. So if you didn't use them there shouldn't be one being referenced.
It doesn't build. I get errors `src/idt_asm.asm:(.text+0x4f): undefined reference to `interupt_handler'` and there is no function `interupt_handler` in any file. Interupt is spelled wrong. It should be interrupt.
Your error code processing is all broken so it just prints garbage. If you want the error code you are going to have to pass a stack frame into the exception handler from the interrupts/exception stubs. Your stubs also don't handle exceptions with error codes properly. I ran your code with `qemu-system-i386 -cdrom build/os.iso -d int -no-shutdown -no-reboot` and got this
So you get a timer interrupt (v=20) and then a GPF with v=0d. Error code is e=0102. So this is a segment problem with entry 0x20 in the IDT. The reason for this is because you haven't actually initialized the IDT entries for the interrupts in idt.c . You have:
Tomrs123 wrote: ↑Thu Sep 19, 2024 4:28 pm
After 55 posts, this topic is finally over.
Little did I know..
So anyway I'm working on the keyboard driver, but for some reason when I press a key, it resets the system- Just kidding. It just doesn't print anything.
I think the first place to start is looking to see if you have disabled PS/2 interrupts in your `keyboard_init` function. As an example comment out all the code except the `attach_interupt(0x21, keyboard_interupt);` and see if it works. If you do get keyboard interrupts then you have done something wrong in the initialization that has to be fixed.
So I need to send command to the actual keyboard (not the controller), but I don't really know how to do that. I've read the controller AND keyboard wiki pages and still don't know how.