Skip to content

Commit d7bf9c7

Browse files
committed
devload v3.25
git-svn-id: http://svn.code.sf.net/p/fdos/code/trunk@140 d9247ac3-808d-4053-b241-f1a6b6229609
1 parent fa314db commit d7bf9c7

File tree

3 files changed

+34
-121
lines changed

3 files changed

+34
-121
lines changed

devload.asm

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ fileerr: pop ax
489489

490490
allocerr: call PrintError
491491

492-
; Indicate error in exit code
492+
; Indicate error (driver not loaded) in exit code
493493
prexit:
494494
mov al,255
495495

@@ -764,13 +764,10 @@ somedone: push cs
764764
jz noprintldrmsg
765765

766766
mov al,byte [LastDrUsed]
767-
inc al
768767
mov ah,byte [LastDrive]
769768

770769
mov byte [LDMsgA], byte 'A'-1 ; explicit byte 3.16
771-
; nop ; mimick ASM
772770
mov byte [LDMsgB], byte 'A'-1 ; explicit byte 3.16
773-
; nop ; mimick ASM
774771

775772
add byte [LDMsgA],al
776773
add byte [LDMsgB],ah
@@ -858,7 +855,8 @@ noprintsize: or bx,bx
858855

859856
; Length of driver is zero, so exit now.
860857

861-
jmp exit
858+
mov dx,NotLoadedMsg
859+
jmp prexit ; ***
862860

863861
; Check whether it fits in the allocated block.
864862

@@ -1023,7 +1021,7 @@ fill0s: xor al,al
10231021
rep stosb
10241022

10251023
stayexit:
1026-
mov al, [LastDrUsed] ; set exit code
1024+
mov al, [ExitCode] ; set exit code
10271025
test byte [ModeFlag],QuietFlag ; *** new 3.15
10281026
jnz stay2exit ; new 3.15
10291027
mov dx,StayingMsg
@@ -1363,9 +1361,20 @@ secsizeok: mov al,[cs:LastDrUsed]
13631361
jnz ldrok
13641362
jmp ldrerr
13651363

1366-
; Increase nBlkDev.
1364+
; Increase count of block devices and update to next free CDS entry
1365+
1366+
ldrok:
13671367

1368-
ldrok: inc byte [cs:nBlkDev]
1368+
inc byte [cs:nBlkDev]
1369+
inc byte [cs:LastDrUsed] ; point to next available drive *** TODO fixme
1370+
1371+
; If 1st block device loaded, store drive letter for returned exit code
1372+
test byte [cs:ExitCode], 0
1373+
jnz notfirst
1374+
mov byte [cs:ExitCode], al ; al=LastDrUsed where A=0,...,Z=25
1375+
inc byte [cs:ExitCode] ; A=1, ..., Z=26
1376+
1377+
notfirst:
13691378

13701379
; Store absolute block no. and block no. in device.
13711380

@@ -1426,6 +1435,7 @@ noprintblhmsg: lds bx,[Invar]
14261435
; Calculate offset in array of entry for this drive.
14271436

14281437
mov al,[cs:LastDrUsed]
1438+
dec al
14291439
mov ah,[cs:LDrSize]
14301440
mul ah
14311441
add bx,ax
@@ -1602,6 +1612,7 @@ LDrErrMsg db '0 drives skipped - LASTDRIVE overflow.',13,10,24h
16021612
AskEndMsg db 13,10,'No drives or Ints - unload (Y/N) ? $'
16031613
NoFreeCDSMsg db 'Error: free drive letter not found, increase LASTDRIVE',13,10,'$'
16041614
SSizeErrMsg db 'Sector size too large.',13,10,24h
1615+
NotLoadedMsg db 'Driver not loaded',13,10,'$'
16051616

16061617
; Error messages.
16071618

@@ -1679,6 +1690,8 @@ nBlkDev db 0 ; resb 1 ; Note: nBlkDev & LastDrive
16791690
LastDrive db 0 ; resb 1 ; must be together as loaded from LoL together
16801691
LastDrUsed db 2 ; default to C:, may be overridden by cmd line option
16811692

1693+
ExitCode db 0 ; default to 0 for char devices, 1=A to 26=Z for 1st block device loaded
1694+
16821695
OldAllocStrat dw 0 ; resw 1 ; DOS allocation strategy
16831696
BlockSize dw 0 ; resw 1
16841697
WantedParas dw 0 ; minimum paragraphs or RAM to load driver
@@ -1716,7 +1729,7 @@ LASTBYTE equ $
17161729

17171730
; ................DATA WHICH ISN'T NEEDED AFTER RELOCATION...................
17181731

1719-
SignOnMsg db 'DEVLOAD v3.24 - load DOS device drivers '
1732+
SignOnMsg db 'DEVLOAD v3.25 - load DOS device drivers '
17201733
db '- license' ; db '- free -'
17211734
db ' GNU General Public License 2',13,10
17221735
db '(c) 1992-2011 David Woodhouse, Eric Auer '

devload.txt

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
DEVLOAD 3.24 USER GUIDE
2+
DEVLOAD 3.25 USER GUIDE
33
-----------------------
44

55
DEVLOAD is an utility for loading device drivers from command line.
@@ -69,11 +69,17 @@
6969

7070
The /D option is used to indicate the drive letter to use.
7171
If the requested drive is in use then subsequent drive letters
72-
until LASTDRIVE is reached are tried. The final drive used
73-
is returned as the exit code, where A:=0, ... Z:=25. The
74-
default value is equivalent to /DC, i.e. C: or later - the
75-
first available drive letter. On any error the exit code
76-
will be 255.
72+
until LASTDRIVE is reached are tried. The default value is
73+
equivalent to /DC, i.e. C: or later - the first available
74+
drive letter.
75+
76+
On successful loading the exit code (ERRORLEVEL) will be set
77+
to a value between 0 and 26, where 0 is returned for character
78+
devices and for block devices the first assigned drive is
79+
returned (where 1=A:, 2=B:, 3=C:, ... 26=Z:). On any error
80+
or is device is not loaded then 255 is returned. [Future
81+
versions may provide unique values depending on the error.]
82+
is returned as the exit code, where A:=0, ... Z:=25.
7783

7884
Examples:
7985

readme.txt

Lines changed: 0 additions & 106 deletions
This file was deleted.

0 commit comments

Comments
 (0)