fix some minor bugs and replace the old manual with the new one.

This commit is contained in:
okuji 1999-10-23 23:58:27 +00:00
parent 4b1ec86348
commit 8ae7fd5f6f
10 changed files with 287 additions and 3167 deletions

View file

@ -1,3 +1,26 @@
1999-10-24 OKUJI Yoshinori <okuji@kuicr.kyoto-u.ac.jp>
The new GRUB manual becomes official.
* docs/grub.texi: Replaced with new-grub.texi.
* docs/new-grub.texi: Removed.
* docs/Makefile.am (grub_TEXINFOS): New variable.
(UNFINISHED_MANUALS): Removed.
(EXTRA_DIST): Deleted $(UNFINISHED_MANUALS).
1999-10-24 OKUJI Yoshinori <okuji@kuicr.kyoto-u.ac.jp>
* stage2/builtins.c (device_func) [!GRUB_UTIL]: Set ERRNUM to
ERR_UNRECOGINIZED and return 1.
(impsprobe_func) [GRUB_UTIL]: Likewise.
(quit_func) [!GRUB_UTIL]: Likewise.
* docs/tutorial.texi: Rename "Device Syntax" to "Filename".
Added many cross-references.
* docs/new-grub.texi: "Device Syntax" -> "Filename".
* docs/user-ref.texi: Fix typos and added some cross-references.
* docs/prog-ref.texi: Likewise.
* docs/appendices.texi: Likewise.
1999-10-23 OKUJI Yoshinori <okuji@kuicr.kyoto-u.ac.jp> 1999-10-23 OKUJI Yoshinori <okuji@kuicr.kyoto-u.ac.jp>
* stage2/builtins.c (map_func): If BIOS_DRIVE_MAP already * stage2/builtins.c (map_func): If BIOS_DRIVE_MAP already

2
NEWS
View file

@ -19,6 +19,8 @@ New in 0.5.94:
chain-load some foolish operating systems (such as DOS) even if such chain-load some foolish operating systems (such as DOS) even if such
an operating system resides at a non-first drive. an operating system resides at a non-first drive.
* The command "keycode" maps a key code to another. * The command "keycode" maps a key code to another.
* The GRUB manual is rewritten, and now consists of three parts and
appendices.
New in 0.5.93: New in 0.5.93:
* ELF format of FreeBSD kernel is supported. * ELF format of FreeBSD kernel is supported.

View file

@ -1,4 +1,6 @@
info_TEXINFOS = grub.texi multiboot.texi info_TEXINFOS = grub.texi multiboot.texi
grub_TEXINFOS = tutorial.texi user-ref.texi prog-ref.texi \
appendices.texi
EXAMPLES = boot.S kernel.c multiboot.h EXAMPLES = boot.S kernel.c multiboot.h
multiboot_TEXINFOS = boot.S.texi kernel.c.texi multiboot.h.texi multiboot_TEXINFOS = boot.S.texi kernel.c.texi multiboot.h.texi
man_MANS = grub.8 mbchk.1 man_MANS = grub.8 mbchk.1
@ -6,12 +8,8 @@ HELP2MAN = help2man
SRC2TEXI = src2texi SRC2TEXI = src2texi
noinst_SCRIPTS = $(HELP2MAN) $(SRC2TEXI) noinst_SCRIPTS = $(HELP2MAN) $(SRC2TEXI)
# The unfinished manuals.
UNFINISHED_MANUALS = new-grub.texi tutorial.texi user-ref.texi \
prog-ref.texi appendices.texi
EXTRA_DIST = menu.lst $(man_MANS) $(noinst_SCRIPTS) \ EXTRA_DIST = menu.lst $(man_MANS) $(noinst_SCRIPTS) \
$(EXAMPLES) $(multiboot_TEXINFOS) $(UNFINISHED_MANUALS) $(EXAMPLES) $(multiboot_TEXINFOS)
# Cancel the rule %.texi -> %. This rule may confuse make to determine # Cancel the rule %.texi -> %. This rule may confuse make to determine
# the dependecies. # the dependecies.

View file

