some bugfixes and documentation updates.

This commit is contained in:
okuji 1999-10-23 19:38:45 +00:00
parent 24b486cfc3
commit 4b1ec86348
7 changed files with 134 additions and 87 deletions

View file

@ -1,3 +1,14 @@
1999-10-23 OKUJI Yoshinori <okuji@kuicr.kyoto-u.ac.jp>
* stage2/builtins.c (map_func): If BIOS_DRIVE_MAP already
contains FROM, override the existsing entry.
If TO is equal to FROM, delete the existing entry if any.
(keycode_func): Likewise.
* docs/user-ref.texi (Command): Use the list of `@deffn's
instead of @table.
(Basic usage): Use @option instead of @code.
(Invoking mbchk): Likewise.
1999-10-23 OKUJI Yoshinori <okuji@kuicr.kyoto-u.ac.jp> 1999-10-23 OKUJI Yoshinori <okuji@kuicr.kyoto-u.ac.jp>
* stage2/asm.S [!STAGE1_5] (set_int15_handler): New function. * stage2/asm.S [!STAGE1_5] (set_int15_handler): New function.

2
NEWS
View file

@ -14,7 +14,7 @@ New in 0.5.94:
* A simple checker for the format of a Multiboot kernel, ``mbchk'', is * A simple checker for the format of a Multiboot kernel, ``mbchk'', is
added. added.
* The command "find" searches for a filename in all devices and print * The command "find" searches for a filename in all devices and print
the list of the device which contain the file. the list of the devices which contain the file.
* The command "map" maps a drive to another drive so that we can * The command "map" maps a drive to another drive so that we can
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.

6
TODO
View file

@ -30,10 +30,12 @@ Priorities:
parameters. !! parameters. !!
* Support embedding a Stage 1.5 in the "bootloader" area of a FFS * Support embedding a Stage 1.5 in the "bootloader" area of a FFS
partition. !!! partition. !!!
* Add keyboard layout configuration support. ! * Clean up and enhance the manuals, especially indices. !!!
* Clean up and enhance the manuals, especially concept indexes. !!!
* Add more filesystems support (XFS, NTFS, etc.) * Add more filesystems support (XFS, NTFS, etc.)
* Add remote console support (serial, parallel and net). * Add remote console support (serial, parallel and net).
* Add RAID support. * Add RAID support.
* Complete the netboot support. ! * Complete the netboot support. !
* Add automatic configuration support. * Add automatic configuration support.
* Add bunzip2 support.
* Define the module system. !
* Add ISA PnP support.

View file

@ -131,7 +131,6 @@ Appendices and Indices
* Obtaining and Building GRUB:: How to obtain and build GRUB * Obtaining and Building GRUB:: How to obtain and build GRUB
* Reporting bugs:: Where you should send a bug report * Reporting bugs:: Where you should send a bug report
* Index:: * Index::
@end menu @end menu
@iftex @iftex

View file

@ -290,16 +290,17 @@ However, GRUB is a very large program, so we break GRUB into 2 (or 3)
distinct components, @dfn{stage1} and @dfn{stage2} (and optionally 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 a partition table, and place We embed @dfn{stage1} in a MBR or in the boot sector of a partition
@dfn{stage2} in a filesystem. The optional @dfn{stage1.5} can be table, and place @dfn{stage2} in a filesystem. The optional
installed in a filesystem, in the @dfn{bootloader} area in a FFS, and in @dfn{stage1.5} can be installed in a filesystem, in the @dfn{bootloader}
the sectors right after a MBR, because @dfn{stage1.5} is enough small area in a FFS, and in the sectors right after a MBR, because
and the sectors right after a MBR is normally an unused region. The size @dfn{stage1.5} is enough small and the sectors right after a MBR is
of this region is the number of sectors per head minus 1. normally an unused region. The size of this region is the number of
sectors per head minus 1.
Thus, all the @dfn{stage1} must do is just load a @dfn{stage2} or Thus, all the @dfn{stage1} must do is just load a @dfn{stage2} or
@dfn{stage1.5}. But even if @dfn{stage1} needs not to support the user @dfn{stage1.5}. But even if @dfn{stage1} needs not to support the user
interface or the filesystem interfave, it is impossible to make interface or the filesystem interface, it is impossible to make
@dfn{stage1} less than 400 bytes, because GRUB should support both the @dfn{stage1} less than 400 bytes, because GRUB should support both the
CHS mode and the LBA mode (@pxref{Low-level disk I/O}). CHS mode and the LBA mode (@pxref{Low-level disk I/O}).
@ -325,9 +326,9 @@ The flow of @dfn{stage2} (and @dfn{stage1.5}) is:
@enumerate @enumerate
@item @item
Load the rest of itself to the real starting address, the starting Load the rest of itself to the real starting address, that is, the
address plus 512 bytes. The blocklists is stored in the last part of the starting address plus 512 bytes. The blocklists are stored in the last
first sector. part of the first sector.
@item @item
Long jump to the real starting address. Long jump to the real starting address.
@ -989,10 +990,6 @@ of maximum cylinder number in bits 6-7.
@item @code{ES:DI} @tab Drive parameter table (floppies only). @item @code{ES:DI} @tab Drive parameter table (floppies only).
@end multitable @end multitable
GRUB does not use this call for floppies, but attempts to read the first
sector from the last head of the last cylinder to determine the maximum
head number and the maximum cylinder number.
@node LBA mode disk I/O @node LBA mode disk I/O
@section INT 13H, AH=4xh interrupt call @section INT 13H, AH=4xh interrupt call

View file

@ -420,7 +420,7 @@ configuration file and in the command line.
@menu @menu
* Menu-specific commands:: * Menu-specific commands::
* General commads:: * General commands::
* Command-line-specific commands:: * Command-line-specific commands::
@end menu @end menu
@ -459,40 +459,43 @@ start, where they are ignored.
Commands usable in the menu only. Commands usable in the menu only.
@table @code @deffn Command default num
@item default @var{num}
Set the default entry to the entry number @var{num} (if not specified, Set the default entry to the entry number @var{num} (if not specified,
it is 0, the first entry). it is 0, the first entry).
@end deffn
@item fallback @var{num} @deffn Command fallback num
Go into unattended boot mode: if the default boot entry has any errors, Go into unattended boot mode: if the default boot entry has any errors,
instead of waiting for the user to do anything, it immediately starts instead of waiting for the user to do anything, it immediately starts
over using the @var{num} entry (same numbering as the @code{default} over using the @var{num} entry (same numbering as the @code{default}
command). This obviously won't help if the machine was rebooted by a command). This obviously won't help if the machine was rebooted by a
kernel that GRUB loaded. kernel that GRUB loaded.
@end deffn
@item password @var{passwd} @var{new-config-file} @deffn Command password passwd new-config-file
Disable all interactive editing control (menu entry editor and Disable all interactive editing control (menu entry editor and
command line). If the password @var{passwd} is entered, it loads the command line). If the password @var{passwd} is entered, it loads the
@var{new-config-file} as a new config file and restarts the GRUB Stage @var{new-config-file} as a new config file and restarts the GRUB Stage
2. 2.
@end deffn
@item timeout @var{sec} @deffn Command timeout sec
Set a timeout, in @var{sec} seconds, before automatically booting the Set a timeout, in @var{sec} seconds, before automatically booting the
default entry (normally the first entry defined). default entry (normally the first entry defined).
@end deffn
@item title @var{name}@dots{} @deffn Command title name @dots{}
Start a new boot entry, and set its name to the contents of the rest of Start a new boot entry, and set its name to the contents of the rest of
the line, starting with the first non-space character. the line, starting with the first non-space character.
@end table @end deffn
@node General commads
@node General commands
@section The list of general commands @section The list of general commands
Commands usable both in the menu and in the command line. Commands usable both in the menu and in the command line.
@table @code @deffn Command color normal [highlight]
@item color @var{normal} [@var{highlight}]
Change the menu colors. The color @var{normal} is used for most Change the menu colors. The color @var{normal} is used for most
lines in the menu, and the color @var{highlight} is used to highlight the lines in the menu, and the color @var{highlight} is used to highlight the
line where the cursor points. If you omit @var{highlight}, then the line where the cursor points. If you omit @var{highlight}, then the
@ -569,8 +572,9 @@ color light-gray/blue black/light-gray
title OS-BS like title OS-BS like
color magenta/blue black/magenta color magenta/blue black/magenta
@end example @end example
@end deffn
@item device @var{drive} @var{file} @deffn Command device drive file
In the grub shell, specify the file @var{file} as the actual drive for a In the grub shell, specify the file @var{file} as the actual drive for a
@sc{bios} drive @var{drive}. You can use this command to create a disk @sc{bios} drive @var{drive}. You can use this command to create a disk
image and to fix the drives guessed by GRUB when GRUB fails to determine image and to fix the drives guessed by GRUB when GRUB fails to determine
@ -582,17 +586,19 @@ grub> device (hd0) /dev/sd0
@end example @end example
This command is just ignored in Stage 2. This command is just ignored in Stage 2.
@end deffn
@item hide @var{partition} @deffn Command hide partition
Hide @var{partition} by setting the @dfn{hidden} bit in its partition Hide @var{partition} by setting the @dfn{hidden} bit in its partition
type code. This is useful only for DOS or Windows when multiple primary type code. This is useful only for DOS or Windows when multiple primary
partitions exist in one disk. partitions exist in one disk.
@end deffn
@item unhide @var{partition} @deffn Command unhide partition
Unhide @var{partition} by clearing the @dfn{hidden} bit in its partition Unhide @var{partition} by clearing the @dfn{hidden} bit in its partition
type code. This is useful only for DOS or Windows when multiple primary type code. This is useful only for DOS or Windows when multiple primary
partitions exist in one disk. partitions exist in one disk.
@end table @end deffn
@node Command-line-specific commands @node Command-line-specific commands
@ -601,36 +607,40 @@ partitions exist in one disk.
These commands are usable only in the command line and in menu entries. These commands are usable only in the command line and in menu entries.
If you forget some command, run the command @command{help}. If you forget some command, run the command @command{help}.
@table @code @deffn Command boot
@item boot
This boots the OS/chain-loader which has been loaded. Only necessary if This boots the OS/chain-loader which has been loaded. Only necessary if
running the fully interactive command line (it is implicit at the end of running the fully interactive command line (it is implicit at the end of
a config-file entry). a config-file entry).
@end deffn
@item cat @var{file} @deffn Command cat file
Display the contents of the file @var{file}. This command may be useful Display the contents of the file @var{file}. This command may be useful
to remind you of your OS's root partition: to remind you of your OS's root partition:
@example @example
grub> cat /etc/fstab grub> cat /etc/fstab
@end example @end example
@end deffn
@item chainloader @var{file} @deffn Command chainloader file
Load @var{file} as a chain-loader. Like any other file loaded by the Load @var{file} as a chain-loader. Like any other file loaded by the
filesystem code, it can use the blocklist notation to grab the first filesystem code, it can use the blocklist notation to grab the first
sector of the current partition with @samp{+1}. sector of the current partition with @samp{+1}.
@end deffn
@item configfile @var{file} @deffn Command configfile @var{file}
Load @var{file} as the configuration file. Load @var{file} as the configuration file.
@end deffn
@item embed @var{stage1_5} @var{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{bootloader} 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.
@end deffn
@item displaymem @deffn Command displaymem
Display what GRUB thinks the system address space map of the machine is, Display what GRUB thinks the system address space map of the machine is,
including all regions of physical @sc{ram} installed. GRUB's including all regions of physical @sc{ram} installed. GRUB's
@dfn{upper/lower memory} display uses the standard BIOS interface for @dfn{upper/lower memory} display uses the standard BIOS interface for
@ -639,13 +649,15 @@ synthesized number from various BIOS interfaces of the memory starting
at 1MB and going up to the first chipset hole for @dfn{upper memory} at 1MB and going up to the first chipset hole for @dfn{upper memory}
(the standard PC @dfn{upper memory} interface is limited to reporting a (the standard PC @dfn{upper memory} interface is limited to reporting a
maximum of 64MB). maximum of 64MB).
@end deffn
@item find @var{filename} @deffn Command find filename
Search for the filename @var{filename} in all of partitions and print Search for the filename @var{filename} in all of partitions and print
the list of the devices which contain the file. @var{filename} should be the list of the devices which contain the file. @var{filename} should be
an absolute filename like @code{/boot/grub/stage1}. an absolute filename like @code{/boot/grub/stage1}.
@end deffn
@item fstest @deffn Command fstest
Toggle filesystem test mode. Toggle filesystem test mode.
Filesystem test mode, when turned on, prints out data corresponding to Filesystem test mode, when turned on, prints out data corresponding to
@ -657,63 +669,71 @@ requests from the disk.
Filesystem test mode is turned off by any use of the @command{install} Filesystem test mode is turned off by any use of the @command{install}
or @command{testload} commands. or @command{testload} commands.
@end deffn
@item geometry @var{drive} [@var{cylinder} @var{head} @var{sector} [@var{total_sector}]] @deffn Command geometry drive [cylinder head sector [total_sector]]
Print the information for the drive @var{drive}. In the grub shell, you Print the information for the drive @var{drive}. In the grub shell, you
can set the geometry of the drive arbitrarily. The number of the can set the geometry of the drive arbitrarily. The number of the
cylinders, the one of the heads, the one of the sectors and the one of cylinders, the one of the heads, the one of the sectors and the one of
the total sectors are set to CYLINDER, HEAD, SECTOR and TOTAL_SECTOR, the total sectors are set to CYLINDER, HEAD, SECTOR and TOTAL_SECTOR,
respectively. If you omit TOTAL_SECTOR, then it will be calculated respectively. If you omit TOTAL_SECTOR, then it will be calculated
based on the C/H/S values automatically. based on the C/H/S values automatically.
@end deffn
@item help [@var{pattern} @dots{}] @deffn Command help [pattern @dots{}]
Display helpful information about builtin commands. If you do not Display helpful information about builtin commands. If you do not
specify @var{pattern}, this command lists the short documents of all specify @var{pattern}, this command lists the short documents of all
available commands, and, if you specify one or more @var{pattern}s, it available commands, and, if you specify one or more @var{pattern}s, it
displays long documents of the commands which match @var{pattern}. displays long documents of the commands which match @var{pattern}.
@end deffn
@item 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.
@end deffn
@item initrd @var{file} @dots{} @deffn Command initrd file @dots{}
Load an initial ramdisk for a Linux format boot image and set the Load an initial ramdisk for a Linux format boot image and set the
appropriate parameters in the Linux setup area in memory. appropriate parameters in the Linux setup area in memory.
@end deffn
@item install @var{stage1-file} [d] @var{dest-device} @var{file} [@var{addr}] [p] [@var{config-file}] @deffn Command install stage1_file [@option{d}] dest_dev file [addr] [@option{p}] [config_file]
This command is fairly complex, and you should not use this command This command is fairly complex, and you should not use this command
unless you are familiar with GRUB. In short, it will perform a full unless you are familiar with GRUB. In short, it will perform a full
install presuming the Stage 2 or Stage 1.5@footnote{They're loaded the install presuming the Stage 2 or Stage 1.5@footnote{They're loaded the
same way, so we will refer to the Stage 1.5 as a Stage 2 from now on.} same way, so we will refer to the Stage 1.5 as a Stage 2 from now on.}
is in its final install location. is in its final install location.
In slightly more detail, it will load @var{stage1-file}, validate that In slightly more detail, it will load @var{stage1_file}, validate that
it is a GRUB Stage 1 of the right version number, install a blocklist for it is a GRUB Stage 1 of the right version number, install a blocklist for
loading @var{file} as a Stage 2. If the option @samp{d} is present, the loading @var{file} as a Stage 2. If the option @option{d} is present, the
Stage 1 will always look for the actual disk @var{file} was installed on, Stage 1 will always look for the actual disk @var{file} was installed on,
rather than using the booting drive. The Stage 2 will be loaded at rather than using the booting drive. The Stage 2 will be loaded at
address @var{addr}, which must be @samp{0x8000} for a true Stage 2, and address @var{addr}, which must be @samp{0x8000} for a true Stage 2, and
@samp{0x2000} for a Stage 1.5. If @var{addr} is not present, GRUB will @samp{0x2000} for a Stage 1.5. If @var{addr} is not present, GRUB will
determine the address automatically. It then writes the completed Stage 1 determine the address automatically. It then writes the completed Stage 1
to the first block of the device @var{dest-dev}. If the options @samp{p} to the first block of the device @var{dest_dev}. If the options @option{p}
or @var{config-file} are present, then it reads the first block of or @var{config_file} are present, then it reads the first block of
stage2, modifies it with the values of the partition @var{file} was stage2, modifies it with the values of the partition @var{file} was
found on (for @samp{p}) or places the string @var{config-file} into the found on (for @option{p}) or places the string @var{config_file} into the
area telling the stage2 where to look for a configuration file at boot area telling the stage2 where to look for a configuration file at boot
time. This command preserves the DOS BPB (and for hard disks, the time. This command preserves the DOS BPB (and for hard disks, the
partition table) of the sector the Stage 1 is to be installed into. partition table) of the sector the Stage 1 is to be installed into.
@end deffn
@item kernel @var{file} @dots{} @deffn Command kernel file @dots{}
Attempt to load the primary boot image (Multiboot a.out or @sc{elf}, Attempt to load the primary boot image (Multiboot a.out or @sc{elf},
Linux zImage or bzImage, FreeBSD a.out, NetBSD a.out, etc.) from Linux zImage or bzImage, FreeBSD a.out, NetBSD a.out, etc.) from
@var{file}. The rest of the line is passed verbatim as the @dfn{kernel @var{file}. The rest of the line is passed verbatim as the @dfn{kernel
command line}. Any modules must be reloaded after using this command. command line}. Any modules must be reloaded after using this command.
@end deffn
@item makeactive @deffn Command makeactive
Set the active partition on the root disk to GRUB's root device. Set the active partition on the root disk to GRUB's root device.
This command is limited to @emph{primary} PC partitions on a hard disk. This command is limited to @emph{primary} PC partitions on a hard disk.
@end deffn
@item map @var{to_drive} @var{from_drive} @deffn Command map to_drive from_drive
Map the drive @var{from_drive} to the drive @var{to_drive}. This is Map the drive @var{from_drive} to the drive @var{to_drive}. This is
necessary when you chain-load some operating systems, such as DOS, if necessary when you chain-load some operating systems, such as DOS, if
such an OS resides at a non-first drive. Here is an example: such an OS resides at a non-first drive. Here is an example:
@ -725,34 +745,40 @@ grub> map (hd1) (hd0)
The example exchanges the order between the first hard disk and the The example exchanges the order between the first hard disk and the
second hard disk. second hard disk.
@end deffn
@item module @var{file} @dots{} @deffn Command module file @dots{}
Load a boot module @var{file} for a Multiboot format boot image (no Load a boot module @var{file} for a Multiboot format boot image (no
interpretation of the file contents are made, so that user of this interpretation of the file contents are made, so that user of this
command must know what the kernel in question expects). The rest of the command must know what the kernel in question expects). The rest of the
line is passed as the @dfn{module command line}, like the line is passed as the @dfn{module command line}, like the
@command{kernel} command. You must load a Multiboot kernel image before @command{kernel} command. You must load a Multiboot kernel image before
loading any module. loading any module.
@end deffn
@item modulenounzip @var{file} @dots{} @deffn Command modulenounzip file @dots{}
The same as @command{module}, except that automatic decompression is The same as @command{module}, except that automatic decompression is
disabled. disabled.
@end deffn
@item pause @var{message}@dots{} @deffn Command pause message @dots{}
Print the @var{message}, then wait until a key is pressed. Note that Print the @var{message}, then wait until a key is pressed. Note that
placing @key{^G} (ASCII code 7) in the message will cause the speaker to placing @key{^G} (ASCII code 7) in the message will cause the speaker to
emit the standard beep sound, which is useful when prompting the user to emit the standard beep sound, which is useful when prompting the user to
change floppies. change floppies.
@end deffn
@item 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 is ignored in the native Stage 2.
@end deffn
@item read @var{addr} @deffn Command read addr
Read a 32-bit value from memory at address @var{addr} and display it in Read a 32-bit value from memory at address @var{addr} and display it in
hex format. hex format.
@end deffn
@item root @var{device} [@var{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 bootloaders), the
@ -763,15 +789,17 @@ kernel how many BIOS drive numbers are on controllers before the current
one. For example, if there is an IDE disk and a SCSI disk, and your one. For example, if there is an IDE disk and a SCSI disk, and your
FreeBSD root partition is on the SCSI disk, then use a @samp{1} for FreeBSD root partition is on the SCSI disk, then use a @samp{1} for
@var{hdbias}. @var{hdbias}.
@end deffn
@item rootnoverify @var{device} [@var{hdbias}] @deffn Command rootnoverify device [hdbias]
Similar to @command{root}, but don't attempt to mount the Similar to @command{root}, but don't attempt to mount the
partition. This is useful for when an OS is outside of the area of the partition. This is useful for when an OS is outside of the area of the
disk that GRUB can read, but setting the correct root device is still disk that GRUB can read, but setting the correct root device is still
desired. Note that the items mentioned in @command{root} above which desired. Note that the items mentioned in @command{root} above which
derived from attempting the mount will @emph{not} work correctly. derived from attempting the mount will @emph{not} work correctly.
@end deffn
@item setup @var{install_device} [@var{image_device}] @deffn Command setup install_device [image_device]
Set up the installation of GRUB automatically. This command uses the Set up the installation of GRUB automatically. This command uses the
more flexible command @command{install} in the backend and installs GRUB more flexible command @command{install} in the backend and installs GRUB
into the device @var{install_device}. If @var{image_device} is into the device @var{install_device}. If @var{image_device} is
@ -779,8 +807,9 @@ specified, then find the GRUB images in the device @var{image_device},
otherwise use the current @dfn{root device}, which can be set by the otherwise use the current @dfn{root device}, which can be set by the
command @command{root}. If @var{install_dvice} is a hard disk, then command @command{root}. If @var{install_dvice} is a hard disk, then
embed a Stage 1.5 in the disk if possible. embed a Stage 1.5 in the disk if possible.
@end deffn
@item testload @var{file} @deffn Command testload file
Read the entire contents of @var{file} in several different ways and Read the entire contents of @var{file} in several different ways and
compares them, to test the filesystem code. The output is somewhat compares them, to test the filesystem code. The output is somewhat
cryptic , but if no errors are reported and the final @samp{i=@var{X}, cryptic , but if no errors are reported and the final @samp{i=@var{X},
@ -788,8 +817,9 @@ filepos=@var{Y}} reading has @var{X} and @var{Y} equal, then it is
definitely consistent, and very likely works correctly subject to a definitely consistent, and very likely works correctly subject to a
consistent offset error. If this test succeeds, then a good next step is 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
@item uppermem @var{kbytes} @deffn 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.
@ -797,7 +827,7 @@ are installed. Any system address range maps are discarded.
only be necessary on some old machines. GRUB's BIOS probe can pick up only be necessary on some old machines. GRUB's BIOS probe can pick up
all @sc{ram} on all new machines the author has ever heard of. It can all @sc{ram} on all new machines the author has ever heard of. It can
also be used for debugging purposes to lie to an OS. also be used for debugging purposes to lie to an OS.
@end table @end deffn
@node Troubleshooting @node Troubleshooting
@ -1034,7 +1064,7 @@ calls with UNIX system calls and libc functions.
The command @command{grub} accepts the following options: The command @command{grub} accepts the following options:
@table @code @table @option
@item --help @item --help
Print a summary of the command line options and exit. Print a summary of the command line options and exit.
@ -1177,7 +1207,7 @@ by GRUB.
@command{mbchk} accepts the following options: @command{mbchk} accepts the following options:
@table @code @table @option
@item --help @item --help
Print a summary of the command line options and exit. Print a summary of the command line options and exit.

View file

@ -1464,8 +1464,7 @@ static struct builtin builtin_kernel =
kernel_func, kernel_func,
BUILTIN_CMDLINE, BUILTIN_CMDLINE,
"kernel FILE [ARG ...]", "kernel FILE [ARG ...]",
"Attempt to load the primary boot image (Multiboot a.out or ELF," "Attempt to load the primary boot image from"
" Linux zImage or bzImage, FreeBSD a.out, or NetBSD a.out) from"
" FILE. The rest of the line is passed verbatim as the" " FILE. The rest of the line is passed verbatim as the"
" \"kernel command line\". Any modules must be reloaded after" " \"kernel command line\". Any modules must be reloaded after"
" using this command." " using this command."
@ -1503,10 +1502,6 @@ keycode_func (char *arg, int flags)
return 1; return 1;
} }
/* If TO is identical with FROM, do nothing. */
if (to == from)
return 0;
/* Find an empty slot. */ /* Find an empty slot. */
for (i = 0; i < KEY_MAP_SIZE; i++) for (i = 0; i < KEY_MAP_SIZE; i++)
{ {
@ -1526,6 +1521,11 @@ keycode_func (char *arg, int flags)
return 1; return 1;
} }
if (to == from)
/* If TO is equal to FROM, delete the entry. */
grub_memmove ((char *) &key_map[i], (char *) &key_map[i + 1],
sizeof (unsigned short) * (KEY_MAP_SIZE - i));
else
key_map[i] = (to << 8) | from; key_map[i] = (to << 8) | from;
/* Ugly but should work. */ /* Ugly but should work. */
@ -1562,7 +1562,7 @@ static struct builtin builtin_makeactive =
makeactive_func, makeactive_func,
BUILTIN_CMDLINE, BUILTIN_CMDLINE,
"makeactive", "makeactive",
"Set the active partition on the root disk to GRUB's root partition." "Set the active partition on the root disk to GRUB's root device."
" This command is limited to _primary_ PC partitions on a hard disk." " This command is limited to _primary_ PC partitions on a hard disk."
}; };
@ -1592,14 +1592,16 @@ map_func (char *arg, int flags)
return 1; return 1;
from = current_drive; from = current_drive;
/* If TO and FROM is the same, do nothing. */
if (to == from)
return 0;
/* Search for an empty slot in BIOS_DRIVE_MAP. */ /* Search for an empty slot in BIOS_DRIVE_MAP. */
for (i = 0; i < DRIVE_MAP_SIZE; i++) for (i = 0; i < DRIVE_MAP_SIZE; i++)
{
/* Perhaps the user wants to override the map. */
if ((bios_drive_map[i] & 0xff) == from)
break;
if (! bios_drive_map[i]) if (! bios_drive_map[i])
break; break;
}
if (i == DRIVE_MAP_SIZE) if (i == DRIVE_MAP_SIZE)
{ {
@ -1607,7 +1609,13 @@ map_func (char *arg, int flags)
return 1; return 1;
} }
if (to == from)
/* If TO is equal to FROM, delete the entry. */
grub_memmove ((char *) &bios_drive_map[i], (char *) &bios_drive_map[i + 1],
sizeof (unsigned short) * (DRIVE_MAP_SIZE - i));
else
bios_drive_map[i] = from | (to << 8); bios_drive_map[i] = from | (to << 8);
return 0; return 0;
} }
@ -1618,7 +1626,7 @@ static struct builtin builtin_map =
BUILTIN_CMDLINE, BUILTIN_CMDLINE,
"map TO_DRIVE FROM_DRIVE", "map TO_DRIVE FROM_DRIVE",
"Map the drive FROM_DRIVE to the drive TO_DRIVE. This is necessary" "Map the drive FROM_DRIVE to the drive TO_DRIVE. This is necessary"
" when you chain-load some operating systems, such as DOS, if such a" " when you chain-load some operating systems, such as DOS, if such an"
" OS resides at a non-first drive." " OS resides at a non-first drive."
}; };
@ -1838,7 +1846,7 @@ static struct builtin builtin_root =
root_func, root_func,
BUILTIN_CMDLINE, BUILTIN_CMDLINE,
"root DEVICE [HDBIAS]", "root DEVICE [HDBIAS]",
"Set the current \"root partition\" to the device DEVICE, then" "Set the current \"root device\" to the device DEVICE, then"
" attempt to mount it to get the partition size (for passing the" " attempt to mount it to get the partition size (for passing the"
" partition descriptor in `ES:ESI', used by some chain-loaded" " partition descriptor in `ES:ESI', used by some chain-loaded"
" bootloaders), the BSD drive-type (for booting BSD kernels using" " bootloaders), the BSD drive-type (for booting BSD kernels using"
@ -1872,7 +1880,7 @@ static struct builtin builtin_rootnoverify =
"rootnoverify DEVICE [HDBIAS]", "rootnoverify DEVICE [HDBIAS]",
"Similar to `root', but don't attempt to mount the partition. This" "Similar to `root', but don't attempt to mount the partition. This"
" is useful for when an OS is outside of the area of the disk that" " is useful for when an OS is outside of the area of the disk that"
" GRUB can read, but setting the correct root partition is still" " GRUB can read, but setting the correct root device is still"
" desired. Note that the items mentioned in `root' which" " desired. Note that the items mentioned in `root' which"
" derived from attempting the mount will NOT work correctly." " derived from attempting the mount will NOT work correctly."
}; };
@ -2080,7 +2088,7 @@ static struct builtin builtin_setup =
" the more flexible command \"install\" in the backend and installs" " the more flexible command \"install\" in the backend and installs"
" GRUB into the device INSTALL_DEVICE. If IMAGE_DEVICE is specified," " GRUB into the device INSTALL_DEVICE. If IMAGE_DEVICE is specified,"
" then find the GRUB images in the device IMAGE_DEVICE, otherwise" " then find the GRUB images in the device IMAGE_DEVICE, otherwise"
" use the current \"root partition\", which can be set by the command" " use the current \"root device\", which can be set by the command"
" \"root\"." " \"root\"."
}; };