From 844cb6f07d86270960c8be7e63ae469d80054af7 Mon Sep 17 00:00:00 2001 From: okuji Date: Mon, 7 Feb 2000 21:21:52 +0000 Subject: [PATCH] use _llseek even if glibc2.0 under Linux, add a new option --disable-lba-support-bitmap-check into configure. --- ChangeLog | 15 ++++ NEWS | 5 ++ THANKS | 1 + acconfig.h | 3 + config.h.in | 3 + configure | 186 ++++++++++++++++++++++++++---------------------- configure.in | 9 +++ grub/asmstub.c | 7 +- stage1/stage1.S | 4 +- stage2/bios.c | 4 +- 10 files changed, 146 insertions(+), 91 deletions(-) diff --git a/ChangeLog b/ChangeLog index 615fadda4..a44d1b798 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2000-02-08 OKUJI Yoshinori + + * grub/asmstub.c (biosdisk) [__linux__]: Use _llseek when + __GLIBC_MINOR__ is less than 1 even if __GLIBC__ is 2. Reported + by Goran Koruga . + + * configure.in (--disable-lba-support-bitmap-check): New option. + Don't define CHECK_LBA_SUPPORT_BITMAP if specified. + * stage1/stage1.S (real_start): Check if AH=0x42 is supported if + CHECK_LBA_SUPPORT_BITMAP instead of NO_BUGGY_BIOS_IN_THE_WORLD + is defined. + * stage2/bios.c (get_diskinfo): Check if LBA read/write + functions are supported iff CHECK_LBA_SUPPORT_BITMAP is defined, + instead of NO_BUGGY_BIOS_IN_THE_WORLD. + 2000-02-07 OKUJI Yoshinori The netboot support is heavily rewritten, based on diff --git a/NEWS b/NEWS index 934109699..b4a2b3dcc 100644 --- a/NEWS +++ b/NEWS @@ -33,6 +33,11 @@ New in 0.5.94: * The netboot support is heavily rewritten, based on Etherboot-4.4.2. Most of the device drivers are stolen from it, so we now have many network drivers. See netboot/README.netboot for more details. +* Now configure accepts the option `--disable-lba-support-bitmap-check' + to ignore an incorrect LBA support bitmap returned by a buggy BIOS. If + you are sure that your BIOS does support LBA mode but GRUB doesn't + work in LBA mode, recompile GRUB with this option specified. You can + check if GRUB accesses a drive in LBA mode by the command "geometry". New in 0.5.93 - 1999-10-30: * ELF format of FreeBSD kernel is supported. diff --git a/THANKS b/THANKS index ff7b0418d..0718f5d30 100644 --- a/THANKS +++ b/THANKS @@ -14,6 +14,7 @@ Dan J. Walters Edmund GRIMLEY EVANS Edward Killips Eric Hanchrow +Goran Koruga Heiko Schroeder Hisazumi Kenji Jochen Hoenicke diff --git a/acconfig.h b/acconfig.h index 218aa62e5..da4d4c9b7 100644 --- a/acconfig.h +++ b/acconfig.h @@ -24,3 +24,6 @@ /* Defined if _end is defined. */ #undef HAVE_USCORE_END_SYMBOL + +/* Defined if --disable-lba-support-bitmap is specified. */ +#undef CHECK_LBA_SUPPORT_BITMAP diff --git a/config.h.in b/config.h.in index 86f983e41..230b7fab2 100644 --- a/config.h.in +++ b/config.h.in @@ -24,6 +24,9 @@ /* Defined if _end is defined. */ #undef HAVE_USCORE_END_SYMBOL +/* Defined if --disable-lba-support-bitmap is specified. */ +#undef CHECK_LBA_SUPPORT_BITMAP + /* Define it to "addr32" or "addr32;" to make GAS happy */ #undef ADDR32 diff --git a/configure b/configure index 9c7b6760a..09d477e08 100644 --- a/configure +++ b/configure @@ -21,6 +21,9 @@ ac_arg_with_help="$ac_arg_with_help --with-binutils=DIR search the directory DIR to find binutils" ac_arg_with_help="$ac_arg_with_help --without-curses do not use curses" +ac_arg_enable_help="$ac_arg_enable_help + --disable-lba-support-bitmap-check + disable a check for LBA support bitmap" ac_arg_enable_help="$ac_arg_enable_help --disable-ext2fs disable ext2fs support in Stage 2" ac_arg_enable_help="$ac_arg_enable_help @@ -676,7 +679,7 @@ ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install... $ac_c" 1>&6 -echo "configure:680: checking for a BSD compatible install" 1>&5 +echo "configure:683: checking for a BSD compatible install" 1>&5 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -733,7 +736,7 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' echo $ac_n "checking whether build environment is sane... $ac_c" 1>&6 -echo "configure:737: checking whether build environment is sane" 1>&5 +echo "configure:740: checking whether build environment is sane" 1>&5 # Just in case sleep 1 echo timestamp > conftestfile @@ -794,7 +797,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word... $ac_c" 1>&6 -echo "configure:798: checking for $ac_word" 1>&5 +echo "configure:801: checking for $ac_word" 1>&5 if test "${ac_cv_prog_AWK+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -824,7 +827,7 @@ test -n "$AWK" && break done echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}... $ac_c" 1>&6 -echo "configure:828: checking whether ${MAKE-make} sets \${MAKE}" 1>&5 +echo "configure:831: checking whether ${MAKE-make} sets \${MAKE}" 1>&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -873,7 +876,7 @@ EOF missing_dir=`cd $ac_aux_dir && pwd` echo $ac_n "checking for working aclocal... $ac_c" 1>&6 -echo "configure:877: checking for working aclocal" 1>&5 +echo "configure:880: checking for working aclocal" 1>&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -886,7 +889,7 @@ else fi echo $ac_n "checking for working autoconf... $ac_c" 1>&6 -echo "configure:890: checking for working autoconf" 1>&5 +echo "configure:893: checking for working autoconf" 1>&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -899,7 +902,7 @@ else fi echo $ac_n "checking for working automake... $ac_c" 1>&6 -echo "configure:903: checking for working automake" 1>&5 +echo "configure:906: checking for working automake" 1>&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -912,7 +915,7 @@ else fi echo $ac_n "checking for working autoheader... $ac_c" 1>&6 -echo "configure:916: checking for working autoheader" 1>&5 +echo "configure:919: checking for working autoheader" 1>&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -925,7 +928,7 @@ else fi echo $ac_n "checking for working makeinfo... $ac_c" 1>&6 -echo "configure:929: checking for working makeinfo" 1>&5 +echo "configure:932: checking for working makeinfo" 1>&5 # Run test in a subshell; some versions of sh will print an error if # an executable is not found, even if stderr is redirected. # Redirect stdin to placate older versions of autoconf. Sigh. @@ -945,7 +948,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word... $ac_c" 1>&6 -echo "configure:949: checking for $ac_word" 1>&5 +echo "configure:952: checking for $ac_word" 1>&5 if test "${ac_cv_prog_AMTAR+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -989,7 +992,7 @@ fi echo $ac_n "checking host system type... $ac_c" 1>&6 -echo "configure:993: checking host system type" 1>&5 +echo "configure:996: checking host system type" 1>&5 if test "x$ac_cv_host" = "x" || (test "x$host" != "xNONE" && test "x$host" != "x$ac_cv_host_alias"); then # Make sure we can run config.sub. @@ -1042,7 +1045,7 @@ esac # echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles... $ac_c" 1>&6 -echo "configure:1046: checking whether to enable maintainer-specific portions of Makefiles" 1>&5 +echo "configure:1049: checking whether to enable maintainer-specific portions of Makefiles" 1>&5 # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval="$enable_maintainer_mode" @@ -1068,7 +1071,7 @@ if test "x$enable_maintainer_mode" = xyes; then # Extract the first word of "perl", so it can be a program name with args. set dummy perl; ac_word=$2 echo $ac_n "checking for $ac_word... $ac_c" 1>&6 -echo "configure:1072: checking for $ac_word" 1>&5 +echo "configure:1075: checking for $ac_word" 1>&5 if test "${ac_cv_path_PERL+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1113,7 +1116,7 @@ fi echo $ac_n "checking build system type... $ac_c" 1>&6 -echo "configure:1117: checking build system type" 1>&5 +echo "configure:1120: checking build system type" 1>&5 if test "x$ac_cv_build" = "x" || (test "x$build" != "xNONE" && test "x$build" != "x$ac_cv_build_alias"); then # Make sure we can run config.sub. @@ -1160,7 +1163,7 @@ fi # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 echo $ac_n "checking for $ac_word... $ac_c" 1>&6 -echo "configure:1164: checking for $ac_word" 1>&5 +echo "configure:1167: checking for $ac_word" 1>&5 if test "${ac_cv_prog_CC+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1197,7 +1200,7 @@ esac # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word... $ac_c" 1>&6 -echo "configure:1201: checking for $ac_word" 1>&5 +echo "configure:1204: checking for $ac_word" 1>&5 if test "${ac_cv_prog_CC+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1227,7 +1230,7 @@ fi # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word... $ac_c" 1>&6 -echo "configure:1231: checking for $ac_word" 1>&5 +echo "configure:1234: checking for $ac_word" 1>&5 if test "${ac_cv_prog_CC+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1278,7 +1281,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word... $ac_c" 1>&6 -echo "configure:1282: checking for $ac_word" 1>&5 +echo "configure:1285: checking for $ac_word" 1>&5 if test "${ac_cv_prog_CC+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1314,7 +1317,7 @@ done test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works... $ac_c" 1>&6 -echo "configure:1318: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works" 1>&5 +echo "configure:1321: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) works" 1>&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -1325,12 +1328,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat >conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1337: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -1356,12 +1359,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler... $ac_c" 1>&6 -echo "configure:1360: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler" 1>&5 +echo "configure:1363: checking whether the C compiler ($CC $CFLAGS $CPPFLAGS $LDFLAGS) is a cross-compiler" 1>&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C... $ac_c" 1>&6 -echo "configure:1365: checking whether we are using GNU C" 1>&5 +echo "configure:1368: checking whether we are using GNU C" 1>&5 if test "${ac_cv_prog_gcc+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1370,7 +1373,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1374: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1377: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -1388,7 +1391,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g... $ac_c" 1>&6 -echo "configure:1392: checking whether ${CC-cc} accepts -g" 1>&5 +echo "configure:1395: checking whether ${CC-cc} accepts -g" 1>&5 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1430,7 +1433,7 @@ if test "x$with_binutils" != x; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo $ac_n "checking for $ac_word... $ac_c" 1>&6 -echo "configure:1434: checking for $ac_word" 1>&5 +echo "configure:1437: checking for $ac_word" 1>&5 if test "${ac_cv_path_RANLIB+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1466,7 +1469,7 @@ if test -z "$ac_cv_prog_RANLIB"; then # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word... $ac_c" 1>&6 -echo "configure:1470: checking for $ac_word" 1>&5 +echo "configure:1473: checking for $ac_word" 1>&5 if test "${ac_cv_path_RANLIB+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1505,7 +1508,7 @@ else # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo $ac_n "checking for $ac_word... $ac_c" 1>&6 -echo "configure:1509: checking for $ac_word" 1>&5 +echo "configure:1512: checking for $ac_word" 1>&5 if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1545,7 +1548,7 @@ if test "x$ac_cv_prog_gcc" = xyes; then STAGE1_CFLAGS="-O2" GRUB_CFLAGS="-O2" echo $ac_n "checking whether optimization for size works... $ac_c" 1>&6 -echo "configure:1549: checking whether optimization for size works" 1>&5 +echo "configure:1552: checking whether optimization for size works" 1>&5 if test "${size_flag+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1553,14 +1556,14 @@ else saved_CFLAGS=$CFLAGS CFLAGS="-Os -g" cat >conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1567: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* size_flag=yes else @@ -1593,7 +1596,7 @@ if test "x$with_binutils" != x; then # Extract the first word of "${ac_tool_prefix}objcopy", so it can be a program name with args. set dummy ${ac_tool_prefix}objcopy; ac_word=$2 echo $ac_n "checking for $ac_word... $ac_c" 1>&6 -echo "configure:1597: checking for $ac_word" 1>&5 +echo "configure:1600: checking for $ac_word" 1>&5 if test "${ac_cv_path_OBJCOPY+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1629,7 +1632,7 @@ else # Extract the first word of "${ac_tool_prefix}objcopy", so it can be a program name with args. set dummy ${ac_tool_prefix}objcopy; ac_word=$2 echo $ac_n "checking for $ac_word... $ac_c" 1>&6 -echo "configure:1633: checking for $ac_word" 1>&5 +echo "configure:1636: checking for $ac_word" 1>&5 if test "${ac_cv_prog_OBJCOPY+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1663,7 +1666,7 @@ fi # Defined in acinclude.m4. echo $ac_n "checking if C symbols get an underscore after compilation... $ac_c" 1>&6 -echo "configure:1667: checking if C symbols get an underscore after compilation" 1>&5 +echo "configure:1670: checking if C symbols get an underscore after compilation" 1>&5 if test "${grub_cv_asm_uscore+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1676,7 +1679,7 @@ func (int *list) } EOF -if { ac_try='${CC-cc} ${CFLAGS} -S conftest.c'; { (eval echo configure:1680: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } && test -s conftest.s; then +if { ac_try='${CC-cc} ${CFLAGS} -S conftest.c'; { (eval echo configure:1683: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } && test -s conftest.s; then true else { echo "configure: error: ${CC-cc} failed to produce assembly code" 1>&2; exit 1; } @@ -1702,7 +1705,7 @@ fi echo "$ac_t""$grub_cv_asm_uscore" 1>&6 echo $ac_n "checking whether ${OBJCOPY} works for absolute addresses... $ac_c" 1>&6 -echo "configure:1706: checking whether ${OBJCOPY} works for absolute addresses" 1>&5 +echo "configure:1709: checking whether ${OBJCOPY} works for absolute addresses" 1>&5 if test "${grub_cv_prog_objcopy_absolute+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1714,21 +1717,21 @@ cmain (void) } EOF -if { (eval echo configure:1718: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.o; then : +if { (eval echo configure:1721: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.o; then : else { echo "configure: error: ${CC-cc} cannot compile C source code" 1>&2; exit 1; } fi grub_cv_prog_objcopy_absolute=yes for link_addr in 2000 8000 7C00; do - if { ac_try='${CC-cc} ${CFLAGS} -nostdlib -Wl,-N -Wl,-Ttext -Wl,$link_addr conftest.o -o conftest.exec'; { (eval echo configure:1724: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then : + if { ac_try='${CC-cc} ${CFLAGS} -nostdlib -Wl,-N -Wl,-Ttext -Wl,$link_addr conftest.o -o conftest.exec'; { (eval echo configure:1727: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then : else { echo "configure: error: ${CC-cc} cannot link at address $link_addr" 1>&2; exit 1; } fi - if { ac_try='${OBJCOPY-objcopy} -O binary conftest.exec conftest'; { (eval echo configure:1728: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then : + if { ac_try='${OBJCOPY-objcopy} -O binary conftest.exec conftest'; { (eval echo configure:1731: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then : else { echo "configure: error: ${OBJCOPY-objcopy} cannot create binary files" 1>&2; exit 1; } fi - if test ! -f conftest.old || { ac_try='cmp -s conftest.old conftest'; { (eval echo configure:1732: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then + if test ! -f conftest.old || { ac_try='cmp -s conftest.old conftest'; { (eval echo configure:1735: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then mv -f conftest conftest.old else grub_cv_prog_objcopy_absolute=no @@ -1745,7 +1748,7 @@ fi echo $ac_n "checking whether addr32 must be in the same line as the instruction... $ac_c" 1>&6 -echo "configure:1749: checking whether addr32 must be in the same line as the instruction" 1>&5 +echo "configure:1752: checking whether addr32 must be in the same line as the instruction" 1>&5 if test "${grub_cv_asm_prefix_requirement+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1754,7 +1757,7 @@ else l1: addr32 movb %al, l1 EOF -if { ac_try='${CC-cc} ${CFLAGS} -c conftest.s'; { (eval echo configure:1758: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } && test -s conftest.o; then +if { ac_try='${CC-cc} ${CFLAGS} -c conftest.s'; { (eval echo configure:1761: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } && test -s conftest.o; then grub_cv_asm_prefix_requirement=yes else grub_cv_asm_prefix_requirement=no @@ -1786,7 +1789,7 @@ echo "$ac_t""$grub_cv_asm_prefix_requirement" 1>&6 echo $ac_n "checking for .code16 addr32 assembler support... $ac_c" 1>&6 -echo "configure:1790: checking for .code16 addr32 assembler support" 1>&5 +echo "configure:1793: checking for .code16 addr32 assembler support" 1>&5 if test "${grub_cv_asm_addr32+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1801,7 +1804,7 @@ else sed -e s/@ADDR32@/addr32\;/ < conftest.s.in > conftest.s fi -if { ac_try='${CC-cc} ${CFLAGS} -c conftest.s'; { (eval echo configure:1805: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } && test -s conftest.o; then +if { ac_try='${CC-cc} ${CFLAGS} -c conftest.s'; { (eval echo configure:1808: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } && test -s conftest.o; then grub_cv_asm_addr32=yes else grub_cv_asm_addr32=no @@ -1818,19 +1821,19 @@ fi echo $ac_n "checking if start is defined by the compiler... $ac_c" 1>&6 -echo "configure:1822: checking if start is defined by the compiler" 1>&5 +echo "configure:1825: checking if start is defined by the compiler" 1>&5 if test "${grub_cv_check_start_symbol+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else cat >conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1837: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* grub_cv_check_start_symbol=yes else @@ -1854,19 +1857,19 @@ echo "$ac_t""$grub_cv_check_start_symbol" 1>&6 echo $ac_n "checking if _start is defined by the compiler... $ac_c" 1>&6 -echo "configure:1858: checking if _start is defined by the compiler" 1>&5 +echo "configure:1861: checking if _start is defined by the compiler" 1>&5 if test "${grub_cv_check_uscore_start_symbol+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else cat >conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1873: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* grub_cv_check_uscore_start_symbol=yes else @@ -1895,19 +1898,19 @@ fi echo $ac_n "checking if __bss_start is defined by the compiler... $ac_c" 1>&6 -echo "configure:1899: checking if __bss_start is defined by the compiler" 1>&5 +echo "configure:1902: checking if __bss_start is defined by the compiler" 1>&5 if test "${grub_cv_check_uscore_uscore_bss_start_symbol+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else cat >conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1914: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* grub_cv_check_uscore_uscore_bss_start_symbol=yes else @@ -1931,19 +1934,19 @@ echo "$ac_t""$grub_cv_check_uscore_uscore_bss_start_symbol" 1>&6 echo $ac_n "checking if _edata is defined by the compiler... $ac_c" 1>&6 -echo "configure:1935: checking if _edata is defined by the compiler" 1>&5 +echo "configure:1938: checking if _edata is defined by the compiler" 1>&5 if test "${grub_cv_check_uscore_edata_symbol+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else cat >conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1950: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* grub_cv_check_uscore_edata_symbol=yes else @@ -1967,19 +1970,19 @@ echo "$ac_t""$grub_cv_check_uscore_edata_symbol" 1>&6 echo $ac_n "checking if edata is defined by the compiler... $ac_c" 1>&6 -echo "configure:1971: checking if edata is defined by the compiler" 1>&5 +echo "configure:1974: checking if edata is defined by the compiler" 1>&5 if test "${grub_cv_check_edata_symbol+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else cat >conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1986: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* grub_cv_check_edata_symbol=yes else @@ -2009,19 +2012,19 @@ fi echo $ac_n "checking if end is defined by the compiler... $ac_c" 1>&6 -echo "configure:2013: checking if end is defined by the compiler" 1>&5 +echo "configure:2016: checking if end is defined by the compiler" 1>&5 if test "${grub_cv_check_end_symbol+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else cat >conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2028: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* grub_cv_check_end_symbol=yes else @@ -2045,19 +2048,19 @@ echo "$ac_t""$grub_cv_check_end_symbol" 1>&6 echo $ac_n "checking if _end is defined by the compiler... $ac_c" 1>&6 -echo "configure:2049: checking if _end is defined by the compiler" 1>&5 +echo "configure:2052: checking if _end is defined by the compiler" 1>&5 if test "${grub_cv_check_uscore_end_symbol+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else cat >conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2064: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* grub_cv_check_uscore_end_symbol=yes else @@ -2095,14 +2098,14 @@ fi # Get the filename or the whole disk and open it. # Known to work on NetBSD. echo $ac_n "checking for opendisk in -lutil... $ac_c" 1>&6 -echo "configure:2099: checking for opendisk in -lutil" 1>&5 +echo "configure:2102: checking for opendisk in -lutil" 1>&5 if test "${ac_cv_lib_util_opendisk+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lutil $LIBS" cat >conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2120: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_lib_util_opendisk=yes else @@ -2138,14 +2141,14 @@ fi # Unless the user specify --without-curses, check for curses. if test "x$with_curses" != "xno"; then echo $ac_n "checking for wgetch in -lncurses... $ac_c" 1>&6 -echo "configure:2142: checking for wgetch in -lncurses" 1>&5 +echo "configure:2145: checking for wgetch in -lncurses" 1>&5 if test "${ac_cv_lib_ncurses_wgetch+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lncurses $LIBS" cat >conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2163: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_lib_ncurses_wgetch=yes else @@ -2177,14 +2180,14 @@ EOF else echo $ac_n "checking for wgetch in -lcurses... $ac_c" 1>&6 -echo "configure:2181: checking for wgetch in -lcurses" 1>&5 +echo "configure:2184: checking for wgetch in -lcurses" 1>&5 if test "${ac_cv_lib_curses_wgetch+set}" = set; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_save_LIBS="$LIBS" LIBS="-lcurses $LIBS" cat >conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2202: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_cv_lib_curses_wgetch=yes else @@ -2224,7 +2227,7 @@ fi # Check for headers. echo $ac_n "checking how to run the C preprocessor... $ac_c" 1>&6 -echo "configure:2228: checking how to run the C preprocessor" 1>&5 +echo "configure:2231: checking how to run the C preprocessor" 1>&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -2239,13 +2242,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat >conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2249: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2252: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2256,13 +2259,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat >conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2266: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2269: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2273,13 +2276,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat >conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2283: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2286: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then : @@ -2307,17 +2310,17 @@ for ac_header in string.h strings.h ncurses/curses.h ncurses.h curses.h do ac_ac_Header=`echo "ac_cv_header_$ac_header" | $ac_tr_sh` echo $ac_n "checking for $ac_header... $ac_c" 1>&6 -echo "configure:2311: checking for $ac_header" 1>&5 +echo "configure:2314: checking for $ac_header" 1>&5 if eval "test \"\${$ac_ac_Header+set}\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat >conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2321: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2324: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -2343,6 +2346,21 @@ done # Check for user options. +# some compile-time options. +# Check whether --enable-lba-support-bitmap-check or --disable-lba-support-bitmap-check was given. +if test "${enable_lba_support_bitmap_check+set}" = set; then + enableval="$enable_lba_support_bitmap_check" + : +fi + + +if test "x$enable_lba_support_bitmap_check" != xno; then + cat >>confdefs.h <<\EOF +#define CHECK_LBA_SUPPORT_BITMAP 1 +EOF + +fi + # filesystems support. # Check whether --enable-ext2fs or --disable-ext2fs was given. if test "${enable_ext2fs+set}" = set; then diff --git a/configure.in b/configure.in index 199bfbf5a..660664152 100644 --- a/configure.in +++ b/configure.in @@ -161,6 +161,15 @@ AC_CHECK_HEADERS(string.h strings.h ncurses/curses.h ncurses.h curses.h) # Check for user options. +# some compile-time options. +AC_ARG_ENABLE(lba-support-bitmap-check, + [ --disable-lba-support-bitmap-check + disable a check for LBA support bitmap]) + +if test "x$enable_lba_support_bitmap_check" != xno; then + AC_DEFINE(CHECK_LBA_SUPPORT_BITMAP) +fi + # filesystems support. AC_ARG_ENABLE(ext2fs, [ --disable-ext2fs disable ext2fs support in Stage 2]) diff --git a/grub/asmstub.c b/grub/asmstub.c index ca3df0fbe..a11218552 100644 --- a/grub/asmstub.c +++ b/grub/asmstub.c @@ -43,11 +43,11 @@ int grub_stage2 (void); #ifdef __linux__ # include /* ioctl */ # include /* HDIO_GETGEO */ -# if __GLIBC__ < 2 +# if (__GLIBC__ < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 1)) /* Maybe libc doesn't have large file support. */ # include /* _llseek */ # include /* BLKFLSBUF */ -# endif /* GLIBC < 2 */ +# endif /* (GLIBC < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR < 1)) */ # ifndef BLKFLSBUF # define BLKFLSBUF _IO (0x12,97) # endif /* ! BLKFLSBUF */ @@ -1114,7 +1114,8 @@ biosdisk (int subfunc, int drive, struct geometry *geometry, return BIOSDISK_ERROR_GEOMETRY; /* Seek to the specified location. */ -#if defined(__linux) && (__GLIBC__ < 2) +#if defined(__linux__) \ + && ((__GLIBC__ < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 1))) /* Maybe libc doesn't have large file support. */ { loff_t offset, result; diff --git a/stage1/stage1.S b/stage1/stage1.S index 5b235b684..53cfb94b6 100644 --- a/stage1/stage1.S +++ b/stage1/stage1.S @@ -149,11 +149,11 @@ real_start: cmpw $0xaa55, %bx jne chs_mode -#ifdef NO_BUGGY_BIOS_IN_THE_WORLD +#ifdef CHECK_LBA_SUPPORT_BITMAP /* check if AH=0x42 is supported */ andw $1, %cx jz chs_mode -#endif +#endif /* CHECK_LBA_SUPPORT_BITMAP */ /* get the geometry (limited to 2TB!) */ movb $0x48, %ah diff --git a/stage2/bios.c b/stage2/bios.c index f6769d7b5..e588da85d 100644 --- a/stage2/bios.c +++ b/stage2/bios.c @@ -163,7 +163,7 @@ get_diskinfo (int drive, struct geometry *geometry) read/write is supported, so we cannot help assuming that the functions are supported by default and clearing the flag when either of them fails. *sigh* */ -#ifdef NO_BUGGY_BIOS_IN_THE_WORLD +#ifdef CHECK_LBA_SUPPORT_BITMAP /* Make sure that LBA read/write functions are supported. */ if (drp.flags & 1) { @@ -174,7 +174,7 @@ get_diskinfo (int drive, struct geometry *geometry) change the type of TOTAL_SECTORS to unsigned long long. */ total_sectors = drp.total_sectors & ~0L; -#ifdef NO_BUGGY_BIOS_IN_THE_WORLD +#ifdef CHECK_LBA_SUPPORT_BITMAP } #endif }