summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2010-06-19 19:08:39 -0700
committerH. Peter Anvin <hpa@zytor.com>2010-06-19 19:08:39 -0700
commitbf0617aecb78a5dbe54962c05d533efd074f7902 (patch)
tree167f17e2dddd9d5c40a26c2399db8a8c214a6c05
parent9f1407746a1154a2dc456059e5f223bc689e8f4b (diff)
parent107806f9ab7e87b0535944606d53b07dca291b1c (diff)
downloadsyslinux-bf0617aecb78a5dbe54962c05d533efd074f7902.tar.gz
Merge remote branch 'sha0/for_hpa' into pathbased
-rw-r--r--dosutil/eltorito.asm15
-rw-r--r--dosutil/mdiskchk.c11
-rw-r--r--memdisk/memdisk.inc7
3 files changed, 24 insertions, 9 deletions
diff --git a/dosutil/eltorito.asm b/dosutil/eltorito.asm
index 96cfd9ba..d6b6b50e 100644
--- a/dosutil/eltorito.asm
+++ b/dosutil/eltorito.asm
@@ -1029,9 +1029,11 @@ SpecGo: mov si,SpecPkt
ScanDrives: push ax ; at df3 in 1.4
push si
- mov dl, 80h ;Start at Drive 0x80
-NextDrv: mov ax,4B01h ;Get Bootable CD-ROM Status
- mov BYTE [SpecPkt],0 ;Clear 1st byte of SpecPkt
+ mov dl, 7fh ;Start at Drive 0x80
+NextDrv: inc dl
+ clc
+ mov ax,4B01h ;Get Bootable CD-ROM Status
+ mov BYTE [SpecPkt],0 ;Clear 1st byte of SpecPkt
call SpecGo
; Carry is not cleared in buggy Dell BIOSes,
; so I'm checking packet size byte
@@ -1044,10 +1046,9 @@ NextDrv: mov ax,4B01h ;Get Bootable CD-ROM Status
ja FindFail ; in 1.4 at e16
jmp short SendFound ; in 1.4 at e26
-FindFail: inc dl ;Next drive
- cmp dl, 0ffh
- jb SendFail ; Check from 80h..ffh
- jmp short NextDrv
+FindFail: cmp dl, 0ffh
+ je SendFail ; Check from 80h..ffh
+ jmp short NextDrv ;Next drive
SendFail: xor dl,dl
stc
jmp short ThingDone
diff --git a/dosutil/mdiskchk.c b/dosutil/mdiskchk.c
index ddc57632..f7bde614 100644
--- a/dosutil/mdiskchk.c
+++ b/dosutil/mdiskchk.c
@@ -200,7 +200,8 @@ static MDISKCHK_FUNC_DECL(show_usage)
"Action: --safe-hooks . . Will scan INT 13h \"safe hook\" chain\n"
" --mbfts . . . . Will scan memory for MEMDISK mBFTs\n"
" --batch-output . Will output SET command output based\n"
- " on MEMDISK kernel arguments\n");
+ " on MEMDISK kernel arguments\n"
+ " --no-sequential Suppresses probing all drive numbers\n");
}
/* Search memory for mBFTs and report them via the output method */
@@ -297,6 +298,7 @@ int main(int argc, char *argv[])
{
int d;
int found = 0;
+ int sequential_scan = 1; /* Classic behaviour */
const struct memdiskinfo *m;
/* Default behaviour */
@@ -331,6 +333,10 @@ int main(int argc, char *argv[])
case 'b':
show_memdisk = batch_output;
break;
+ case 'N':
+ case 'n':
+ sequential_scan = 0;
+ break;
default:
usage = show_usage;
} /* switch */
@@ -338,6 +344,8 @@ int main(int argc, char *argv[])
safe_hooks();
mbfts();
+ if (!sequential_scan)
+ goto skip_sequential;
for (d = 0; d <= 0xff; d++) {
m = query_memdisk(d);
if (m != NULL) {
@@ -345,6 +353,7 @@ int main(int argc, char *argv[])
show_memdisk(d, m);
}
}
+skip_sequential:
usage();
return found;
diff --git a/memdisk/memdisk.inc b/memdisk/memdisk.inc
index 90e6ef9f..91040bad 100644
--- a/memdisk/memdisk.inc
+++ b/memdisk/memdisk.inc
@@ -616,7 +616,12 @@ ElToritoTerminate:
mov ax,[cs:SavedAX]
cmp al,1 ; We only support query, not terminate
jne ElToritoErr ; Fail
- mov es,P_DS ; Caller's DS:SI pointed to packet
+ cmp dl,7fh ; Terminate all?
+ je .doit
+ cmp dl,[cs:DriveNo] ; Terminate our drive?
+ je .doit
+ jmp ElToritoErr ; Fail
+.doit: mov es,P_DS ; Caller's DS:SI pointed to packet
mov di,P_SI ; We'll use ES:DI
mov si,CD_PKT.size ; First byte is packet size
xor cx,0 ; Empty our count