don't check if a sector of a disk is outside the disk in LBA mode by default, because some BIOSes don't return correct geometries.
This commit is contained in:
parent
35662478d7
commit
abca3d8f72
4 changed files with 25 additions and 2 deletions
13
ChangeLog
13
ChangeLog
|
@ -1,3 +1,16 @@
|
||||||
|
2000-09-05 OKUJI Yoshinori <okuji@gnu.org>
|
||||||
|
|
||||||
|
* stage1/stage1.S (lba_mode) [!NO_BUGGY_BIOS_IN_THE_WORLD]:
|
||||||
|
Don't check for the geometry, since some BIOSes don't return the
|
||||||
|
number of total sectors correctly, even if they have working LBA
|
||||||
|
support.
|
||||||
|
* stage2/start.S (lba_mode) [!NO_BUGGY_BIOS_IN_THE_WORLD]:
|
||||||
|
Likewise.
|
||||||
|
* stage2/bios.c (biosdisk) [!NO_BUGGY_BIOS_IN_THE_WORLD]:
|
||||||
|
Likewise.
|
||||||
|
Reported by Jan Fricke <fricke@uni-greifswald.de> and Pixel
|
||||||
|
<pixel@mandrakesoft.com>.
|
||||||
|
|
||||||
2000-09-05 OKUJI Yoshinori <okuji@gnu.org>
|
2000-09-05 OKUJI Yoshinori <okuji@gnu.org>
|
||||||
|
|
||||||
From Alessandro Rubini <rubini@gnu.org>:
|
From Alessandro Rubini <rubini@gnu.org>:
|
||||||
|
|
|
@ -184,8 +184,11 @@ lba_mode:
|
||||||
|
|
||||||
movl ABS(stage2_sector), %ebx
|
movl ABS(stage2_sector), %ebx
|
||||||
|
|
||||||
|
/* check for the geometry */
|
||||||
|
#ifdef NO_BUGGY_BIOS_IN_THE_WORLD
|
||||||
cmpl %ecx, %ebx
|
cmpl %ecx, %ebx
|
||||||
jge geometry_error
|
jge geometry_error
|
||||||
|
#endif /* NO_BUGGY_BIOS_IN_THE_WORLD */
|
||||||
|
|
||||||
/* the size and the reserved byte */
|
/* the size and the reserved byte */
|
||||||
movw $0x0010, (%si)
|
movw $0x0010, (%si)
|
||||||
|
|
|
@ -60,9 +60,14 @@ biosdisk (int read, int drive, struct geometry *geometry,
|
||||||
unsigned long buffer;
|
unsigned long buffer;
|
||||||
unsigned long long block;
|
unsigned long long block;
|
||||||
} dap;
|
} dap;
|
||||||
|
|
||||||
|
/* XXX: Don't check the geometry by default, because some buggy
|
||||||
|
BIOSes don't return the number of total sectors correctly,
|
||||||
|
even if they have working LBA support. Hell. */
|
||||||
|
#ifdef NO_BUGGY_BIOS_IN_THE_WORLD
|
||||||
if (sector >= geometry->total_sectors)
|
if (sector >= geometry->total_sectors)
|
||||||
return BIOSDISK_ERROR_GEOMETRY;
|
return BIOSDISK_ERROR_GEOMETRY;
|
||||||
|
#endif /* NO_BUGGY_BIOS_IN_THE_WORLD */
|
||||||
|
|
||||||
/* FIXME: sizeof (DAP) must be 0x10. Should assert that the compiler
|
/* FIXME: sizeof (DAP) must be 0x10. Should assert that the compiler
|
||||||
can't add any padding. */
|
can't add any padding. */
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
* GRUB -- GRand Unified Bootloader
|
* GRUB -- GRand Unified Bootloader
|
||||||
* Copyright (C) 1996 Erich Boleyn <erich@uruk.org>
|
* Copyright (C) 1996 Erich Boleyn <erich@uruk.org>
|
||||||
* Copyright (C) 1999 Free Software Foundation, Inc.
|
* Copyright (C) 1999,2000 Free Software Foundation, Inc.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
@ -96,8 +96,10 @@ lba_mode:
|
||||||
movl (%di), %ebx
|
movl (%di), %ebx
|
||||||
|
|
||||||
/* check for the geometry */
|
/* check for the geometry */
|
||||||
|
#ifdef NO_BUGGY_BIOS_IN_THE_WORLD
|
||||||
cmpl %ecx, %ebx
|
cmpl %ecx, %ebx
|
||||||
jge geometry_error
|
jge geometry_error
|
||||||
|
#endif /* NO_BUGGY_BIOS_IN_THE_WORLD */
|
||||||
|
|
||||||
/* the maximum is limited to 0x7f because of Phoenix EDD */
|
/* the maximum is limited to 0x7f because of Phoenix EDD */
|
||||||
xorl %eax, %eax
|
xorl %eax, %eax
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue