flat assembler
Message board for the users of flat assembler.

Index > OS Construction > Some doubts about paging in long mode...

Author
Thread Post new topic Reply to topic
Adan



Joined: 30 Mar 2007
Posts: 17
Adan
Hi people!, I need some help with virtual memory management, hope someone can help me, here is my problem:

I´ve set up the PML4 for a kernel running in long mode at...let´s say... 0x102000 (physical), the initial PDPT at 0x103000, the initial PDT at 0x104000, and the initial page table at 0x105000, all this is only for the kernel initialization.

I´ve set up the first entry in the PML4 as: (PDPT_address | 7).
I´ve set up the first entry in the PDPT as: (PDT_address | 7).
I´ve set up the first entry in the PDT as: (PT_address | 7).
And finally, I´ve filled the entire page table to map the first 2MB 1:1 (virtual address = physical address), I mean:

First page table entry: 0x0000000000000007
Second page table entry: 0x0000000000001007
Third page table entry: 0x0000000000002007 …and so on.

Now, I want to map for example physical address 0x10000000 to virtual address 0xC0000000.

How do I modify the tables so I can access physical memory at 0x10000000 through virtual address 0xC0000000?
There are a lot of examples on the net but they are not clear enough for me and all of them are for 32-bit processor (less page translation table levels).

I just need only one example, then I´ll be able to apply this to some other situation.

Thanks in advance and sorry for my bad English.
Very Happy
Post 30 Mar 2007, 14:41
View user's profile Send private message MSN Messenger Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.