Hi!

9--2006 14:22 [EMAIL PROTECTED] (Michael Devore) wrote to
freedos-devel@lists.sourceforge.net:

>>But if it implemented, it should be implemented right.  :)  Especially, this
>>is easy implementation.
MD> It should be implemented to work for the most users with the minimum amount
MD> of confusion and the minimum amount of FreeDOS support contact
MD> afterwards.  That may or may not meet your definition of "right".

     My definition based on specifications. :)

MD> But, now there are rumors of applications which leave A20 hanging off, to
MD> spite and annoy us all.

     But such application will not work with DOS in HMA at all!

MD> Nothing like a little challenge.  And
MD> competition.  So here it is:
MD> Write the most compatible A20 handler and submit it for inclusion in the
MD> EMM386 release.  Three simple rules:  1) has to work with EXEPACK, 2) you
MD> test to make sure it works, and 3) you have twelve hours from the beep to
MD> submit it.

1: behavior not changed.
2: tested - see below.
3: :) I receive this letter 23:28 my local time (TZ +003). Finished 6 hours
   later.  :)

     Tests (diff file see in attachment):

______________O\_/_________________________________\_/O______________
-a
0100 int3
0101
-a 110
0110 mov ax,4300
0113 int 2fh
0115 mov si,1
0118 cmp al,80
011A jne 100
011C mov ax,4310
011F int 2f
0121 mov word ptr [300],bx
0125 mov word ptr [302],es
0129 mov si,2
012C mov ax,es
012E or ax,bx
0130 jz 100
0132 ;
0132 mov si,304
0135 call 200        ; 304: initial query 210
0138 ;
0138 mov si,308
013B mov ah,3
013D add ah,[304]
0141 call 210        ; 308: global disable
0144 mov ah,4
0146 sub ah,[304]
014A call 210        ; 30C: global enable
014D ;
014D mov si,310
0150 mov ah,4
0152 call 210        ; 310: global disable
0155 mov ah,6
0157 call 210        ; 314: local disable
015A mov ah,6
015C call 210        ; 318: local disable
015F mov ah,4
0161 call 210        ; 30C: global disable
0164 ;
0164 mov si,320
0167 mov ah,5
0169 call 210        ; 320: local enable 1
016C mov ah,5
016E call 210        ; 324: local enable 2
0171 mov ah,6
0173 call 210        ; 328: local disable 1
0176 mov ah,6
0178 call 210        ; 32C: local disable 2
017B mov ah,6
017D call 210        ; 330: local disable 3
0180 mov ah,5
0182 call 210        ; 334: local enable
0185 int3
0186
-a 200
0200 mov ah,7
0202 jmp 220
0204
-a 210
0210 call 220
0213 jmp 200
0215
-a 220
0220 call far [300]
0224 mov [si],al
0226 mov [si+1],bl
0229 add si,2
022C ret
022D
-g=110

AX=0001  BX=0700  CX=0000  DX=0000  SP=FFEE  BP=0000  SI=0338  DI=0000
DS=0E7D  ES=0213  SS=0E7D  CS=0E7D  IP=0185   NV UP EI PL NZ NA PO NC
0185 CC            INT  3
-d 300l40
0300  6C 07 13 02 01 00 89 36-01 00 00 00 01 00 01 00   l......6........
0310  01 00 00 00 01 00 00 00-01 00 00 00 01 00 00 00   ................
0320  01 00 01 00 01 00 01 00-01 00 01 00 01 00 00 00   ................
0330  01 00 00 00 01 00 01 00-E8 A9 FB C6 06 89 D3 00   ................
-q
_____________________________________________________________________
              O/~\                                 /~\O

Compare this with MS-HIMEM/EMM:

______________O\_/_________________________________\_/O______________
0300  CF 00 13 02 01 00 74 62-01 00 00 00 01 00 01 00   ......tb........
0310  01 00 00 00 00 82 00 00-00 82 00 00 01 00 00 00   ................
0320  01 00 01 00 01 00 01 00-01 00 01 00 01 00 00 00   ................
0330  00 82 00 00 01 00 01 00-32 C0 B9 FF FF F2 AE F7   ........2.......
_____________________________________________________________________
              O/~\                                 /~\O

Here is only one difference - MS diagnoses local disable (AX=0/BL=82), when
A20 already disabled. My patch makes local disable always successful.
diff -rup -x config.bat old/emm386/emm386.asm new/emm386/emm386.asm
--- old/emm386/emm386.asm       2006-08-09 12:26:18.000000000 +0000
+++ new/emm386/emm386.asm       2006-08-10 06:06:38.000000000 +0000
@@ -413,6 +413,7 @@ public _UMBsegments
 ;              dd 0,0,0,0
 _UMBsegments           dd      0,0,0,0,0,0,0,0 ; segment/size entry each
 VDS_retcode    DB      0
+A20_localcount DW      0
 
 
 UMBallocate:
@@ -539,13 +540,22 @@ UMBfree:
 ;; so we don't do anything - and even say SUCCESS - like WinNT DOSBOX
 ;
 
-global_enable_a20:
 local_enable_a20:
+       mov     ax,[cs:A20_localcount]
+       inc     ax
+       jz      global_enable_a20       ; overflow -> skip counter increment
+       mov     [cs:A20_localcount],ax
+global_enable_a20:
        mov     al,1    ; enable A20 flag to EMM
        jmp     disen_share
 
-global_disable_a20:
 local_disable_a20:
+       mov     ax,[cs:A20_localcount]
+       sub     ax,1
+       jc      global_disable_a20      ; underflow -> skip counter decrement
+       mov     [cs:A20_localcount],ax
+       jnz     global_enable_a20
+global_disable_a20:
        mov     al,0    ; disable A20 flag to EMM
 
 disen_share:
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to