From 81faaf6c56735499e7e3ab3236103fd17c25bad2 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Mon, 9 Nov 2009 23:51:01 +0100 Subject: [PATCH 1/3] 2009-11-09 Vladimir Serbinenko * kern/i386/pc/startup.S (grub_biosdisk_get_diskinfo_int13_extensions): Ignore return status if CF is cleared. --- kern/i386/pc/startup.S | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/kern/i386/pc/startup.S b/kern/i386/pc/startup.S index da3624c89..83f0b4ef8 100644 --- a/kern/i386/pc/startup.S +++ b/kern/i386/pc/startup.S @@ -776,6 +776,11 @@ FUNCTION(grub_biosdisk_get_diskinfo_int13_extensions) movw %cx, %ax movw %bx, %ds int $0x13 /* do the operation */ + jc noclean + /* Clean return value if carry isn't set to workaround + some buggy BIOSes. */ + xor %ax, %ax +noclean: movb %ah, %bl /* save return value in %bl */ /* back to protected mode */ DATA32 call real_to_prot From b8baeed9eef7543e78e25ca9861544e9909c8e05 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Mon, 9 Nov 2009 23:59:59 +0100 Subject: [PATCH 2/3] ChangeLog --- ChangeLog.lbafix | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 ChangeLog.lbafix diff --git a/ChangeLog.lbafix b/ChangeLog.lbafix new file mode 100644 index 000000000..add35fb83 --- /dev/null +++ b/ChangeLog.lbafix @@ -0,0 +1,5 @@ +2009-11-09 Vladimir Serbinenko + + * kern/i386/pc/startup.S (grub_biosdisk_get_diskinfo_int13_extensions): + Ignore return status if CF is cleared. + From 6ee8daeead5859a956dc9f919b4bb612627eb072 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Fri, 27 Nov 2009 13:38:01 +0100 Subject: [PATCH 3/3] Second part of the LBA fix --- ChangeLog.lbafix | 1 + kern/i386/pc/startup.S | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/ChangeLog.lbafix b/ChangeLog.lbafix index add35fb83..ec9737e9c 100644 --- a/ChangeLog.lbafix +++ b/ChangeLog.lbafix @@ -2,4 +2,5 @@ * kern/i386/pc/startup.S (grub_biosdisk_get_diskinfo_int13_extensions): Ignore return status if CF is cleared. + (grub_biosdisk_get_diskinfo_standard): Likewise. diff --git a/kern/i386/pc/startup.S b/kern/i386/pc/startup.S index 83f0b4ef8..a81795b22 100644 --- a/kern/i386/pc/startup.S +++ b/kern/i386/pc/startup.S @@ -824,6 +824,11 @@ FUNCTION(grub_biosdisk_get_diskinfo_standard) .code16 movb $0x8, %ah int $0x13 /* do the operation */ + jc noclean2 + /* Clean return value if carry isn't set to workaround + some buggy BIOSes. */ + xor %ax, %ax +noclean2: /* check if successful */ testb %ah, %ah jnz 1f