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.
maybe you could try to locate the message in BOCHS sources and then run bochs in a debugger , setting a breakpoint where the error is reported and inspect the virtual CPU's state (like IDT descriptor content, RIP value, CS limit, etc).
another question- i've setup the page directories and tables, but how do i map physical addresses to virtual addresses, and how do i know it works when i do?
virtual memory makes since, but i can't get it to work. i enable pagin, map a physical address to a virtual address, but the only way to access the data at the address is through the virtual address. it doesn't make sense.
sure it does...that's the way paging works. Once you enable paging, the memory unit interprets every address you try to access as a virtual address. So if you try to access memory at it's physical address, the memory unit will try to interpret that physical address as a virtual address, which won't work well at all, or at least won't do what you are expecting it to do.
The only ways to access that memory at its physical address is to a) disable paging, or b) identity-map that address, or tell the memory unit that the virtual address maps to the same physical address.
In other words, if the physical address of the memory is 0x20000, you have to map that virtual address to the same physical address. Then you wil be able to address that memory using either 0x20000, or the other virtual address you assigned it when allocating.
But there's no real point to doing this as you only need to reference it through it's virtual address, and if you add two references to the same physical address, you're just wasting virtual address space.
northfuse2005 wrote:
virtual memory makes since, but i can't get it to work. i enable pagin, map a physical address to a virtual address, but the only way to access the data at the address is through the virtual address. it doesn't make sense.
of course, you must make sure to have the page directory itself mapped somewhere or you'll be unable to change the memory mapping once paging will be enabled.
sorry- i messed up when typing my post. i mean't to say that even after enabling paging, the only way to access the memory is through the physical address, even if that page table (and directory) aren't mapped to the physical address.