Re: Is it possible to address more than 1MB in real-mode




JJ "João Jerónimo" asked:

Elcaro Nosille wrote:
Would it be possible to use a 32-bit addressing-mode in real-mode via
address-size prefix and thereby to have segments which are 4GB long?

Yes, it's possible. However, first you have to change the size of the
segments in the Internal Descriptor Cache. Otherwise, you'll get a GPF
(i'm
not sure, however, if the processor even tries to handle such a strange
thing as a GPF triggered in real mode of if it tripple faults
immediately)...

This (changing the size of the segments) is a feature of PM, so you need
PM
to do this. So, you go to 16-bit PM, you load your segment registers with
4GB segment descriptors, and then you switch back to real mode, since you
still want to run the BIOS and things alike... Then, you can access data
above 1MB and (I suppose), run code there. Beware that the BIOS won't be
able to return to extended memory, though...

What I described is what we usually call Unreal Mode, Voodoo Mode, Flat
Real Mode, 32-bit Real Mode (this is the less accurate of them!), etc.
In the unlikely case that you have a 386 or a 286, you can also use
LOADALL
(but it's not recommended unless you don't intend to share your code with
anyone else).


The opcode for 'Loadall' got a totally different meaning on newer CPUs !

I figured it out a few weeks ago, YES if you don't (re)set the limit
of your seg-regs whenever you switch from PM to RM. The stored seg-limits
(this hidden 48 bits) remain valid and let you access all 4GB within RM.

Last checks showed that this is valid for CPUs above/equal 486DX, while
previous CPUs may have a hard-wired 64 KB limit for RM (stated in 386/486
Intel docs) regardless of desciptor setups (mentioned as ignored at
all in RM).

Modern (586+) seem to remember the PM-limit settings for seg regs when
re-entering real (unreal/bigreal then) mode [except for CS of course].
__
wolfgang


.



Relevant Pages

  • Re: Is it possible to address more than 1MB in real-mode
    ... address-size prefix and thereby to have segments which are 4GB long? ... segments in the Internal Descriptor Cache. ... thing as a GPF triggered in real mode of if it tripple faults immediately)... ... still want to run the BIOS and things alike... ...
    (comp.lang.asm.x86)
  • Re: Prefix 0x0F is used in 16 Bit
    ... > No, I think you can go to protected mode, set up the segments to be ... > running in real mode combined with the simplicity of 32 bit flat pointers. ...
    (comp.lang.asm.x86)
  • Re: What exactly is Protected Mode?
    ... Then they switch back to real mode. ... >>not a true flat mode, for all practical purposes it acts like one. ... The fs and gs segments are used and therefore cannot be manipulated, ... Flat real mode makes the segments irrelevent. ...
    (alt.lang.asm)
  • Re: Prefix 0x0F is used in 16 Bit
    ... >>No, I think you can go to protected mode, set up the segments to be ... >>running in real mode combined with the simplicity of 32 bit flat pointers. ... But, that is a hack, and only ... > get out of protected mode, ...
    (comp.lang.asm.x86)