2005-02-15 Yoshinori K. Okuji <okuji@enbug.org>

* stage2/builtins.c (install_func): If DEST_DRIVE is a hard
  disk, enable the workaround in Stage 1 by replacing the jmp
  with double nop's.

  * stage1/stage1.h (STAGE1_BOOT_DRIVE_CHECK): New macro.
  (STAGE1_BOOT_DRIVE_MASK): Removed.

  * stage1/stage1.S (boot_drive_check): New label. This implements
  a different workaround for buggy BIOSes which don't pass boot
  drive correctly. This is effective for BIOSes which pass a value
  without the seventh bit (0x80).
  (boot_drive_mask): Removed.
This commit is contained in:
okuji committed 2005-02-15 22:05:07 +00:00
1 parent fb908db4ad
commit 041e243877
5 files changed
+41 -12

No files matched your search

+11 -5
View File
@@ -108,12 +108,18 @@ after_BPB:
/*
* This is a workaround for buggy BIOSes which don't pass boot
* drive correctly. If GRUB is installed into a HDD, do
* "orb $0x80, %dl", otherwise "orb $0x00, %dl" (i.e. nop).
* drive correctly. If GRUB is installed into a HDD, check if
* DL is masked correctly. If not, assume that the BIOS passed
* a bogus value and set DL to 0x80, since this is the only
* possible boot drive. If GRUB is installed into a floppy,
* this does nothing (only jump).
*/
.byte 0x80, 0xca
boot_drive_mask:
.byte 0x00
boot_drive_check:
jmp 1f
testb $0x80, %dl
jnz 1f
movb $0x80, %dl
1:
/*
* ljmp to the next instruction because some bogus BIOSes