Skip to content

Commit ce270c2

Browse files
committed
devload v3.22 - handle no UMBs better when /H used
git-svn-id: http://svn.code.sf.net/p/fdos/code/trunk@126 d9247ac3-808d-4053-b241-f1a6b6229609
1 parent 4a50ec4 commit ce270c2

File tree

3 files changed

+31
-22
lines changed

3 files changed

+31
-22
lines changed

devload.asm

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
; .....................PROGRAM HEADER FOR PROJECT BUILDER....................
22

33
; TITLE DEVLOAD to load device drivers from command line.
4-
; FORMAT EXE ; *** changed to COM in 3.12/newer ***
5-
; VERSION 3.21
4+
; FORMAT COM
5+
; VERSION 3.22
66
; CODE 80x86
7-
; OPTIONS /ML ; *** NASM -o devload.com in 3.21/newer ***
8-
; TIME CHECK
9-
; DATE 12/3/92 - 31/3/98
7+
; BUILD NASM -o devload.com in 3.21/newer ***
108
; AUTHOR David Woodhouse
119

1210
; (C) 1992, 1993 David Woodhouse.
@@ -16,7 +14,7 @@
1614

1715

1816
; Devload - a tool to load DOS device drivers from the command line
19-
; Copyright (c) 1992-2008 David Woodhouse and Eric Auer
17+
; Copyright (c) 1992-2011 David Woodhouse and Eric Auer
2018
;
2119
; This program is free software; you can redistribute it and/or modify
2220
; it under the terms of the GNU General Public License as published by
@@ -182,6 +180,9 @@
182180
; driver needs at least. Tuned messages again.
183181
; GNU GPL info (see infradead.org) added here.
184182

183+
; Version 3.22 14/7/2011 - Jeremy: if error testing umb size don't fall
184+
; through and do double allocations, 2nd failing
185+
185186
; .............................IMPROVEMENT IDEAS.............................
186187

187188

@@ -272,7 +273,6 @@ relenvok: push cs
272273
int 21h
273274
mov [OldAllocStrat],ax
274275

275-
mov bx, 0ffffh ; max. amount 1 MB if loading LOW
276276
mov bp,1 ; default: no special UMB link state
277277

278278
test byte [ModeFlag], UMBFlag
@@ -284,12 +284,15 @@ relenvok: push cs
284284
; (4xh is only UMB, 00h is low only)
285285
; (x0h first, x1h best, x2h last fit)
286286
int 21h
287+
jc lowload ; TODO print message, no UMB available
287288
mov ax,5802h ; get UMB link state
288289
int 21h
290+
xor ah, ah
289291
mov bp,ax ; store link state (AL is 1 if linked)
290292
mov ax,5803h ; set UMB link state (!)
291293
mov bx,1 ; make UMBs part of the DOS mem chain!
292294
int 21h
295+
jc lowload ; assume no UMB available
293296
; mov bx,0fffh ; never desire > 64k of UMBs
294297
mov bx,7fffh ; ask unrealistic size UMB
295298
mov ah,48h
@@ -303,14 +306,13 @@ relenvok: push cs
303306
mov ax,5801h ; set new alloc strat: UMB first
304307
mov bx,80h ; (8xh is try UMB first, low 2nd)
305308
int 21h
306-
mov bx,0ffffh ; ask unrealistic size, 1 MB
307309

308310
lowload: ; *** end of added code ***
309311

310312
; Find out how much memory is available by asking for stupid amounts.
311313

312314
mov ah,48h
313-
; mov bx,0FFFFh ; now depends on load location
315+
mov bx,0FFFFh ; ask unrealistic size, 1 MB
314316
int 21h
315317

316318
; In MS-DOS version 6 and below, this will always fail, but check
@@ -333,6 +335,7 @@ sizeok: mov ah,48h
333335
jnc grablowok
334336

335337
; *** added because of UMB alloc strat ***
338+
push ax ; store error code for alloc
336339
mov ax,5801h ; set (here: restore) alloc strat
337340
mov bx,[OldAllocStrat]
338341
mov bh,0 ; sanitize
@@ -342,6 +345,7 @@ sizeok: mov ah,48h
342345
mov ax,5803h ; set UMB link state (!)
343346
mov bx,0 ; remove UMBs from chain again
344347
int 21h
348+
pop ax ; restore error code from alloc
345349
keepumbs: ; *** end of added part ***
346350

347351
; Failed to grab memory - print error and exit.
@@ -1557,13 +1561,13 @@ TooBigMsg db "Error: Driver overflowed memory allocation."
15571561

