Kernel Placement Question(?)

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
Warrior

Kernel Placement Question(?)

Post by Warrior »

Hello,

I've been thinking about putting my kernel at the 3GB mark and
leaving anything below for programs and DLLs

Now, my question is a lot of code referrs to putting it there (higher half barebones) as 0xC000000, but shouldn't it be like this

[pre]
0x0 - 0x1000000 = 1 GB
0x1000000 - 0x2000000 = 2GB
0x2000000 - 0x3000000 = 3GB
0x3000000 - 0x4000000 = 4GB
[/pre]
?

I'm just confused about this and I like to be sure of what I am actually writing when I program.

Any help is as always, appreciated.

Thanks,
Nelson
User avatar
Colonel Kernel
Member
Member
Posts: 1437
Joined: Tue Oct 17, 2006 6:06 pm
Location: Vancouver, BC, Canada
Contact:

Re:Kernel Placement Question(?)

Post by Colonel Kernel »

Remember you're dealing with hex here.

A gigabyte is 2^30 bytes. 2^30 in binary looks like this:

Code: Select all

0100 0000 0000 0000 0000 0000 0000 0000
In hex, that looks like this:

Code: Select all

4000 0000
2 gigs is 2^31, which in binary is 1000 etc... So in hex, that'd be 8000 0000. 3 gigs is 2^31 + 2^30, which in binary is 1100 etc... In hex, it's C000 0000.

Does this make sense?
Top three reasons why my OS project died:
  1. Too much overtime at work
  2. Got married
  3. My brain got stuck in an infinite loop while trying to design the memory manager
Don't let this happen to you!
Warrior

Re:Kernel Placement Question(?)

Post by Warrior »

Hmm..I think so, thanks for the explination.
Post Reply