33
44; TITLE DEVLOAD to load device drivers from command line.
55; FORMAT EXE ; *** changed to COM in 3.12/newer ***
6- ; VERSION 3.17
6+ ; VERSION 3.18
77; CODE 80x86
88; OPTIONS /ML
99; TIME CHECK
1010; DATE 12/3/92 - 31/3/98
1111; AUTHOR David Woodhouse
1212; (C) 1992, 1993 David Woodhouse.
13- ; Patches for 3.12 to 3.16, 3.17: 2004 and 2005, 2007 by Eric Auer
13+ ; Patches for 3.12 to 3.16, 3.17 / 3.18 : 2004 to 2005, 2007 by Eric Auer
1414
1515; EXPLANATION...
1616; The program first relocates itself to the top of the available memory
136136; Added some "short" and "ds:" as suggested by Diego Rodriguez.
137137; DR DOS version check based on research by Diego Rodriguez.
138138
139- ; Version 3.16 9/5/2007 - allocate more space for DPB if DOS 7+ (FAT32)
139+ ; Version 3.17 9/5/2007 - Eric: more RAM for DPB if DOS 7+ (FAT32)
140+
141+ ; Version 3.18 11/5/2007 - Alexey: use magic CX / DX to build ext DPB
142+ ; (int 21.53), use true instead of setver
143+ ; version if DOS 5+, provide make.bat file.
144+ ; - Eric: Tuned messages to get 3069 byte .com
145+ ; (with UPX 2.02d --8086 --best)
140146
141147; .............................IMPROVEMENT IDEAS.............................
142148
@@ -1335,10 +1341,16 @@ noprintblhmsg: lds bx,Invar
13351341 mov es : [ bp ], 0FFFFh
13361342 sub bp , cs :word ptr NextBlHOfs
13371343
1338- ; Expand BPB into block header.
1339-
1340- mov ah , 53h ; hello woody y doesnt this work
1344+ ; Expand BPB into block header
1345+ ; *** Extended in DEVLOAD 3.18: use magic CX/DX ***
1346+ push cx ; Save registers
1347+ ; push dx ;
1348+ mov cx , 4558h ; Signature for calling
1349+ mov dx , 4152h ; FAT32 extension
1350+ mov ah , 53h ; convert BPB to DPB
13411351 int 21h
1352+ ; pop dx ; Restore registers
1353+ pop cx ;
13421354
13431355 ; Point ES:BP to location of next block header.
13441356
@@ -1446,7 +1458,7 @@ nosegchange: cmp si,0FFFFh
14461458
14471459StayingMsg db 'Driver staying resident.' , 13 , 10 , 24h
14481460FNameMsg db 'Filename: $'
1449- LoadAddrMsg db 'Load address : $'
1461+ LoadAddrMsg db 'Loaded at : $'
14501462InitRetMsg db 'Init status: $'
14511463SizeMsg db 'Driver size in paras: $'
14521464IntChangeMsg db 'Int vectors changed: $'
@@ -1459,14 +1471,14 @@ CrLfMsg db 13,10,24h
14591471LastDrMsg db 13 , 10 , 'Last used drive: '
14601472LDMsgA db 'A:' , 13 , 10 , 'LASTDRIVE: '
14611473LDMsgB db 'A:' , 13 , 10 , 24h
1462- BlHdrMsg db 'Block header for '
1474+ BlHdrMsg db 'DPB for '
14631475BlHdrMsgA db 'A: at $'
14641476NumBlInstMsg db '0 drives$'
1465- NumChInstMsg db '0 character device$'
1477+ NumChInstMsg db '0 char device$'
14661478NumInstMsgA db 's installed.' , 13 , 10 , 24h
1467- LDrErrMsg db '0 drive(s) skipped - LASTDRIVE too small.' , 13 , 10 , 24h
1468- AskEndMsg db 13 , 10 , 'No drives or INTs - unload (Y/N) ? $'
1469- SSizeErrMsg db 'Sector size too large, drive(s) skipped.' , 13 , 10 , 24h
1479+ LDrErrMsg db '0 drives skipped - LASTDRIVE too small.' , 13 , 10 , 24h
1480+ AskEndMsg db 13 , 10 , 'No drives or Ints - unload (Y/N) ? $'
1481+ SSizeErrMsg db 'Sector size too large, drives skipped.' , 13 , 10 , 24h
14701482
14711483 ; Error messages.
14721484
@@ -1486,11 +1498,11 @@ TooBigMsg db 13,10,'Error: Driver wants too much memory.',13,10,24h
14861498 ; Error cause messages.
14871499
14881500Err2 db 'h - File not found)' , 13 , 10 , 24h
1489- Err3 db "h - Directory not found)" , 13 , 10 , 24h
1501+ Err3 db "h - Dir not found)" , 13 , 10 , 24h
14901502Err5 db 'h - Access denied)' , 13 , 10 , 24h
1491- Err7 db 'h - Arena header corrupted )' , 13 , 10 , 24h
1503+ Err7 db 'h - Arena header bad )' , 13 , 10 , 24h
14921504Err8 db 'h - Out of memory)' , 13 , 10 , 24h
1493- Err9 db 'h - Wrong segment passed! )' , 13 , 10 , 24h
1505+ Err9 db 'h - Wrong seg? )' , 13 , 10 , 24h
14941506; *** db ' PLEASE INFORM THE AUTHOR!',13,10,24h
14951507ErrB db 'h - Format invalid)' , 13 , 10 , 24h
14961508ErrUnknown db 'h'
@@ -1572,10 +1584,10 @@ LASTBYTE equ $
15721584
15731585; ................DATA WHICH ISN'T NEEDED AFTER RELOCATION...................
15741586
1575- SignOnMsg db 'DEVLOAD v3.17 (C) 1992 - 1996 David Woodhouse '
1587+ SignOnMsg db 'DEVLOAD v3.18 (C) 1992 - 1996 David Woodhouse '
157615881577- db ' Patches for v3.12-3.17 by Eric Auer 2004-2007'
1578- db ' <Eric*CoLi .uni-sb.de>' , 13 , 10
1589+ db ' Patches for v3.12-3.18 by Eric Auer 2004-2007'
1590+ db ' <Eric*coli .uni-sb.de>' , 13 , 10
15791591 db ' Loads device drivers from the shell.' , 13 , 10
15801592; kind of obvious...: db ' Needs DOS 3 or newer.'
15811593 db 13 , 10 , 24h
@@ -1682,11 +1694,19 @@ realver3: mov LDrSize,51h
16821694 mov NextBlHOfs , 18h
16831695 jmp short classicver
16841696
1685- okver: cmp al , 7 ; new 3.17
1697+ okver: ; Check FAT32 compatibility: VER >= 7.01
1698+ ; (new in 3.17, extended in 3.18)
1699+ cmp al , 5 ; new 3.17
16861700 jb classicver
1701+ mov ax , 3306h ; Get true DOS version
1702+ int 21h
1703+ mov cl , 8 ; Swap BH and BL
1704+ ror bx , cl ;
1705+ cmp bx , 0701h ; VER >= 7.01 ?
1706+ jb classicver
16871707
16881708 ; FAT32 aware version: larger DPB, but same DPB pointer / CDS size
1689- mov byte ptr BlHSize , 003dh ; new 3.17
1709+ mov byte ptr BlHSize , 003Dh ; new 3.17
16901710
16911711classicver:
16921712
0 commit comments