Flat memory on 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
mschummi
Posts: 3
Joined: Sat Aug 29, 2009 3:08 pm

Flat memory on 64-bit

Post by mschummi »

What do I have to set to have a 64-bit environment with a flat memory model, no paging and "no segmentation"?

When I search for switching to long mode, I can only find information for people that already have paging enabled.
Last edited by mschummi on Mon Aug 31, 2009 9:05 am, edited 1 time in total.
whowhatwhere
Member
Member
Posts: 199
Joined: Sat Jun 28, 2008 6:44 pm

Re: Flat memory on 64-bit

Post by whowhatwhere »

mschummi wrote:I'd like
What do I have to set to have a 64-bit environment with a flat memory model, no paging and "no segmentation"?

When I search for switching to long mode, I can only find information for people that already have paging enabled.
It's automatically in a flat memory model, assuming you've set up long mode properly. When you set LME bit and enable paging, you are in long mode.
mschummi
Posts: 3
Joined: Sat Aug 29, 2009 3:08 pm

Re: Flat memory on 64-bit

Post by mschummi »

So, can't I switch to long mode without having paging enabled?
whowhatwhere
Member
Member
Posts: 199
Joined: Sat Jun 28, 2008 6:44 pm

Re: Flat memory on 64-bit

Post by whowhatwhere »

mschummi wrote:So, can't I switch to long mode without having paging enabled?
Yes, exactly. For better or for worse, AMD engineers are ... brilliant.
Kitsune
Posts: 20
Joined: Wed Aug 05, 2009 7:13 pm

Re: Flat memory on 64-bit

Post by Kitsune »

Just to add what was already said, but 64 bit mode doesn't have segmentation to begin with.



Edit: Didn't realize that the compatibility modes were considered a sub mode of long mode!
Last edited by Kitsune on Mon Aug 31, 2009 4:11 pm, edited 1 time in total.
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: Flat memory on 64-bit

Post by Brendan »

Hi,
Kitsune wrote:Just to add what was already said, but long mode doesn't have segmentation to begin with.
In long mode there's 2 sub-modes. There's the 64-bit sub-mode (which has no segmentation, except for FS and GS), and the "compatibility" sub-mode that allows you to run 32-bit and 16-bit software (which has full segmentation).

@mschummi: If you don't want to take advantage of paging (e.g. to improve performance, reduce RAM usage and simplify the address space/s) then you could just identity map everything. There's also other beneficial features you can disable or ignore (caches, FPU/MMX, SSE, etc) if you really want to ensure your OS is inefficient. ;)


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