@ -13,9 +13,9 @@ Technically speaking, GNU GRUB has many features that are not
seen in the original GRUB. For example, GNU GRUB can be installed on seen in the original GRUB. For example, GNU GRUB can be installed on
UNIX-like operating system (i.e. GNU/Linux) via the grub shell UNIX-like operating system (i.e. GNU/Linux) via the grub shell
@file{/sbin/grub}, it supports Logical Block Address (LBA) mode that @file{/sbin/grub}, it supports Logical Block Address (LBA) mode that
solves the 1024 cylinders problem, and TAB completes a filename when solves the 1024 cylinders problem, and @kbd{@key{TAB}} completes a
it's unique. Of course, many bug fixes are done as well, so it is filename when it's unique. Of course, many bug fixes are done as well,
recommended to use GNU GRUB. so it is recommended to use GNU GRUB.
@item Can GRUB boot my operating system from over 8GB hard disks? @item Can GRUB boot my operating system from over 8GB hard disks?
@ -72,13 +72,13 @@ EOT
@item GRUB does not recognize my GNU/Hurd partition. @item GRUB does not recognize my GNU/Hurd partition.
I don't know why, but the authors of FDISK programs have assigned the I don't know why, but the authors of FDISK programs have assigned the
partition type 0x63 to GNU Hurd incorrectly. A partition type should partition type @samp{0x63} to GNU Hurd incorrectly. A partition type
mean what format is used in the partition, such as filesystem and BSD should mean what format is used in the partition, such as filesystem and
slices, and should not be used to represent what operating system owns BSD slices, and should not be used to represent what operating system
the partition. So use 0x83 if the partition contains ext2fs owns the partition. So use @samp{0x83} if the partition contains ext2fs
filesystem, and use 0xA5 if the partition contains ffs fielsystem, filesystem, and use @samp{0xA5} if the partition contains ffs
whether the partition owner is Hurd or not. We will use 0x63 for GNU fielsystem, whether the partition owner is Hurd or not. We will use
Hurd filesystem that has not been implemented yet. @samp{0x63} for GNU Hurd filesystem that has not been implemented yet.
@item I've installed a recent version of binutils, but GRUB still crashes. @item I've installed a recent version of binutils, but GRUB still crashes.
@ -112,7 +112,9 @@ there is a serious bug in GRUB. @xref{Reporting bugs}.
@item Why doesn't Linux (FreeBSD, NetBSD, etc.) become Multiboot-compliant? @item Why doesn't Linux (FreeBSD, NetBSD, etc.) become Multiboot-compliant?
Please ask the maintainers. If all free kernels were Please ask the maintainers. If all free kernels were
Multiboot-compliant, the world would be an utopia@dots{} Multiboot-compliant (@pxref{Top, Multiboot Specification, Motivation,
multiboot, The Multiboot Specification}), the world would be an
utopia@dots{}
@end table @end table
@ -145,13 +147,16 @@ instructions on how to build and install GRUB, but you should be able to
just do: just do:
@example @example
@group
$ cd grub-@value{VERSION} $ cd grub-@value{VERSION}
$ ./configure $ ./configure
$ make install $ make install
@end group
@end example @end example
This will install the grub shell @file{grub}, the Multiboot checker This will install the grub shell @file{grub} (@pxref{Invoking the grub
@file{mbchk}, and the GRUB images It will also install the GRUB manual. shell}), the Multiboot checker @file{mbchk} (@pxref{Invoking mbchk}),
and the GRUB images It will also install the GRUB manual.
Also, you can obtain the latest version from the CVS. Use the repository Also, you can obtain the latest version from the CVS. Use the repository
@code{:pserver:anoncvs@@anoncvs.gnu.org:/gd/gnu/anoncvsroot} and the @code{:pserver:anoncvs@@anoncvs.gnu.org:/gd/gnu/anoncvsroot} and the
@ -159,9 +164,11 @@ module @code{grub}. The password for anoncvs is empty. So the
instruction is: instruction is:
@example @example
@group
$ cvs -d :pserver:anoncvs@@anoncvs.gnu.org:/gd/gnu/anoncvsroot login $ cvs -d :pserver:anoncvs@@anoncvs.gnu.org:/gd/gnu/anoncvsroot login
Password: @key{ENTER} Password: @key{ENTER}
$ cvs -d :pserver:anoncvs@@anoncvs.gnu.org:/gd/gnu/anoncvsroot co grub $ cvs -d :pserver:anoncvs@@anoncvs.gnu.org:/gd/gnu/anoncvsroot co grub
@end group
@end example @end example
Get the recent version of GNU Automake from the CVS to regenerate Get the recent version of GNU Automake from the CVS to regenerate

File diff suppressed because it is too large Load diff

View file

@ -1,165 +0,0 @@
\input texinfo
@c -*-texinfo-*-
@c %**start of header
@c @setfilename grub.info
@settitle GRUB Manual
@c %**end of header
@c This new manual is under development. When it will be completed, I'll
@c replace it with the old one. If you'd like to help it, please let me
@c know. - okuji
@include version.texi
@c Unify all our little indices for now.
@syncodeindex fn cp
@syncodeindex vr cp
@syncodeindex ky cp
@syncodeindex pg cp
@syncodeindex tp cp
@dircategory Kernel
@direntry
* GRUB: (grub). The GRand Unified Bootloader
@end direntry
@dircategory Kernel
@direntry
* mbchk: (grub)Invoking mbchk. Check for the format of a Multiboot kernel
@end direntry
@setchapternewpage off
@ifinfo
Copyright @copyright{} 1996 Erich Boleyn
Copyright @copyright{} 1999 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
are preserved on all copies.
@ignore
Permission is granted to process this file through TeX and print the
results, provided the printed document carries a copying permission
notice identical to this one except for the removal of this paragraph
(this paragraph not being relevant to the printed manual).
@end ignore
Permission is granted to copy and distribute modified versions of this
manual under the conditions for verbatim copying, provided also that
the entire resulting derived work is distributed under the terms of a
permission notice identical to this one.
Permission is granted to copy and distribute translations of this manual
into another language, under the above conditions for modified versions.
@end ifinfo
@titlepage
@sp 10
@title The GRUB Manual
@author Gordon Matzigkeit
@author OKUJI Yoshinori
@c The following two commands start the copyright page.
@page
@vskip 0pt plus 1filll
@vskip 0pt plus 1filll
Copyright @copyright{} 1996 Erich Boleyn
Copyright @copyright{} 1999 Free Software Foundation, Inc.
Permission is granted to make and distribute verbatim copies of
this manual provided the copyright notice and this permission notice
are preserved on all copies.
Permission is granted to copy and distribute modified versions of this
manual under the conditions for verbatim copying, provided that the entire
resulting derived work is distributed under the terms of a permission
notice identical to this one.
Permission is granted to copy and distribute translations of this manual
into another language, under the above conditions for modified versions,
except that this permission notice may be stated in a translation approved
by Free Software Foundation.
@end titlepage
@finalout
@headings double
@c The Top node should not appear in TeX.
@ifnottex
@node Top
@top GRUB
This file documents GNU GRUB, the Grand Unified Bootloader. This
edition documents version @value{VERSION}.
@end ifnottex
@menu
Part I: The Tutorial Manual
* Overview:: Starting to use GRUB
* Device Syntax:: How to specify a device
* Installation:: How to install GRUB on your drive
* Boot:: How to boot your operating systems
* Configuration:: Writing your configuration file
Part II: The User Reference Manual
* Introduction:: Capturing the spirit of GRUB
* Filesystem:: Filesystem syntax and semantics
* Interface:: The menu and the command-line
* Command:: The list of available builtin commands
* Troubleshooting:: Error messages produced by GRUB
* Invoking the grub shell:: How to use the grub shell
* Invoking mbchk:: How to use the Multiboot checker
Part III: The Programmer Reference Manual
* Hacking:: Implementation details
* Memory map:: The memory map of various components
* Embedded data:: Embedded variables in GRUB
* Filesystem interface:: The generic interface for the fs code
* Bootstrap tricks:: The bootstrap mechanism used in GRUB
* Memory detection:: How to detect all installed @sc{ram}
* Low-level disk I/O:: INT 13H disk I/O interrupts
* MBR:: The structure of Master Boot Record
* Partition table:: The format of partition table
Appendices and Indices
* FAQ:: Frequently asked questions
* Obtaining and Building GRUB:: How to obtain and build GRUB
* Reporting bugs:: Where you should send a bug report
* Index::
@end menu
@iftex
@page
@unnumbered{Part I: The Tutorial Manual}
@end iftex
@include tutorial.texi
@iftex
@page
@unnumbered{Part II: The User Reference Manual}
@end iftex
@include user-ref.texi
@iftex
@page
@unnumbered{Part III: The Programmer Reference Manual}
@end iftex
@include prog-ref.texi
@iftex
@page
@unnumbered{Appendices and Indices}
@end iftex
@include appendices.texi
@contents
@bye

