new old patch - setup.S

Ulrich Windl (Ulrich.Windl@rz.uni-regensburg.de)
Tue, 20 Feb 1996 12:18:18 +0100


This patch prevents that the disk parameters for the second harddisk
are wiped out with zeros if the (buggy) BIOS returns the wrong state
for the carry flag. Since 1.2 the second harddisk would still work,
but CHS is reported as 0/0/0 then.

Note: If there's no second harddisk configured in the BIOS the code
isn't executed at all. Should break nothing; essentially a one-line
fix.

cd /tmp/
diff -c /usr/src/linux/arch/i386/boot/setup.S /tmp/setup.S
*** /usr/src/linux/arch/i386/boot/setup.S Mon Dec 11 08:55:42 1995
--- /tmp/setup.S Tue Feb 20 10:38:29 1996
***************
*** 217,223 ****
--- 217,234 ----
mov ax,#0x01500
mov dl,#0x81
int 0x13
+ ! First of all it doesn't make much sense to configure
+ ! a harddisk in the BIOS that isn't present; thus we
+ ! could delete the whole check.
+ ! Secondly there's a bug in some Acer 386SX BIOS that
+ ! does not set the carry flag correctly. After all, removing
+ ! the test should not harm, because register AH is 1 when
+ ! entering the interrupt. Thus it can't be 3 when there's
+ ! no harddisk, or when the call is unsupported. That's IBM BIOS
+ ! compatibility.
+ #if 0 /* don't zero out disk parameters for 2nd IDE drive when
present */
jc no_disk1
+ #endif
cmp ah,#3
je is_disk1
no_disk1: