TIP: Click on subject to list as thread! ANSI
echo: 80xxx
to: PAUL WANKADIA
from: MARIUS BENDIKSEN
date: 1997-10-13 17:29:00
subject: extended memory 1/3

> The 80XXX "Snippets" archive for 1995 has some UNREAL.EXE util, which is
> purported to do some phantasmic magic to allow access to the entire 4Gb
> address-space while allowing everything to run normally.  Grab 
XXX_95.ZIP.
Actually, Unreal uses protected mode. What it does is to exploit the selector 
cache registers. Here is a simple source to do this (in NASM, compile to a 
.COM file). It looks like spaghetti since I only spent a couple of minutes 
tossing it together from scraps of my boot code, but it works.
--------
[BITS 16]
[SECTION .text]
[ORG 0x0100]
                jmp     Code.entry
data:
.msg0a20        db 'A20       ', 0x24
.msg1a20        db 'Checking A20 status: ', 0x24
.msgYa20        db 'HIGH', 0x0a, 0x0d, 0x24
.msgNa20        db 'LOW', 0x0a, 0x0d, 0x24
.msg2a20        db 'Raising A20 line', 0x0a, 0x0d, 0x24
.msg3a20        db 'Fatal 8042 error', 0x0a, 0x0d, 0x24
.msg4a20        db '8042 timeout', 0x0a, 0x0d, 0x24
.msg0unr        db 'XTD       ', 0x24
.msg1unr        db 'Unreal extender by Marius Bendiksen.', 0x0a, 0x0d, 0x24
.msg2unr        db 'Extending linear adressing space', 0x0a, 0x0d, 0x24
.msgarghh       db 'Error.', 0x0a, 0x0d, 0x24
.GDTunr         dw 0x0f
.patch          dd .GDTunr
                dw 0
                dw 0xffff
                db 0x0, 0x0, 0x0
                db 0x92
                db 0xcf
                db 0x0
Code:
.outs:          push    ax
                push    dx
                mov     dx, si
                mov     ah, 0x09
                pop     dx
                pop     ax
                ret
.a20_msg:       push    dx
                push    ax
                push    si
                mov     dx, data.msg0a20
                mov     ah, 0x09
                int     0x21
                pop     dx
                mov     ah, 0x09
                int     0x21
                pop     ax
                pop     dx
                ret
.a20_tout:      mov     si, data.msg4a20
                call    .a20_msg
                jmp     .bootout
.a20_p0:        xor     cx, cx ;clear
.a20_p0a:       in      al, 0x64
                test    al, 1
                jnz     short .a20_go
                loop    .a20_p0a
                jmp     short .a20_tout
.a20_p1:        xor     cx, cx  ;set
.a20_p1a:       in      al, 0x64
                test    al, 2
                jz      short .a20_go
                loop    .a20_p1a
                jmp     short .a20_tout
.a20_go:        ret
.unr_msg:       push    si
                mov     si, data.msg0unr
                call    .outs
                pop     si
                call    .outs
                ret
.a20gogo:       pushad
                mov     si, data.msg1a20
                call    .a20_msg
* [ Continued In Next Message... ]
 -- SPEED 2.00 [NR]: -- Lord Nihil -- This is a microsoft-free zone.
--- BBBS/NT v3.33 How
---------------
* Origin: Circle of Protection +47 55961259 ISDN/V.34+ (2:211/37)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.