View file

@ -161,7 +161,7 @@ file. It will, by default, look in the @dfn{install_partition} of the
disk GRUB was loaded from, though one can use any valid GRUB filesystem disk GRUB was loaded from, though one can use any valid GRUB filesystem
string, up to and including making it look on other disks. string, up to and including making it look on other disks.
The bootloader itself doesn't search for the end of The boot loader itself doesn't search for the end of
@dfn{version_string}, it simply knows where @dfn{config_file} is, so the @dfn{version_string}, it simply knows where @dfn{config_file} is, so the
beginning of the string cannot be moved after compile-time. This should beginning of the string cannot be moved after compile-time. This should
be OK, since the @dfn{version_string} is meant to be static. be OK, since the @dfn{version_string} is meant to be static.
@ -291,8 +291,8 @@ distinct components, @dfn{stage1} and @dfn{stage2} (and optionally
@dfn{stage1.5}). @xref{Memory map}, for more information. @dfn{stage1.5}). @xref{Memory map}, for more information.
We embed @dfn{stage1} in a MBR or in the boot sector of a partition We embed @dfn{stage1} in a MBR or in the boot sector of a partition
table, and place @dfn{stage2} in a filesystem. The optional , and place @dfn{stage2} in a filesystem. The optional
@dfn{stage1.5} can be installed in a filesystem, in the @dfn{bootloader} @dfn{stage1.5} can be installed in a filesystem, in the @dfn{boot loader}
area in a FFS, and in the sectors right after a MBR, because area in a FFS, and in the sectors right after a MBR, because
@dfn{stage1.5} is enough small and the sectors right after a MBR is @dfn{stage1.5} is enough small and the sectors right after a MBR is
normally an unused region. The size of this region is the number of normally an unused region. The size of this region is the number of
@ -310,7 +310,7 @@ loads the rest. The flow of @dfn{stage1} is:
@enumerate @enumerate
@item @item
Initialize the symtem briefly. Initialize the system briefly.
@item @item
Detect the geometry and the accessing mode of the @dfn{loading drive}. Detect the geometry and the accessing mode of the @dfn{loading drive}.

View file

