Where to map everything?

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
Mattie
Posts: 1
Joined: Sat Jun 14, 2014 2:12 pm

Where to map everything?

Post by Mattie »

Hey all,

I'm sure this question gets asked a lot, however I couldn't find any resources on the wiki, forum, or after some google searches...

I was wondering why people map their kernels to strange addresses such as 0xC0000000 in the case of the x64 tutorials, or 0xFF300000 in the case of pedigree (any may other locations when i have been looking through code from various other oses)

I can understand the reasoning for not mapping below the 1MB mark, however why not just map the kernel there? Why not use a linear space for the kernel then allocate virtual spaces from 1MB for each new userland application. Is this just personal taste or is there a better technical explanation for this?

Thanks!
User avatar
bluemoon
Member
Member
Posts: 1761
Joined: Wed Dec 01, 2010 3:41 am
Location: Hong Kong

Re: Where to map everything?

Post by bluemoon »

Mattie wrote:I was wondering why people map their kernels to strange addresses such as 0xC0000000 in the case of the x64 tutorials
x86_64 kernel usually maps at high address (FFXXXXXX:00000000) or low address,
while x86 kernel usually maps to C0000000, ie. higher half, or low address.

The reason for such is that it form a logical zone to divide kernel and user space, and have these zones be continuous.
You may adjust the size of kernel zone to fit your design, some micro-kernel may just sits on the top most 128MB region (ie. F8000000~FFFFFFFF).
embryo

Re: Where to map everything?

Post by embryo »

Mattie wrote:Is this just personal taste or is there a better technical explanation for this?
I suppose today it's just personal taste. It is defined by a memory management strategy which everyone choses according to his personal taste.
Post Reply