OSDev.org https://forum.osdev.org/ |
|
Page fault on page that is present? https://forum.osdev.org/viewtopic.php?f=1&t=32611 |
Page 1 of 1 |
Author: | isaacwoods [ Sat Dec 02, 2017 9:18 am ] |
Post subject: | Page fault on page that is present? |
Hi, I have been trying to move my Rust kernel from identity mapping to instead map the kernel at 0xffffffff80000000. There have been a bunch of problems with this, all of which I've fixed except a weird page fault when trying to create the IDT. I'm using spin::Once to create the IDT which is just a `[IdtEntry; 256]` primitive like so: Code: static IDT : Once<Idt> = Once::new(); pub fn init() { ... IDT.call_once( || { let mut idt = Idt::new(); idt }); ... } On returning the IDT from the closure (`spin` then puts the return value into the static variable), a page fault occurs: Code: check_exception old: 0xffffffff new 0xe 0: v=0e e=0002 i=0 cpl=0 IP=0008:ffffffff801119fe pc=ffffffff801119fe SP=0010:ffffffff80120db0 CR2=ffffffff80120dd0 From the error code and CR2, I established that the page containing 0xffffffff80120dd0 isn't present. This seemed simple - there was a bug in the code that allocates the ELF sections (this address is within the .bss section) - but the page IS present as far as I can tell. I suspect I'm just being dim, but I don't know where to proceed from here? |
Author: | iansjack [ Sat Dec 02, 2017 12:25 pm ] |
Post subject: | Re: Page fault on page that is present? |
Perhaps I'm being silly, but your qemu screenshot shows all your page mappings at non-canonical addresses. That doesn't seem right. |
Author: | isaacwoods [ Sun Dec 03, 2017 10:49 am ] |
Post subject: | Re: Page fault on page that is present? |
Quote: Perhaps I'm being silly, but your qemu screenshot shows all your page mappings at non-canonical addresses. That doesn't seem right. Yeah, I'm not sure what's up with that. The four leading 0s in each address should be Fs (the kernel is mapped at 0xffffffff80000000 + physical address), and other stuff works at these correct addresses, so I assume it's something wrong with the qemu monitor. Is it worth looking into? |
Page 1 of 1 | All times are UTC - 6 hours |
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group http://www.phpbb.com/ |