Page 1 of 1

A memory question

Posted: Fri Jul 01, 2011 10:55 am
by Karlosoft
Hi. In unreal mode when the a20 line is enabled we can access a bit less than a 2^16 bytes from the 2nd mb. Is it possible to access in this way to the memory beyond 2^32 using a different segment for every location. For example

0x100000000 = 1:0xfffffff0
0x100000001 = 1:0xfffffff1

and so on?

Re: A memory question

Posted: Fri Jul 01, 2011 11:40 am
by bluemoon
A20 line is hardwired pin (to some extend) for addressing bus, it works on physical address has nothing to do with address mode.
Is it possible to access in this way to the memory beyond 2^32 using a different segment for every location
From Intel manual 3A:
3.3 PHYSICAL ADDRESS SPACE
In protected mode, the IA-32 architecture provides a normal physical address space of 4 GBytes (232 bytes). This is the address space that the processor can address on its address bus. This address space is flat (unsegmented), with addresses ranging continuously from 0 to FFFFFFFFH. This physical address space can be mapped to read-write memory, read-only memory, and memory mapped I/O. The memory mapping facilities described in this chapter can be used to divide this physical memory up into segments and/or pages.
So, for IA-32(without PAE) if the address translate to more than 4G, the high bits is either ignored and wrap around, (ie. overflow) or #GP, I have not tested it though.
Btw, the idea of seg.base + offset > 4G won't work on paging too.
Since unreal mode employ features from protected mode, I suppose it has same limitation.

The proper way is to access more than 4G would be using PAE to access up to 64GB, or switch to long mode.

Re: A memory question

Posted: Fri Jul 01, 2011 11:44 am
by Owen
No. It is explicitly defined that for Real, Protected and Long-Compatibility modes the address calculation is Linear = (Segment.Base + Virtual) & 0xFFFFFFFF. That is, it is not possible to address more virtual memory without being in Long-64 mode. Because in (un)real mode there is no paging, and because without paging Virtual addresses are mapped 1:1 to physical addresses, you cannot address more memory.

Re: A memory question

Posted: Sat Jul 02, 2011 3:01 pm
by Karlosoft
Ok :) Thank you for the answers ;)