15581562
; Error cause messages.
15591563

1564+
Err1 db 'h - invalid request)',13,10,24h
15601565
Err2 db 'h - File not found)',13,10,24h
15611566
Err3 db "h - Dir not found)",13,10,24h
15621567
Err5 db 'h - Access denied)',13,10,24h
15631568
Err7 db 'h - MCB bad)',13,10,24h ; MCB destroyed, Arena header bad
15641569
Err8 db 'h - Out of memory)',13,10,24h
15651570
Err9 db 'h - MCB not found)',13,10,24h
1566-
ErrBadFile db 'h - File read error)',13,10,24h
15671571
; *** db ' PLEASE INFORM THE AUTHOR!',13,10,24h
15681572
; ErrB db 'h - Format invalid)',13,10,24h
15691573
; FreeDOS only returns error 0b, DE_INVLDFMT, if you
@@ -1574,7 +1578,7 @@ BadSwitchMsg2 db ')',13,10,24h
15741578

15751579

15761580
ErrTable dw ErrUnknown ; no error
1577-
dw ErrBadFile ; function nr. bad / unsupported
1581+
dw Err1 ; function nr. bad / unsupported
15781582
dw Err2 ; file not found
15791583
dw Err3 ; path / dir not found
15801584
dw ErrUnknown ; <-- too many files open
@@ -1651,11 +1655,11 @@ LASTBYTE equ $
16511655

16521656
; ................DATA WHICH ISN'T NEEDED AFTER RELOCATION...................
16531657

1654-
SignOnMsg db 'DEVLOAD v3.21 - load DOS device drivers '
1658+
SignOnMsg db 'DEVLOAD v3.22 - load DOS device drivers '
16551659
db '- license' ; db '- free -'
16561660
db ' GNU General Public License 2',13,10
1657-
db '(c) 1992-2008 David Woodhouse [email protected] '
1658-
db 'Eric Auer [email protected]',13,10
1661+
db '(c) 1992-2011 David Woodhouse, Eric Auer '
1662+
db '(FreeDOS.org)',13,10
16591663
db 13,10,24h
16601664
%if 0
16611665
db 'DEVLOAD v3.21 (C) 1992-1996 David Woodhouse '
@@ -2461,6 +2465,6 @@ BREAKPOINT1: ; ret far ; *** Arrowsoft ASM screws up retf / ret far
24612465
; db STACKLEN dup (?)
24622466
; SSeg ends
24632467

2464-
end ; *** can be Main for .exe version ***
2468+
; end ; *** can be Main for .exe version ***
24652469

24662470

make.bat

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
@ECHO OFF
2-
rem if you have tasm: tasm devload.asm
3-
rem asm is ArrowASM - freeware
4-
asm devload.asm devload.obj nul.lst nul.crf
5-
rem tlink is part of Turbo C 2.01 - freeware
6-
tlink devload.obj /t
7-
rem upx is and open source binary packer
2+
rem No longer using TASM/ArrowASM and TLink/WarpLink...
3+
rem tasm devload.asm devload.obj nul.lst nul.crf
4+
rem asm devload.asm devload.obj nul.lst nul.crf
5+
rem warplink /c devload.obj
6+
rem tlink /t devload.obj , , nul.map ,
7+
rem
8+
rem nasm - open source assembler
9+
nasm -O5 -o devload.com devload.asm
10+
rem upx - open source binary packer
811
upx --8086 --best devload.com

readme.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
DEVLOAD 3.21 USER GUIDE
2+
DEVLOAD 3.22 USER GUIDE
33
-----------------------
44

55
DEVLOAD is an utility for loading device drivers from command line.
@@ -13,6 +13,7 @@
1313
Devload - a tool to load DOS device drivers from the command line
1414
Copyright (c) 1992-1998 David Woodhouse <[email protected]>
1515
Copyright (c) 2004-2008 Eric Auer <[email protected]>
16+
Copyright (c) 2011
1617

1718
This program is free software you can redistribute it and/or modify
1819
it under the terms of the GNU General Public License as published by
@@ -92,6 +93,7 @@
9293
DEVLOAD.ASM Source code for NASM, version history information
9394
MAKEDEVL.BAT "Make" script for NASM and UPX (see URLs below)
9495
README.TXT The file you are reading right now :-)
96+
READ.ME Note about origin of DEVLOAD with FreeDOS (TM)
9597
LICENCE.TXT GNU GPL v2, DEVLOAD is free open source software
9698

9799
Compilation

0 commit comments

Comments
 (0)