@ -17,17 +17,27 @@ without recording the position of your kernel on the disk.
Therefore, you have to specify the drive/partition where your kernel Therefore, you have to specify the drive/partition where your kernel
resides and the filename at hand. If you don't want to type the resides and the filename at hand. If you don't want to type the
drive and the filename every time, the menu interface will help drive and the filename every time, the menu interface (@pxref{Menu})
you. GRUB loads a configuration file if found and provides the menu so will help you. GRUB loads a configuration file (@pxref{Configuration})
that you can select which OS is booted at ease. Of course, you can enter if found and provides the menu so that you can select which OS is booted
the command-line interface whenever you like. at ease. Of course, you can enter the command-line interface
(@pxref{Command line}) whenever you like.
In the following chapters, we teach you how to specify your drive, how In the following chapters, we teach you how to specify a
to install GRUB on your drive, and how to boot your OSes, step by step. drive/partition and a filename (@pxref{Filename}), how to install GRUB
on your drive (@pxref{Installation}), and how to boot your OSes
(@pxref{Boot}), step by step.
@node Device Syntax @c @node Fundamentals
@chapter Device Syntax @c @chapter Introduction to the technical basic knowledge
@c
@c I'm going to include Bill White's documentation here, once his
@c copyright problem will be solved.
@node Filename
@chapter Filename
Now is the time when you should learn the device syntax used in GRUB, so Now is the time when you should learn the device syntax used in GRUB, so
that you can specify a drive/partition. See this example: that you can specify a drive/partition. See this example:
@ -37,8 +47,9 @@ that you can specify a drive/partition. See this example:
@end example @end example
This means the first floppy disk drive. GRUB requires that the device This means the first floppy disk drive. GRUB requires that the device
name is enclosed with @samp{(} and @samp{)}. In this case, GRUB name is enclosed with @samp{(} and @samp{)}. The number @samp{0} is the
uses the whole of the floppy disk. drive number, which is counted from @emph{zero}. In this case, GRUB uses
the whole of the floppy disk.
@example @example
(hd0,1) (hd0,1)
@ -52,6 +63,15 @@ partition numbers are counted from @emph{zero} but not from one. In this
case, GRUB uses the partition of the disk instead of the whole of the case, GRUB uses the partition of the disk instead of the whole of the
disk. disk.
@example
(hd0,4)
@end example
This specifies the first @dfn{extended partition} of the first hard disk
drive. Note that the partition numbers for extended partitions are
counted from @samp{4}, whether your disks has four primary partitions or
less.
@example @example
(hd1,a) (hd1,a)
@end example @end example
@ -63,13 +83,14 @@ searches for the first @sc{pc} slice which has a BSD @samp{a} partition.
Note that GRUB does @emph{not} distinguish IDE from SCSI; just count the Note that GRUB does @emph{not} distinguish IDE from SCSI; just count the
drive numbers from zero. Normally, any IDE drive number is less than any drive numbers from zero. Normally, any IDE drive number is less than any
SCSI drive number, but this is not correct if you exchange the boot SCSI drive number, but this is not true if you exchange the boot
sequence between IDE and SCSI in your BIOS. But do not worry. In the sequence between IDE and SCSI in your BIOS. But do not worry. In the
GRUB command-line, you can always use the @key{TAB} completion which GRUB command-line (@pxref{Command line}), you can always use the
displays the list of drives, the list of the partitions of a drive, or @key{TAB} completion which displays the list of drives, the list of the
the list of the filenames on a partition, depending on where you push partitions of a drive, or the list of the filenames on a partition,
the @key{TAB} key in the command-line. So it should be possible to depending on where you push the @key{TAB} key in the command-line. So it
determine which drive and which partition are what you seek for. should be possible to determine which drive and which partition are what
you seek for.
Now the question is how to specify a file. Again, see this example: Now the question is how to specify a file. Again, see this example:
@ -79,10 +100,10 @@ Now the question is how to specify a file. Again, see this example:
This specifies the file whose name is @samp{vmlinuz} on the first This specifies the file whose name is @samp{vmlinuz} on the first
partition of the first hard disk drive. Isn't that easy? All you should partition of the first hard disk drive. Isn't that easy? All you should
do is just type the absolute filename. If you are tired of typing the do is type the absolute filename. If you are tired of typing the
whole of the filename, press the @key{TAB} key. @key{TAB} completes the whole of the filename, press the @key{TAB} key. @kbd{@key{TAB}}
filename if it is unique. Otherwise, it displays the list of the completes the filename if it is unique. Otherwise, it displays the list
candidates. of the candidates.
OK, the next chapter introduces how to install GRUB on your drive. OK, the next chapter introduces how to install GRUB on your drive.
@ -93,11 +114,12 @@ OK, the next chapter introduces how to install GRUB on your drive.
At first, install GRUB by @code{make install} (@pxref{Obtaining and At first, install GRUB by @code{make install} (@pxref{Obtaining and
Building GRUB}) or by the GRUB package for your OS. If this is done, Building GRUB}) or by the GRUB package for your OS. If this is done,
let's install GRUB on your drive. There are two ways to install GRUB: let's install GRUB on your drive. There are two ways to install GRUB:
using the grub shell on a UNIX-like OS and using the native Stage 2. The using the grub shell (@pxref{Invoking the grub shell}) on a UNIX-like OS
two ways are almost same, but the main difference is that the grub shell and using the native Stage 2. The two ways are almost the same, but the
might probe a wrong BIOS drive on a UNIX-like OS. If you install GRUB on main difference is that the grub shell might probe a wrong BIOS drive on
a UNIX-like OS, make sure that you have a boot floppy disk so that you a UNIX-like OS. If you install GRUB on a UNIX-like OS, make sure that
can rescue your computer when it crashes. you have a boot floppy disk so that you can rescue your computer when it
crashes.
Anyhow, copy your GRUB images (@file{stage1}, @file{stage2}, etc.) to Anyhow, copy your GRUB images (@file{stage1}, @file{stage2}, etc.) to
the directory @file{/boot/grub} before staring to install the directory @file{/boot/grub} before staring to install
@ -146,13 +168,14 @@ DOS).
OK, now reboot your computer with a GRUB boot floppy inserted if you OK, now reboot your computer with a GRUB boot floppy inserted if you
decide to install GRUB in the native environment. That's definitely decide to install GRUB in the native environment. That's definitely
desirable. However, if you don't want to reboot your computer, run the desirable. However, if you don't want to reboot your computer, run the
program @file{/sbin/grub}. program @file{/sbin/grub} (@pxref{Invoking the grub shell}).
In both, GRUB will show the command-line interface. First, set the In both, GRUB will show the command-line interface (@pxref{Command
GRUB's @dfn{root device}@footnote{Note that GRUB's root device is line}). First, set the GRUB's @dfn{root device}@footnote{Note that
not your OS's root partition; if you need to specify a root partition GRUB's root device is not your OS's root partition; if you need to
for your OS, add the argument into the command @command{kernel}.} to the specify a root partition for your OS, add the argument into the command
partition which has your GRUB images, like this: @command{kernel}.} to the partition which has your GRUB images, like
this:
@example @example
grub> root (hd0,0) grub> root (hd0,0)
@ -166,7 +189,7 @@ grub> find /boot/grub/stage1
@end example @end example
This will search for the filename @file{/boot/grub/stage1} and show the This will search for the filename @file{/boot/grub/stage1} and show the
device which contains the images. devices which contain the image.
If you set the root device correctly, run the command If you set the root device correctly, run the command
@command{setup}: @command{setup}:
@ -175,9 +198,10 @@ If you set the root device correctly, run the command
grub> setup (hd0) grub> setup (hd0)
@end example @end example
This command will install GRUB on the MBR in the first drive. If you This command will install GRUB on the MBR (@pxref{MBR}) in the first
want to install GRUB into the @dfn{boot sector} of a partition instead drive. If you want to install GRUB into the @dfn{boot sector} of a
of the MBR, specify a partition into which you want to install GRUB: partition instead of the MBR, specify a partition into which you want to
install GRUB:
@example @example
grub> setup (hd0,0) grub> setup (hd0,0)
@ -217,18 +241,18 @@ steps:
@enumerate @enumerate
@item @item
Set GRUB's root device to the drive where the OS images is stored by Set GRUB's root device to the drive where the OS images are stored by
the command @command{root}. the command @command{root} (@pxref{Command}).
@item @item
Load the kernel image by the command @command{kernel}. Load the kernel image by the command @command{kernel} (@pxref{Command}).
@item @item
Load the modules by the command @command{module} or Load the modules by the command @command{module} or
@command{modulenounzip} as you need. @command{modulenounzip} as you need (@pxref{Command}).
@item @item
Run the command @command{boot}. Run the command @command{boot} (@pxref{Command}).
@end enumerate @end enumerate
@ -257,7 +281,8 @@ And, finally, run the command @command{boot}.
@section Booting GNU/Linux @section Booting GNU/Linux
It is relatively easy to boot GNU/Linux from GRUB, because booting It is relatively easy to boot GNU/Linux from GRUB, because booting
GNU/Linux somewhat resembles booting a Multiboot-compliant OS. GNU/Linux somewhat resembles booting a Multiboot-compliant OS
(@pxref{Booting a Multiboot-compliant OS}).
First, set GRUB's root device to the same drive as First, set GRUB's root device to the same drive as
GNU/Linux's. Probably @code{find /vmlinuz} or such will help GNU/Linux's. Probably @code{find /vmlinuz} or such will help
@ -270,7 +295,7 @@ grub> kernel /vmlinuz root=/dev/hda1
@end example @end example
If you need to specify some kernel parameters, just append them to the If you need to specify some kernel parameters, just append them to the
command. An example is to set @samp{vga} to @samp{ext}: command. An example is to set @option{vga} to @samp{ext}:
@example @example
grub> kernel /vmlinuz root=/dev/hda1 vga=ext grub> kernel /vmlinuz root=/dev/hda1 vga=ext
@ -314,7 +339,7 @@ FIXME
@node Chain-loading @node Chain-loading
@section Chain-loading @section Chain-loading
If you want to boot a unsupported operating system (i.e. Windows 95), If you want to boot an unsupported operating system (i.e. Windows 95),
chain-load the boot loader for the operating system. Normally, the boot chain-load the boot loader for the operating system. Normally, the boot
loader is embedded in the @dfn{boot sector} of the partition on which loader is embedded in the @dfn{boot sector} of the partition on which
the operating system is installed. the operating system is installed.
@ -326,7 +351,7 @@ First, set GRUB's root device to the partition by the command
grub> rootnoverify (hd0,0) grub> rootnoverify (hd0,0)
@end example @end example
Second, set the @dfn{active} flags in the partition by the command Second, set the @dfn{active} flag in the partition by the command
@command{makeactive}: @command{makeactive}:
@example @example
@ -340,18 +365,33 @@ grub> chainloader +1
@end example @end example
Do not care about what @samp{+1} is. We describe it later in Do not care about what @samp{+1} is. We describe it later in
@xref{Filesystem}. If this succeeds, run the command @command{boot}. @ref{Filesystem}. If this succeeds, run the command @command{boot}.
However, some tricks will be necessary if you have installed DOS or
Windows on a non-first hard disk, because they cannot boot any disks
except for the first one. The solution is to use the command
@command{map} (@pxref{Command}), like this:
@example
@group
grub> map (hd0) (hd1)
grub> map (hd1) (hd0)
@end group
@end example
This performs the @dfn{logical} exchange between your first disk and
your second one.
@node Configuration @node Configuration
@chapter Configuration @chapter Configuration
Probably it is bothersome to type the commands to boot your OS. So Probably it is bothersome to type the commands to boot your OS. So
GRUB provides the menu interface so that you can just select an item GRUB provides the menu interface (@pxref{Menu}) so that you can just
from the menu. select an item from the menu.
To enable the menu, write a configuration file and save it in To enable the menu, write a configuration file and save it in
@file{/boot/grub/menu.lst}. Here is the sample configuration file: @file{/boot/grub/menu.lst}. Here is a sample configuration file:
@example @example
@include menu.lst @include menu.lst
@ -366,10 +406,10 @@ The argument for the command @command{title} is used to display the
message about the entry. Since @command{title} displays the argument as message about the entry. Since @command{title} displays the argument as
it is, you can write any words as you like. it is, you can write any words as you like.
You can write the menu interface specific commands before any You can write the menu interface specific commands (@pxref{Menu-specific
@command{title}. There are several commands you can use in there, but we commands}) before any @command{title}. There are several commands you
describe a few of them. The complete descriptions can be found in can use in there, but we describe a few of them. The complete
@xref{Command}. descriptions can be found in @ref{Command}.
The command @command{default} specifies which entry will be selected The command @command{default} specifies which entry will be selected
when you do not select an entry explicitly. The argument is the entry when you do not select an entry explicitly. The argument is the entry
@ -380,16 +420,16 @@ The default entry will be executed when you do not select any entry
during certain seconds, which is defined by the command during certain seconds, which is defined by the command
@command{timeout}. So in the example above, the timeout is 30 seconds. @command{timeout}. So in the example above, the timeout is 30 seconds.
The command @command{fallback} is used if the default entry fails. If The command @command{fallback} is used only if the default entry
GRUB executes the default entry and it fails, then it executes the fails. If GRUB executes the default entry and it fails, then it executes
@dfn{fallback} entry. The argument is the same meaning as the one for the @dfn{fallback} entry. The argument is the same meaning as the one
@command{default}. This command is rarely used. for @command{default}. This command is rarely used.
In the last entry, @command{color} is used. This command is somewhat In the last entry, @command{color} is used. This command is somewhat
special because it can be used both in the command-line and in the special because it can be used both in the command-line and in the
menu. GRUB has such several commands. The command @command{color} menu (@pxref{General commands}). GRUB has such several commands. The
changes the menu colors. It is best to run the command actually to command @command{color} changes the menu colors. It is best to run the
understand what happens. command actually to understand what happens.
We hope that you now understand how to use GRUB. To understand more We hope that you now understand how to use GRUB. To understand more
about GRUB, see the User Reference Manual (@pxref{Introduction}). Have about GRUB, see the User Reference Manual (@pxref{Introduction}). Have

