improve the tutorial.
This commit is contained in:
parent
e01f0b9514
commit
a4a19300f1
5 changed files with 84 additions and 77 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
2000-07-23 OKUJI Yoshinori <okuji@gnu.org>
|
||||||
|
|
||||||
|
* docs/tutorial.texi: Fix some syntax errors and ambiguous
|
||||||
|
sentences. Suggested by M. Meiarashi <mes@st.rim.or.jp>.
|
||||||
|
|
||||||
2000-07-14 Khimenko Victor <grub@khim.sch57.msk.ru>
|
2000-07-14 Khimenko Victor <grub@khim.sch57.msk.ru>
|
||||||
|
|
||||||
* stage2/boot.c (load_image): When getting the text length of a
|
* stage2/boot.c (load_image): When getting the text length of a
|
||||||
|
|
1
THANKS
1
THANKS
|
@ -29,6 +29,7 @@ Kalle Olavi Niemitalo <tosi@ees2.oulu.fi>
|
||||||
Khimenko Victor <grub@khim.sch57.msk.ru>
|
Khimenko Victor <grub@khim.sch57.msk.ru>
|
||||||
Klaus Reichl <klaus.reichl@alcatel.at>
|
Klaus Reichl <klaus.reichl@alcatel.at>
|
||||||
Kunihiro Ishiguro <kunihiro@zebra.org>
|
Kunihiro Ishiguro <kunihiro@zebra.org>
|
||||||
|
M. Meiarashi <mes@st.rim.or.jp>
|
||||||
Mark Lundeberg <aa026@pgfn.bc.ca>
|
Mark Lundeberg <aa026@pgfn.bc.ca>
|
||||||
Michael Hohmuth <hohmuth@innocent.com>
|
Michael Hohmuth <hohmuth@innocent.com>
|
||||||
Miles Bader <miles@gnu.org>
|
Miles Bader <miles@gnu.org>
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
@set UPDATED 11 June 2000
|
@set UPDATED 23 July 2000
|
||||||
@set EDITION 0.5.96
|
@set EDITION 0.5.96
|
||||||
@set VERSION 0.5.96
|
@set VERSION 0.5.96
|
||||||
|
|
|
@ -3,29 +3,30 @@
|
||||||
|
|
||||||
Briefly, a @dfn{boot loader} is the first software program that runs when
|
Briefly, a @dfn{boot loader} is the first software program that runs when
|
||||||
a computer starts. It is responsible for loading and transferring
|
a computer starts. It is responsible for loading and transferring
|
||||||
control to the operating system @dfn{kernel} software (such as the Linux
|
control to an operating system @dfn{kernel} software (such as the Linux
|
||||||
or GNU Hurd kernel). The kernel, in turn, initializes the rest of the
|
or GNU Hurd kernel). The kernel, in turn, initializes the rest of the
|
||||||
operating system (e.g. a GNU system).
|
operating system (e.g. a GNU system).
|
||||||
|
|
||||||
GRUB can load a wide variety of free operating systems, as well as
|
GNU GRUB is a very powerful boot loader, which can load a wide variety
|
||||||
|
of free operating systems, as well as proprietary operating systems with
|
||||||
chain-loading@footnote{@dfn{chain-load} is the mechanism for loading
|
chain-loading@footnote{@dfn{chain-load} is the mechanism for loading
|
||||||
unsupported operating systems by loading another boot loader. It is
|
unsupported operating systems by loading another boot loader. It is
|
||||||
typically used for loading DOS or Windows.} proprietary operating
|
typically used for loading DOS or Windows.}.
|
||||||
systems.
|
|
||||||
|
|
||||||
The important feature in GRUB is flexibility; GRUB understands
|
One of the important features in GRUB is flexibility; GRUB understands
|
||||||
filesystems and kernel executable formats, so you can load an arbitrary
|
filesystems and kernel executable formats, so you can load an arbitrary
|
||||||
operating system the way you like, without recording the physical
|
operating system the way you like, without recording the physical
|
||||||
position of your kernel on the disk.
|
position of your kernel on the disk.
|
||||||
|
|
||||||
Therefore, you have to specify the drive (and the partition) where your
|
Thus you can load the kernel just by specifying its filename and the
|
||||||
kernel resides and the filename at hand. If you don't want to type in
|
drive (and the partition) where the kernel resides. To let GRUB know the
|
||||||
the drive and the filename every time, you can set it up in a simple
|
drive and the filename, you can either type in them manually via the
|
||||||
configuration file (@pxref{Configuration}). GRUB will locate and load
|
command-line interface (@pxref{Command line}), or use the nice menu
|
||||||
it, and provide a nice menu interface (@pxref{Menu interface}) through
|
interface (@pxref{Menu interface}) through which you can easily select
|
||||||
which you can easily select which OS it boots. Of course, you can enter
|
which OS it boots. To allow you to customize the menu, GRUB will load a
|
||||||
the command-line interface (@pxref{Command line}) whenever you like, or
|
preexisting configuration file (@pxref{Configuration}). Note that you
|
||||||
you can edit specific menu entries prior to using them.
|
can not only enter the command-line interface whenever you like, but
|
||||||
|
also you can edit specific menu entries prior to using them.
|
||||||
|
|
||||||
In the following chapters, you will learn how to specify a drive or a
|
In the following chapters, you will learn how to specify a drive or a
|
||||||
partition, and a file name (@pxref{Naming convention}) to GRUB, how to
|
partition, and a file name (@pxref{Naming convention}) to GRUB, how to
|
||||||
|
@ -152,9 +153,9 @@ GRUB comes with boot images, which are normally installed in the
|
||||||
@node Installing GRUB on a floppy
|
@node Installing GRUB on a floppy
|
||||||
@section Installing GRUB on a floppy
|
@section Installing GRUB on a floppy
|
||||||
|
|
||||||
To create a GRUB boot floppy, you need to take the @file{stage1} and
|
To create a GRUB boot floppy, you need to take the files @file{stage1}
|
||||||
@file{stage2} files from @file{/boot/grub} directory, and write them to
|
and @file{stage2} from @file{/boot/grub} directory, and write them to
|
||||||
the first and the second block of the floppy disk.
|
the first and the second block of the floppy disk, respectively.
|
||||||
|
|
||||||
@quotation
|
@quotation
|
||||||
@strong{Caution:} This procedure will destroy any data currently stored
|
@strong{Caution:} This procedure will destroy any data currently stored
|
||||||
|
@ -197,10 +198,10 @@ the grub shell}) as the super-user (@samp{root}).
|
||||||
|
|
||||||
Once started, GRUB will show the command-line interface (@pxref{Command
|
Once started, GRUB will show the command-line interface (@pxref{Command
|
||||||
line}). First, set the GRUB's @dfn{root device}@footnote{Note that
|
line}). First, set the GRUB's @dfn{root device}@footnote{Note that
|
||||||
GRUB's root device does not neccessarily have to be your OS's root
|
GRUB's root device doesn't necessarily mean your OS's root partition; if
|
||||||
partition; if you need to specify a root partition for your OS, add the
|
you need to specify a root partition for your OS, add the argument into
|
||||||
argument into the command @command{kernel}.} to the partition which has
|
the command @command{kernel}.} to the partition which has your GRUB
|
||||||
your GRUB images, like this:
|
images, like this:
|
||||||
|
|
||||||
@example
|
@example
|
||||||
grub> root (hd0,0)
|
grub> root (hd0,0)
|
||||||
|
@ -232,15 +233,14 @@ install GRUB:
|
||||||
grub> setup (hd0,0)
|
grub> setup (hd0,0)
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
If you install GRUB into a partition or a drive except for the first
|
If you install GRUB into a partition or a drive other than the first
|
||||||
one, you must chain-load GRUB from another boot loader. Refer the manual
|
one, you must chain-load GRUB from another boot loader. Refer to the
|
||||||
for the boot loader to know how to chain-load GRUB.
|
manual for the boot loader to know how to chain-load GRUB.
|
||||||
|
|
||||||
@c FIXME: you should specify --force-lba when...
|
@c FIXME: you should specify --force-lba when...
|
||||||
|
|
||||||
That's all there is to it: now you can boot GRUB without a GRUB
|
That's all: now you can boot GRUB without a GRUB floppy. See the next
|
||||||
floppy. See the next chapter to find out how to boot your operating
|
chapter to find out how to boot your operating systems from GRUB.
|
||||||
systems from GRUB.
|
|
||||||
|
|
||||||
|
|
||||||
@node Booting
|
@node Booting
|
||||||
|
@ -259,13 +259,13 @@ magic.
|
||||||
@node General boot methods
|
@node General boot methods
|
||||||
@section How to boot operating systems
|
@section How to boot operating systems
|
||||||
|
|
||||||
GRUB has two distinct sets of boot methods, that is, loading an
|
GRUB has two distinct boot methods. One of the two is to load an
|
||||||
operating system directly and chain-loading another boot loader which
|
operating system directly, and the other is to chain-load another boot
|
||||||
then will load an operating system actually. Generally speaking, the
|
loader which then will load an operating system actually. Generally
|
||||||
former is preferable, because you don't need to install or maintain
|
speaking, the former is desirable, because you don't need to install or
|
||||||
other boot loaders and GRUB is flexible enough to load an operating
|
maintain other boot loaders and GRUB is flexible enough to load an
|
||||||
system from an arbitrary disk/partition. However, the latter is
|
operating system from an arbitrary disk/partition. However, the latter
|
||||||
sometimes required, since GRUB doesn't support all the existing
|
is sometimes required, since GRUB doesn't support all the existing
|
||||||
operating systems natively.
|
operating systems natively.
|
||||||
|
|
||||||
@menu
|
@menu
|
||||||
|
@ -277,11 +277,11 @@ operating systems natively.
|
||||||
@node Loading an operating system directly
|
@node Loading an operating system directly
|
||||||
@subsection How to boot an OS directly by GRUB
|
@subsection How to boot an OS directly by GRUB
|
||||||
|
|
||||||
The native format supported by GRUB is Multiboot (@pxref{Top, Multiboot
|
Multiboot (@pxref{Top, Multiboot Specification, Motivation, multiboot,
|
||||||
Specification, Motivation, multiboot, The Multiboot Specification}), but
|
The Multiboot Specification}) is the native format supported by GRUB.
|
||||||
Linux, FreeBSD, NetBSD and OpenBSD are also supported for
|
For the sake of convenience, there are also support for Linux, FreeBSD,
|
||||||
convenience. If you want to boot other operating systems, you will have
|
NetBSD and OpenBSD. If you want to boot other operating systems, you
|
||||||
to chain-load them (@pxref{Chain-loading}).
|
will have to chain-load them (@pxref{Chain-loading}).
|
||||||
|
|
||||||
Generally, GRUB can boot any Multiboot-compliant OS in the following
|
Generally, GRUB can boot any Multiboot-compliant OS in the following
|
||||||
steps:
|
steps:
|
||||||
|
@ -314,7 +314,7 @@ for the information on your OS-specific issues.
|
||||||
@subsection Load another boot loader to boot unsupported operating systems
|
@subsection Load another boot loader to boot unsupported operating systems
|
||||||
|
|
||||||
If you want to boot an unsupported operating system (e.g. Windows 95),
|
If you want to boot an unsupported operating system (e.g. Windows 95),
|
||||||
chain-load the boot loader for the operating system. Normally, the boot
|
chain-load a 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,8 +326,8 @@ grub> rootnoverify (hd0,0)
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
Second, set the @dfn{active} flag in the partition by the command
|
Second, set the @dfn{active} flag in the partition by the command
|
||||||
@command{makeactive}@footnote{This is not necessary for most modern
|
@command{makeactive}@footnote{This is not necessary for most of the
|
||||||
operating systems.}:
|
modern operating systems.}:
|
||||||
|
|
||||||
@example
|
@example
|
||||||
grub> makeactive
|
grub> makeactive
|
||||||
|
@ -395,7 +395,7 @@ Run the command @command{boot}.
|
||||||
@subsection GNU/Linux
|
@subsection GNU/Linux
|
||||||
|
|
||||||
It is relatively easy to boot GNU/Linux from GRUB, because it somewhat
|
It is relatively easy to boot GNU/Linux from GRUB, because it somewhat
|
||||||
resembles booting a Multiboot-compliant OS.
|
resembles to boot a Multiboot-compliant OS.
|
||||||
|
|
||||||
@enumerate
|
@enumerate
|
||||||
@item
|
@item
|
||||||
|
@ -440,9 +440,10 @@ kernel. @xref{Command-line-specific commands}, for more information.
|
||||||
@node FreeBSD
|
@node FreeBSD
|
||||||
@subsection FreeBSD
|
@subsection FreeBSD
|
||||||
|
|
||||||
GRUB can directly load both kernel formats, ELF and a.out, but this is
|
GRUB can load the kernel directly, either in ELF or a.out format. But
|
||||||
deprecated, since FreeBSD's bootstrap interface sometimes changes
|
this is not recommended, since FreeBSD's bootstrap interface sometimes
|
||||||
heavily, so GRUB can't guarantee to pass kernel parameters correctly.
|
changes heavily, so GRUB can't guarantee to pass kernel parameters
|
||||||
|
correctly.
|
||||||
|
|
||||||
Thus, we'd recommend loading the very flexible loader
|
Thus, we'd recommend loading the very flexible loader
|
||||||
@file{/boot/loader} instead. See this example:
|
@file{/boot/loader} instead. See this example:
|
||||||
|
@ -485,21 +486,21 @@ see @ref{Chain-loading}.
|
||||||
@node OpenBSD
|
@node OpenBSD
|
||||||
@subsection OpenBSD
|
@subsection OpenBSD
|
||||||
|
|
||||||
The booting instructions are exactly the same as for NetBSD
|
The booting instruction is exactly the same as for NetBSD
|
||||||
(@pxref{NetBSD}).
|
(@pxref{NetBSD}).
|
||||||
|
|
||||||
|
|
||||||
@node DOS/Windows
|
@node DOS/Windows
|
||||||
@subsection DOS/Windows
|
@subsection DOS/Windows
|
||||||
|
|
||||||
GRUB doesn't support booting DOS or Windows directly, so you must
|
GRUB cannot boot DOS or Windows directly, so you must chain-load them
|
||||||
chain-load them (@pxref{Chain-loading}). However, their boot loaders
|
(@pxref{Chain-loading}). However, their boot loaders have some critical
|
||||||
have some critical deficiencies, so the general methods may not be
|
deficiencies, so it may not work to just chain-load them. To overcome
|
||||||
enough.
|
the problems, GRUB provides you with two helper functions.
|
||||||
|
|
||||||
If you have installed DOS (or Windows) on a non-first hard disk, you
|
If you have installed DOS (or Windows) on a non-first hard disk, you
|
||||||
have to use the disk swapping technique, because that OS cannot boot
|
have to use the disk swapping technique, because that OS cannot boot
|
||||||
from any disks but the first one. The solution used in GRUB is the
|
from any disks but the first one. The workaround used in GRUB is the
|
||||||
command @command{map} (@pxref{Commands}), like this:
|
command @command{map} (@pxref{Commands}), like this:
|
||||||
|
|
||||||
@example
|
@example
|
||||||
|
@ -513,20 +514,20 @@ This performs a @dfn{virtual} swap between your first and second hard
|
||||||
drive.
|
drive.
|
||||||
|
|
||||||
@strong{Caution:} This is effective only if DOS (or Windows) uses BIOS
|
@strong{Caution:} This is effective only if DOS (or Windows) uses BIOS
|
||||||
to access the swapped disks. If it uses a special driver for them,
|
to access the swapped disks. If that OS uses a special driver for the
|
||||||
it probably won't work.
|
disks, this probably won't work.
|
||||||
|
|
||||||
Another problem arises if you install more than one sets of DOS/Windows
|
Another problem arises if you installed more than one set of DOS/Windows
|
||||||
onto one disk, because they could be confused if there are more than one
|
onto one disk, because they could be confused if there are more than one
|
||||||
primary partitions for DOS/Windows. Certainly you should avoid doing
|
primary partitions for DOS/Windows. Certainly you should avoid doing
|
||||||
this, but there is a solution if you do want to do so. Use the partition
|
this, but there is a solution if you do want to do so. Use the partition
|
||||||
hiding/unhiding technique.
|
hiding/unhiding technique.
|
||||||
|
|
||||||
If GRUB @dfn{hide}s a DOS (or Windows) partition, then it ignores the
|
If GRUB @dfn{hide}s a DOS (or Windows) partition, it ignores the
|
||||||
partition. If GRUB @dfn{unhide}s a DOS (or Windows) partition, it
|
partition. If GRUB @dfn{unhide}s a DOS (or Windows) partition, it
|
||||||
detects the partition. Thus, if you have installed DOS (or Windows) on
|
detects the partition. Thus, if you have installed DOS (or Windows) on
|
||||||
the first partition and the second partition of the first hard disk,
|
the first partition and the second of the first hard disk, and boot the
|
||||||
to boot the first copy, do the following:
|
first copy, do the following:
|
||||||
|
|
||||||
@example
|
@example
|
||||||
@group
|
@group
|
||||||
|
@ -561,9 +562,9 @@ grub> boot
|
||||||
@chapter Downloading OS images from a network
|
@chapter Downloading OS images from a network
|
||||||
|
|
||||||
Although GRUB is a disk-based boot loader, it does provide some network
|
Although GRUB is a disk-based boot loader, it does provide some network
|
||||||
support. To using the network support, you need to enable at least one
|
support. To use the network support, you need to enable at least one
|
||||||
network driver in the build process. For more information please see
|
network driver in the GRUB build process. For more information please
|
||||||
@file{netboot/README.netboot} in the source distribution.
|
see @file{netboot/README.netboot} in the source distribution.
|
||||||
|
|
||||||
@menu
|
@menu
|
||||||
* General usage of network support::
|
* General usage of network support::
|
||||||
|
@ -574,19 +575,19 @@ network driver in the build process. For more information please see
|
||||||
@node General usage of network support
|
@node General usage of network support
|
||||||
@section How to set up your network
|
@section How to set up your network
|
||||||
|
|
||||||
First, you have to set up servers in your network. GRUB requires a
|
GRUB requires a server that will assign an IP address to the machine on
|
||||||
server that will assign an IP address, and a file server. The former is
|
which GRUB is running, and a file server. The former is either BOOTP,
|
||||||
either BOOTP, DHCP or a RARP server (RARP is deprecated, since it cannot
|
DHCP or a RARP server (RARP is deprecated, since it cannot serve much
|
||||||
serve much information). For the latter, only TFTP is supported at the
|
information). For the latter, only TFTP is supported at the moment. It
|
||||||
moment. It is not necessary to run both the servers on one computer. How
|
is not necessary to run both the servers on one computer. How to
|
||||||
to configure the servers is beyond the scope of this document, so please
|
configure these servers is beyond the scope of this document, so please
|
||||||
refer to the manuals specific to those protocols/servers.
|
refer to the manuals specific to those protocols/servers.
|
||||||
|
|
||||||
Second, run @command{bootp}, @command{dhcp} and @command{rarp} for
|
Once you have set up the servers, run @command{bootp}, @command{dhcp}
|
||||||
BOOTP, DHCP and RARP, respectively. Each command will show an assigned
|
or @command{rarp} for BOOTP, DHCP or RARP, respectively. Each command
|
||||||
IP address, a netmask, an IP address for your TFTP server and a
|
will show an assigned IP address, a netmask, an IP address for your TFTP
|
||||||
gateway. If any of the addresses is wrong or it causes an error,
|
server and a gateway. If any of the addresses is wrong or it causes an
|
||||||
probably the configuration of your servers isn't set up properly.
|
error, probably the configuration of your servers isn't set up properly.
|
||||||
|
|
||||||
Finally, download your OS images from your network. The network can be
|
Finally, download your OS images from your network. The network can be
|
||||||
accessed using the network drive @samp{(nd)}. Everything else is very
|
accessed using the network drive @samp{(nd)}. Everything else is very
|
||||||
|
@ -662,7 +663,7 @@ exact syntax should differ from the example, more or less.
|
||||||
You probably noticed that you need to type several commands to boot your
|
You probably noticed that you need to type several commands to boot your
|
||||||
OS. There's a solution to that - GRUB provides a menu interface
|
OS. There's a solution to that - GRUB provides a menu interface
|
||||||
(@pxref{Menu interface}) from which you can select an item (using arrow
|
(@pxref{Menu interface}) from which you can select an item (using arrow
|
||||||
keys) which will do everything to boot an OS.
|
keys) that will do everything to boot an OS.
|
||||||
|
|
||||||
To enable the menu, you need a configuration file,
|
To enable the menu, you need a configuration file,
|
||||||
@file{/boot/grub/menu.lst}. We'll analyze an example file.
|
@file{/boot/grub/menu.lst}. We'll analyze an example file.
|
||||||
|
@ -801,7 +802,7 @@ chainloader +1
|
||||||
@end group
|
@end group
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
The same as the above, just for Windows.
|
The same as the above, but for Windows.
|
||||||
|
|
||||||
@example
|
@example
|
||||||
@group
|
@group
|
||||||
|
@ -812,7 +813,7 @@ setup (hd0)
|
||||||
@end group
|
@end group
|
||||||
@end example
|
@end example
|
||||||
|
|
||||||
This will just (re)install GRUB on the hard disk.
|
This will just (re)install GRUB onto the hard disk.
|
||||||
|
|
||||||
@example
|
@example
|
||||||
# Change the colors.
|
# Change the colors.
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
@set UPDATED 11 June 2000
|
@set UPDATED 23 July 2000
|
||||||
@set EDITION 0.5.96
|
@set EDITION 0.5.96
|
||||||
@set VERSION 0.5.96
|
@set VERSION 0.5.96
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue