aboutsummaryrefslogtreecommitdiffstats
path: root/memdisk/memdisk.asm
diff options
context:
space:
mode:
authorhpa <hpa>2005-08-23 21:11:36 +0000
committerhpa <hpa>2005-08-23 21:11:36 +0000
commitaea77f706dc62f6a674e3a349c977f380f35977b (patch)
tree34f249ef48eb96f91976efa0d86196490d9e8d00 /memdisk/memdisk.asm
parenta68c07995cc5e7ff18c1a7535cbfeca15f2bbeb5 (diff)
downloadsyslinux.git-aea77f706dc62f6a674e3a349c977f380f35977b.tar.gz
syslinux.git-aea77f706dc62f6a674e3a349c977f380f35977b.tar.xz
syslinux.git-aea77f706dc62f6a674e3a349c977f380f35977b.zip
* -ffreestandingsyslinux-3.10-pre21
* handle systems where a reset HD fails without HDs * allow the user to select a different disk number (experimental)
Diffstat (limited to 'memdisk/memdisk.asm')
-rw-r--r--memdisk/memdisk.asm15
1 files changed, 10 insertions, 5 deletions
diff --git a/memdisk/memdisk.asm b/memdisk/memdisk.asm
index 6eb83302..c59704da 100644
--- a/memdisk/memdisk.asm
+++ b/memdisk/memdisk.asm
@@ -177,19 +177,24 @@ DoneWeird:
Reset:
; Reset affects multiple drives, so we need to pass it on
TRACER 'R'
+ xor ax,ax ; Bottom of memory
+ mov es,ax
test dl,dl ; Always pass it on if we are resetting HD
- js .pass_on ; Bit 7 set
+ js .hard_disk ; 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
; BIOS equipment byte, top two bits + 1 == total # of floppies
- test byte [es:0x410],0C0h
+ test byte [es:0x410],0C0h
jz success
- ; ... otherwise pass it to the BIOS
+ jmp .pass_on ; ... otherwise pass it to the BIOS
+.hard_disk:
+ ; ... same thing for hard disks, sigh ...
+ cmp byte [es:0x475],1 ; BIOS variable for number of hard disks
+ jbe success
+
.pass_on:
pop ax ; Drop return address
popad ; Restore all registers