View file

@ -8,7 +8,7 @@ Manual (@pxref{Hacking}).
@menu @menu
* History:: From maggot to house fly. * History:: From maggot to house fly.
* Features:: How GRUB is different. * Features:: How GRUB is different.
* Role of a bootloader:: Judging a system by its bootloader. * Role of a boot loader:: Judging a system by its boot loader.
@end menu @end menu
@ -17,15 +17,15 @@ Manual (@pxref{Hacking}).
GRUB originated in 1995 when Erich Boleyn was trying to boot the GNU GRUB originated in 1995 when Erich Boleyn was trying to boot the GNU
Hurd with the University of Utah's Mach 4 microkernel (now known as GNU Hurd with the University of Utah's Mach 4 microkernel (now known as GNU
Mach). Erich and Brian Ford designed the Multiboot Standard Mach). Erich and Brian Ford designed the Multiboot Specification
(@pxref{Top, Multiboot Specification, Motivation, multiboot, The Multiboot (@pxref{Top, Multiboot Specification, Motivation, multiboot, The Multiboot
Specification}), because they were determined not to add to the large Specification}), because they were determined not to add to the large
number of mutually-incompatible PC boot methods. number of mutually-incompatible PC boot methods.
Erich then began modifying the FreeBSD bootloader so that it would Erich then began modifying the FreeBSD boot loader so that it would
understand Multiboot. He soon realized that it would be a lot easier understand Multiboot. He soon realized that it would be a lot easier
to write his own bootloader from scratch than to keep working on the to write his own boot loader from scratch than to keep working on the
FreeBSD bootloader, and so GRUB was born. FreeBSD boot loader, and so GRUB was born.
Erich added many features to GRUB, but other priorities prevented him Erich added many features to GRUB, but other priorities prevented him
from keeping up with the demands of its quickly-expanding user base. In from keeping up with the demands of its quickly-expanding user base. In
@ -59,7 +59,7 @@ supported via a chain-loading function.
Except for specific compatibility modes (chain-loading and the Linux Except for specific compatibility modes (chain-loading and the Linux
@dfn{piggyback} format), all kernels will be started in much the same @dfn{piggyback} format), all kernels will be started in much the same
state as in the Multiboot Standard. Only kernels loaded at 1 megabyte state as in the Multiboot Specification. Only kernels loaded at 1 megabyte
or above are presently supported. Any attempt to load below that or above are presently supported. Any attempt to load below that
boundary will simply result in immediate failure and an error message boundary will simply result in immediate failure and an error message
reporting the problem. reporting the problem.
@ -73,12 +73,12 @@ that GRUB supports):
Supports many of the @dfn{a.out} variants plus @dfn{ELF}. Symbol Supports many of the @dfn{a.out} variants plus @dfn{ELF}. Symbol
tables are also loaded. tables are also loaded.
@item Supports Non-Multiboot Kernels @item Support Non-Multiboot Kernels
Supports many of the various free 32-bit kernels that lack Multiboot Supports many of the various free 32-bit kernels that lack Multiboot
compliance (primarily FreeBSD, NetBSD, OpenBSD, and compliance (primarily FreeBSD, NetBSD, OpenBSD, and
Linux). Chain-loading of other bootloaders is also supported. Linux). Chain-loading of other boot loaders is also supported.
@item Loads Multiples Modules @item Load Multiples Modules
GRUB fully supports the Multiboot feature of loading multiple modules. GRUB fully supports the Multiboot feature of loading multiple modules.
@item Configuration File @item Configuration File
@ -128,12 +128,12 @@ Supports reading data from any or all floppy or hard disk(s) recognized
by the BIOS, independent of the setting of the root device. by the BIOS, independent of the setting of the root device.
@item Independent of Drive Geometry Translation @item Independent of Drive Geometry Translation
Unlike many other bootloaders, GRUB makes the particular drive Unlike many other boot loaders, GRUB makes the particular drive
translation irrelevant. A drive installed and running with one translation irrelevant. A drive installed and running with one
translation may be converted to another translation without any adverse translation may be converted to another translation without any adverse
effects or changes in GRUB's configuration. effects or changes in GRUB's configuration.
@item Detects All Installed @sc{ram} @item Detect All Installed @sc{ram}
GRUB can generally find all the installed @sc{ram} on a PC-compatible GRUB can generally find all the installed @sc{ram} on a PC-compatible
machine. It uses an advanced BIOS query technique for finding all machine. It uses an advanced BIOS query technique for finding all
memory regions (@pxref{Memory detection}). As described on the Multiboot memory regions (@pxref{Memory detection}). As described on the Multiboot
@ -141,7 +141,7 @@ Specification (@pxref{Top, Multiboot Specification, Motivation,
multiboot, The Multiboot Specification}), not all kernels make use of multiboot, The Multiboot Specification}), not all kernels make use of
this information, but GRUB provides it for those who do. this information, but GRUB provides it for those who do.
@item Supports Logical Block Address Mode @item Support Logical Block Address Mode
In traditional disk calls (called @dfn{CHS mode}), there is a geometry In traditional disk calls (called @dfn{CHS mode}), there is a geometry
translation problem, that is, the BIOS cannot access over 1024 translation problem, that is, the BIOS cannot access over 1024
cylinders, so the accessible space is limited to at least 508 MB and to cylinders, so the accessible space is limited to at least 508 MB and to
@ -161,8 +161,8 @@ NEC PC-98xx series. See
for more information.} for more information.}
@node Role of a bootloader @node Role of a boot loader
@section The role of a bootloader @section The role of a boot loader
The following is a quotation from Gordon Matzigkeit, a GRUB fanatic: The following is a quotation from Gordon Matzigkeit, a GRUB fanatic:
@ -176,7 +176,7 @@ their GNU operating systems ``Linux systems.''
I, personally, believe that this is a grave injustice, because the I, personally, believe that this is a grave injustice, because the
@emph{boot loader} is the most important software of all. I used to @emph{boot loader} is the most important software of all. I used to
refer to the above systems as either ``LILO''@footnote{The LInux LOader, refer to the above systems as either ``LILO''@footnote{The LInux LOader,
a bootloader that everybody uses, but nobody likes.} or ``GRUB'' a boot loader that everybody uses, but nobody likes.} or ``GRUB''
systems. systems.
Unfortunately, nobody ever understood what I was talking about; now I Unfortunately, nobody ever understood what I was talking about; now I
@ -200,7 +200,8 @@ GRUB uses a special syntax for specifying disk drives which can be
accessed by BIOS. Because of BIOS limitations, GRUB cannot distinguish accessed by BIOS. Because of BIOS limitations, GRUB cannot distinguish
between IDE, ESDI, SCSI, or others. You must know yourself which BIOS between IDE, ESDI, SCSI, or others. You must know yourself which BIOS
device is equivalent to which OS device. Normally, that will be clear if device is equivalent to which OS device. Normally, that will be clear if
you see the files in a device or use the command @command{find}. you see the files in a device or use the command @command{find}
(@pxref{Command}).
@menu @menu
* Device syntax:: How to specify devices * Device syntax:: How to specify devices
@ -230,8 +231,9 @@ which is a BIOS drive number, so the following are equivalent:
@end example @end example
@var{part-num} represents the partition number of @var{bios-device}, @var{part-num} represents the partition number of @var{bios-device},
starting from zero, and @var{bsd-subpart-letter} represents the BSD starting from zero for primary partitions and from four for extened
disklabel subpartition, such as @samp{a} or @samp{e}. partitions, and @var{bsd-subpart-letter} represents the BSD disklabel
subpartition, such as @samp{a} or @samp{e}.
A shortcut for specifying BSD subpartitions is A shortcut for specifying BSD subpartitions is
@code{(@var{bios-device},@var{bsd-subpart-letter})}, in this case, GRUB @code{(@var{bios-device},@var{bsd-subpart-letter})}, in this case, GRUB
@ -313,19 +315,19 @@ The command line interface provides a prompt and after it an editable
text area much like a command line in Unix or DOS. Each command is text area much like a command line in Unix or DOS. Each command is
immediately executed after it is entered @footnote{However, this immediately executed after it is entered @footnote{However, this
behavior will be changed in the future version, in a user-invisible behavior will be changed in the future version, in a user-invisible
way.}. The commands are a subset of those available in the configuration way.}. The commands (@pxref{Command}) are a subset of those available in
file, used with exactly the same syntax. the configuration file, used with exactly the same syntax.
Cursor movement and editing of the text on the line can be done via a Cursor movement and editing of the text on the line can be done via a
subset of the functions available in the Bash shell: subset of the functions available in the Bash shell:
@table @key @table @key
@item C-f @item C-f
@itemx PC left key @itemx PC right key
Move forward one character. Move forward one character.
@item C-b @item C-b
@itemx PC right key @itemx PC left key
Move back one character. Move back one character.
@item C-a @item C-a
@ -365,8 +367,9 @@ Move down through the history list.
When typing commands interactively, if the cursor is within or before When typing commands interactively, if the cursor is within or before
the first word in the command-line, pressing the @key{TAB} key (or the first word in the command-line, pressing the @key{TAB} key (or
@key{C-i}) will display a listing of the available commands, and if the @key{C-i}) will display a listing of the available commands, and if the
cursor is after the first word, the @key{TAB} will provide a completion cursor is after the first word, the @kbd{@key{TAB}} will provide a
listing of disks, partitions, and filenames depending on the context. completion listing of disks, partitions, and filenames depending on the
context.
@node Menu @node Menu
@ -585,7 +588,8 @@ grub> device (fd0) /floppy-image
grub> device (hd0) /dev/sd0 grub> device (hd0) /dev/sd0
@end example @end example
This command is just ignored in Stage 2. This command can be used only in the grub shell (@pxref{Invoking the
grub shell}).
@end deffn @end deffn
@deffn Command hide partition @deffn Command hide partition
@ -634,7 +638,7 @@ Load @var{file} as the configuration file.
@deffn Command embed stage1_5 device @deffn Command embed stage1_5 device
Embed the Stage 1.5 @var{stage1_5} in the sectors after the MBR if Embed the Stage 1.5 @var{stage1_5} in the sectors after the MBR if
@var{device} is a drive, or in the @dfn{bootloader} area if @var{device} @var{device} is a drive, or in the @dfn{boot loader} area if @var{device}
is a FFS partition.@footnote{The latter feature has not been implemented is a FFS partition.@footnote{The latter feature has not been implemented
yet.} Print the number of sectors which @var{stage1_5} occupies if yet.} Print the number of sectors which @var{stage1_5} occupies if
successful. successful.
@ -689,7 +693,8 @@ displays long documents of the commands which match @var{pattern}.
@deffn Command impsprobe @deffn Command impsprobe
Probe the Intel Multiprocessor Specification 1.1 or 1.4 configuration Probe the Intel Multiprocessor Specification 1.1 or 1.4 configuration
table and boot the various CPUs which are found into a tight loop. table and boot the various CPUs which are found into a tight loop. This
command can be used only in the Stage 2.
@end deffn @end deffn
@deffn Command initrd file @dots{} @deffn Command initrd file @dots{}
@ -770,7 +775,7 @@ change floppies.
@deffn Command quit @deffn Command quit
Exit from the GRUB shell @command{grub} (@pxref{Invoking the grub Exit from the GRUB shell @command{grub} (@pxref{Invoking the grub
shell}). This command is ignored in the native Stage 2. shell}). This command can be used only in the grub shell.
@end deffn @end deffn
@deffn Command read addr @deffn Command read addr
@ -781,7 +786,7 @@ hex format.
@deffn Command root device [hdbias] @deffn Command root device [hdbias]
Set the current @dfn{root device} to the device @var{device}, then Set the current @dfn{root device} to the device @var{device}, then
attempt to mount it to get the partition size (for passing the partition attempt to mount it to get the partition size (for passing the partition
descriptor in @code{ES:ESI}, used by some chain-loaded bootloaders), the descriptor in @code{ES:ESI}, used by some chain-loaded boot loaders), the
BSD drive-type (for booting BSD kernels using their native boot format), BSD drive-type (for booting BSD kernels using their native boot format),
and correctly determine the PC partition where a BSD sub-partition is and correctly determine the PC partition where a BSD sub-partition is
located. The optional @var{hdbias} parameter is a number to tell a BSD located. The optional @var{hdbias} parameter is a number to tell a BSD
@ -819,7 +824,7 @@ consistent offset error. If this test succeeds, then a good next step is
to try loading a kernel. to try loading a kernel.
@end deffn @end deffn
@deffn uppermem kbytes @deffn Command uppermem kbytes
Force GRUB to assume that only @var{kbytes} kilobytes of upper memory Force GRUB to assume that only @var{kbytes} kilobytes of upper memory
are installed. Any system address range maps are discarded. are installed. Any system address range maps are discarded.
@ -1059,8 +1064,8 @@ You can use the command @command{grub} for installing GRUB under your
operating systems and for a testbed when you add a new feature into GRUB operating systems and for a testbed when you add a new feature into GRUB
or when fix a bug. @command{grub} is almost the same as the Stage 2, or when fix a bug. @command{grub} is almost the same as the Stage 2,
and, in fact, it shares the source code with the Stage 2 and you can use and, in fact, it shares the source code with the Stage 2 and you can use
the same commands in @command{grub}. It is emulated by replacing BIOS the same commands (@pxref{Command}) in @command{grub}. It is emulated by
calls with UNIX system calls and libc functions. replacing BIOS calls with UNIX system calls and libc functions.
The command @command{grub} accepts the following options: The command @command{grub} accepts the following options:
@ -1185,13 +1190,13 @@ drives to OS devices. This file consists of lines like this:
@end example @end example
@var{device} is a drive, which syntax is the same as the one in GRUB @var{device} is a drive, which syntax is the same as the one in GRUB
(@pxref{Device syntax}), and @var{file} is a OS's file, which is (@pxref{Device syntax}), and @var{file} is an OS's file, which is
normally a device file. normally a device file.
The reason why the grub shell gives you the device map file is that it The reason why the grub shell gives you the device map file is that it
cannot guess the map between BIOS drives and OS devices in some cannot guess the map between BIOS drives and OS devices correctly in
environments. For example, if you exchange the boot sequence between IDE some environments. For example, if you exchange the boot sequence
and SCSI in your BIOS, it mistakes the order. between IDE and SCSI in your BIOS, it mistakes the order.
Thus, edit the file if the grub shell makes a mistake. You can put any Thus, edit the file if the grub shell makes a mistake. You can put any
comments in the file if needed, as the grub shell assumes that a line is comments in the file if needed, as the grub shell assumes that a line is

