Hi there,
my kernel start paging immediatly so it can map himself in 0xC0000000. I've followed this tutorial:
http://wiki.osdev.org/Higher_Half_bare_bones
Anyway the problem occour when i have to copy phisical frames in the memory manager i clearly obtain a page fault because i try (for example) to copy the frame 0x10000 to 0x11000.
What can i do?! it's that the common way to obtain a upper half kernel?!
Thanks a lot David
Upper half kernel problems with paging
Re: Upper half kernel problems with paging
First, I don't see any reason for you to access first MB of physical memory,
if you already got into protected mode. I assume you meant frames 0x100000 0x101000.
If I'm not mistaken, your mapping goes as following:
VA ---> PA
0xC0100000 ---> 0x100000
0xC0101000 ---> 0x101000
...
So, obviously, when you have those mapping and paging on, in order to access PA 0x100000 you
should write in your code 0xC0100000, and CPU (or your emulator) will access 0x100000, after
it's calculation of physical address.
if you already got into protected mode. I assume you meant frames 0x100000 0x101000.
If I'm not mistaken, your mapping goes as following:
VA ---> PA
0xC0100000 ---> 0x100000
0xC0101000 ---> 0x101000
...
So, obviously, when you have those mapping and paging on, in order to access PA 0x100000 you
should write in your code 0xC0100000, and CPU (or your emulator) will access 0x100000, after
it's calculation of physical address.
- xenos
- Member
- Posts: 1121
- Joined: Thu Aug 11, 2005 11:00 pm
- Libera.chat IRC: xenos1984
- Location: Tartu, Estonia
- Contact:
Re: Upper half kernel problems with paging
It would be very helpful if you could provide some code. Otherwise one can only suspect that there is some bug in your page copy algorithm.
Re: Upper half kernel problems with paging
So...the best way suggested is for the kernel have:
1 page entry for the virtual address and 1 page entry for the physical frame?! (for the kernel dir so it can operate on page frames of other tasks that are not mapped in the kernel pagedir/table!?
1 page entry for the virtual address and 1 page entry for the physical frame?! (for the kernel dir so it can operate on page frames of other tasks that are not mapped in the kernel pagedir/table!?
Re: Upper half kernel problems with paging
@tryharder
yousay C0010000 to access at the physical frame 0x10000. But what if i have 4GB of physical ram and i whant to access at the physical frame at FFFFF000. Mmmm... looks that the best way is that the kernel identity-map direcly also the physical addresses.
In the kernel dir/table
0x10000->0x10000
0xC0010000->0x10000
So i can access frames direcly without know where they are mapped
yousay C0010000 to access at the physical frame 0x10000. But what if i have 4GB of physical ram and i whant to access at the physical frame at FFFFF000. Mmmm... looks that the best way is that the kernel identity-map direcly also the physical addresses.
In the kernel dir/table
0x10000->0x10000
0xC0010000->0x10000
So i can access frames direcly without know where they are mapped