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.
I'm currently developing a C++ kernel using bochs. I managed to setup Long mode, and have a working GDT and paging. The problem I'm running into is that when I try to add anything to virtual memory above 4GB, entry 4+ in the PDP, it doesn't show up when I look at my pages. I've tried 1GB, 2MB, and 4KB pages. Nothing works.
My glass ball is in the wash right now, and with the info you provided I cannot be certain, since there is no link to the source code anywhere, nor enough information to make such a determination. However, I bet you cast an address to int at some point, not realizing that this is too small a type.
nullplan wrote:My glass ball is in the wash right now, and with the info you provided I cannot be certain, since there is no link to the source code anywhere, nor enough information to make such a determination. However, I bet you cast an address to int at some point, not realizing that this is too small a type.
I'm so sorry! I forgot to add relevant code! I have fixed that, and have added the code to the post. As you can see, I use uint64_t, so I'm using an appropriate data type
1. Are you sure that you are in Long Mode? Does gdb show 64-bit registers when you do "info registers"?
2. What do you mean by "it doesn't show up when I look at my pages". How are you "looking" at your pages? What does the qemu monitor show when you do "info mem"?
iansjack wrote:1. Are you sure that you are in Long Mode? Does gdb show 64-bit registers when you do "info registers"?
2. What do you mean by "it doesn't show up when I look at my pages". How are you "looking" at your pages? What does the qemu monitor show when you do "info mem"?
As I said, I'm using bochs. Bochs tells me that I'm in Long mode and shows Long mode registers. I'm looking at my page table in the page table output provided by bochs.
It is a limitation in BOCHS. It just doesn't show mappings above 4gb unless you patch the source. We have touched on this issue previously: viewtopic.php?f=1&t=27650
MichaelPetch wrote:It is a limitation in BOCHS. It just doesn't show mappings above 4gb unless you patch the source. We have touched on this issue previously: viewtopic.php?f=1&t=27650