View file

@ -472,9 +472,13 @@ device_func (char *arg, int flags)
*ptr = 0; *ptr = 0;
assign_device_name (current_drive, device); assign_device_name (current_drive, device);
#endif /* GRUB_UTIL */
return 0; return 0;
#else /* ! GRUB_UTIL */
/* In Stage 2, this command cannot be used. */
errnum = ERR_UNRECOGNIZED;
return 1;
#endif /* GRUB_UTIL */
} }
static struct builtin builtin_device = static struct builtin builtin_device =
@ -484,7 +488,7 @@ static struct builtin builtin_device =
BUILTIN_MENU | BUILTIN_CMDLINE, BUILTIN_MENU | BUILTIN_CMDLINE,
"device DRIVE DEVICE", "device DRIVE DEVICE",
"Specify DEVICE as the actual drive for a BIOS drive DRIVE. This command" "Specify DEVICE as the actual drive for a BIOS drive DRIVE. This command"
" is just ignored in the native Stage 2." " can be used only in the grub shell."
}; };
@ -1052,12 +1056,16 @@ static struct builtin builtin_hide =
static int static int
impsprobe_func (char *arg, int flags) impsprobe_func (char *arg, int flags)
{ {
#ifndef GRUB_UTIL #ifdef GRUB_UTIL
/* In the grub shell, we cannot probe IMPS. */
errnum = ERR_UNRECOGNIZED;
return 1;
#else /* ! GRUB_UTIL */
if (!imps_probe ()) if (!imps_probe ())
#endif
printf (" No MPS information found or probe failed\n"); printf (" No MPS information found or probe failed\n");
return 0; return 0;
#endif /* ! GRUB_UTIL */
} }
static struct builtin builtin_impsprobe = static struct builtin builtin_impsprobe =
@ -1767,10 +1775,13 @@ quit_func (char *arg, int flags)
{ {
#ifdef GRUB_UTIL #ifdef GRUB_UTIL
stop (); stop ();
#endif
/* In Stage 2, just ignore this command. */ /* Never reach here. */
return 0; return 0;
#else /* ! GRUB_UTIL */
errnum = ERR_UNRECOGINIZED;
return 1;
#endif /* ! GRUB_UTIL */
} }
static struct builtin builtin_quit = static struct builtin builtin_quit =