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.
iansjack wrote:When you call the function it accesses the stack to save the return address.
I'm not calling any functions, I'm iret'ing to the function. The return address of the thread is already stored in the stack.
But what I think is the most strange is that the #PF handler isn't called during the page fault, although the kernel is still mapped. Instead it just triple-faults.
That's because the page fault is happening when the processor is trying to invoke the #DF handler.
Also, your TSS is... abnormally large. (The limit should not be base + sizeof(), just sizeof().) I don't know if this is part of what's causing the problem or not, though.
iansjack wrote:When you call the function it accesses the stack to save the return address.
I'm not calling any functions, I'm iret'ing to the function. The return address of the thread is already stored in the stack.
But what I think is the most strange is that the #PF handler isn't called during the page fault, although the kernel is still mapped. Instead it just triple-faults.
That's because the page fault is happening when the processor is trying to invoke the #DF handler.
Also, your TSS is... abnormally large. (The limit should not be base + sizeof(), just sizeof().) I don't know if this is part of what's causing the problem or not, though.
Fixed it.Still the same problem though. GDT is now like this:
<bochs:3> info gdt
Global Descriptor Table (base=0x00000000c0111aa0, limit=47):
GDT[0x00]=??? descriptor hi=0x00000000, lo=0x00000000
GDT[0x01]=Code segment, base=0x00000000, limit=0xffffffff, Execute/Read, Conforming, Accessed, 32-bit
GDT[0x02]=Data segment, base=0x00000000, limit=0xffffffff, Read/Write, Accessed
GDT[0x03]=Code segment, base=0x00000000, limit=0xffffffff, Execute/Read, Conforming, Accessed, 32-bit
GDT[0x04]=Data segment, base=0x00000000, limit=0xffffffff, Read/Write, Accessed
GDT[0x05]=32-Bit TSS (Busy) at 0xc0111a20, length 0x00068
You can list individual entries with 'info gdt [NUM]' or groups with 'info gdt [NUM] [NUM]'
<bochs:4>
If some of you people keep insisting on having backwards compatibitity with the stone age, we'll have stone tools forever.
My Hobby OS: https://github.com/heatd/Onyx