AMD Opteron 64 bit "unreal" mode 
Author Message
 AMD Opteron 64 bit "unreal" mode

Anyone got any opinions (or facts) on if unreal mode works in the case
of accessing 64 bit addresses from a 32 bit program ?

--
For most men, true happiness can only be achieved with a woman.
Also for most men, true happiness can only be achieved without a woman.
Sharp minds have noted that these two rules tend to conflict.....



Fri, 09 Dec 2005 14:47:32 GMT  
 AMD Opteron 64 bit "unreal" mode
Quote:
> Anyone got any opinions (or facts) on if unreal mode works in the case
> of accessing 64 bit addresses from a 32 bit program ?

Long mode requires paging to be enabled. Since the i80486, paging cannot
be enabled when switching back to real mode (exception).
On earlier i80486 models, paging could be enabled using the undocumented
LOADALL instruction. Newer models don't have this instruction anymore.
Dunno about other CPU's.

Also, in 64-bit mode, some x86 opcodes are replaced with a couple
of 64-bit overrides. If somehow you succeed to enabled 64-bit mode
in real mode, you'll have the trouble not being able to use:
- AAA/AAD/AAM/AAS/DAA/DAS
- SAHF/SALC
- INTO
- BOUND
- single byte INC and DEC (of which the opcodes are used for 64-bit
override)
- most segment related instructions, such as CALL FAR, PUSH/POP <seg>
- redundant MOV group

H



Sat, 10 Dec 2005 04:32:46 GMT  
 AMD Opteron 64 bit "unreal" mode

Quote:

> > Anyone got any opinions (or facts) on if unreal mode works in the case
> > of accessing 64 bit addresses from a 32 bit program ?
> Long mode requires paging to be enabled. Since the i80486, paging cannot
> be enabled when switching back to real mode (exception).
> On earlier i80486 models, paging could be enabled using the undocumented
> LOADALL instruction. Newer models don't have this instruction anymore.
> Dunno about other CPU's.

> Also, in 64-bit mode, some x86 opcodes are replaced with a couple
> of 64-bit overrides. If somehow you succeed to enabled 64-bit mode
> in real mode, you'll have the trouble not being able to use:
> - AAA/AAD/AAM/AAS/DAA/DAS
> - SAHF/SALC
> - INTO
> - BOUND
> - single byte INC and DEC (of which the opcodes are used for 64-bit
> override)
> - most segment related instructions, such as CALL FAR, PUSH/POP <seg>
> - redundant MOV group

> H

Also, unreal mode relies on loading the segment descriptors with 4GB limits,
and switching back to real mode.

In long mode, you don't load the don't load the descriptors with 16EB limits,
the processor is set to ignore the limits ( and the bases too for all but FS and
GS ). Once you switch back from long mode the 4GB limits will be enforced
again.

Why would you want to do this anyway?

- Show quoted text -



Sat, 10 Dec 2005 10:05:36 GMT  
 AMD Opteron 64 bit "unreal" mode

Quote:


> > > Anyone got any opinions (or facts) on if unreal mode works in the case
> > > of accessing 64 bit addresses from a 32 bit program ?
> > Long mode requires paging to be enabled. Since the i80486, paging cannot
> > be enabled when switching back to real mode (exception).
> > On earlier i80486 models, paging could be enabled using the undocumented
> > LOADALL instruction. Newer models don't have this instruction anymore.
> > Dunno about other CPU's.

> > Also, in 64-bit mode, some x86 opcodes are replaced with a couple
> > of 64-bit overrides. If somehow you succeed to enabled 64-bit mode
> > in real mode, you'll have the trouble not being able to use:
> > - AAA/AAD/AAM/AAS/DAA/DAS
> > - SAHF/SALC
> > - INTO
> > - BOUND
> > - single byte INC and DEC (of which the opcodes are used for 64-bit
> > override)
> > - most segment related instructions, such as CALL FAR, PUSH/POP <seg>
> > - redundant MOV group

> > H

> Also, unreal mode relies on loading the segment descriptors with 4GB limits,
> and switching back to real mode.

> In long mode, you don't load the don't load the descriptors with 16EB limits,
> the processor is set to ignore the limits ( and the bases too for all but FS and
> GS ). Once you switch back from long mode the 4GB limits will be enforced
> again.

> Why would you want to do this anyway?

"unreal" mode is, as you said, enabled by setting the segment descriptors and
returning to real mode, so not sure where paging enters into it. The first
poster implied that unreal mode no longer works, but Joel Fines bootloader
seems to work using unreal mode on a AMD-64, so I think these issues are unrelated.

The why ? Simple. Access of > 4gb from a 32 bit program.

--
For most men, true happiness can only be achieved with a woman.
Also for most men, true happiness can only be achieved without a woman.
Sharp minds have noted that these two rules tend to conflict.....



Sun, 11 Dec 2005 14:08:29 GMT  
 AMD Opteron 64 bit "unreal" mode
Quote:
> "unreal" mode is, as you said, enabled by setting the segment descriptors
and
> returning to real mode, so not sure where paging enters into it.

For the 64-bit extensions, one needs to be in 'Long mode'. For some reason,
AMD has made long mode dependent on the PG bit.
64-bit mode bypasses the segmentation unit, ie does not uses segments or
segment descriptors.

Quote:
> The first poster implied that unreal mode no longer works

No I didn't. Just said that you can't do 64-bit in (un)real mode.
In 'Legacy mode', the Opteron behaves like any normal x86 CPU,
which included unreal mode.

H



Mon, 12 Dec 2005 06:28:17 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Linux 64-bit (Opteron) Fortran 95?

2. 64-bit Opteron g77 compiles

3. Announce: Fltk for 64 bit Opterons under SUSE

4. 64-Bit Hexadecimal to 64-Bit Binary

5. x86-64 performance: 32 bit vs 64 bit

6. AMD-64/IA-64 Forths

7. Python on 64 bit/IA-64 ...

8. string.join(["Tk 4.2p2", "Python 1.4", "Win32", "free"], "for")

9. Tcl 8.5a4 freezing on "expr 1.234" on AMD Opteron

10. Dividing 128 bit by 64 bit numbers

11. 64 bit index of the low bit

12. first bit set in a 64 bit integer...

 

 
Powered by phpBB® Forum Software