diff options
author | hpa <hpa> | 2003-08-27 20:34:23 +0000 |
---|---|---|
committer | hpa <hpa> | 2003-08-27 20:34:23 +0000 |
commit | 21f2acd8b66d97cf3d3ad7bbc4a3053a2adc8d53 (patch) | |
tree | 911c51765cd61631e53cf339c89b025190dd831f /memdisk | |
parent | c46453fbbcb6717143d36b75e2159b409b5eb310 (diff) | |
download | syslinux-21f2acd8b66d97cf3d3ad7bbc4a3053a2adc8d53.tar.gz |
Try to detect if this is the only floppy drive, and if so, don't pass
RESET commands to the BIOS.
Diffstat (limited to 'memdisk')
-rw-r--r-- | memdisk/memdisk.asm | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/memdisk/memdisk.asm b/memdisk/memdisk.asm index acad7132..ad295b40 100644 --- a/memdisk/memdisk.asm +++ b/memdisk/memdisk.asm @@ -164,6 +164,20 @@ DoneWeird: Reset: ; Reset affects multiple drives, so we need to pass it on TRACER 'R' + test dl,dl ; Always pass it on if we are resetting HD + js .pass_on ; Bit 7 set + ; Some BIOSes get very unhappy if we pass a reset floppy + ; command to them and don't actually have any floppies. + ; This is a bug, but we have to deal with it nontheless. + ; Therefore, if we are the *ONLY* floppy drive, and the + ; user didn't request HD reset, then just drop the command. + xor ax,ax ; Bottom of memory + mov es,ax + mov al,[es:0x410] ; BIOS equipment byte + shr al,6 ; Top two bits + 1 + jz success ; If this is the only device, just report success + ; ... otherwise pass it to the BIOS +.pass_on: pop ax ; Drop return address popad ; Restore all registers pop es |