x86_64 interrupt handling
Created by: Roxxik
-
I don't know why there was kernel relocation code. on i386 there is none. And the relocation code as it was did quite some garbage. That's why i removed it. It moved the memory from kernel_file + 0xB000 to kernel_file, so overwrote the kernel, and afterwards cleared 0xB000 Bytes from the end of the - now overwritten - kernel. And this memory is taken from 0x80000+ where there could be some parts from EBDA, which could have led to the Page Fault. Tried to move the kernel to some higher address(1MB+) and it worked, but i don't know if this memory is used elsewhere, and i don't see the purpose in moving the kernel. If this is needed for something and someone knows where to place the kernel, i'd be happy to put the code back.
-
Where does this MagicValue(tm) 0x18 come from? in
mov eax, [kernel_file + 0x18] mov [interrupts.handler], rax
It works on i386 but on x86_64 it points in the midst of zeroed memory
-
Interrupts are working now, the page fault experienced before was due to writing to protected lower memory (my theory, see above) and the kernel exception handler wasn't yet set up, which led to a triple fault.
tl;dr: We have interrupts, but I don't know where the kernel interrupt handler lives, so we can't do much with those interrupts.