Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the board
Thread view  Mix view  Order
CandyMan

03.06.2022, 13:26
 

MAXMEM.SYS driver for M$DOS 7.1 (Announce)

I wrote a driver for M$DOS 7.1 which pretends to be QEMM and allows you to transfer some DOS data to UMB memory. After use, my system only uses 8KB of conventional memory. Compile/assemble source code using fasm.

;
; Maximum Memory Driver for QEMM's DOSDATA.SYS/DOS-UP.SYS
;
;My CONFIG.SYS (M$DOS 7.1) looks like:
;DEVICE=UMBPCI.SYS /I=D000-E7FF
;DEVICE=UMBM.EXE /I=D000-E7FF
;DEVICE=D:\QEMM\DOSDATA.SYS
;DEVICEHIGH=D:\QEMM\MAXMEM.SYS
;DEVICEHIGH=D:\QEMM\DOS-UP.SYS
;DEVICEHIGH=XMGR.SYS
;
        format  binary as 'sys'
;
; Device Driver
;
struc   InitRequest
{
.Length         db      ?
.Unit           db      ?
.Function       db      ?
.Status         dw      ?
.Reserved       rb      8
.Units          db      ?
.EndAddress     dd      ?
.ParamAddr      dd      ?
}

virtual at 0
InitRequest     InitRequest
end virtual

        dd      -1
        dw      0xC000
        dw      Strategy
MainDevInt      \
        dw      DevInt1st
MyNewMagic      \
        db      '$MAXMEM'       ;7 chars
Counter db      2               ;#2->#0

Strategy:
        push    es bx
        pop     [cs:CmdPtr]
        retf

DevInt: push    ds bx
        pushd   0xAAAA5555
label CmdPtr dword at $-4
        pop     bx ds
        mov     [bx+InitRequest.Status],0100h
        pop     bx ds
        retf

New2Fh: pushfw
        cmp     ax,$D200
JumpsA: jz      short IsD200
        cmp     ax,$D201
JumpsB: jz      short IsD201
Jmp2Fh: popfw
        jmp     0:0
label Old2Fh dword at $-4

IsD200: cmp     bx,5144h
        jne     Jmp2Fh
        cmp     cx,4D45h
        jne     Jmp2Fh
        cmp     dx,4D30h
        jnz     Jmp2Fh
        popf
        mov     al,-1
        mov     bx,4D45h
        mov     cx,4D44h
        mov     dx,5652h
        clc
        retfw   2

IsD201: cmp     bx,4849h
        jnz     Jmp2Fh
        cmp     cx,5241h
        jnz     Jmp2Fh
        cmp     dx,4D30h
        jnz     Jmp2Fh
if 1
        dec     [cs:Counter]
        jnz     @F
        mov     word [cs:JumpsA],9090h
        mov     word [cs:JumpsB],9090h
@@:
end if
        popf
        ;
        push    es
        mov     ah,52h
        int     21h
        mov     cx,[es:008Ch]   ;DOS 7.1/8.0 UMB
        mov     es,cx
        inc     cx
        add     cx,[es:3]
        pop     es
        ;
        mov     bx,4F4Bh
        xor     dx,dx
        clc
        retfw   2

Resident:

InitFunc:
        mov     ax,3000h
        int     21h
        mov     ax,8103h
        xor     dx,dx
        cmp     bh,-1   ;MS-DOS?
        jnz     .Exit
        push    cs
        pop     ds
        mov     [MainDevInt],DevInt
        mov     ax,352Fh
        int     21h
        push    es bx
        pop     [Old2Fh]
        mov     ax,252Fh
        mov     dx,New2Fh
        int     21h
        mov     ax,0100h
        mov     dx,Resident
.Exit:  ret

DevInt1st:
        pusha
        push    ds es

        lds     bx,[cs:CmdPtr]
        cmp     [bx+InitRequest.Function],0
        jnz     OtherCmd

        push    ds bx
        call    InitFunc
        pop     bx ds
        mov     [bx+InitRequest.Status],ax
        push    cs dx
        pop     [bx+InitRequest.EndAddress]
OtherCmd:
        pop     es ds
        popa
        retf

Zyzzle

04.06.2022, 04:33

@ CandyMan

MAXMEM.SYS driver for M$DOS 7.1

> I wrote a driver for M$DOS 7.1 which pretends to be QEMM and allows you to
> transfer some DOS data to UMB memory. After use, my system only uses 8KB of
> conventional memory. Compile/assemble source code using fasm.
So, did anyone get it to compile (to .SYS file?).

I think this does not require QEMM, correct? But it does require UMBPCI.SYS as listed in your sample CONFIG.SYS above.

What is purpose of this except to "fool" system into thinking QEMM is loaded? It still requires a seperate UMB and / or EMS driver as well as HIMEM.SYS to function, as I understand it. Sort of a passthrough or to shorten boot time?

Japheth

Homepage

Germany (South),
04.06.2022, 09:13

@ Zyzzle

MAXMEM.SYS driver for M$DOS 7.1

> So, did anyone get it to compile (to .SYS file?).

Yes. I used fasm v1.68 - no warnings or errors displayed.

> HIMEM.SYS to function, as I understand it. Sort of a passthrough or to
> shorten boot time?

It's been made pretty clear that the purpose is to get more conventional memory.

It works. On my test machine, the max free conv. space for program increases from 644.512 to 646.512 bytes.

On the downside, for those extra 2000 bytes, you have to load 3 additional drivers in config.sys ... :-D

Upside: 2000 bytes are 16000 bit, so the total of bit combinations is increased by 2 to the power of 16000 ... that's a lot, if you have to count down it...

---
MS-DOS forever!

CandyMan

04.06.2022, 14:31

@ Zyzzle

MAXMEM.SYS driver for M$DOS 7.1

> So, did anyone get it to compile (to .SYS file?).

Binaries you can download from:
https://board.flatassembler.net/topic.php?t=22268

Back to the board
Thread view  Mix view  Order
22632 Postings in 2109 Threads, 402 registered users, 412 users online (1 registered, 411 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum