clear the bss at the startup and fix some netboot bugs.
This commit is contained in:
parent
f4c8bacd5a
commit
1f6d422a9a
23 changed files with 2406 additions and 125 deletions
55
ChangeLog
55
ChangeLog
|
@ -1,3 +1,58 @@
|
||||||
|
1999-10-23 OKUJI Yoshinori <okuji@kuicr.kyoto-u.ac.jp>
|
||||||
|
|
||||||
|
From Michael Hohmuth <hohmuth@innocent.com>:
|
||||||
|
* acconfig.h (HAVE_USCORE_USCORE_BSS_START_SYMBOL): Added the
|
||||||
|
`undef' entry.
|
||||||
|
(HAVE_EDATA_SYMBOL): Likewise.
|
||||||
|
(HAVE_USCORE_EDATA_SYMBOL): Likewise.
|
||||||
|
* acinclude.m4 (grub_CHECK_USCORE_USCORE_BSS_START_SYMBOL): New
|
||||||
|
function.
|
||||||
|
(grub_CHECK_EDATA_SYMBOL): Likewise.
|
||||||
|
(grub_CHECK_USCORE_EDATA_SYMBOL): Likewise.
|
||||||
|
* configure.in: Check for __bss, edata and _edata.
|
||||||
|
* netboot/Makefile.am (DRIVERS): Deleted ns8390.c and ns8390.h.
|
||||||
|
(libdrivers_a_LIBADD): New variable.
|
||||||
|
($(libdrivers_a_LIBADD)): New target.
|
||||||
|
(nepci_o_CFLAGS): New variable.
|
||||||
|
(ne_o_CFLAGS): Likewise.
|
||||||
|
(wd_o_CFLAGS): Likewise.
|
||||||
|
(t503_o_CFLAGS): Likewise.
|
||||||
|
* netboot/fsys_tftp.c (tftp_close): New function.
|
||||||
|
* stage2/boot.c (load_image): Call grub_close before return.
|
||||||
|
(load_initrd): Likewise.
|
||||||
|
(load_module): Likewise.
|
||||||
|
* stage2/builtins.c (cat_func): Likewise.
|
||||||
|
(chainloader_func): Likewise.
|
||||||
|
(configfile_func): Likewise.
|
||||||
|
(embed_func): Likewise.
|
||||||
|
(find_func): Likewise.
|
||||||
|
(install_func): Set IS_OPEN to the value returned by grub_open.
|
||||||
|
If IS_OPEN is non-zero, call grub_close before return.
|
||||||
|
(setup_func): Call grub_close after grub_open.
|
||||||
|
(testload): Call grub_close before return.
|
||||||
|
* stage2/disk_io.c (fsys_table): Add the `close' member into
|
||||||
|
each of the entries. For TFTP, tftp_close is added, and for the
|
||||||
|
rest, NULL is added.
|
||||||
|
(grub_read): "|" -> "||".
|
||||||
|
(grub_close): New function.
|
||||||
|
* stage2/filesys.h [FSYS_TFTP] (tftp_close): Declared.
|
||||||
|
(struct fsys_entry): Added close_func.
|
||||||
|
* stage2/shared.h (grub_close): Declared.
|
||||||
|
* stage2/stage1_5.c (cmain): Call grub_close after grub_open.
|
||||||
|
* stage2/stage2.c (cmain): Clear ERRNUM after calling
|
||||||
|
find_command to just ignore the error code.
|
||||||
|
Call grub_close after loading the configuration file.
|
||||||
|
|
||||||
|
* stage2/asm.S (main): Clean out the bss.
|
||||||
|
|
||||||
|
1999-10-23 OKUJI Yoshinori <okuji@kuicr.kyoto-u.ac.jp>
|
||||||
|
|
||||||
|
* docs/new-grub.texi: Updated.
|
||||||
|
* docs/user-ref.texi: Likewise.
|
||||||
|
* docs/tutorial.texi: Likewise.
|
||||||
|
* docs/prog-ref.texi: Likewise.
|
||||||
|
* docs/appendices.texi: Likewise.
|
||||||
|
|
||||||
1999-10-22 OKUJI Yoshinori <okuji@kuicr.kyoto-u.ac.jp>
|
1999-10-22 OKUJI Yoshinori <okuji@kuicr.kyoto-u.ac.jp>
|
||||||
|
|
||||||
* docs/prog-ref.texi: New file.
|
* docs/prog-ref.texi: New file.
|
||||||
|
|
1
THANKS
1
THANKS
|
@ -22,6 +22,7 @@ John Tobey <spam@john-edwin-tobey.org>
|
||||||
Klaus Reichl <klaus.reichl@alcatel.at>
|
Klaus Reichl <klaus.reichl@alcatel.at>
|
||||||
Kunihiro Ishiguro <kunihiro@zebra.org>
|
Kunihiro Ishiguro <kunihiro@zebra.org>
|
||||||
Mark Lundeberg <aa026@pgfn.bc.ca>
|
Mark Lundeberg <aa026@pgfn.bc.ca>
|
||||||
|
Michael Hohmuth <hohmuth@innocent.com>
|
||||||
Miles Bader <miles@gnu.org>
|
Miles Bader <miles@gnu.org>
|
||||||
OKUJI Yoshinori <okuji@kuicr.kyoto-u.ac.jp>
|
OKUJI Yoshinori <okuji@kuicr.kyoto-u.ac.jp>
|
||||||
Pavel Roskin <pavel_roskin@geocities.com>
|
Pavel Roskin <pavel_roskin@geocities.com>
|
||||||
|
|
|
@ -10,6 +10,15 @@
|
||||||
/* Defined if _start is defined. */
|
/* Defined if _start is defined. */
|
||||||
#undef HAVE_USCORE_START_SYMBOL
|
#undef HAVE_USCORE_START_SYMBOL
|
||||||
|
|
||||||
|
/* Defined if __bss_start is defined. */
|
||||||
|
#undef HAVE_USCORE_USCORE_BSS_START_SYMBOL
|
||||||
|
|
||||||
|
/* Defined if edata is defined. */
|
||||||
|
#undef HAVE_EDATA_SYMBOL
|
||||||
|
|
||||||
|
/* Defined if _edata is defined. */
|
||||||
|
#undef HAVE_USCORE_EDATA_SYMBOL
|
||||||
|
|
||||||
/* Defined if end is defined. */
|
/* Defined if end is defined. */
|
||||||
#undef HAVE_END_SYMBOL
|
#undef HAVE_END_SYMBOL
|
||||||
|
|
||||||
|
|
240
acinclude.m4
240
acinclude.m4
|
@ -1,3 +1,15 @@
|
||||||
|
dnl aclocal.m4 generated automatically by aclocal 1.4a
|
||||||
|
|
||||||
|
dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
|
||||||
|
dnl This file is free software; the Free Software Foundation
|
||||||
|
dnl gives unlimited permission to copy and/or distribute it,
|
||||||
|
dnl with or without modifications, as long as this notice is preserved.
|
||||||
|
|
||||||
|
dnl This program is distributed in the hope that it will be useful,
|
||||||
|
dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||||
|
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||||
|
dnl PARTICULAR PURPOSE.
|
||||||
|
|
||||||
dnl grub_ASM_USCORE checks if C symbols get an underscore after
|
dnl grub_ASM_USCORE checks if C symbols get an underscore after
|
||||||
dnl compiling to assembler.
|
dnl compiling to assembler.
|
||||||
dnl Written by Pavel Roskin. Based on grub_ASM_EXT_C written by
|
dnl Written by Pavel Roskin. Based on grub_ASM_EXT_C written by
|
||||||
|
@ -189,6 +201,63 @@ fi
|
||||||
AC_MSG_RESULT([$grub_cv_check_uscore_start_symbol])
|
AC_MSG_RESULT([$grub_cv_check_uscore_start_symbol])
|
||||||
])
|
])
|
||||||
|
|
||||||
|
dnl
|
||||||
|
dnl grub_CHECK_USCORE_USCORE_BSS_START_SYMBOL checks if __bss_start is
|
||||||
|
dnl automatically defined by the compiler.
|
||||||
|
dnl Written by Michael Hohmoth.
|
||||||
|
AC_DEFUN(grub_CHECK_USCORE_USCORE_BSS_START_SYMBOL,
|
||||||
|
[AC_REQUIRE([AC_PROG_CC])
|
||||||
|
AC_MSG_CHECKING([if __bss_start is defined by the compiler])
|
||||||
|
AC_CACHE_VAL(grub_cv_check_uscore_uscore_bss_start_symbol,
|
||||||
|
[AC_TRY_LINK([], [asm ("incl __bss_start")],
|
||||||
|
grub_cv_check_uscore_uscore_bss_start_symbol=yes,
|
||||||
|
grub_cv_check_uscore_uscore_bss_start_symbol=no)])
|
||||||
|
|
||||||
|
if test "x$grub_cv_check_uscore_uscore_bss_start_symbol" = xyes; then
|
||||||
|
AC_DEFINE([HAVE_USCORE_USCORE_BSS_START_SYMBOL])
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_MSG_RESULT([$grub_cv_check_uscore_uscore_bss_start_symbol])
|
||||||
|
])
|
||||||
|
|
||||||
|
dnl
|
||||||
|
dnl grub_CHECK_EDATA_SYMBOL checks if edata is automatically defined by the
|
||||||
|
dnl compiler.
|
||||||
|
dnl Written by Michael Hohmuth.
|
||||||
|
AC_DEFUN(grub_CHECK_EDATA_SYMBOL,
|
||||||
|
[AC_REQUIRE([AC_PROG_CC])
|
||||||
|
AC_MSG_CHECKING([if edata is defined by the compiler])
|
||||||
|
AC_CACHE_VAL(grub_cv_check_edata_symbol,
|
||||||
|
[AC_TRY_LINK([], [asm ("incl edata")],
|
||||||
|
grub_cv_check_edata_symbol=yes,
|
||||||
|
grub_cv_check_edata_symbol=no)])
|
||||||
|
|
||||||
|
if test "x$grub_cv_check_edata_symbol" = xyes; then
|
||||||
|
AC_DEFINE([HAVE_EDATA_SYMBOL])
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_MSG_RESULT([$grub_cv_check_edata_symbol])
|
||||||
|
])
|
||||||
|
|
||||||
|
dnl
|
||||||
|
dnl grub_CHECK_USCORE_EDATA_SYMBOL checks if _edata is automatically
|
||||||
|
dnl defined by the compiler.
|
||||||
|
dnl Written by Michael Hohmuth.
|
||||||
|
AC_DEFUN(grub_CHECK_USCORE_EDATA_SYMBOL,
|
||||||
|
[AC_REQUIRE([AC_PROG_CC])
|
||||||
|
AC_MSG_CHECKING([if _edata is defined by the compiler])
|
||||||
|
AC_CACHE_VAL(grub_cv_check_uscore_edata_symbol,
|
||||||
|
[AC_TRY_LINK([], [asm ("incl _edata")],
|
||||||
|
grub_cv_check_uscore_edata_symbol=yes,
|
||||||
|
grub_cv_check_uscore_edata_symbol=no)])
|
||||||
|
|
||||||
|
if test "x$grub_cv_check_uscore_edata_symbol" = xyes; then
|
||||||
|
AC_DEFINE([HAVE_USCORE_EDATA_SYMBOL])
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_MSG_RESULT([$grub_cv_check_uscore_edata_symbol])
|
||||||
|
])
|
||||||
|
|
||||||
dnl
|
dnl
|
||||||
dnl grub_CHECK_END_SYMBOL checks if end is automatically defined by the
|
dnl grub_CHECK_END_SYMBOL checks if end is automatically defined by the
|
||||||
dnl compiler.
|
dnl compiler.
|
||||||
|
@ -226,3 +295,174 @@ fi
|
||||||
|
|
||||||
AC_MSG_RESULT([$grub_cv_check_uscore_end_symbol])
|
AC_MSG_RESULT([$grub_cv_check_uscore_end_symbol])
|
||||||
])
|
])
|
||||||
|
|
||||||
|
# Do all the work for Automake. This macro actually does too much --
|
||||||
|
# some checks are only needed if your package does certain things.
|
||||||
|
# But this isn't really a big deal.
|
||||||
|
|
||||||
|
# serial 1
|
||||||
|
|
||||||
|
dnl Usage:
|
||||||
|
dnl AM_INIT_AUTOMAKE(package,version, [no-define])
|
||||||
|
|
||||||
|
AC_DEFUN(AM_INIT_AUTOMAKE,
|
||||||
|
[AC_REQUIRE([AC_PROG_INSTALL])
|
||||||
|
dnl We require 2.13 because we rely on SHELL being computed by configure.
|
||||||
|
AC_PREREQ([2.13])
|
||||||
|
PACKAGE=[$1]
|
||||||
|
AC_SUBST(PACKAGE)
|
||||||
|
VERSION=[$2]
|
||||||
|
AC_SUBST(VERSION)
|
||||||
|
dnl test to see if srcdir already configured
|
||||||
|
if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
|
||||||
|
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
|
||||||
|
fi
|
||||||
|
ifelse([$3],,
|
||||||
|
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
|
||||||
|
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
|
||||||
|
AC_REQUIRE([AM_SANITY_CHECK])
|
||||||
|
AC_REQUIRE([AC_ARG_PROGRAM])
|
||||||
|
dnl FIXME This is truly gross.
|
||||||
|
missing_dir=`cd $ac_aux_dir && pwd`
|
||||||
|
AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
|
||||||
|
AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
|
||||||
|
AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
|
||||||
|
AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
|
||||||
|
AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
|
||||||
|
dnl Set install_sh for make dist
|
||||||
|
install_sh="$missing_dir/install-sh"
|
||||||
|
test -f "$install_sh" || install_sh="$missing_dir/install.sh"
|
||||||
|
AC_SUBST(install_sh)
|
||||||
|
dnl We check for tar when the user configures the end package.
|
||||||
|
dnl This is sad, since we only need this for "dist". However,
|
||||||
|
dnl there's no other good way to do it. We prefer GNU tar if
|
||||||
|
dnl we can find it. If we can't find a tar, it doesn't really matter.
|
||||||
|
AC_CHECK_PROGS(AMTAR, gnutar gtar tar)
|
||||||
|
dnl We need awk for the "check" target. The system "awk" is bad on
|
||||||
|
dnl some platforms.
|
||||||
|
AC_REQUIRE([AC_PROG_AWK])
|
||||||
|
AMTARFLAGS=
|
||||||
|
if test -n "$AMTAR"; then
|
||||||
|
if $SHELL -c "$AMTAR --version" > /dev/null 2>&1; then
|
||||||
|
dnl We have GNU tar.
|
||||||
|
AMTARFLAGS=o
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
AC_SUBST(AMTARFLAGS)
|
||||||
|
AC_REQUIRE([AC_PROG_MAKE_SET])])
|
||||||
|
|
||||||
|
#
|
||||||
|
# Check to make sure that the build environment is sane.
|
||||||
|
#
|
||||||
|
|
||||||
|
AC_DEFUN(AM_SANITY_CHECK,
|
||||||
|
[AC_MSG_CHECKING([whether build environment is sane])
|
||||||
|
# Just in case
|
||||||
|
sleep 1
|
||||||
|
echo timestamp > conftestfile
|
||||||
|
# Do `set' in a subshell so we don't clobber the current shell's
|
||||||
|
# arguments. Must try -L first in case configure is actually a
|
||||||
|
# symlink; some systems play weird games with the mod time of symlinks
|
||||||
|
# (eg FreeBSD returns the mod time of the symlink's containing
|
||||||
|
# directory).
|
||||||
|
if (
|
||||||
|
set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
|
||||||
|
if test "[$]*" = "X"; then
|
||||||
|
# -L didn't work.
|
||||||
|
set X `ls -t $srcdir/configure conftestfile`
|
||||||
|
fi
|
||||||
|
if test "[$]*" != "X $srcdir/configure conftestfile" \
|
||||||
|
&& test "[$]*" != "X conftestfile $srcdir/configure"; then
|
||||||
|
|
||||||
|
# If neither matched, then we have a broken ls. This can happen
|
||||||
|
# if, for instance, CONFIG_SHELL is bash and it inherits a
|
||||||
|
# broken ls alias from the environment. This has actually
|
||||||
|
# happened. Such a system could not be considered "sane".
|
||||||
|
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
|
||||||
|
alias in your environment])
|
||||||
|
fi
|
||||||
|
|
||||||
|
test "[$]2" = conftestfile
|
||||||
|
)
|
||||||
|
then
|
||||||
|
# Ok.
|
||||||
|
:
|
||||||
|
else
|
||||||
|
AC_MSG_ERROR([newly created file is older than distributed files!
|
||||||
|
Check your system clock])
|
||||||
|
fi
|
||||||
|
rm -f conftest*
|
||||||
|
AC_MSG_RESULT(yes)])
|
||||||
|
|
||||||
|
dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
|
||||||
|
dnl The program must properly implement --version.
|
||||||
|
AC_DEFUN(AM_MISSING_PROG,
|
||||||
|
[AC_MSG_CHECKING(for working $2)
|
||||||
|
# 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.
|
||||||
|
if ($2 --version) < /dev/null > /dev/null 2>&1; then
|
||||||
|
$1=$2
|
||||||
|
AC_MSG_RESULT(found)
|
||||||
|
else
|
||||||
|
$1="$3/missing $2"
|
||||||
|
AC_MSG_RESULT(missing)
|
||||||
|
fi
|
||||||
|
AC_SUBST($1)])
|
||||||
|
|
||||||
|
# Like AC_CONFIG_HEADER, but automatically create stamp file.
|
||||||
|
|
||||||
|
AC_DEFUN(AM_CONFIG_HEADER,
|
||||||
|
[AC_PREREQ([2.12])
|
||||||
|
AC_CONFIG_HEADER([$1])
|
||||||
|
dnl When config.status generates a header, we must update the stamp-h file.
|
||||||
|
dnl This file resides in the same directory as the config header
|
||||||
|
dnl that is generated. We must strip everything past the first ":",
|
||||||
|
dnl and everything past the last "/".
|
||||||
|
AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
|
||||||
|
ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
|
||||||
|
<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
|
||||||
|
<<am_indx=1
|
||||||
|
for am_file in <<$1>>; do
|
||||||
|
case " <<$>>CONFIG_HEADERS " in
|
||||||
|
*" <<$>>am_file "*<<)>>
|
||||||
|
echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
am_indx=`expr "<<$>>am_indx" + 1`
|
||||||
|
done<<>>dnl>>)
|
||||||
|
changequote([,]))])
|
||||||
|
|
||||||
|
# Add --enable-maintainer-mode option to configure.
|
||||||
|
# From Jim Meyering
|
||||||
|
|
||||||
|
# serial 1
|
||||||
|
|
||||||
|
AC_DEFUN(AM_MAINTAINER_MODE,
|
||||||
|
[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
|
||||||
|
dnl maintainer-mode is disabled by default
|
||||||
|
AC_ARG_ENABLE(maintainer-mode,
|
||||||
|
[ --enable-maintainer-mode enable make rules and dependencies not useful
|
||||||
|
(and sometimes confusing) to the casual installer],
|
||||||
|
USE_MAINTAINER_MODE=$enableval,
|
||||||
|
USE_MAINTAINER_MODE=no)
|
||||||
|
AC_MSG_RESULT($USE_MAINTAINER_MODE)
|
||||||
|
AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
|
||||||
|
MAINT=$MAINTAINER_MODE_TRUE
|
||||||
|
AC_SUBST(MAINT)dnl
|
||||||
|
]
|
||||||
|
)
|
||||||
|
|
||||||
|
# Define a conditional.
|
||||||
|
|
||||||
|
AC_DEFUN(AM_CONDITIONAL,
|
||||||
|
[AC_SUBST($1_TRUE)
|
||||||
|
AC_SUBST($1_FALSE)
|
||||||
|
if $2; then
|
||||||
|
$1_TRUE=
|
||||||
|
$1_FALSE='#'
|
||||||
|
else
|
||||||
|
$1_TRUE='#'
|
||||||
|
$1_FALSE=
|
||||||
|
fi])
|
||||||
|
|
||||||
|
|
70
aclocal.m4
vendored
70
aclocal.m4
vendored
|
@ -10,6 +10,18 @@ dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||||
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||||
dnl PARTICULAR PURPOSE.
|
dnl PARTICULAR PURPOSE.
|
||||||
|
|
||||||
|
dnl aclocal.m4 generated automatically by aclocal 1.4a
|
||||||
|
|
||||||
|
dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
|
||||||
|
dnl This file is free software; the Free Software Foundation
|
||||||
|
dnl gives unlimited permission to copy and/or distribute it,
|
||||||
|
dnl with or without modifications, as long as this notice is preserved.
|
||||||
|
|
||||||
|
dnl This program is distributed in the hope that it will be useful,
|
||||||
|
dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||||
|
dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||||
|
dnl PARTICULAR PURPOSE.
|
||||||
|
|
||||||
dnl grub_ASM_USCORE checks if C symbols get an underscore after
|
dnl grub_ASM_USCORE checks if C symbols get an underscore after
|
||||||
dnl compiling to assembler.
|
dnl compiling to assembler.
|
||||||
dnl Written by Pavel Roskin. Based on grub_ASM_EXT_C written by
|
dnl Written by Pavel Roskin. Based on grub_ASM_EXT_C written by
|
||||||
|
@ -201,6 +213,63 @@ fi
|
||||||
AC_MSG_RESULT([$grub_cv_check_uscore_start_symbol])
|
AC_MSG_RESULT([$grub_cv_check_uscore_start_symbol])
|
||||||
])
|
])
|
||||||
|
|
||||||
|
dnl
|
||||||
|
dnl grub_CHECK_USCORE_USCORE_BSS_START_SYMBOL checks if __bss_start is
|
||||||
|
dnl automatically defined by the compiler.
|
||||||
|
dnl Written by Michael Hohmoth.
|
||||||
|
AC_DEFUN(grub_CHECK_USCORE_USCORE_BSS_START_SYMBOL,
|
||||||
|
[AC_REQUIRE([AC_PROG_CC])
|
||||||
|
AC_MSG_CHECKING([if __bss_start is defined by the compiler])
|
||||||
|
AC_CACHE_VAL(grub_cv_check_uscore_uscore_bss_start_symbol,
|
||||||
|
[AC_TRY_LINK([], [asm ("incl __bss_start")],
|
||||||
|
grub_cv_check_uscore_uscore_bss_start_symbol=yes,
|
||||||
|
grub_cv_check_uscore_uscore_bss_start_symbol=no)])
|
||||||
|
|
||||||
|
if test "x$grub_cv_check_uscore_uscore_bss_start_symbol" = xyes; then
|
||||||
|
AC_DEFINE([HAVE_USCORE_USCORE_BSS_START_SYMBOL])
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_MSG_RESULT([$grub_cv_check_uscore_uscore_bss_start_symbol])
|
||||||
|
])
|
||||||
|
|
||||||
|
dnl
|
||||||
|
dnl grub_CHECK_EDATA_SYMBOL checks if edata is automatically defined by the
|
||||||
|
dnl compiler.
|
||||||
|
dnl Written by Michael Hohmuth.
|
||||||
|
AC_DEFUN(grub_CHECK_EDATA_SYMBOL,
|
||||||
|
[AC_REQUIRE([AC_PROG_CC])
|
||||||
|
AC_MSG_CHECKING([if edata is defined by the compiler])
|
||||||
|
AC_CACHE_VAL(grub_cv_check_edata_symbol,
|
||||||
|
[AC_TRY_LINK([], [asm ("incl edata")],
|
||||||
|
grub_cv_check_edata_symbol=yes,
|
||||||
|
grub_cv_check_edata_symbol=no)])
|
||||||
|
|
||||||
|
if test "x$grub_cv_check_edata_symbol" = xyes; then
|
||||||
|
AC_DEFINE([HAVE_EDATA_SYMBOL])
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_MSG_RESULT([$grub_cv_check_edata_symbol])
|
||||||
|
])
|
||||||
|
|
||||||
|
dnl
|
||||||
|
dnl grub_CHECK_USCORE_EDATA_SYMBOL checks if _edata is automatically
|
||||||
|
dnl defined by the compiler.
|
||||||
|
dnl Written by Michael Hohmuth.
|
||||||
|
AC_DEFUN(grub_CHECK_USCORE_EDATA_SYMBOL,
|
||||||
|
[AC_REQUIRE([AC_PROG_CC])
|
||||||
|
AC_MSG_CHECKING([if _edata is defined by the compiler])
|
||||||
|
AC_CACHE_VAL(grub_cv_check_uscore_edata_symbol,
|
||||||
|
[AC_TRY_LINK([], [asm ("incl _edata")],
|
||||||
|
grub_cv_check_uscore_edata_symbol=yes,
|
||||||
|
grub_cv_check_uscore_edata_symbol=no)])
|
||||||
|
|
||||||
|
if test "x$grub_cv_check_uscore_edata_symbol" = xyes; then
|
||||||
|
AC_DEFINE([HAVE_USCORE_EDATA_SYMBOL])
|
||||||
|
fi
|
||||||
|
|
||||||
|
AC_MSG_RESULT([$grub_cv_check_uscore_edata_symbol])
|
||||||
|
])
|
||||||
|
|
||||||
dnl
|
dnl
|
||||||
dnl grub_CHECK_END_SYMBOL checks if end is automatically defined by the
|
dnl grub_CHECK_END_SYMBOL checks if end is automatically defined by the
|
||||||
dnl compiler.
|
dnl compiler.
|
||||||
|
@ -409,3 +478,4 @@ else
|
||||||
$1_FALSE=
|
$1_FALSE=
|
||||||
fi])
|
fi])
|
||||||
|
|
||||||
|
|
||||||
|
|
166
configure
vendored
166
configure
vendored
|
@ -1776,9 +1776,9 @@ if test "x$grub_cv_check_start_symbol" != "xyes" \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
echo $ac_n "checking if end is defined by the compiler""... $ac_c" 1>&6
|
echo $ac_n "checking if __bss_start is defined by the compiler""... $ac_c" 1>&6
|
||||||
echo "configure:1781: checking if end is defined by the compiler" >&5
|
echo "configure:1781: checking if __bss_start is defined by the compiler" >&5
|
||||||
if eval "test \"\${grub_cv_check_end_symbol+set}\" = set"; then
|
if eval "test \"\${grub_cv_check_uscore_uscore_bss_start_symbol+set}\" = set"; then
|
||||||
echo $ac_n "(cached) $ac_c" 1>&6
|
echo $ac_n "(cached) $ac_c" 1>&6
|
||||||
else
|
else
|
||||||
cat > conftest.$ac_ext <<EOF
|
cat > conftest.$ac_ext <<EOF
|
||||||
|
@ -1786,10 +1786,124 @@ else
|
||||||
#include "confdefs.h"
|
#include "confdefs.h"
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
asm ("incl end")
|
asm ("incl __bss_start")
|
||||||
; return 0; }
|
; return 0; }
|
||||||
EOF
|
EOF
|
||||||
if { (eval echo configure:1793: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
if { (eval echo configure:1793: \"$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
|
||||||
|
echo "configure: failed program was:" >&5
|
||||||
|
cat conftest.$ac_ext >&5
|
||||||
|
rm -rf conftest*
|
||||||
|
grub_cv_check_uscore_uscore_bss_start_symbol=no
|
||||||
|
fi
|
||||||
|
rm -f conftest*
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
if test "x$grub_cv_check_uscore_uscore_bss_start_symbol" = xyes; then
|
||||||
|
cat >> confdefs.h <<\EOF
|
||||||
|
#define HAVE_USCORE_USCORE_BSS_START_SYMBOL 1
|
||||||
|
EOF
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
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:1817: checking if _edata is defined by the compiler" >&5
|
||||||
|
if eval "test \"\${grub_cv_check_uscore_edata_symbol+set}\" = set"; then
|
||||||
|
echo $ac_n "(cached) $ac_c" 1>&6
|
||||||
|
else
|
||||||
|
cat > conftest.$ac_ext <<EOF
|
||||||
|
#line 1822 "configure"
|
||||||
|
#include "confdefs.h"
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
asm ("incl _edata")
|
||||||
|
; return 0; }
|
||||||
|
EOF
|
||||||
|
if { (eval echo configure:1829: \"$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
|
||||||
|
echo "configure: failed program was:" >&5
|
||||||
|
cat conftest.$ac_ext >&5
|
||||||
|
rm -rf conftest*
|
||||||
|
grub_cv_check_uscore_edata_symbol=no
|
||||||
|
fi
|
||||||
|
rm -f conftest*
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
if test "x$grub_cv_check_uscore_edata_symbol" = xyes; then
|
||||||
|
cat >> confdefs.h <<\EOF
|
||||||
|
#define HAVE_USCORE_EDATA_SYMBOL 1
|
||||||
|
EOF
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
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:1853: checking if edata is defined by the compiler" >&5
|
||||||
|
if eval "test \"\${grub_cv_check_edata_symbol+set}\" = set"; then
|
||||||
|
echo $ac_n "(cached) $ac_c" 1>&6
|
||||||
|
else
|
||||||
|
cat > conftest.$ac_ext <<EOF
|
||||||
|
#line 1858 "configure"
|
||||||
|
#include "confdefs.h"
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
asm ("incl edata")
|
||||||
|
; return 0; }
|
||||||
|
EOF
|
||||||
|
if { (eval echo configure:1865: \"$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
|
||||||
|
echo "configure: failed program was:" >&5
|
||||||
|
cat conftest.$ac_ext >&5
|
||||||
|
rm -rf conftest*
|
||||||
|
grub_cv_check_edata_symbol=no
|
||||||
|
fi
|
||||||
|
rm -f conftest*
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
if test "x$grub_cv_check_edata_symbol" = xyes; then
|
||||||
|
cat >> confdefs.h <<\EOF
|
||||||
|
#define HAVE_EDATA_SYMBOL 1
|
||||||
|
EOF
|
||||||
|
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "$ac_t""$grub_cv_check_edata_symbol" 1>&6
|
||||||
|
|
||||||
|
if test "x$grub_cv_check_uscore_uscore_bss_start_symbol" != "xyes" \
|
||||||
|
-a "x$grub_cv_check_uscore_edata_symbol" != "xyes" \
|
||||||
|
-a "x$grub_cv_check_edata_symbol" != "xyes"; then
|
||||||
|
{ echo "configure: error: None of __bss_start, _edata, edata defined" 1>&2; exit 1; }
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
echo $ac_n "checking if end is defined by the compiler""... $ac_c" 1>&6
|
||||||
|
echo "configure:1895: checking if end is defined by the compiler" >&5
|
||||||
|
if eval "test \"\${grub_cv_check_end_symbol+set}\" = set"; then
|
||||||
|
echo $ac_n "(cached) $ac_c" 1>&6
|
||||||
|
else
|
||||||
|
cat > conftest.$ac_ext <<EOF
|
||||||
|
#line 1900 "configure"
|
||||||
|
#include "confdefs.h"
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
asm ("incl end")
|
||||||
|
; return 0; }
|
||||||
|
EOF
|
||||||
|
if { (eval echo configure:1907: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||||
rm -rf conftest*
|
rm -rf conftest*
|
||||||
grub_cv_check_end_symbol=yes
|
grub_cv_check_end_symbol=yes
|
||||||
else
|
else
|
||||||
|
@ -1813,19 +1927,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 $ac_n "checking if _end is defined by the compiler""... $ac_c" 1>&6
|
||||||
echo "configure:1817: checking if _end is defined by the compiler" >&5
|
echo "configure:1931: checking if _end is defined by the compiler" >&5
|
||||||
if eval "test \"\${grub_cv_check_uscore_end_symbol+set}\" = set"; then
|
if eval "test \"\${grub_cv_check_uscore_end_symbol+set}\" = set"; then
|
||||||
echo $ac_n "(cached) $ac_c" 1>&6
|
echo $ac_n "(cached) $ac_c" 1>&6
|
||||||
else
|
else
|
||||||
cat > conftest.$ac_ext <<EOF
|
cat > conftest.$ac_ext <<EOF
|
||||||
#line 1822 "configure"
|
#line 1936 "configure"
|
||||||
#include "confdefs.h"
|
#include "confdefs.h"
|
||||||
|
|
||||||
int main() {
|
int main() {
|
||||||
asm ("incl _end")
|
asm ("incl _end")
|
||||||
; return 0; }
|
; return 0; }
|
||||||
EOF
|
EOF
|
||||||
if { (eval echo configure:1829: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
if { (eval echo configure:1943: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||||
rm -rf conftest*
|
rm -rf conftest*
|
||||||
grub_cv_check_uscore_end_symbol=yes
|
grub_cv_check_uscore_end_symbol=yes
|
||||||
else
|
else
|
||||||
|
@ -1863,7 +1977,7 @@ fi
|
||||||
# Get the filename or the whole disk and open it.
|
# Get the filename or the whole disk and open it.
|
||||||
# Known to work on NetBSD.
|
# Known to work on NetBSD.
|
||||||
echo $ac_n "checking for opendisk in -lutil""... $ac_c" 1>&6
|
echo $ac_n "checking for opendisk in -lutil""... $ac_c" 1>&6
|
||||||
echo "configure:1867: checking for opendisk in -lutil" >&5
|
echo "configure:1981: checking for opendisk in -lutil" >&5
|
||||||
ac_lib_var=`echo util'_'opendisk | sed 'y%./+-:%__p__%'`
|
ac_lib_var=`echo util'_'opendisk | sed 'y%./+-:%__p__%'`
|
||||||
if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
|
if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
|
||||||
echo $ac_n "(cached) $ac_c" 1>&6
|
echo $ac_n "(cached) $ac_c" 1>&6
|
||||||
|
@ -1871,7 +1985,7 @@ else
|
||||||
ac_save_LIBS="$LIBS"
|
ac_save_LIBS="$LIBS"
|
||||||
LIBS="-lutil $LIBS"
|
LIBS="-lutil $LIBS"
|
||||||
cat > conftest.$ac_ext <<EOF
|
cat > conftest.$ac_ext <<EOF
|
||||||
#line 1875 "configure"
|
#line 1989 "configure"
|
||||||
#include "confdefs.h"
|
#include "confdefs.h"
|
||||||
/* Override any gcc2 internal prototype to avoid an error. */
|
/* Override any gcc2 internal prototype to avoid an error. */
|
||||||
/* We use char because int might match the return type of a gcc2
|
/* We use char because int might match the return type of a gcc2
|
||||||
|
@ -1882,7 +1996,7 @@ int main() {
|
||||||
opendisk()
|
opendisk()
|
||||||
; return 0; }
|
; return 0; }
|
||||||
EOF
|
EOF
|
||||||
if { (eval echo configure:1886: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
if { (eval echo configure:2000: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||||
rm -rf conftest*
|
rm -rf conftest*
|
||||||
eval "ac_cv_lib_$ac_lib_var=yes"
|
eval "ac_cv_lib_$ac_lib_var=yes"
|
||||||
else
|
else
|
||||||
|
@ -1910,7 +2024,7 @@ fi
|
||||||
# Unless the user specify --without-curses, check for curses.
|
# Unless the user specify --without-curses, check for curses.
|
||||||
if test "x$with_curses" != "xno"; then
|
if test "x$with_curses" != "xno"; then
|
||||||
echo $ac_n "checking for wgetch in -lncurses""... $ac_c" 1>&6
|
echo $ac_n "checking for wgetch in -lncurses""... $ac_c" 1>&6
|
||||||
echo "configure:1914: checking for wgetch in -lncurses" >&5
|
echo "configure:2028: checking for wgetch in -lncurses" >&5
|
||||||
ac_lib_var=`echo ncurses'_'wgetch | sed 'y%./+-:%__p__%'`
|
ac_lib_var=`echo ncurses'_'wgetch | sed 'y%./+-:%__p__%'`
|
||||||
if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
|
if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
|
||||||
echo $ac_n "(cached) $ac_c" 1>&6
|
echo $ac_n "(cached) $ac_c" 1>&6
|
||||||
|
@ -1918,7 +2032,7 @@ else
|
||||||
ac_save_LIBS="$LIBS"
|
ac_save_LIBS="$LIBS"
|
||||||
LIBS="-lncurses $LIBS"
|
LIBS="-lncurses $LIBS"
|
||||||
cat > conftest.$ac_ext <<EOF
|
cat > conftest.$ac_ext <<EOF
|
||||||
#line 1922 "configure"
|
#line 2036 "configure"
|
||||||
#include "confdefs.h"
|
#include "confdefs.h"
|
||||||
/* Override any gcc2 internal prototype to avoid an error. */
|
/* Override any gcc2 internal prototype to avoid an error. */
|
||||||
/* We use char because int might match the return type of a gcc2
|
/* We use char because int might match the return type of a gcc2
|
||||||
|
@ -1929,7 +2043,7 @@ int main() {
|
||||||
wgetch()
|
wgetch()
|
||||||
; return 0; }
|
; return 0; }
|
||||||
EOF
|
EOF
|
||||||
if { (eval echo configure:1933: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
if { (eval echo configure:2047: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||||
rm -rf conftest*
|
rm -rf conftest*
|
||||||
eval "ac_cv_lib_$ac_lib_var=yes"
|
eval "ac_cv_lib_$ac_lib_var=yes"
|
||||||
else
|
else
|
||||||
|
@ -1952,7 +2066,7 @@ EOF
|
||||||
else
|
else
|
||||||
echo "$ac_t""no" 1>&6
|
echo "$ac_t""no" 1>&6
|
||||||
echo $ac_n "checking for wgetch in -lcurses""... $ac_c" 1>&6
|
echo $ac_n "checking for wgetch in -lcurses""... $ac_c" 1>&6
|
||||||
echo "configure:1956: checking for wgetch in -lcurses" >&5
|
echo "configure:2070: checking for wgetch in -lcurses" >&5
|
||||||
ac_lib_var=`echo curses'_'wgetch | sed 'y%./+-:%__p__%'`
|
ac_lib_var=`echo curses'_'wgetch | sed 'y%./+-:%__p__%'`
|
||||||
if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
|
if eval "test \"\${ac_cv_lib_$ac_lib_var+set}\" = set"; then
|
||||||
echo $ac_n "(cached) $ac_c" 1>&6
|
echo $ac_n "(cached) $ac_c" 1>&6
|
||||||
|
@ -1960,7 +2074,7 @@ else
|
||||||
ac_save_LIBS="$LIBS"
|
ac_save_LIBS="$LIBS"
|
||||||
LIBS="-lcurses $LIBS"
|
LIBS="-lcurses $LIBS"
|
||||||
cat > conftest.$ac_ext <<EOF
|
cat > conftest.$ac_ext <<EOF
|
||||||
#line 1964 "configure"
|
#line 2078 "configure"
|
||||||
#include "confdefs.h"
|
#include "confdefs.h"
|
||||||
/* Override any gcc2 internal prototype to avoid an error. */
|
/* Override any gcc2 internal prototype to avoid an error. */
|
||||||
/* We use char because int might match the return type of a gcc2
|
/* We use char because int might match the return type of a gcc2
|
||||||
|
@ -1971,7 +2085,7 @@ int main() {
|
||||||
wgetch()
|
wgetch()
|
||||||
; return 0; }
|
; return 0; }
|
||||||
EOF
|
EOF
|
||||||
if { (eval echo configure:1975: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
if { (eval echo configure:2089: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
|
||||||
rm -rf conftest*
|
rm -rf conftest*
|
||||||
eval "ac_cv_lib_$ac_lib_var=yes"
|
eval "ac_cv_lib_$ac_lib_var=yes"
|
||||||
else
|
else
|
||||||
|
@ -2003,7 +2117,7 @@ fi
|
||||||
|
|
||||||
# Check for headers.
|
# Check for headers.
|
||||||
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
|
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
|
||||||
echo "configure:2007: checking how to run the C preprocessor" >&5
|
echo "configure:2121: checking how to run the C preprocessor" >&5
|
||||||
# On Suns, sometimes $CPP names a directory.
|
# On Suns, sometimes $CPP names a directory.
|
||||||
if test -n "$CPP" && test -d "$CPP"; then
|
if test -n "$CPP" && test -d "$CPP"; then
|
||||||
CPP=
|
CPP=
|
||||||
|
@ -2018,13 +2132,13 @@ else
|
||||||
# On the NeXT, cc -E runs the code through the compiler's parser,
|
# On the NeXT, cc -E runs the code through the compiler's parser,
|
||||||
# not just through cpp.
|
# not just through cpp.
|
||||||
cat > conftest.$ac_ext <<EOF
|
cat > conftest.$ac_ext <<EOF
|
||||||
#line 2022 "configure"
|
#line 2136 "configure"
|
||||||
#include "confdefs.h"
|
#include "confdefs.h"
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
Syntax Error
|
Syntax Error
|
||||||
EOF
|
EOF
|
||||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||||
{ (eval echo configure:2028: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
{ (eval echo configure:2142: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||||
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
|
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
|
||||||
if test -z "$ac_err"; then
|
if test -z "$ac_err"; then
|
||||||
:
|
:
|
||||||
|
@ -2035,13 +2149,13 @@ else
|
||||||
rm -rf conftest*
|
rm -rf conftest*
|
||||||
CPP="${CC-cc} -E -traditional-cpp"
|
CPP="${CC-cc} -E -traditional-cpp"
|
||||||
cat > conftest.$ac_ext <<EOF
|
cat > conftest.$ac_ext <<EOF
|
||||||
#line 2039 "configure"
|
#line 2153 "configure"
|
||||||
#include "confdefs.h"
|
#include "confdefs.h"
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
Syntax Error
|
Syntax Error
|
||||||
EOF
|
EOF
|
||||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||||
{ (eval echo configure:2045: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
{ (eval echo configure:2159: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||||
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
|
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
|
||||||
if test -z "$ac_err"; then
|
if test -z "$ac_err"; then
|
||||||
:
|
:
|
||||||
|
@ -2052,13 +2166,13 @@ else
|
||||||
rm -rf conftest*
|
rm -rf conftest*
|
||||||
CPP="${CC-cc} -nologo -E"
|
CPP="${CC-cc} -nologo -E"
|
||||||
cat > conftest.$ac_ext <<EOF
|
cat > conftest.$ac_ext <<EOF
|
||||||
#line 2056 "configure"
|
#line 2170 "configure"
|
||||||
#include "confdefs.h"
|
#include "confdefs.h"
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
Syntax Error
|
Syntax Error
|
||||||
EOF
|
EOF
|
||||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||||
{ (eval echo configure:2062: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
{ (eval echo configure:2176: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||||
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
|
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
|
||||||
if test -z "$ac_err"; then
|
if test -z "$ac_err"; then
|
||||||
:
|
:
|
||||||
|
@ -2086,17 +2200,17 @@ for ac_hdr in string.h strings.h ncurses/curses.h ncurses.h curses.h
|
||||||
do
|
do
|
||||||
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
|
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
|
||||||
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
|
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
|
||||||
echo "configure:2090: checking for $ac_hdr" >&5
|
echo "configure:2204: checking for $ac_hdr" >&5
|
||||||
if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
|
if eval "test \"\${ac_cv_header_$ac_safe+set}\" = set"; then
|
||||||
echo $ac_n "(cached) $ac_c" 1>&6
|
echo $ac_n "(cached) $ac_c" 1>&6
|
||||||
else
|
else
|
||||||
cat > conftest.$ac_ext <<EOF
|
cat > conftest.$ac_ext <<EOF
|
||||||
#line 2095 "configure"
|
#line 2209 "configure"
|
||||||
#include "confdefs.h"
|
#include "confdefs.h"
|
||||||
#include <$ac_hdr>
|
#include <$ac_hdr>
|
||||||
EOF
|
EOF
|
||||||
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
|
||||||
{ (eval echo configure:2100: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
{ (eval echo configure:2214: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
|
||||||
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
|
ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
|
||||||
if test -z "$ac_err"; then
|
if test -z "$ac_err"; then
|
||||||
rm -rf conftest*
|
rm -rf conftest*
|
||||||
|
|
|
@ -121,6 +121,15 @@ if test "x$grub_cv_check_start_symbol" != "xyes" \
|
||||||
AC_MSG_ERROR([Neither start nor _start is defined])
|
AC_MSG_ERROR([Neither start nor _start is defined])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
grub_CHECK_USCORE_USCORE_BSS_START_SYMBOL
|
||||||
|
grub_CHECK_USCORE_EDATA_SYMBOL
|
||||||
|
grub_CHECK_EDATA_SYMBOL
|
||||||
|
if test "x$grub_cv_check_uscore_uscore_bss_start_symbol" != "xyes" \
|
||||||
|
-a "x$grub_cv_check_uscore_edata_symbol" != "xyes" \
|
||||||
|
-a "x$grub_cv_check_edata_symbol" != "xyes"; then
|
||||||
|
AC_MSG_ERROR([None of __bss_start, _edata, edata defined])
|
||||||
|
fi
|
||||||
|
|
||||||
grub_CHECK_END_SYMBOL
|
grub_CHECK_END_SYMBOL
|
||||||
grub_CHECK_USCORE_END_SYMBOL
|
grub_CHECK_USCORE_END_SYMBOL
|
||||||
if test "x$grub_cv_check_end_symbol" != "xyes" \
|
if test "x$grub_cv_check_end_symbol" != "xyes" \
|
||||||
|
|
|
@ -49,7 +49,9 @@ $ mke2fs /dev/fd0
|
||||||
Mount it on somewhere, say, @file{/mnt}.
|
Mount it on somewhere, say, @file{/mnt}.
|
||||||
|
|
||||||
@item
|
@item
|
||||||
Copy the GRUB images to @file{/mnt/boot/grub}.
|
Copy the GRUB images to @file{/mnt/boot/grub}. Only @file{stage1},
|
||||||
|
@file{stage2} and @file{menu.lst} are necessary. You may not copy
|
||||||
|
@dfn{stage1.5}s.
|
||||||
|
|
||||||
@item
|
@item
|
||||||
Run the following command:
|
Run the following command:
|
||||||
|
@ -115,7 +117,7 @@ Multiboot-compliant, the world would be an utopia@dots{}
|
||||||
|
|
||||||
|
|
||||||
@node Obtaining and Building GRUB
|
@node Obtaining and Building GRUB
|
||||||
@appendix Obtaining and Building GRUB
|
@appendix How to obtain and build GRUB
|
||||||
|
|
||||||
@quotation
|
@quotation
|
||||||
@strong{Caution:} GRUB requires binutils-2.9.1.0.23 or later because the
|
@strong{Caution:} GRUB requires binutils-2.9.1.0.23 or later because the
|
||||||
|
|
|
@ -97,38 +97,39 @@ edition documents version @value{VERSION}.
|
||||||
@menu
|
@menu
|
||||||
Part I: The Tutorial Manual
|
Part I: The Tutorial Manual
|
||||||
|
|
||||||
* Overview::
|
* Overview:: Starting to use GRUB
|
||||||
* Device Syntax::
|
* Device Syntax:: How to specify a device
|
||||||
* Installation::
|
* Installation:: How to install GRUB on your drive
|
||||||
* Boot::
|
* Boot:: How to boot your operating systems
|
||||||
* Configuration::
|
* Configuration:: Writing your configuration file
|
||||||
|
|
||||||
Part II: The User Reference Manual
|
Part II: The User Reference Manual
|
||||||
|
|
||||||
* Introduction::
|
* Introduction:: Capturing the spirit of GRUB
|
||||||
* Filesystem::
|
* Filesystem:: Filesystem syntax and semantics
|
||||||
* Interface::
|
* Interface:: The menu and the command-line
|
||||||
* Command::
|
* Command:: The list of available builtin commands
|
||||||
* Troubleshooting::
|
* Troubleshooting:: Error messages produced by GRUB
|
||||||
* Invoking the grub shell::
|
* Invoking the grub shell:: How to use the grub shell
|
||||||
* Invoking mbchk::
|
* Invoking mbchk:: How to use the Multiboot checker
|
||||||
|
|
||||||
Part III: The Programmer Reference Manual
|
Part III: The Programmer Reference Manual
|
||||||
|
|
||||||
* Memory map::
|
* Hacking:: Implementation details
|
||||||
* Embedded data::
|
* Memory map:: The memory map of various components
|
||||||
* Filesystem interface::
|
* Embedded data:: Embedded variables in GRUB
|
||||||
* Bootstrap tricks::
|
* Filesystem interface:: The generic interface for the fs code
|
||||||
* Memory detection::
|
* Bootstrap tricks:: The bootstrap mechanism used in GRUB
|
||||||
* Low-level disk I/O::
|
* Memory detection:: How to detect all installed @sc{ram}
|
||||||
* MBR::
|
* Low-level disk I/O:: INT 13H disk I/O interrupts
|
||||||
* Partition table::
|
* MBR:: The structure of Master Boot Record
|
||||||
|
* Partition table:: The format of partition table
|
||||||
|
|
||||||
Appendices and Indices
|
Appendices and Indices
|
||||||
|
|
||||||
* FAQ::
|
* FAQ:: Frequently asked questions
|
||||||
* Obtaining and Building GRUB::
|
* Obtaining and Building GRUB:: How to obtain and build GRUB
|
||||||
* Reporting bugs::
|
* Reporting bugs:: Where you should send a bug report
|
||||||
* Index::
|
* Index::
|
||||||
|
|
||||||
@end menu
|
@end menu
|
||||||
|
|
1655
docs/prog-ref.texi
1655
docs/prog-ref.texi
File diff suppressed because it is too large
Load diff
|
@ -276,6 +276,9 @@ command. An example is to set @samp{vga} to @samp{ext}:
|
||||||
grub> kernel /vmlinuz root=/dev/hda1 vga=ext
|
grub> kernel /vmlinuz root=/dev/hda1 vga=ext
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
|
See the documentation in the Linux source tree, for the complete
|
||||||
|
information on the available options.
|
||||||
|
|
||||||
If you use initrd, execute the command @command{initrd} after
|
If you use initrd, execute the command @command{initrd} after
|
||||||
@command{kernel}:
|
@command{kernel}:
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
@node Introduction
|
@node Introduction
|
||||||
@chapter Introduction
|
@chapter Introduction
|
||||||
|
|
||||||
This chapter documents the history and the features of GRUB.
|
This part documents the user-visible aspect of GRUB. If you are looking
|
||||||
|
for the information on the internals, see the Programmer Reference
|
||||||
|
Manual (@pxref{Hacking}).
|
||||||
|
|
||||||
@menu
|
@menu
|
||||||
* History:: From maggot to house fly.
|
* History:: From maggot to house fly.
|
||||||
|
|
|
@ -11,10 +11,25 @@ endif
|
||||||
noinst_LIBRARIES = $(LIBDRIVERS)
|
noinst_LIBRARIES = $(LIBDRIVERS)
|
||||||
|
|
||||||
DRIVERS = 3c509.c 3c509.h 3c59x.c cs89x0.c cs89x0.h eepro100.c \
|
DRIVERS = 3c509.c 3c509.h 3c59x.c cs89x0.c cs89x0.h eepro100.c \
|
||||||
lance.c ns8390.c ns8390.h
|
lance.c
|
||||||
|
|
||||||
libdrivers_a_SOURCES = byteorder.h config.c netboot_config.h \
|
libdrivers_a_SOURCES = byteorder.h config.c netboot_config.h \
|
||||||
fsys_tftp.c if.h io.h ip.c ip.h netboot.h netdevice.h nic.h \
|
fsys_tftp.c if.h io.h ip.c ip.h netboot.h netdevice.h nic.h \
|
||||||
pci.c pci.h $(DRIVERS)
|
pci.c pci.h $(DRIVERS)
|
||||||
libdrivers_a_CFLAGS = $(STAGE2_CFLAGS) -fno-builtin -nostdinc \
|
libdrivers_a_CFLAGS = $(STAGE2_CFLAGS) -fno-builtin -nostdinc \
|
||||||
-DFSYS_TFTP $(NET_CFLAGS) $(NET_EXTRAFLAGS)
|
-DFSYS_TFTP $(NET_CFLAGS) $(NET_EXTRAFLAGS)
|
||||||
|
|
||||||
|
libdrivers_a_LIBADD = nepci.o ne.o wd.o t503.o
|
||||||
|
|
||||||
|
$(libdrivers_a_LIBADD): ns8390.c ns8390.h
|
||||||
|
$(libdrivers_a_LIBADD): %.o: ns8390.c
|
||||||
|
$(COMPILE) $($(basename $@)_o_CFLAGS) -o $@ -c $<
|
||||||
|
|
||||||
|
nepci_o_CFLAGS = $(filter-out -DINCLUDE_T503=1 -DINCLUDE_NE=1 \
|
||||||
|
-DINCLUDE_WD=1, $(libdrivers_a_CFLAGS))
|
||||||
|
ne_o_CFLAGS = $(filter-out -DINCLUDE_T503=1 -DINCLUDE_NEPCI=1 \
|
||||||
|
-DINCLUDE_WD=1, $(libdrivers_a_CFLAGS))
|
||||||
|
wd_o_CFLAGS = $(filter-out -DINCLUDE_T503=1 -DINCLUDE_NE=1 \
|
||||||
|
-DINCLUDE_NEPCI=1, $(libdrivers_a_CFLAGS))
|
||||||
|
t503_o_CFLAGS = $(filter-out -DINCLUDE_NE=1 -DINCLUDE_NEPCI=1 \
|
||||||
|
-DINCLUDE_WD=1, $(libdrivers_a_CFLAGS))
|
||||||
|
|
|
@ -91,7 +91,7 @@ INCLUDES = -I$(top_srcdir)/stage1
|
||||||
noinst_LIBRARIES = $(LIBDRIVERS)
|
noinst_LIBRARIES = $(LIBDRIVERS)
|
||||||
|
|
||||||
DRIVERS = 3c509.c 3c509.h 3c59x.c cs89x0.c cs89x0.h eepro100.c \
|
DRIVERS = 3c509.c 3c509.h 3c59x.c cs89x0.c cs89x0.h eepro100.c \
|
||||||
lance.c ns8390.c ns8390.h
|
lance.c
|
||||||
|
|
||||||
|
|
||||||
libdrivers_a_SOURCES = byteorder.h config.c netboot_config.h \
|
libdrivers_a_SOURCES = byteorder.h config.c netboot_config.h \
|
||||||
|
@ -101,6 +101,21 @@ libdrivers_a_SOURCES = byteorder.h config.c netboot_config.h \
|
||||||
libdrivers_a_CFLAGS = $(STAGE2_CFLAGS) -fno-builtin -nostdinc \
|
libdrivers_a_CFLAGS = $(STAGE2_CFLAGS) -fno-builtin -nostdinc \
|
||||||
-DFSYS_TFTP $(NET_CFLAGS) $(NET_EXTRAFLAGS)
|
-DFSYS_TFTP $(NET_CFLAGS) $(NET_EXTRAFLAGS)
|
||||||
|
|
||||||
|
|
||||||
|
libdrivers_a_LIBADD = nepci.o ne.o wd.o t503.o
|
||||||
|
|
||||||
|
nepci_o_CFLAGS = $(filter-out -DINCLUDE_T503=1 -DINCLUDE_NE=1 \
|
||||||
|
-DINCLUDE_WD=1, $(libdrivers_a_CFLAGS))
|
||||||
|
|
||||||
|
ne_o_CFLAGS = $(filter-out -DINCLUDE_T503=1 -DINCLUDE_NEPCI=1 \
|
||||||
|
-DINCLUDE_WD=1, $(libdrivers_a_CFLAGS))
|
||||||
|
|
||||||
|
wd_o_CFLAGS = $(filter-out -DINCLUDE_T503=1 -DINCLUDE_NE=1 \
|
||||||
|
-DINCLUDE_NEPCI=1, $(libdrivers_a_CFLAGS))
|
||||||
|
|
||||||
|
t503_o_CFLAGS = $(filter-out -DINCLUDE_NE=1 -DINCLUDE_NEPCI=1 \
|
||||||
|
-DINCLUDE_WD=1, $(libdrivers_a_CFLAGS))
|
||||||
|
|
||||||
subdir = netboot
|
subdir = netboot
|
||||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||||
CONFIG_HEADER = ../config.h
|
CONFIG_HEADER = ../config.h
|
||||||
|
@ -113,11 +128,11 @@ CPPFLAGS = @CPPFLAGS@
|
||||||
LDFLAGS = @LDFLAGS@
|
LDFLAGS = @LDFLAGS@
|
||||||
LIBS = @LIBS@
|
LIBS = @LIBS@
|
||||||
libdrivers_a_AR = $(AR) cru
|
libdrivers_a_AR = $(AR) cru
|
||||||
libdrivers_a_LIBADD =
|
libdrivers_a_DEPENDENCIES = nepci.o ne.o wd.o t503.o
|
||||||
am_libdrivers_a_OBJECTS = libdrivers_a-config.o \
|
am_libdrivers_a_OBJECTS = libdrivers_a-config.o \
|
||||||
libdrivers_a-fsys_tftp.o libdrivers_a-ip.o libdrivers_a-pci.o \
|
libdrivers_a-fsys_tftp.o libdrivers_a-ip.o libdrivers_a-pci.o \
|
||||||
libdrivers_a-3c509.o libdrivers_a-3c59x.o libdrivers_a-cs89x0.o \
|
libdrivers_a-3c509.o libdrivers_a-3c59x.o libdrivers_a-cs89x0.o \
|
||||||
libdrivers_a-eepro100.o libdrivers_a-lance.o libdrivers_a-ns8390.o
|
libdrivers_a-eepro100.o libdrivers_a-lance.o
|
||||||
libdrivers_a_OBJECTS = $(am_libdrivers_a_OBJECTS)
|
libdrivers_a_OBJECTS = $(am_libdrivers_a_OBJECTS)
|
||||||
AR = ar
|
AR = ar
|
||||||
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||||
|
@ -132,8 +147,7 @@ DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
|
||||||
|
|
||||||
GZIP_ENV = --best
|
GZIP_ENV = --best
|
||||||
DEP_FILES = .deps/3c509.P .deps/3c59x.P .deps/config.P .deps/cs89x0.P \
|
DEP_FILES = .deps/3c509.P .deps/3c59x.P .deps/config.P .deps/cs89x0.P \
|
||||||
.deps/eepro100.P .deps/fsys_tftp.P .deps/ip.P .deps/lance.P \
|
.deps/eepro100.P .deps/fsys_tftp.P .deps/ip.P .deps/lance.P .deps/pci.P
|
||||||
.deps/ns8390.P .deps/pci.P
|
|
||||||
SOURCES = $(libdrivers_a_SOURCES)
|
SOURCES = $(libdrivers_a_SOURCES)
|
||||||
OBJECTS = $(am_libdrivers_a_OBJECTS)
|
OBJECTS = $(am_libdrivers_a_OBJECTS)
|
||||||
|
|
||||||
|
@ -175,7 +189,6 @@ libdrivers_a-3c59x.o: 3c59x.c
|
||||||
libdrivers_a-cs89x0.o: cs89x0.c
|
libdrivers_a-cs89x0.o: cs89x0.c
|
||||||
libdrivers_a-eepro100.o: eepro100.c
|
libdrivers_a-eepro100.o: eepro100.c
|
||||||
libdrivers_a-lance.o: lance.c
|
libdrivers_a-lance.o: lance.c
|
||||||
libdrivers_a-ns8390.o: ns8390.c
|
|
||||||
|
|
||||||
libdrivers.a: $(libdrivers_a_OBJECTS) $(libdrivers_a_DEPENDENCIES)
|
libdrivers.a: $(libdrivers_a_OBJECTS) $(libdrivers_a_DEPENDENCIES)
|
||||||
-rm -f libdrivers.a
|
-rm -f libdrivers.a
|
||||||
|
@ -438,25 +451,6 @@ libdrivers_a-lance.lo: lance.c
|
||||||
| sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
|
| sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
|
||||||
>> .deps/$(*D)/$(*F).P; \
|
>> .deps/$(*D)/$(*F).P; \
|
||||||
rm -f .deps/$(*D)/$(*F).pp
|
rm -f .deps/$(*D)/$(*F).pp
|
||||||
|
|
||||||
libdrivers_a-ns8390.o: ns8390.c
|
|
||||||
@echo '$(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdrivers_a_CFLAGS) $(CFLAGS) -c -o $@ $<'; \
|
|
||||||
$(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdrivers_a_CFLAGS) $(CFLAGS) -Wp,-MD,.deps/$(*D)/$(*F).pp -c -o $@ $<
|
|
||||||
@-cp .deps/$(*D)/$(*F).pp .deps/$(*D)/$(*F).P; \
|
|
||||||
tr ' ' '\012' < .deps/$(*D)/$(*F).pp \
|
|
||||||
| sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
|
|
||||||
>> .deps/$(*D)/$(*F).P; \
|
|
||||||
rm .deps/$(*D)/$(*F).pp
|
|
||||||
|
|
||||||
libdrivers_a-ns8390.lo: ns8390.c
|
|
||||||
@echo '$(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdrivers_a_CFLAGS) $(CFLAGS) -c -o $@ $<'; \
|
|
||||||
$(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libdrivers_a_CFLAGS) $(CFLAGS) -Wp,-MD,.deps/$(*D)/$(*F).pp -c -o $@ $<
|
|
||||||
@-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \
|
|
||||||
< .deps/$(*D)/$(*F).pp > .deps/$(*D)/$(*F).P; \
|
|
||||||
tr ' ' '\012' < .deps/$(*D)/$(*F).pp \
|
|
||||||
| sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
|
|
||||||
>> .deps/$(*D)/$(*F).P; \
|
|
||||||
rm -f .deps/$(*D)/$(*F).pp
|
|
||||||
info-am:
|
info-am:
|
||||||
info: info-am
|
info: info-am
|
||||||
dvi-am:
|
dvi-am:
|
||||||
|
@ -530,6 +524,10 @@ installdirs mostlyclean-generic distclean-generic clean-generic \
|
||||||
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
|
maintainer-clean-generic clean mostlyclean distclean maintainer-clean
|
||||||
|
|
||||||
|
|
||||||
|
$(libdrivers_a_LIBADD): ns8390.c ns8390.h
|
||||||
|
$(libdrivers_a_LIBADD): %.o: ns8390.c
|
||||||
|
$(COMPILE) $($(basename $@)_o_CFLAGS) -o $@ -c $<
|
||||||
|
|
||||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||||
.NOEXPORT:
|
.NOEXPORT:
|
||||||
|
|
|
@ -146,13 +146,11 @@ int tftp_dir(char *dirname)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
|
||||||
void tftp_close(void)
|
void tftp_close(void)
|
||||||
{
|
{
|
||||||
buf_read = 0;
|
buf_read = 0;
|
||||||
buf_fill (1); /* abort. */
|
buf_fill (1); /* abort. */
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
static int buf_fill(int abort)
|
static int buf_fill(int abort)
|
||||||
{
|
{
|
||||||
|
|
31
stage2/asm.S
31
stage2/asm.S
|
@ -117,6 +117,37 @@ codestart:
|
||||||
/* The ".code32" directive takes GAS out of 16-bit mode. */
|
/* The ".code32" directive takes GAS out of 16-bit mode. */
|
||||||
.code32
|
.code32
|
||||||
|
|
||||||
|
/* clean out the bss */
|
||||||
|
|
||||||
|
/* set %edi to the bss starting address */
|
||||||
|
#if defined(HAVE_USCORE_USCORE_BSS_START_SYMBOL)
|
||||||
|
movl $__bss_start, %edi
|
||||||
|
#elif defined(HAVE_USCORE_EDATA_SYMBOL)
|
||||||
|
movl $_edata, %edi
|
||||||
|
#elif defined(HAVE_EDATA_SYMBOL)
|
||||||
|
movl $edata, %edi
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* set %ecx to the bss end */
|
||||||
|
#if defined(HAVE_END_SYMBOL)
|
||||||
|
movl $end, %ecx
|
||||||
|
#elif defined(HAVE_USCORE_END_SYMBOL)
|
||||||
|
movl $_end, %ecx
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* compute the bss length */
|
||||||
|
subl %edi, %ecx
|
||||||
|
|
||||||
|
/* zero %al */
|
||||||
|
xorb %al, %al
|
||||||
|
|
||||||
|
/* set the direction */
|
||||||
|
cld
|
||||||
|
|
||||||
|
/* clean out */
|
||||||
|
rep
|
||||||
|
stosb
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Call the start of main body of C code, which does some
|
* Call the start of main body of C code, which does some
|
||||||
* of it's own initialization before transferring to "cmain".
|
* of it's own initialization before transferring to "cmain".
|
||||||
|
|
|
@ -64,6 +64,8 @@ load_image (char *kernel, char *arg)
|
||||||
|
|
||||||
if (!(len = grub_read (buffer, MULTIBOOT_SEARCH)) || len < 32)
|
if (!(len = grub_read (buffer, MULTIBOOT_SEARCH)) || len < 32)
|
||||||
{
|
{
|
||||||
|
grub_close ();
|
||||||
|
|
||||||
if (!errnum)
|
if (!errnum)
|
||||||
errnum = ERR_EXEC_FORMAT;
|
errnum = ERR_EXEC_FORMAT;
|
||||||
|
|
||||||
|
@ -77,6 +79,7 @@ load_image (char *kernel, char *arg)
|
||||||
flags = ((struct multiboot_header *) (buffer + i))->flags;
|
flags = ((struct multiboot_header *) (buffer + i))->flags;
|
||||||
if (flags & MULTIBOOT_UNSUPPORTED)
|
if (flags & MULTIBOOT_UNSUPPORTED)
|
||||||
{
|
{
|
||||||
|
grub_close ();
|
||||||
errnum = ERR_BOOT_FEATURES;
|
errnum = ERR_BOOT_FEATURES;
|
||||||
return KERNEL_TYPE_NONE;
|
return KERNEL_TYPE_NONE;
|
||||||
}
|
}
|
||||||
|
@ -201,6 +204,7 @@ load_image (char *kernel, char *arg)
|
||||||
if (! big_linux && text_len > LINUX_KERNEL_MAXLEN)
|
if (! big_linux && text_len > LINUX_KERNEL_MAXLEN)
|
||||||
{
|
{
|
||||||
printf (" linux 'zImage' kernel too big, try 'make bzImage'\n");
|
printf (" linux 'zImage' kernel too big, try 'make bzImage'\n");
|
||||||
|
grub_close ();
|
||||||
errnum = ERR_WONT_FIT;
|
errnum = ERR_WONT_FIT;
|
||||||
return KERNEL_TYPE_NONE;
|
return KERNEL_TYPE_NONE;
|
||||||
}
|
}
|
||||||
|
@ -232,9 +236,12 @@ load_image (char *kernel, char *arg)
|
||||||
else if (safe_parse_maxint (&value, &vid_mode))
|
else if (safe_parse_maxint (&value, &vid_mode))
|
||||||
;
|
;
|
||||||
else
|
else
|
||||||
|
{
|
||||||
/* ERRNUM is already set inside the function
|
/* ERRNUM is already set inside the function
|
||||||
safe_parse_maxint. */
|
safe_parse_maxint. */
|
||||||
return KERNEL_TYPE_NONE;
|
return KERNEL_TYPE_NONE;
|
||||||
|
grub_close ();
|
||||||
|
}
|
||||||
|
|
||||||
/* Set the vid mode to VID_MODE. Note that this can work
|
/* Set the vid mode to VID_MODE. Note that this can work
|
||||||
because i386 architecture is little-endian. */
|
because i386 architecture is little-endian. */
|
||||||
|
@ -276,8 +283,12 @@ load_image (char *kernel, char *arg)
|
||||||
filepos = data_len + SECTOR_SIZE;
|
filepos = data_len + SECTOR_SIZE;
|
||||||
|
|
||||||
cur_addr = LINUX_STAGING_AREA + text_len;
|
cur_addr = LINUX_STAGING_AREA + text_len;
|
||||||
if (grub_read ((char *) LINUX_STAGING_AREA, text_len) >= (text_len - 16))
|
if (grub_read ((char *) LINUX_STAGING_AREA, text_len)
|
||||||
return (big_linux ? KERNEL_TYPE_BIG_LINUX : KERNEL_TYPE_LINUX);
|
>= (text_len - 16))
|
||||||
|
{
|
||||||
|
grub_close ();
|
||||||
|
return big_linux ? KERNEL_TYPE_BIG_LINUX : KERNEL_TYPE_LINUX;
|
||||||
|
}
|
||||||
else if (!errnum)
|
else if (!errnum)
|
||||||
errnum = ERR_EXEC_FORMAT;
|
errnum = ERR_EXEC_FORMAT;
|
||||||
}
|
}
|
||||||
|
@ -289,7 +300,10 @@ load_image (char *kernel, char *arg)
|
||||||
|
|
||||||
/* return if error */
|
/* return if error */
|
||||||
if (errnum)
|
if (errnum)
|
||||||
|
{
|
||||||
|
grub_close ();
|
||||||
return KERNEL_TYPE_NONE;
|
return KERNEL_TYPE_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
/* fill the multiboot info structure */
|
/* fill the multiboot info structure */
|
||||||
mbi.cmdline = (int) arg;
|
mbi.cmdline = (int) arg;
|
||||||
|
@ -472,6 +486,7 @@ load_image (char *kernel, char *arg)
|
||||||
type = KERNEL_TYPE_NONE;
|
type = KERNEL_TYPE_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
grub_close ();
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -483,9 +498,16 @@ load_module (char *module, char *arg)
|
||||||
/* if we are supposed to load on 4K boundaries */
|
/* if we are supposed to load on 4K boundaries */
|
||||||
cur_addr = (cur_addr + 0xFFF) & 0xFFFFF000;
|
cur_addr = (cur_addr + 0xFFF) & 0xFFFFF000;
|
||||||
|
|
||||||
if (!grub_open (module) || !(len = grub_read ((char *) cur_addr, -1)))
|
if (!grub_open (module))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
len = grub_read ((char *) cur_addr, -1);
|
||||||
|
if (! len)
|
||||||
|
{
|
||||||
|
grub_close ();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
printf (" [Multiboot-module @ 0x%x, 0x%x bytes]\n", cur_addr, len);
|
printf (" [Multiboot-module @ 0x%x, 0x%x bytes]\n", cur_addr, len);
|
||||||
|
|
||||||
/* these two simply need to be set if any modules are loaded at all */
|
/* these two simply need to be set if any modules are loaded at all */
|
||||||
|
@ -501,6 +523,7 @@ load_module (char *module, char *arg)
|
||||||
/* increment number of modules included */
|
/* increment number of modules included */
|
||||||
mbi.mods_count++;
|
mbi.mods_count++;
|
||||||
|
|
||||||
|
grub_close ();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -510,9 +533,16 @@ load_initrd (char *initrd)
|
||||||
int len;
|
int len;
|
||||||
unsigned long *ramdisk, moveto;
|
unsigned long *ramdisk, moveto;
|
||||||
|
|
||||||
if (! grub_open (initrd) || ! (len = grub_read ((char *) cur_addr, -1)))
|
if (! grub_open (initrd))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
len = grub_read ((char *) cur_addr, -1);
|
||||||
|
if (! len)
|
||||||
|
{
|
||||||
|
grub_close ();
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
moveto = ((mbi.mem_upper + 0x400) * 0x400 - len) & 0xfffff000;
|
moveto = ((mbi.mem_upper + 0x400) * 0x400 - len) & 0xfffff000;
|
||||||
memmove ((void *) RAW_ADDR (moveto), (void *) cur_addr, len);
|
memmove ((void *) RAW_ADDR (moveto), (void *) cur_addr, len);
|
||||||
|
|
||||||
|
@ -522,6 +552,7 @@ load_initrd (char *initrd)
|
||||||
ramdisk[0] = RAW_ADDR (moveto);
|
ramdisk[0] = RAW_ADDR (moveto);
|
||||||
ramdisk[1] = len;
|
ramdisk[1] = len;
|
||||||
|
|
||||||
|
grub_close ();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -165,6 +165,7 @@ cat_func (char *arg, int flags)
|
||||||
while (grub_read (&c, 1))
|
while (grub_read (&c, 1))
|
||||||
grub_putchar (c);
|
grub_putchar (c);
|
||||||
|
|
||||||
|
grub_close ();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -182,18 +183,25 @@ static struct builtin builtin_cat =
|
||||||
static int
|
static int
|
||||||
chainloader_func (char *arg, int flags)
|
chainloader_func (char *arg, int flags)
|
||||||
{
|
{
|
||||||
if (grub_open (arg)
|
if (! grub_open (arg))
|
||||||
&& grub_read ((char *) BOOTSEC_LOCATION, SECTOR_SIZE) == SECTOR_SIZE
|
{
|
||||||
|
kernel_type = KERNEL_TYPE_NONE;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (grub_read ((char *) BOOTSEC_LOCATION, SECTOR_SIZE) == SECTOR_SIZE
|
||||||
&& (*((unsigned short *) (BOOTSEC_LOCATION + BOOTSEC_SIG_OFFSET))
|
&& (*((unsigned short *) (BOOTSEC_LOCATION + BOOTSEC_SIG_OFFSET))
|
||||||
== BOOTSEC_SIGNATURE))
|
== BOOTSEC_SIGNATURE))
|
||||||
kernel_type = KERNEL_TYPE_CHAINLOADER;
|
kernel_type = KERNEL_TYPE_CHAINLOADER;
|
||||||
else if (! errnum)
|
else if (! errnum)
|
||||||
{
|
{
|
||||||
|
grub_close ();
|
||||||
errnum = ERR_EXEC_FORMAT;
|
errnum = ERR_EXEC_FORMAT;
|
||||||
kernel_type = KERNEL_TYPE_NONE;
|
kernel_type = KERNEL_TYPE_NONE;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
grub_close ();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -351,6 +359,8 @@ configfile_func (char *arg, int flags)
|
||||||
if (! grub_open (arg))
|
if (! grub_open (arg))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
|
grub_close ();
|
||||||
|
|
||||||
/* Copy ARG to CONFIG_FILE. */
|
/* Copy ARG to CONFIG_FILE. */
|
||||||
while ((*new_config++ = *arg++) != 0)
|
while ((*new_config++ = *arg++) != 0)
|
||||||
;
|
;
|
||||||
|
@ -546,6 +556,8 @@ embed_func (char *arg, int flags)
|
||||||
|
|
||||||
/* Read the whole of the Stage 1.5. */
|
/* Read the whole of the Stage 1.5. */
|
||||||
len = grub_read (stage1_5_buffer, -1);
|
len = grub_read (stage1_5_buffer, -1);
|
||||||
|
grub_close ();
|
||||||
|
|
||||||
if (errnum)
|
if (errnum)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
|
@ -702,8 +714,11 @@ find_func (char *arg, int flags)
|
||||||
saved_drive = current_drive;
|
saved_drive = current_drive;
|
||||||
saved_partition = current_partition;
|
saved_partition = current_partition;
|
||||||
if (grub_open (filename))
|
if (grub_open (filename))
|
||||||
|
{
|
||||||
|
grub_close ();
|
||||||
grub_printf (" (fd%d)\n", drive);
|
grub_printf (" (fd%d)\n", drive);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Hard disks. */
|
/* Hard disks. */
|
||||||
for (drive = 0x80; drive < 0x88; drive++)
|
for (drive = 0x80; drive < 0x88; drive++)
|
||||||
|
@ -728,19 +743,25 @@ find_func (char *arg, int flags)
|
||||||
saved_drive = current_drive;
|
saved_drive = current_drive;
|
||||||
saved_partition = current_partition;
|
saved_partition = current_partition;
|
||||||
if (grub_open (filename))
|
if (grub_open (filename))
|
||||||
|
{
|
||||||
|
grub_close ();
|
||||||
grub_printf (" (hd%d,%d,%c)",
|
grub_printf (" (hd%d,%d,%c)",
|
||||||
drive - 0x80, slice, part + 'a');
|
drive - 0x80, slice, part + 'a');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
saved_drive = current_drive;
|
saved_drive = current_drive;
|
||||||
saved_partition = current_partition;
|
saved_partition = current_partition;
|
||||||
if (grub_open (filename))
|
if (grub_open (filename))
|
||||||
|
{
|
||||||
|
grub_close ();
|
||||||
grub_printf (" (hd%d,%d)", drive - 0x80, slice);
|
grub_printf (" (hd%d,%d)", drive - 0x80, slice);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
errnum = 0;
|
errnum = 0;
|
||||||
saved_drive = tmp_drive;
|
saved_drive = tmp_drive;
|
||||||
|
@ -1098,6 +1119,8 @@ install_func (char *arg, int flags)
|
||||||
char *config_file_location;
|
char *config_file_location;
|
||||||
/* If FILE is a Stage 1.5? */
|
/* If FILE is a Stage 1.5? */
|
||||||
int is_stage1_5 = 0;
|
int is_stage1_5 = 0;
|
||||||
|
/* Must call grub_close? */
|
||||||
|
int is_open = 0;
|
||||||
|
|
||||||
/* Save the first sector of Stage2 in STAGE2_SECT. */
|
/* Save the first sector of Stage2 in STAGE2_SECT. */
|
||||||
static void disk_read_savesect_func (int sector)
|
static void disk_read_savesect_func (int sector)
|
||||||
|
@ -1161,7 +1184,8 @@ install_func (char *arg, int flags)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Read Stage 1. */
|
/* Read Stage 1. */
|
||||||
if (! grub_open (stage1_file)
|
is_open = grub_open (stage1_file);
|
||||||
|
if (! is_open
|
||||||
|| ! grub_read (stage1_buffer, SECTOR_SIZE) == SECTOR_SIZE)
|
|| ! grub_read (stage1_buffer, SECTOR_SIZE) == SECTOR_SIZE)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
|
@ -1206,8 +1230,11 @@ install_func (char *arg, int flags)
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
grub_close ();
|
||||||
|
|
||||||
/* Open Stage 2. */
|
/* Open Stage 2. */
|
||||||
if (! grub_open (file))
|
is_open = grub_open (file);
|
||||||
|
if (! is_open)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
if (! new_drive)
|
if (! new_drive)
|
||||||
|
@ -1371,6 +1398,8 @@ install_func (char *arg, int flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
|
if (is_open)
|
||||||
|
grub_close ();
|
||||||
|
|
||||||
disk_read_hook = 0;
|
disk_read_hook = 0;
|
||||||
|
|
||||||
|
@ -1864,8 +1893,13 @@ setup_func (char *arg, int flags)
|
||||||
/* Check for stage1 and stage2. We hardcode the filenames, so
|
/* Check for stage1 and stage2. We hardcode the filenames, so
|
||||||
if the user installed GRUB in a uncommon directory, this never
|
if the user installed GRUB in a uncommon directory, this never
|
||||||
succeed. */
|
succeed. */
|
||||||
if (! grub_open (stage1) || ! grub_open (stage2))
|
if (! grub_open (stage1))
|
||||||
goto fail;
|
goto fail;
|
||||||
|
grub_close ();
|
||||||
|
|
||||||
|
if (! grub_open (stage2))
|
||||||
|
goto fail;
|
||||||
|
grub_close ();
|
||||||
|
|
||||||
/* If the drive where stage2 resides is a hard disk, try to use a
|
/* If the drive where stage2 resides is a hard disk, try to use a
|
||||||
Stage 1.5. */
|
Stage 1.5. */
|
||||||
|
@ -1882,6 +1916,7 @@ setup_func (char *arg, int flags)
|
||||||
/* OK, check if the Stage 1.5 exists. */
|
/* OK, check if the Stage 1.5 exists. */
|
||||||
if (grub_open (stage1_5_map[i].name))
|
if (grub_open (stage1_5_map[i].name))
|
||||||
{
|
{
|
||||||
|
grub_close ();
|
||||||
grub_strcpy (config_file, stage2);
|
grub_strcpy (config_file, stage2);
|
||||||
grub_strcpy (stage2, stage1_5_map[i].name);
|
grub_strcpy (stage2, stage1_5_map[i].name);
|
||||||
|
|
||||||
|
@ -2038,6 +2073,7 @@ testload_func (char *arg, int flags)
|
||||||
|
|
||||||
grub_printf ("Max is 0x10ac0: i=0x%x, filepos=0x%x\n", i, filepos);
|
grub_printf ("Max is 0x10ac0: i=0x%x, filepos=0x%x\n", i, filepos);
|
||||||
disk_read_hook = 0;
|
disk_read_hook = 0;
|
||||||
|
grub_close ();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -42,23 +42,23 @@ struct fsys_entry fsys_table[NUM_FSYS + 1] =
|
||||||
{
|
{
|
||||||
/* TFTP should come first because others don't handle net device. */
|
/* TFTP should come first because others don't handle net device. */
|
||||||
# ifdef FSYS_TFTP
|
# ifdef FSYS_TFTP
|
||||||
{"tftp", tftp_mount, tftp_read, tftp_dir},
|
{"tftp", tftp_mount, tftp_read, tftp_dir, tftp_close},
|
||||||
# endif
|
# endif
|
||||||
# ifdef FSYS_FAT
|
# ifdef FSYS_FAT
|
||||||
{"fat", fat_mount, 0, fat_dir},
|
{"fat", fat_mount, 0, fat_dir, 0},
|
||||||
# endif
|
# endif
|
||||||
# ifdef FSYS_EXT2FS
|
# ifdef FSYS_EXT2FS
|
||||||
{"ext2fs", ext2fs_mount, ext2fs_read, ext2fs_dir},
|
{"ext2fs", ext2fs_mount, ext2fs_read, ext2fs_dir, 0},
|
||||||
# endif
|
# endif
|
||||||
# ifdef FSYS_MINIX
|
# ifdef FSYS_MINIX
|
||||||
{"minix", minix_mount, minix_read, minix_dir},
|
{"minix", minix_mount, minix_read, minix_dir, 0},
|
||||||
# endif
|
# endif
|
||||||
/* XX FFS should come last as it's superblock is commonly crossing tracks
|
/* XX FFS should come last as it's superblock is commonly crossing tracks
|
||||||
on floppies from track 1 to 2, while others only use 1. */
|
on floppies from track 1 to 2, while others only use 1. */
|
||||||
# ifdef FSYS_FFS
|
# ifdef FSYS_FFS
|
||||||
{"ffs", ffs_mount, ffs_read, ffs_dir},
|
{"ffs", ffs_mount, ffs_read, ffs_dir, 0},
|
||||||
# endif
|
# endif
|
||||||
{0, 0, 0, 0}
|
{0, 0, 0, 0, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -1391,11 +1391,11 @@ int
|
||||||
grub_read (char *buf, int len)
|
grub_read (char *buf, int len)
|
||||||
{
|
{
|
||||||
/* Make sure "filepos" is a sane value */
|
/* Make sure "filepos" is a sane value */
|
||||||
if ((filepos < 0) | (filepos > filemax))
|
if ((filepos < 0) || (filepos > filemax))
|
||||||
filepos = filemax;
|
filepos = filemax;
|
||||||
|
|
||||||
/* Make sure "len" is a sane value */
|
/* Make sure "len" is a sane value */
|
||||||
if ((len < 0) | (len > (filemax - filepos)))
|
if ((len < 0) || (len > (filemax - filepos)))
|
||||||
len = filemax - filepos;
|
len = filemax - filepos;
|
||||||
|
|
||||||
/* if target file position is past the end of
|
/* if target file position is past the end of
|
||||||
|
@ -1513,3 +1513,18 @@ dir (char *dirname)
|
||||||
return (*(fsys_table[fsys_type].dir_func)) (dirname);
|
return (*(fsys_table[fsys_type].dir_func)) (dirname);
|
||||||
}
|
}
|
||||||
#endif /* STAGE1_5 */
|
#endif /* STAGE1_5 */
|
||||||
|
|
||||||
|
void
|
||||||
|
grub_close (void)
|
||||||
|
{
|
||||||
|
if (fsys_type == NUM_FSYS)
|
||||||
|
{
|
||||||
|
errnum = ERR_FSYS_MOUNT;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fsys_table[fsys_type].close_func == 0)
|
||||||
|
return;
|
||||||
|
|
||||||
|
(*(fsys_table[fsys_type].close_func)) ();
|
||||||
|
}
|
||||||
|
|
|
@ -65,6 +65,7 @@ int minix_dir (char *dirname);
|
||||||
int tftp_mount (void);
|
int tftp_mount (void);
|
||||||
int tftp_read (char *buf, int len);
|
int tftp_read (char *buf, int len);
|
||||||
int tftp_dir (char *dirname);
|
int tftp_dir (char *dirname);
|
||||||
|
void tftp_close (void);
|
||||||
#else
|
#else
|
||||||
#define FSYS_TFTP_NUM 0
|
#define FSYS_TFTP_NUM 0
|
||||||
#endif
|
#endif
|
||||||
|
@ -95,6 +96,7 @@ struct fsys_entry
|
||||||
int (*mount_func) (void);
|
int (*mount_func) (void);
|
||||||
int (*read_func) (char *buf, int len);
|
int (*read_func) (char *buf, int len);
|
||||||
int (*dir_func) (char *dirname);
|
int (*dir_func) (char *dirname);
|
||||||
|
void (*close_func) (void);
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef STAGE1_5
|
#ifdef STAGE1_5
|
||||||
|
|
|
@ -680,6 +680,9 @@ int grub_open (char *filename);
|
||||||
GRUB_OPEN. If LEN is -1, read all the remaining data in the file */
|
GRUB_OPEN. If LEN is -1, read all the remaining data in the file */
|
||||||
int grub_read (char *buf, int len);
|
int grub_read (char *buf, int len);
|
||||||
|
|
||||||
|
/* Close a file. */
|
||||||
|
void grub_close (void);
|
||||||
|
|
||||||
/* List the contents of the directory that was opened with GRUB_OPEN,
|
/* List the contents of the directory that was opened with GRUB_OPEN,
|
||||||
printing all completions. */
|
printing all completions. */
|
||||||
int dir (char *dirname);
|
int dir (char *dirname);
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* GRUB -- GRand Unified Bootloader
|
* GRUB -- GRand Unified Bootloader
|
||||||
* Copyright (C) 1996 Erich Boleyn <erich@uruk.org>
|
* Copyright (C) 1996 Erich Boleyn <erich@uruk.org>
|
||||||
|
@ -29,8 +28,13 @@ cmain (void)
|
||||||
* Here load the true second-stage boot-loader.
|
* Here load the true second-stage boot-loader.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (grub_open (config_file) && grub_read ((char *) 0x8000, -1))
|
if (grub_open (config_file))
|
||||||
|
{
|
||||||
|
grub_close ();
|
||||||
|
|
||||||
|
if (grub_read ((char *) 0x8000, -1))
|
||||||
chain_stage2 (0, 0x8200);
|
chain_stage2 (0, 0x8200);
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If not, then print error message and die.
|
* If not, then print error message and die.
|
||||||
|
|
|
@ -608,6 +608,7 @@ cmain (void)
|
||||||
|
|
||||||
/* Get the pointer to the builtin structure. */
|
/* Get the pointer to the builtin structure. */
|
||||||
builtin = find_command (cmdline);
|
builtin = find_command (cmdline);
|
||||||
|
errnum = 0;
|
||||||
if (! builtin)
|
if (! builtin)
|
||||||
/* Unknown command. Just skip now. */
|
/* Unknown command. Just skip now. */
|
||||||
continue;
|
continue;
|
||||||
|
@ -680,6 +681,8 @@ cmain (void)
|
||||||
config_entries[config_len++] = 0;
|
config_entries[config_len++] = 0;
|
||||||
grub_memmove (config_entries + config_len, menu_entries, menu_len);
|
grub_memmove (config_entries + config_len, menu_entries, menu_len);
|
||||||
menu_entries = config_entries + config_len;
|
menu_entries = config_entries + config_len;
|
||||||
|
|
||||||
|
grub_close ();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! num_entries)
|
if (! num_entries)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue