E820 memory map for 64 bit

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
Baold
Posts: 2
Joined: Tue Jul 03, 2007 5:41 pm

E820 memory map for 64 bit

Post by Baold »

Hi,

I plan to make my OS in 64bit long mode.

I use the E820 int 15h interrupt to get the memory map.

qemu-system-x86_64 give me this memory map :

Code: Select all

0000000000000000 000000000009FC00 FREE
000000000009FC00 0000000000000400 -- reserved --
00000000000E8000 0000000000018000 -- reserved --
0000000000100000 0000000007F00000 FREE
00000000FFFC0000 0000000000040000 -- reserved --
The memory at the top of the 32 bit adress space (00000000FFFC0000) seems to be the bios memory space.

When switching to 64bit long mode, will the bios memory change to the top of 64 bit adress space (FFFFFFFFFFFC0000) or stay at the same adress (00000000FFFC0000) ?
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: E820 memory map for 64 bit

Post by Brendan »

Hi,
Baold wrote:When switching to 64bit long mode, will the bios memory change to the top of 64 bit adress space (FFFFFFFFFFFC0000) or stay at the same adress (00000000FFFC0000) ?
The physical memory layout (including where the BIOS is) is controlled by the chipset. The chipset doesn't know (or care) what mode the CPU is running in, and nothing in physical memory changes when you switch to long mode (or from any CPU mode to any other CPU mode).

However, to enable long mode you need to setup paging. This means you create your own virtual address space that might (or might not) look like the physical address space. You choose how virtual addresses are mapped to physical addresses.


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Baold
Posts: 2
Joined: Tue Jul 03, 2007 5:41 pm

Post by Baold »

Thanx for this good explanation :D

For my memory manager, I'll set as free pages, the pages in the free area, and set as used pages, the pages in reserved area.
Post Reply