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: