avoid bogus BIOSes' bug in get_diskinfo_standard

This commit is contained in:
okuji 1999-07-30 09:59:34 +00:00
parent cec4786ec2
commit 1d4df6991d
2 changed files with 15 additions and 0 deletions

View file

@ -1,3 +1,9 @@
1999-07-30 OKUJI Yoshinori <okuji@kuicr.kyoto-u.ac.jp>
From Pavel Roskin <pavel_roskin@geocities.com>:
* stage2/asm.S (get_diskinfo_standard): If the number of sectors
returned is zero, then return an error code, even if non-carrier.
1999-07-15 Gordon Matzigkeit <gord@zen.fig.org>
* docs/Makefile.am (grub.info): Use an ugly hack to downgrade

View file

@ -596,6 +596,15 @@ ENTRY(get_diskinfo_standard)
.code16
movb $0x8, %ah
int $0x13 /* do the operation */
/* check if successful */
testb %ah, %ah
jnz 1f
/* bogus BIOSes may not return an error number */
testb $0x3f, %cl /* 0 sectors means no disk */
jnz 1f /* if non-zero, then succeed */
/* XXX 0x60 is one of the unused error numbers */
movb $0x60, %ah
1:
movb %ah, %bl /* save return value in %bl */
/* back to protected mode */
data32