paging again

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.
Post Reply
Al2

paging again

Post by Al2 »

Hi.

It is yet another question about paging.

I am playing with OS, and I've started from zero.
So now I am trying initialize paging.
I took snippet from L4 but I don't work properly.

1. I Link kernel such way that it have two parts, one direct mapped and another with offset.

2. initialize pdir and ptables

3. set CR3 with pdir address
4. turn on paging by setting CR0
5. jump to continue initialization

It doesn't work, but if I link all without offset all works ok, even with paging.

offset is 0xF0000000

Maybe I have lost something which should be done?

Al.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re:paging again

Post by Combuster »

if you have read the FAQ you might have noticed that everything is linked to one address. Not two
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
Al
Posts: 6
Joined: Wed Oct 18, 2006 9:32 am
Location: Saint-Petersburg

Re:paging again

Post by Al »

I've made another mistake
I didn't change code and data segment to the new location in high half of address space.

Al.
We must use time as a tool, not as a crutch.
JFK.
Post Reply