Professional Documents
Culture Documents
GVGBV
GVGBV
https://gna.org/projects/grub4dos/
Download
Download
Download
Download
Download
Download
http://download.gna.org/grub4dos/
http://grub4dos.sourceforge.net/
http://sarovar.org/projects/grub4dos/
http://grub4dos.nufans.net/
http://sites.google.com/site/grubdos/
ftp://grub4dos.sarovar.org/pub/grub4dos/
site:
site:
site:
site:
site:
site:
Get the latest source code by using anonymous svn in this way:
svn co svn://svn.gna.org/svn/grub4dos/trunk grub4dos
or in this way:
svn co http://svn.gna.org/svn/grub4dos/trunk grub4dos
View the source code online with your web browser at:
http://svn.gna.org/viewcvs/grub4dos/trunk/
GRUB4DOS mailing list:
grub4dos-devel@gna.org
Subscription page:
https://mail.gna.org/listinfo/grub4dos-devel/
Discussion forum(Official technical support site):
http://www.boot-land.net/forums/index.php?showforum=66
-----------------------------------------------------------------------------Usage:
GRUB [--bypass] [--time-out=T] [--hot-key=K] [--config-file=FILE
]
The FILE, for example, can be (hd0,0)/menu.lst
In CONFIG.SYS, the line looks like:
install=c:\some\where\grub.exe --config-file=FILE
If no options present, GRUB.EXE simply uses
(hd0,0)/menu.lst
as the configure file, if it exists. (Notice! We finally
changed the default file from (hd0,0)/boot/grub/menu.lst to
(hd0,0)/menu.lst) (Changed 2006-12-23. See Update 3 below.)
The partition (hd0,0) can be of a Windows partition or a Linux
partition, or any other partition type supported by GRUB.
Only GRUB-style filename is acceptable here for FILE. A DOS
filename won't work(it is certain we should use GRUB-style
Version 0.2.0 also brings out a new thing, GRUB for NTLDR,
which could be used to boot into GRUB from the boot menu
of Windows NT/2000/XP. Copy GRLDR to the root directory of
drive C: of Windows NT/2000/XP and append to C:\BOOT.INI
this line:
C:\GRLDR="Start GRUB"
That will be done. The GRLDR should be in the same directory
as BOOT.INI and NTLDR. Note that BOOT.INI is usually hidden
and you must unhide it before you can see it. The filename
GRLDR shouldn't be changed. If GRLDR is in a NTFS partition,
it should be copied to the root directory of another non-NTFS
partition(and likewise should the menu.lst file be). If GRLDR
is compressed, e.g., in a NTFS partition, it will not work.
Even if the drive letter of this disk has been changed to
other than C by the Windows device manager, it seems you still
have to use the letter C here in BOOT.INI, otherwise, NTLDR
will fail to locate the GRLDR file.
And what's more, if you are booting NTLDR from a floppy, you
will have to write the GRLDR line in A:\BOOT.INI like this:
C:\GRLDR="Start GRUB"
and shouldn't use the letter A like this:
A:\GRLDR="Start GRUB"
(Note that in the case when BOOT.INI is on floppy A, the
notation "C:\GRLDR" actually refer to the file A:\GRLDR).
Update 2:
GRUB for Linux is also introduced along with 0.2.0. You can
boot grub using a linux loader KEXEC, LILO, SYSLINUX or another
GRUB. (GRUB4LIN has merged into GRUB.EXE)
To boot GRUB off Linux, use this pair of commands:
kexec -l grub.exe
kexec -e
To boot GRUB via GRUB, use commands like the following:
kernel (hd0,0)/grub.exe
boot
To boot GRUB via LILO, use these lines in lilo.conf:
image=/boot/grub.exe
label=grub.exe
To boot GRUB via SYSLINUX, use these lines in syslinux.cfg:
label grub.exe
kernel grub.exe
LOADLIN may encounter problems when loading grub.exe, because
grub.exe requires some unchanged original BIOS interrupt
vectors, but DOS has destroyed them, and loadlin does not
recover them before it transfers control to grub.exe.
Update 3:
Update 4:
Update 5:
mkdir iso_root
cp grldr iso_root
mkisofs -R -b grldr -no-emul-boot -boot-load-seg 0x1000
-o bootable.iso iso_root
As an alternative, grldr can also be used the same way as
stage2_eltorito. The -boot-info-table option is allowed but you
can omit it:
mkdir iso_root
cp grldr iso_root
mkisofs -R -b grldr -no-emul-boot -boot-load-size 4 -o g
rldr.iso iso_root
Also note that the bootable.iso above must be created with the
-boot-load-seg 0xHHHH option where HHHH is greater than or
equal to 1000(hex). If HHHH < 1000(hex), QEMU will hang. This
is a bug in QEMU. The grldr.iso can be created with or without
-boot-load-seg 0xHHHH option.
The menu.lst file should be placed in the root dir of the CD.
Update 6:
Update 7:
Added memory drive (md). Like (nd) for network drive and (cd)
for CD-ROM drive, a new drive (md) is implemented for accessing
the whole memory as a disk drive. (md) only works for systems
with BIOS int15/EAX=E820h support.
The cat command now has a few new options: --hex for hexdump,
and --locate=STRING for string search in file.
Typical examples:
cat --hex (hd0)+1
It will display the MBR sector in hex form.
cat --hex (md)+2
It will display 1KB of your memory(in fact, it is the real-mode
IDT table), also in hexdump form.
cat --hex (md)0x800+1
It will display 1 sector of your extended memory.
cat --hex (hd0,0)+1
It will display the first sector of partition (hd0,0). Usually
this sector contains the boot record of an operating system.
Update 8:
Added ram drive (rd). The (md) device accesses the memory
starting at physical address 0. But (rd) accesses memory
starting at any base address. The base and length of the ram
drive can be specified through the map command. "help map" for
details. You can even specify the BIOS drive number used for
the (rd) drive, e.g., map --ram-drive=0xf0. The default drive
number for (rd) is 0x7F which is a floppy. If (rd) is a hard
drive image, you should change the drive number to a value
greater than or equal to 0x80(but should avoid using 0xffff,
because 0xffff is for the (md) device).
The notation (rd)+1 always represents the file which contains
all the bytes stored in (rd).
Update 9:
Update 11:
2.
3.
4.
Emulates an HD partition as the first hard disk and boot DOS from it:
Emulates an image file as the first hard disk and boot DOS from it:
map --read-only (hd0,0)/harddisk.img (hd0)
chainloader --load-length=512 (hd0,0)/harddisk.img
rootnoverify (hd0)
map --harddrives=1
boot
If an image file is used to emulate a hard disk, the image file must
contain an MBR. In other word, the first sector of HARDDISK.IMG must
contain the partition table of the emulated virtual hard disk.
Note:
Counters for floppies and harddrives in the BIOS Data Area remain
unchanged during the mapping. You should manually set them to proper
values with `map --floppies=' and/or `map --harddrives=', especially,
e.g., when there is no real floppy drive attached to the mother board.
If not doing so, DOS might fail to start.
`map --status' can report the values. Note also that `map --floppies='
and `map --harddrives=' can be used independently without the
appearance of mappings.
0.4.2 has introduced a new variable, memdisk_raw, to simulate the
memdisk-like raw mode. If the BIOS has no int15/87h, or if it has
buggy int15/87h support, you should set this variable before any
memdrives are used. Here is an example:
map --memdisk-raw=1
map --mem (hd0,0)/floppy.img (fd0)
map --hook
chainloader (fd0)+1
rootnoverify (fd0)
boot
If you encountered a memdrive failure without using
map --memdisk-raw=1, you should have a try with `map --memdisk-raw=1'.
If you `map --memdisk-raw=0' later, you should afterwards do a
`map --unhook'(and followed by a `map --hook' if needed).
Update: memdisk_raw now defaults to 1. You should `map --memdisk-raw=0'
if you want to use int15/87h to access memdrives.
--------------------------------------------------------
Floppies/harddisks of any size can be emulated with GRUB for DOS 0.2.0.
Image file must be contiguous, or else GRUB for DOS will refuse it.
The `blocklist' command can list fragments or pieces of a file.
Type "help map" at the GRUB prompt to get a brief description of the
command.
The form
map ... (fd?)
is a floppy emulation, and the form
map ... (hd?)
is a hard disk emulation.
When a HARD DISK emulation is used, better not start Windows for
security reasons. Windows may even destroy all data and all information
on all your real hard disks!!!!!!!!
Update for --mem: when --mem is used, it seems rather safe even after
entering Windows. Win98 can operate the memdrive normally.
Windows NT/2000/XP does not recognize the emulated drives no matter
whether the --mem option is present.
******************************************************************************
*** Explanation of the grldr-bootable floppies or harddisk partitions
***
******************************************************************************
1. Ext2 Boot Sector/Boot Record Layout (for loading grldr)
-----------------------------------------------------------------------------An EXT2/EXT3 volume can be GRUB-bootable. Copy grldr and an optional menu.lst
to the root dir of the EXT2/EXT3 volume, and build the boot sector based on the
fifth sector of grldr(some fields need to be changed as detailed in the
following table). And then the EXT2/EXT3 volume is GRUB-bootable.
Update: bootlace.com is a DOS/Linux utility that can install the GRLDR boot
record onto the first sector of an EXT2/EXT3 volume.
Offset Length Description
====== ====== ==============================================================
00h
2
Machine code for short jump over the data.
02h
LBA indicator. Valid values are 0x02 for CHS mode, or 0x42 for
LBA mode.
If the BIOS int13 supports LBA, this byte can be safely set to
0x42.
Some USB BIOSes might have bugs when using CHS mode, so the
format program should set this byte to 0x42. It seems that
(generally) all USB BIOSes have LBA support.
If the format program does not know whether the BIOS has LBA
support, it may operate this way:
if (partition_start + total_sectors_in_partition) exceeds the
CHS addressing ability(especially when it is greater than
1024*256*63), the caller should set this byte to 0x42,
otherwise, set to 0x02.
Note that Windows98 uses the value 0x0e as the LBA indicator.
Update: this byte of LBA indicator is ignored. The boot
record can probe the LBA support of BIOS.
03h
10
0Dh
0Eh
Bytes per block. Valid values are 0x400, 0x800, 0x1000, 0x2000
and 0x4000.
10h
14h
18h
1Ah
Number of heads/sides.
1Ch
20h
24h
25h
26h
28h
2Ch
30h
31h
33h
34h
458
1FEh
LBA indicator. Valid values are 0x90 for CHS mode, or 0x0e for
LBA mode.
If the BIOS int13 supports LBA, this byte can be safely set to
0x0e.
Some USB BIOSes might have bugs when using CHS mode, so the
format program should set this byte to 0x0e. It seems that
(generally) all USB BIOSes have LBA support.
If the format program does not know whether the BIOS has LBA
support, it may operate this way:
if (partition_start + total_sectors_in_partition) exceeds the
CHS addressing ability(especially when it is greater than
1024*256*63), the caller should set this byte to 0x0e,
otherwise, set to 0x90.
Update: this byte of LBA indicator is ignored. The boot
record can probe the LBA support of BIOS.
0Bh
0Dh
0Eh
10h
11h
13h
15h
16h
18h
1Ah
1Ch
20h
24h
25h
26h
27h
2Bh
11
Volume label.
36h
", "FAT16
" or "FAT
".
3Eh
3Fh
40h
41h
42h
442
1FCh
LBA indicator. Valid values are 0x90 for CHS mode, or 0x0e for
LBA mode.
If the BIOS int13 supports LBA, this byte can be safely set to
0x0e.
Some USB BIOSes might have bugs when using CHS mode, so the
format program should set this byte to 0x0e. It seems that
(generally) all USB BIOSes have LBA support.
If the format program does not know whether the BIOS has LBA
support, it may operate this way:
if (partition_start + total_sectors_in_partition) exceeds the
CHS addressing ability(especially when it is greater than
1024*256*63), the caller should set this byte to 0x0e,
otherwise, set to 0x90.
Update: this byte of LBA indicator is ignored. The boot
record can probe the LBA support of BIOS.
Update(2006-07-31): Though GRLDR won't use this LBA-indicator
byte, Windows 98 uses it. Usually this byte should be 0x90 for
CHS mode(especially for floppies). If this byte is not set
properly, Windows 98 will not recognize the floppy or
partition. This problem was reported by neiljoy. Many thanks!
03h
0Bh
0Dh
0Eh
10h
11h
13h
15h
16h
18h
1Ah
1Ch
20h
24h
28h
2Ah
2Ch
30h
32h
34h
12
Reserved, set to 0.
40h
41h
42h
43h
47h
11
Volume label.
52h
5Ah
5Bh
5Ch
5Dh
".
414
1FCh
LBA indicator. Valid values are 0x90 for CHS mode, or 0x0e for
LBA mode.
If the BIOS int13 supports LBA, this byte can be safely set to
0x0e.
Some USB BIOSes might have bugs when using CHS mode, so the
format program should set this byte to 0x0e. It seems that
(generally) all USB BIOSes have LBA support.
If the format program does not know whether the BIOS has LBA
support, it may operate this way:
if (partition_start + total_sectors_in_partition) exceeds the
0Bh
0Dh
0Eh
(Reserved sectors)Unused.
10h
(Number of FATs)Must be 0.
11h
13h
15h
16h
18h
1Ah
1Ch
20h
24h
28h
30h
38h
40h
44h
48h
50h
Checksum, usually 0.
54h
55h
56h
57h
58h
420
1FCh
200h
1536
480
Reserved, set to 0.
1E4h
1E8h
1ECh
1F0h
12
Reserved, set to 0.
1FCh
Type of disk
-----------5 1/4"
5 1/4"
5 1/4"
5 1/4"
both
Sectors
------8
8
9
9
9
Heads
----2
1
2
1
2
Tracks
-----40
40
40
40
80
Capacity
-------320KB
160KB
360KB
180KB
640KB
FAh
F9h
F9h
F0h
F0h
F8h
both
5 1/4"
3 1/2"
3 1/2"
3 1/2"
hard disk
9
15
9
18
36
NA
1
2
2
2
2
NA
80
80
80
80
80
NA
320KB
1200KB
720KB
1440KB
2880KB
NA
******************************************************************************
*** grldr.mbr - How to write it to Master Boot Track of the hard disk
***
******************************************************************************
grldr.mbr contains code that can be used as Master Boot Record. The code is
responsible for searching all partitions for grldr and when found, loading it.
Currently supported partition types are: FAT12/FAT16/FAT32, NTFS, EXT2/EXT3.
Logical partitions in the extended partition are supported, provided that the
extended partition type is Microsoft-compatible. In fact, the Linux extended
partition type(0x85) is not fully tested for the search mechanism.
How to write GRLDR.MBR to the Master Boot Track of a hard disk?
First, read the Windows disk signature and partition information bytes
(72 bytes in total, from offset 0x01b8 to 0x01ff of the MBR sector), and put
them on the same range from offset 0x01b8 to 0x01ff of the beginning sector of
GRLDR.MBR.
Optionally, if the MBR in the hard disk is a single sector MBR created by
Microsoft FDISK, it may be copied onto the second sector of GRLDR.MBR.
The second sector of GRLDR.MBR is called "previous MBR". When GRLDR not found,
"previous MBR" will be started.
No other steps needed, after all necessary changes stated above have been made,
now simply write GRLDR.MBR on to the Master Boot Track. That's all.
Note: The Master Boot Track means the first track of the hard drive.
Note: The bootstrap code of GRLDR.MBR only finds GRLDR file in the root dir of
a partition. You'd better place menu.lst file accompanying with GRLDR(i.e., in
the same root dir of the same partition as GRLDR).
The filename "grldr" in an ext2 partition must be in lower case letters, and
the file type of grldr must be plain regular. Other types, e.g., a symbolic
link, won't work.
Update: bootlace.com is a DOS/Linux utility for installing grldr.mbr to MBR.
The whole grldr.mbr is embedded in the body of the bootlace.com utility, so
bootlace.com can be used independently. See below.
******************************************************************************
***
grldr.mbr - Details about the control bytes
***
******************************************************************************
Six bytes can be used to control the boot process of GRLDR.MBR.
Offset Length Description
====== ====== ==============================================================
02h
1
bit0=1: disable the search for GRLDR on floppy
bit0=0: enable the search for GRLDR on floppy
bit1=1: disable the boot of PREVIOUS MBR with invalid
04h
hot-key code. high byte is scan code, low byte is ASCII code.
the default value is 0x3920, which stands for the space bar.
if this key is pressed, GRUB will be started prior to the boot
of previous MBR. See "int 16 keyboard scan codes" below.
06h
07h
1
1
partition number)
partition number)
partition number)
harddrive number)
partition number)
partition number)
partition number)
harddrive number)
Usage:
bootlace.com [OPTIONS] DEVICE_OR_FILE
OPTIONS:
--read-only
--restore-mbr
--mbr-no-bpb
--no-backup-mbr
--force-backup-mbr
--mbr-enable-floppy
--mbr-disable-floppy
--mbr-enable-osbr
--mbr-disable-osbr
--duce
--chs-no-tune
--boot-prevmbr-first
--boot-prevmbr-last
--preferred-drive=D
--time-out=T
--hot-key=K
--floppy
--floppy=N
--sectors-per-track=S
--heads=H
--start-sector=B
--total-sectors=C
--lba
--chs
--fat12
--fat16
--fat32
--vfat
--ntfs
--ext2
--install-partition=I
DEVICE_OR_FILE: Filename of the device or the image file. For DOS, a BIOS drive
number(hex 0xHH or decimal DDD) can be used to access the drive. BIOS drive
number 0 is for the first floppy, 1 is for the second floppy; 0x80 is for the
first hard drive, 0x81 is for the second hard drive, etc.
Note: BOOTLACE.COM writes only the boot code to MBR. The boot code needs to
load GRLDR as the second(and last) stage of the GRUB boot process. Therefore
GRLDR should be copied to the root directory of one of the supported
partitions, either before or after a successful execution of BOOTLACE.COM.
Currently only partitions with filesystem type of FAT12, FAT16, FAT32, NTFS,
EXT2 or EXT3 are supported.
Note 2: If DEVICE_OR_FILE is a harddisk device or a harddisk image file, it
must contain a valid partition table, otherwise, BOOTLACE.COM will fail. If
DEVICE_OR_FILE is a floppy device or a floppy image file, then it must contain
a supported filesystem(i.e., either of FAT12/FAT16/FAT32/NTFS/EXT2/EXT3).
Note 3: If DEVICE_OR_FILE is a floppy device or a floppy image file, and it
was formated EXT2/EXT3, then you should specify --sectors-per-track and
--heads explicitly.
Important!! If you install GRLDR Boot Record to a floppy or a partition, the
floppy or partition will boot solely grldr, and your original
IO.SYS(DOS/Win9x/Me) and NTLDR(WinNT/2K/XP) will become unbootable. This is
because the original boot record of the floppy or partition was overwritten.
There is no such problem when installing GRLDR Boot Record onto the MBR.
Update: Some NTLDR/IO.SYS/KERNEL.SYS files can be directly chainloaded in the
latest GRUB4DOS.
Tip: If the filename begins in a dash(-) or a digit, you may prefix a dirname
(./) or (.\) to it.
Examples:
Installing GRLDR boot code to MBR under Linux:
bootlace.com /dev/hda
Installing GRLDR boot code to MBR under DOS:
bootlace.com 0x80
Installing GRLDR boot code to a harddisk image under DOS or Linux:
bootlace.com hd.img
Installing GRLDR boot code to floppy under Linux:
bootlace.com --floppy --chs /dev/fd0
Installing GRLDR boot code to floppy under DOS:
bootlace.com --floppy --chs 0x00
Installing GRLDR boot code to a floppy image under DOS or Linux:
bootlace.com --floppy --chs floppy.img
initrd (hd0,0)/DOS.IMG
boot
2. Loaded by LILO:
image=/boot/grub.exe
label=grub.exe
initrd=/boot/DOS.IMG
append="--config-file=map (rd) (fd0); map --hook; chainloader (f
d0)+1; rootnoverify (fd0)"
3. Loaded by SYSLINUX:
label grub.exe
kernel grub.exe
append initrd=DOS.IMG --config-file="map (rd) (fd0); map --hook;
chainloader (fd0)+1; rootnoverify (fd0)"
Note: If the above `map (rd) (...)' failed, you may use `map (rd)+1 (...)'
instead and try again.
******************************************************************************
***
Keyboard BIOS Scan Code/ASCII code tables
***
******************************************************************************
Keyboard bios scan code and ascii character code tables can be obtained from
the web by, for example, googling for "3920 372A 4A2D 4E2B 352F". Here are 2
main results:
1. From "http://heim.ifi.uio.no/~stanisls/helppc/scan_codes.html":
INT 16 - Keyboard Scan Codes
Key
Normal
Shifted
w/Ctrl
w/Alt
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
1E61
3062
2E63
2064
1265
2166
2267
2368
1769
246A
256B
266C
326D
316E
186F
1970
1071
1372
1F73
1474
1675
2F76
1177
2D78
1579
1E41
3042
2E43
2044
1245
2146
2247
2348
1749
244A
254B
264C
324D
314E
184F
1950
1051
1352
1F53
1454
1655
2F56
1157
2D58
1559
1E01
3002
2E03
2004
1205
2106
2207
2308
1709
240A
250B
260C
320D
310E
180F
1910
1011
1312
1F13
1414
1615
2F16
1117
2D18
1519
1E00
3000
2E00
2000
1200
2100
2200
2300
1700
2400
2500
2600
3200
3100
1800
1900
1000
1300
1F00
1400
1600
2F00
1100
2D00
1500
2C7A
2C5A
2C1A
2C00
Key
Normal
Shifted
w/Ctrl
w/Alt
1
2
3
4
5
6
7
8
9
0
0231
0332
0433
0534
0635
0736
0837
0938
0A39
0B30
0221
0340
0423
0524
0625
075E
0826
092A
0A28
0B29
Key
Normal
=
[
]
;
'
`
\
,
.
/
071E
7800
7900
7A00
7B00
7C00
7D00
7E00
7F00
8000
8100
Shifted
w/Ctrl
w/Alt
0C2D
0D3D
1A5B
1B5D
273B
2827
2960
2B5C
332C
342E
352F
0C5F
0D2B
1A7B
1B7D
273A
2822
297E
2B7C
333C
343E
353F
0C1F
1A1B
1B1D
8200
8300
1A00
1B00
2700
2B1C
Key
Normal
Shifted
w/Ctrl
w/Alt
F1
F2
F3
F4
F5
F6
F7
F8
F9
F10
F11
F12
3B00
3C00
3D00
3E00
3F00
4000
4100
4200
4300
4400
8500
8600
5400
5500
5600
5700
5800
5900
5A00
5B00
5C00
5D00
8700
8800
5E00
5F00
6000
6100
6200
6300
6400
6500
6600
6700
8900
8A00
6800
6900
6A00
6B00
6C00
6D00
6E00
6F00
7000
7100
8B00
8C00
Key
BackSpace
Del
Down Arrow
End
Enter
Esc
Home
Ins
Keypad 5
Keypad *
Keypad Keypad +
Keypad /
Left Arrow
0300
Normal
Shifted
w/Ctrl
w/Alt
0E08
5300
5000
4F00
1C0D
011B
4700
5200
0E08
532E
5032
4F31
1C0D
011B
4737
5230
4C35
0E00
A300
A000
9F00
A600
0100
9700
A200
372A
4A2D
4E2B
352F
4B00
4A2D
4E2B
352F
4B34
0E7F
9300
9100
7500
1C0A
011B
7700
9200
8F00
9600
8E00
9500
7300
3700
4A00
4E00
A400
9B00
PgDn
PgUp
PrtSc
Right Arrow
SpaceBar
Tab
Up Arrow
5100
4900
5133
4939
4D00
3920
0F09
4800
4D36
3920
0F00
4838
7600
8400
7200
7400
3920
9400
8D00
A100
9900
9D00
3920
A500
9800
- Some key combinations are not available on all systems. The PS/2
includes many that aren't available on the PC, XT and AT.
- To retrieve the character from a scan code logical AND the word
with 0x00FF.
- see INT 16 MAKE CODES
2. From "http://www.hoppie.nl/ivan/keycodes.txt":
Keystroke
Keypress code
-------------------------------------------------Esc
011B
1
0231
2
0332
3
0433
4
0534
5
0635
6
0736
7
0837
8
0938
9
0A39
0
0B30
0C2D
=
0D3D
Backspace
0E08
Tab
0F09
q
1071
w
1177
e
1265
r
1372
t
1474
y
1579
u
1675
i
1769
o
186F
p
1970
[
1A5B
]
1B5D
Enter
1C0D
Ctrl
**
a
1E61
s
1F73
d
2064
f
2166
g
2267
h
2368
j
246A
k
256B
l
;
'
`
Shift
\
z
x
c
v
b
n
m
,
.
/
Gray *
Alt
Space
Caps Lock
F1
F2
F3
F4
F5
F6
F7
F8
F9
F10
F11
F12
Num Lock
Scroll Lock
White Home
White Up Arrow
White PgUp
Gray White Left Arrow
Center Key
White Right Arrow
Gray +
White End
White Down Arrow
White PgDn
White Ins
White Del
SysReq
Key 45 [1]
Enter (number keypad)
Gray /
PrtSc
Pause
Gray Home
Gray Up Arrow
Gray Page Up
Gray Left Arrow
Gray Right Arrow
Gray End
Gray Down Arrow
266C
273B
2827
2960
**
2B5C
2C7A
2D78
2E63
2F76
3062
316E
326D
332C
342E
352F
372A
**
3920
**
3B00
3C00
3D00
3E00
3F00
4000
4100
4200
4300
4400
8500
8600
**
**
4700
4800
4900
4A2D
4B00
4C00
4D00
4E2B
4F00
5000
5100
5200
5300
**
565C
1C0D
352F
**
**
4700
4800
4900
4B00
4D00
4F00
5000
5100
5200
5300
Shift Esc
!
@
#
$
%
^
&
* (white)
(
)
_
+ (white)
Shift Backspace
Shift Tab (Backtab)
Q
W
E
R
T
Y
U
I
O
P
{
}
Shift Enter
Shift Ctrl
A
S
D
F
G
H
J
K
L
:
"
~
|
Z
X
C
V
B
N
M
<
>
?
Shift Gray *
Shift Alt
Shift Space
Shift Caps Lock
011B
0221
0340
0423
0524
0625
075E
0826
092A
0A28
0B29
0C5F
0D2B
0E08
0F00
1051
1157
1245
1352
1454
1559
1655
1749
184F
1950
1A7B
1B7D
1C0D
**
1E41
1F53
2044
2146
2247
2348
244A
254B
264C
273A
2822
297E
2B7C
2C5A
2D58
2E43
2F56
3042
314E
324D
333C
343E
353F
372A
**
3920
**
Shift
Shift
Shift
Shift
Shift
Shift
Shift
Shift
Shift
Shift
Shift
Shift
Shift
Shift
Shift
Shift
Shift
Shift
Shift
Shift
Shift
Shift
Shift
Shift
Shift
Shift
Shift
Shift
Shift
Shift
Shift
Shift
Shift
Shift
Shift
Shift
Shift
Shift
Shift
Shift
Shift
Shift
Shift
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
F1
F2
F3
F4
F5
F6
F7
F8
F9
F10
F11
F12
Num Lock
Scroll Lock
7 (number pad)
8 (number pad)
9 (number pad)
Gray 4 (number pad)
5 (number pad)
6 (number pad)
Gray +
1 (number pad)
2 (number pad)
3 (number pad)
0 (number pad)
. (number pad)
SysReq
Key 45 [1]
Enter (number pad)
Gray /
PrtSc
Pause
Gray Home
Gray Up Arrow
Gray Page Up
Gray Left Arrow
Gray Right Arrow
Gray End
Gray Down Arrow
Gray Page Down
Gray Insert
Gray Delete
Esc
1
2 (NUL)
3
4
5
6 (RS)
7
8
9
0
=
Backspace (DEL)
Tab
q (DC1)
5400
5500
5600
5700
5800
5900
5A00
5B00
5C00
5D00
8700
8800
**
**
4737
4838
4939
4A2D
4B34
4C35
4D36
4E2B
4F31
5032
5133
5230
532E
**
567C
1C0D
352F
**
**
4700
4800
4900
4B00
4D00
4F00
5000
5100
5200
5300
011B
-0300
---071E
----0C1F
-0E7F
9400
1011
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
w (ETB)
e (ENQ)
r (DC2)
t (DC4)
y (EM)
u (NAK)
i (HT)
o (SI)
p (DEL)
[ (ESC)
] (GS)
Enter (LF)
a (SOH)
s (DC3)
d (EOT)
f (ACK)
g (BEL)
h (Backspace)
j (LF)
k (VT)
l (FF)
;
'
`
Shift
\ (FS)
z (SUB)
x (CAN)
c (ETX)
v (SYN)
b (STX)
n (SO)
m (CR)
,
.
/
Gray *
Alt
Space
Caps Lock
F1
F2
F3
F4
F5
F6
F7
F8
F9
F10
F11
F12
Num Lock
Scroll Lock
White Home
White Up Arrow
White PgUp
Gray White Left Arrow
5 (number pad)
1117
1205
1312
1414
1519
1615
1709
180F
1910
1A1B
1B1D
1C0A
1E01
1F13
2004
2106
2207
2308
240A
250B
260C
---**
2B1C
2C1A
2D18
2E03
2F16
3002
310E
320D
---9600
**
3920
-5E00
5F00
6000
6100
6200
6300
6400
6500
6600
6700
8900
8A00
--7700
8D00
8400
8E00
7300
8F00
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Ctrl
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
7400
9000
7500
9100
7600
9200
9300
**
-1C0A
9500
7200
0000
7700
8DE0
8400
7300
7400
7500
91E0
7600
92E0
93E0
0100
7800
7900
7A00
7B00
7C00
7D00
7E00
7F00
8000
8100
8200
8300
0E00
A500
1000
1100
1200
1300
1400
1500
1600
1700
1800
1900
1A00
1B00
1C00
**
1E00
1F00
2000
2100
2200
2300
2400
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
Alt
k
l
;
'
`
Shift
\
z
x
c
v
b
n
m
,
.
/
Gray *
Space
Caps Lock
F1
F2
F3
F4
F5
F6
F7
F8
F9
F10
F11
F12
Num Lock
Scroll Lock
Gray Gray +
7 (number pad)
8 (number pad)
9 (number pad)
4 (number pad)
5 (number pad)
6 (number pad)
1 (number pad)
2 (number pad)
3 (number pad)
Del
SysReq
Key 45 [1]
Enter (number pad)
/ (number pad)
PrtSc
Pause
Gray Home
Gray Up Arrow
Gray Page Up
Gray Left Arrow
Gray Right Arrow
Gray End
Gray Down Arrow
Gray Page Down
2500
2600
2700
2800
2900
**
2B00
2C00
2D00
2E00
2F00
3000
3100
3200
3300
3400
3500
3700
3920
**
6800
6900
6A00
6B00
6C00
6D00
6E00
6F00
7000
7100
8B00
8C00
**
**
4A00
4E00
#
#
#
#
#
#
#
#
#
-**
-A600
A400
**
**
9700
9800
9900
9B00
9D00
9F00
A000
A100
A200
A300
------------------------------------------------------------------------Footnotes
[1]
[**] Keys and key combinations marked ** are used by the ROM BIOS
but do not put values into the keyboard buffer.
[--] Keys and key combinations marked -- are ignored by the ROM
BIOS.
3. From "http://heim.ifi.uio.no/~stanisls/helppc/make_codes.html":
INT 9 - Hardware Keyboard Make/Break Codes
Key
Backspace
Caps Lock
Enter
Esc
Left Alt
Left Ctrl
Left Shift
Num Lock
Right Shift
Scroll Lock
Space
Sys Req (AT)
Tab
Make Break
0E
3A
1C
01
38
1D
2A
45
36
46
39
54
0F
8E
BA
9C
81
B8
9D
AA
C5
B6
C6
B9
D4
8F
Keypad Keys
Keypad
Keypad
Keypad
Keypad
Keypad
Keypad
Keypad
Keypad
Keypad
Keypad
Keypad
Keypad
Keypad
Keypad
0
1
2
3
4
5
6
7
8
9
.
*
+
(Ins)
(End)
(Down arrow)
(PgDn)
(Left arrow)
(Right arrow)
(Home)
(Up arrow)
(PgUp)
(Del)
(PrtSc)
Key
Make Break
F1
F2
F3
F4
F7
F5
F6
F8
F9
F10
F11
F12
3B
3C
3D
3E
41
3F
40
42
43
44
57
58
Make
Break
52
4F
50
51
4B
4C
4D
47
48
49
53
37
4A
4E
D2
CF
D0
D1
CB
CC
CD
C7
C8
C9
D3
B7
CA
CE
BB
BC
BD
BE
C1
BF
C0
C2
C3
C4
D7
D8
Key
A
B
C
D
E
F
G
H
I
J
K
L
M
Key
1
2
3
4
5
6
7
8
9
0
Make Break
1E
30
2E
20
12
21
22
23
17
24
25
26
32
Key
9E
B0
AE
A0
92
A1
A2
A3
97
A4
A5
A6
B2
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
Make Break
02
03
04
05
06
07
08
09
0A
0B
Make Break
31
18
19
10
13
1F
14
16
2F
11
2D
15
2C
Key
82
83
84
85
86
87
88
89
8A
8B
B1
98
99
90
93
9F
94
96
AF
91
AD
95
AC
Make Break
=
[
]
;
'
`
\
,
.
/
0C
0D
1A
1B
27
28
29
2B
33
34
35
8C
8D
9A
9B
A7
A8
A9
AB
B3
B4
B5
Make
Alt-PrtSc (SysReq)
Ctrl-PrtSc
Enter
PrtSc
Right Alt
Right Ctrl
Shift-PrtSc
/
Pause
Ctrl-Pause (Ctrl-Break)
54
E0
E0
E0
E0
E0
E0
E0
E1
E0
Break
37
1C
2A E0 37
38
1D
37
35
1D 45 E1 9D
46 E0 C6
D4
E0
E0
E0
E0
E0
E0
E0
C5
B7
9C
B7 E0 AA
B8
9D
B7
B5
(not typematic)
(not typematic)
Key
Del
Down arrow
End
Home
Ins
Normal Mode or
Shift w/Numlock
Make
Break
E0
E0
E0
E0
E0
53
50
4F
47
52
E0
E0
E0
E0
E0
D3
D0
CF
C7
D2
Left arrow
PgDn
PgUp
Right arrow
Up arrow
Key
Del
Down arrow
End
Home
Ins
Left arrow
PgDn
PgUp
Right arrow
Up arrow
/
E0
E0
E0
E0
E0
4B
51
49
4D
48
E0
E0
E0
E0
E0
|--Left Shift
Make
E0 AA E0 53
E0 AA E0 50
E0 AA E0 4F
E0 AA E0 47
E0 AA E0 52
E0 AA E0 4B
E0 AA E0 51
E0 AA E0 49
E0 AA E0 4D
E0 AA E0 48
E0 AA E0 35
CB
D1
C9
CD
C8
E0
E0
E0
E0
E0
2A
2A
2A
2A
2A
Pressed--.
Break
E0 D3 E0 2A
E0 D0 E0 2A
E0 CF E0 2A
E0 C7 E0 2A
E0 D2 E0 2A
E0 CB E0 2A
E0 D1 E0 2A
E0 C9 E0 2A
E0 CD E0 2A
E0 C8 E0 2A
E0 B5 E0 2A
E0
E0
E0
E0
E0
4B
51
49
4D
48
E0
E0
E0
E0
E0
CB
D1
C9
CD
C8
E0
E0
E0
E0
E0
|--Right Shift
Make
E0 B6 E0 53
E0 B6 E0 50
E0 B6 E0 4F
E0 B6 E0 47
E0 B6 E0 52
E0 B6 E0 4B
E0 B6 E0 51
E0 B6 E0 49
E0 B6 E0 4D
E0 B6 E0 48
E0 B6 E0 35
AA
AA
AA
AA
AA
Pressed--.
Break
E0 D3 E0 36
E0 D0 E0 36
E0 CF E0 36
E0 C7 E0 36
E0 D2 E0 36
E0 CB E0 36
E0 D1 E0 36
E0 C9 E0 36
E0 CD E0 36
E0 C8 E0 36
E0 B5 E0 36
- The PS/2 models have three make/break scan code sets. The first
set matches the PC & XT make/break scan code set and is the one
listed here. Scan code sets are selected by writing the value F0
to the keyboard via the 8042 (port 60h). The following is a brief
description of the scan code sets (see the PS/2 Technical Reference
manuals for more information on scan code sets 2 and 3):
/ set 1, each key has a base scan code. Some keys generate
extra scan codes to generate artificial shift states. This
is similar to the standard scan code set used on the PC and XT.
/ set 2, each key sends one make scan code and two break scan
codes bytes (F0 followed by the make code). This scan code
set is available on the IBM AT also.
/ set 3, each key sends one make scan code and two break scan
codes bytes (F0 followed by the make code) and no keys are
altered by Shift/Alt/Ctrl keys.
/ typematic scan codes are the same as the make scan code
- Some Tandy 1000's do not handle Alt key combinations when multiple
shift keys are pressed. The Alt-Shift-H combination loses the Alt.
- extended keys like (F11, F12) can only be read with systems that
have extended keyboard BIOS support (or INT 9 extensions); to
read these special keys on these systems INT 16,10 must be used
******************************************************************************
***
GRLDR Error messages
***
******************************************************************************
1. Missing MBR-helper.
The helper function in the sectors that immediately follow the MBR is
not present, or it has been erased by a virus or by Windows XP/Vista.
Run the bootlace.com utility to fix the problem.
2. Buggy BIOS!
Your BIOS is too buggy. It even has no support for INT13/AH=8.
Running GRUB.EXE from a DOS box of Windows 9x/Me could hang the
machine, especially for some systems with USB support. You may
encounter the same problem when running GRUB.EXE through KEXEC under
Linux.
Note:
You don't have to run GRUB.EXE from protected mode of Win9x, which
could hang the machine; Instead, you usually want to run GRUB.EXE
after you have done a "Restart the computer in MS-DOS mode", which
is safe enough.
2.
The default chainloader action will keep A20 on. Some buggy DOS XMS
memory managers could hang the machine. You may use the --disable-a20
option in the chainloader line and try again. Anyway, you should avoid
using those buggy memory managers.
3.
THTF BIOS L4S5M Ver 1.1a(dated 2002-1-10) has a buggy int15 which
causes hang at the boot of a multi boot kernel(memdisk for example).
4.
A Chinese DOS system software, the TechWay SCS, will not work with
newer versions of GRUB.EXE. In general, TSRs that take antitracking
measures will not work with GRUB.EXE any more.
******************************************************************************
***
List of binary files and their corresponding source files
***
******************************************************************************
binary file
-------------
bootlace.com
bootlacestart.S
bootlace.inc, grldrstart.S
grldr
grldrstart.S
grldr.mbr
mbrstart.S
grldrstart.S
grub.exe
dosstart.S
hmload.com
hmloadstart.S
----------------------------------------------------------------------------Note: pre_stage2 is the main body of GNU GRUB and it is simply appended to
grldrstart/dosstart in binary format to form our grldr/grub.exe.
Note: The GRUB file(WITHOUT .EXE suffix) is a static-linked ELF executable
program for Linux, normally called the GRUB Shell. The GRUB Shell is a bootmanager, but not a boot-loader(the "boot" command won't work in GRUB Shell).
GRUB.EXE(with KEXEC) can be used as a bootloader running directly under Linux.
******************************************************************************
***
Memory Layout for Quiting to DOS from GRUB.EXE
***
******************************************************************************
The quit command is implemented to return to DOS in the instance that GRUB.EXE
is started off DOS.
1. Before GRUB.EXE transfers control to pre_stage2, it will copy 640KB of
conventional memory to physical address 0x200000(i.e., 2MB), and write 4 long
integers immediately follows the backup copy of the conventional memory:
At 0x2A0000:
0x50554B42, it is the "BKUP" signature.
At 0x2A0004:
At 0x2A0008:
******************************************************************************
***
The New `cdrom' Command Syntax
***
******************************************************************************
1. Initialize the ATAPI CDROM devices:
grub> cdrom --init
This will display the number of atapi cdroms found: atapi_dev_count
2. Stop the ATAPI CDROM devices:
grub> cdrom --stop
This will set atapi_dev_count to 0.
3. Add IO ports for searching the atapi cdrom devices. For example:
grub> cdrom --add-io-ports=0x03F601F0
After running `cdrom --init' and `map --hook', the cdroms can be accessed
through devices (cd0), (cd1), ...
Note 1: If the system does not fully support the ATAPI CD-ROM specifications,
you will encounter failure when trying to access the (cdX) devices.
Note 2: After doing a `cdrom --stop', you should do a `map --unhook'. Of
course you may `map --hook' again if there are mapped drives.
Note 3: After adding IO ports, you should do a `map --unhook' followed by a
`cdrom --init' and then followed by a `map --hook'.
By default, these ports are used for searching cdroms(so they needn't
be added):
0x03F601F0, 0x03760170, 0x02F600F0,
0x03860180, 0x6F006B00, 0x77007300.
Note 4: The BIOS might have offered a cdrom interface. It would be (cd). After
`cdrom --init' and `map --hook', we might have our (cd0), (cd1), ...
available. It is likely that one of them could access the same media
as the BIOS-offered (cd).
Note 5: You may access the (cd) and (cdX)'es in the blocklist way. Example:
cat --hex (cd0)16+2
The cdrom sectors are big sectors with a size of 2048 bytes.
Note 6: The iso9660 filesystem driver has Rock-Ridge extension support, but
has no Joliet extension support. So you may encounter failure when
you attempt to read files on a Joliet CD.
Note 7: The (cd) or (cdX)'es can be booted now. Examples:
chainloader (cd)
boot
chainloader (cd0)
boot
chainloader (cd1)
boot
You should already have access to the CD sectors before you can
chainload it.
******************************************************************************
***
About the New `setvbe' Command
***
******************************************************************************
Gerardo Richarte contributed the `setvbe' code and the following comment:
New command is `setvbe', and can be used to change the video mode
before executing the kernel.
For example, you can do
setvbe 1024x768x32
this will scan the list of available modes and set it, and
automatically append a `video=' option to each subsequent kernel
command-line. The appended `video=' option is like this:
video=1024x768x32@0xf0000000,4096
where 0xf0000000 is the video framebuffer address as reported by vbe,
and 4096 is the size of a scanline in bytes (also as reported by vbe).
This is really useful if you want to give some graphics support to your
OS, but you don't want to implement any video functionality other than
writing a pixel to video memory.
******************************************************************************
***
About the DOS utility `hmload'
***
******************************************************************************
This program was written by John Cobb (Queen Mary, University of London).
John Cobb's note:
To make use of the ram drive feature I wrote a program `hmload' to load
an arbitrary file to an arbitrary address in high memory. The program
is not very sophisticated and relies on XMS to turn on the A20 line.
(Also one must be very careful to steer clear of any areas of memory
already in use).
Under Linux we generated a disk image `dskimg' (with the kernel and
Initrd and a partition table).
Using this our boot procedure looked something like this:
hmload -fdskimg -a128
fixrb
<unload network drivers>
grub
map --ram-drive=0x81
map --rd-base=0x8000000
map --rd-size=0x400000
root (rd,0)
kernel /kernel root=/dev/ram0 rw ip=bootp ramdisk_size=32768 ...
initrd /initrd
boot
See http://sysdocs.stu.qmul.ac.uk/sysdocs/Comment/GrubForDOS/ for details.
Update 2007-12-05:
Now the MAP command can handle gzipped (rd) image. One can use this
feature with the hmload utility. For example,
step 1. Load the gzipped image under DOS at a relatively low address:
hmload -fdskimg.gz -a16
step 2. Unload network drivers.
step 3. Run GRUB.EXE.
step 4. At the grub prompt, run these commands:
map --rd-base=0x1000000 # set rd-base address to be 16M
map --rd-size=<the accurate size of dskimg.gz in bytes>
map (rd)+1 (hd0)
# This will decompress (rd) and place
# the decompressed image at the top end
# of the extended memory. The (rd)+1
# here has special meaning and stands
# for the whole (rd) device. You must
# use (rd)+1 instead of (rd).
map --hook
root (hd0,0)
kernel /kernel root=/dev/ram0 rw ip=bootp ramdisk_size=32768 ...
initrd /initrd
map --unhook
map (hd0) (hd0)
# Delete the map; this is needed.
boot
******************************************************************************
***
Notes on the use of stack
***
******************************************************************************
The protected-mode and real-mode stack are merged at physical address 0x2000.
All functions should use at most 2K stack space(0x1800-0x2000). So each
subfunction should use as little stack as possible to avoid stack-overflow.
Don't use recursive functions because they could expend too much stack space.
The original protected mode stack at 0x68000(expand-down) is free now and can
be reused for any purposes.
******************************************************************************
***
A bug was found in the CDROM driver
***
******************************************************************************
It seems the cdrom must be connected as the master device of an IDE controller.
If cdrom is slave, the driver will fail to read the cdrom sectors. Hope someone
could fix this problem.
******************************************************************************
***
BIOS and the (cd) drive
***
******************************************************************************
When BIOS
number to
then GRUB
BIOS. The
BIOS can allocate a BIOS drive number to a no-emulation-mode CDROM even when
the CDROM is not bootable. QEMU has done so. At boot time, GRUB4DOS will
search drives 0x80-0xFF for a possible no-emulation-mode CDROM drive allocated
by BIOS. So if BIOS offered a CDROM interface of int13 EBIOS functions 41h-4Eh,
then the (cd) device will be automatically available in GRUB4DOS.
******************************************************************************
***
The way of disk emulation changed greatly
***
******************************************************************************
The way of disk emulation has changed greatly since 0.4.2 final. Please don't
mix newer versions with older versions when disk emulation features are used.
The newer versions won't automatically unhook emulations established in a
previous grub4dos environment. The GRUB.EXE of an older version will
automatically dismiss emulations established earlier, before transferring
control to the main grub program(i.e., pre_stage2).
******************************************************************************
***
FreeDOS EMM386 v2.26 (2006-08-27) VCPI problem
***
******************************************************************************
The VCPI function "AX=DE0Ch - Switch From Protected Mode to V86 Mode" of
FreeDOS EMM386 v2.26 was not implemented properly(it always hangs). As an
alternative, you can use Microsoft's EMM386 instead.
Even while emm386 is
to DOS from grub4dos
be called. If EMM386
FreeDOS, the machine
******************************************************************************
***
New options for map were added
***
******************************************************************************
Along with 0.4.2 final, there are two new options for the map command. They
are --safe-mbr-hook=SMH and --int13-scheme=SCH. Both are related with disk
emulation for use(as smoothly as possible) in the Win9x environment.
SMH can take either of the two values 0 and 1. By default, SMH is 1. If you
encountered problems of disk emulation under Win9x, you may insert a line of
map --safe-mbr-hook=0
before the `boot' command and try again.
Also SCH may take either 0 or 1 at present. By default, SCH is 1. If you
encountered disk emulation problems under Win9x, you may insert a line of
map --int13-scheme=0
before the `boot' command and try again.
Note by the way. Like --safe-mbr-hook and --int13-scheme, the MAP command has
a few other options that are used for setting global variables. They are here:
map --floppies=M
M can be 0, 1, or 2. MAP will set a proper value at 0040:0010 by using M.
map --harddrives=N
N can be between 0 and 127(inclusive). MAP will set 0040:0075 to N.
map --memdisk-raw=RAW
RAW default to 1. If RAW=0, `int15/ah=87h' will be used to access memdrives.
map --ram-drive=RD
RD default to 0x7F which is a floppy. If the RAM DRIVE is a hard drive image
(with partition table in the first sector), you should set RD >= 0x80 and RD
< 0xFF.
map --rd-base=ADDR
map --rd-size=SIZE
ADDR specifies the physical base
the size in bytes of the ramdisk
to 0, but a size of 0 means 4GB,
accessed in the GRUB environment
******************************************************************************
***
About the new map option --in-situ
***
******************************************************************************
--in-situ is used with hard drive images or hardrive partitions. With an
in-situ map, we can typically use a logical partition as a primary partition.
In-situ map is a whole drive map. It only virtualize the partition table and
the number of hidden sectors in the BPB of the DOS Boot Record.
While disk emulation may encounter various problems with win9x, the in-situ map
works fine with win9x.
Note that --in-situ will not change the real partition table.
Example:
Description:
If command1 returns false, then command2 will be executed.
Examples:
is64bit && default 0
is64bit || default 1
******************************************************************************
***
Three new commands is64bit, errnum and errorcheck
***
******************************************************************************
is64bit and errnum retrieve the value of is64bit and errnum respectively.
errorcheck controls whether or not the error will be handled. By default,
errorcheck is on, and menu script execution will stop on error. If errorcheck
is off, the script will continue to execute upto a boot command. A boot command
will turn the errorcheck on.
******************************************************************************
***
Use numeric keys to select a menu entry
***
******************************************************************************
If, for example, you intend to goto entry #25, you may press 2 followed by 5.
******************************************************************************
***
Use the INSERT key to debug step by step at startup
***
******************************************************************************
Some buggy machines could fail to enter grub4dos environment. They might hang
or reboot unexpectedly. Press INSERT as quickly as possible on startup, and
you can get a chance to single-step the boot process and see how far it can
go, and then report bugs.
******************************************************************************
***
The debug command syntax has been changed
***
******************************************************************************
The DEBUG command now can be used to control the verbosity of command output:
debug [ on | off | normal | status | INTEGER ]
0 or off for silent
1 or normal for normal
2 to 0x7FFFFFFF or on for verbose
******************************************************************************
***
GRUB4DOS and Windows Vista
***
******************************************************************************
First, use the following command to create a boot entry:
bcdedit /create /d "GRUB for DOS" /application bootsector
******************************************************************************
***
PXE device
***
******************************************************************************
If PXE service is found at startup, GRUB4DOS will create a virtual device
(pd), through which files from the tftp server can be accessed. You can setup
a diskless boot environment using the following steps:
Client side
You need to boot from PXE ROM.
Server side
You need to configure a dhcp server and a tftp server. In the dhcp server, use
grldr as boot file.
You may also want to load a different menu.lst for different client. GRUB4DOS
will scan the following location for configuration file:
[/mybootdir]/menu.lst/01-88-99-AA-BB-CC-DD
[/mybootdir]/menu.lst/C000025B
[/mybootdir]/menu.lst/C000025
[/mybootdir]/menu.lst/C00002
[/mybootdir]/menu.lst/C0000
[/mybootdir]/menu.lst/C000
[/mybootdir]/menu.lst/C00
[/mybootdir]/menu.lst/C0
[/mybootdir]/menu.lst/C
[/mybootdir]/menu.lst/default
Here, we assume the network card mac for the client machine is
88:99:AA:BB:CC:DD, and the ip address is 192.0.2.91 (C000025B). /mybootdir is
the directory of the boot file, for example, if boot file is /tftp/grldr, then
mybootdir=tftp.
If none of the above files is present, grldr will use its embeded menu.lst.
This is a menu.lst to illstrate how to use files from the tftp server.
title Create ramdisk using map
map --mem (pd)/floppy.img (fd0)
map --hook
rootnoverify (fd0)
chainloader (fd0)+1
title Create ramdisk using memdisk
kernel (pd)/memdisk
initrd (pd)/floppy.img
You can see that the menu.lst is very similar to normal disk boot, you just
need to replace device like (hd0,0) with (pd).
There are some differences between disk device and pxe device:
1. You can't list files in the pxe device.
2. The blocklist command will not work with a file in the pxe device.
3. You must use --mem option if you want to map a file in the pxe device.
When you use chainloader to load file from the pxe device, there is a option
you can use:
chainloader --raw (pd)/BOOT_FILE
Option --raw works just like --force, but it load file in one go. This can
improve performance in some situation.
You can use the pxe command to control the pxe device.
1. pxe
If used without any parameter, pxe command will display current
settings.
2. pxe blksize N
Set the packet size for tftp transmission. Minimum value is 512,
maximum value is 1432. This parameter is used primarily for very old
tftp server where packet larger than 512 byte is not supported.
3. pxe basedir /dir
Set the base directory for files in the tftp server. If
pxe basedir /tftp
then all files in the pxe device is related to directory /tftp, for
example, (pd)/aa.img correspond to /tftp/aa.img in the server.
The default value of base directory is the directory of the boot file,
for example, if boot file is /tftp/grldr, then default base directory
is /tftp.
4. pxe keep
Keep the PXE stack. The default behaviour of GRUB4DOS is to unload
the PXE stack just before it exits.
5. pxe unload
Unload the PXE stack immediately.
******************************************************************************
***
New Feature of Relative Path Support
***
******************************************************************************
Use the `root' or `rootnoverify' command to specify the `working directory'.
For example:
root (hd0,0)/boot/grub
This specifies that the working dir is (hd0,0)/boot/grub. So all subsequent
filenames of the form "/..." will actually refer to (hd0,0)/boot/grub/...
That is to say:
cat /menu.lst
will be equivalent to
cat (hd0,0)/boot/grub/menu.lst
******************************************************************************
***
Notation For The Current Root Device
***
******************************************************************************
The notation `()' can be used to access the current root device. You may use
`find --set-root ...' to set the current root device, but the find command
does not set the `working dir' of the root device. In this case you should
use `()' to set the working dir after the find command:
root ()/boot/grub
Update 2008-05-01:
FIND can also set the `working directory' now. For example:
find --set-root=/tmp /boot/grub/menu.lst
It is equivalent to this pair of commands:
find --set-root /boot/grub/menu.lst
root ()/tmp
******************************************************************************
***
The new map option --a20-keep-on
***
******************************************************************************
Along with 0.4.3 final, map has a new option --a20-keep-on which is related to
A20 control after a memdrive sector access. Usage:
map --a20-keep-on=0
It should be used before the "map --hook" command.
By default, A20 will be always on after an RAM INT13 sector access. If
"map --a20-keep-on=0" is used, the A20 status after the INT13 call will be the
same as that before the INT13 call.
******************************************************************************
***
The CDROM emulation (virtualization)
***
******************************************************************************
The CDROM emulation is sometimes called ISO emulation. Here is an example:
map (hd0,0)/myiso.iso (hd32)
map --hook
chainloader (hd32)
boot
if myiso.iso is not contiguous and you have enough memory, add a --mem option:
map --mem (hd0,0)/myiso.iso (hd32)
map --hook
chainloader (hd32)
boot
Note: (hd32) is a grub drive number equivalent to (0xA0). If a virtual drive is
specified with a drive number greater than or equal to 0xA0, then it will be
treated as a cdrom (i.e., with 2048-byte big sectors).
Like normal disk emulations, the CDROM emulation also (mainly) works with
real-mode OSes. After a protected-mode OS kernel (such as
WinNT/2K/XP/VISTA/LINUX) gains control, the OS would have no ability to access
the virtual CDROM through BIOS int13.
DOS/Win9x users may google for ELTORITO.SYS and use it in CONFIG.SYS as a
device driver for the virtual cdrom.
Example usage of eltorito.sys in CONFIG.SYS:
device=eltorito.sys /D:oemcd001
Corresponding MSCDEX command which can be placed in AUTOEXEC.BAT:
MSCDEX /D:oemcd001 /L:D
Due to some bugs found in eltorito.sys, the driver could fail to load. If you
encounter such problems, then you may replace (hd32) with (0xFF) for the
virtual cdrom drive number and try again.
******************************************************************************
***
The New Command CHECKRANGE
***
******************************************************************************
Checkrange checks whether or not the return value of a command is in the
specified range or ranges.
Usage:
******************************************************************************
***
The New Command TPM
***
******************************************************************************
The "tpm --init" uses 512-byte data at 0000:7C00 as buffer to initialise TPM.
Before you boot VISTA's BOOTMGR, you might have to use the "tpm --init"
command on some machines. Normally you want to issue the "tpm --init" command
after a CHAINLOADER command.
******************************************************************************
***
Delimitors or comments between titles
***
******************************************************************************
It is possible to use titles as delimitors or comments. A title(or menu item)
is called unbootable if all of its menu commands are not boot-sensitive.
The following commands are boot-sensitive(and others are not boot-sensitive):
boot
bootp
chainloader
configfile
embed
commandline
halt
install
kernel
pxe
quit
reboot
setup
An unbootable title will be skipped when the user presses the Up Arrow or Down
Arrow keys. Even the unbootable menu item can get accessed(and executed) by
using the Left Arrow and/or Right Arrow keys. Examples:
title This is an UNBOOTABLE entry(so this line is also a comment)
pause --wait=0 This title is a comment. Nothing to do.
pause --wait=0 You can use non-boot-sensitive commands here
pause --wait=0 of any kind and as many as you would like.
help
help root
help chainloader
help parttype
clear
title -----------------------------------------------------------pause --wait=0 This title is a delimitor. Nothing to do.
pause --wait=0 You can use non-boot-sensitive commands here
pause --wait=0 of any kind and as many as you would like.
clear
help
help boot
title ============================================================
pause --wait=0 This title is a delimitor. Nothing to do.
pause --wait=0 You can use non-boot-sensitive commands here
pause --wait=0 of any kind and as many as you would like.
help
clear
help pause
title ************************************************************
pause --wait=0 This title is a delimitor. Nothing to do.
pause --wait=0 You can use non-boot-sensitive commands here
pause --wait=0 of any kind and as many as you would like.
help kernel
help
clear
Note: An unbootable menu item must contain at least one command. If there
are no commands for a title, the title will be simply discarded and disappear.
******************************************************************************
***
Bifurcate drives
***
******************************************************************************
Some machines apply different actions to a drive between CHS and LBA mode.
When you read sectors using standard BIOS call int13/AH=02h, you might find
out the drive is a floppy. But when you read sectors using extended BIOS
call(EBIOS) int13/AH=42h, you could know the drive is a cdrom. Such a drive
is called bifurcate.
A bifurcate drive can have two drive numbers: one is the normal BIOS drive
number between 00 and FF in hexa, and this drive uses only CHS mode disk
access(standard BIOS int13/AH=02h); the other is the normal BIOS drive number
(Bitwise) OR'ed by 0x100(i.e., 256 in decimal), and this drive uses only
LBA mode disk access(EBIOS int13/AH=42h). For example, if the drive 0x00
(i.e., the first floppy) is bifurcate, then the drive (0x00) uses CHS mode
to access its sectors, and the drive (0x100) uses LBA (meaning EBIOS) mode
to access its sectors.
The geometry command can report the disk access mode for bifurcate drives as
BIF instead of the conventional CHS or LBA.
Known bifurcate drives. Virtual PC and some real machines are found to create
a bifurcate floppy drive when they boot from a floppy-emulation mode bootable
cdrom. The "geometry (fd0)" will show
drive 0x00(BIF): C/H/S=...Sector Count/Size=.../512
and "geometry (0x100)" will show
drive 0x100(BIF): C/H/S=...Sector Count/Size=.../2048
Actually (0x100) can access the whole cdrom, you may "ls (0x100)/" and find
your files on the cdrom(not the files inside the booted floppy image). Of
course "ls (fd0)/" will list the files inside the booted floppy image.
Note that only some (real or virtual) machines have this action, others
will not produce bifurcate drives.
******************************************************************************
***
GRLDR as PXE boot file
***
******************************************************************************
GRLDR can be used as the PXE boot file on a remote/network server. The (pd)
device is used to access files on the server. When GRLDR is booted through
network, it will use its preset menu as the config file. However, you may use
a "pxe detect" command, which acts the same way as PXELINUX:
* First, it will search for the config file using the hardware type (using
its ARP type code) and address, all in hexadecimal with dash separators;
for example, for an Ethernet (ARP type 1) with address 88:99:AA:BB:CC:DD
it would search for the filename 01-88-99-AA-BB-CC-DD.
* Next, it will search for the config file using its own IP address in
upper case hexadecimal, e.g. 192.0.2.91 -> C000025B. If that file is not
found, it will remove one hex digit and try again. At last, it will try
looking for a file named default (in lower case). As an example, if the
boot file name is /mybootdir/grldr, the Ethernet MAC address is
88:99:AA:BB:CC:DD and the IP address 192.0.2.91, it will try following
files (in that order):
/mybootdir/menu.lst/01-88-99-AA-BB-CC-DD
/mybootdir/menu.lst/C000025B
/mybootdir/menu.lst/C000025
/mybootdir/menu.lst/C00002
/mybootdir/menu.lst/C0000
/mybootdir/menu.lst/C000
/mybootdir/menu.lst/C00
/mybootdir/menu.lst/C0
/mybootdir/menu.lst/C
/mybootdir/menu.lst/default
You cannot directly map an image file on (pd). You must map it in memory using
the --mem option. For example,
map --mem (pd)/images/floppy.img (fd0)
map --hook
chainloader (fd0)+1
rootnoverify (fd0)
boot
One more example,
map --mem (pd)/images/cdimage.iso (0xff)
map --hook
chainloader (0xff)
boot
******************************************************************************
***
New program badgrub.exe
***
******************************************************************************
The new program badgrub.exe is intended to serve 'bad' machines(typically some
DELL models) that cannot run the normal grub.exe.
******************************************************************************
***
Conditional find
***
******************************************************************************
The new find syntax allows to find a device conditionally.
find [OPTIONS] [FILENAME] [CONDITION]
******************************************************************************
***
How to build grldr boot images
***
******************************************************************************
1. build 1.44M floppy image ext2grldr.img
dd if=/dev/zero of=ext2grldr.img bs=512 count=2880
mke2fs ext2grldr.img
mkdir ext2tmp
mount -o loop ext2grldr.img ext2tmp
cp default ext2tmp
cp menu.lst ext2tmp
cp grldr ext2tmp
umount ext2tmp
bootlace.com --floppy --chs --sectors-per-track=18 --heads=2 --start-sec
tor=0 --total-sectors=2880 ext2grldr.img
2. build 1.44M floppy image fat12grldr.img
dd if=/dev/zero of=fat12grldr.img bs=512 count=2880
mkdosfs fat12grldr.img
mkdir fat12tmp
mount -o loop fat12grldr.img fat12tmp
cp default fat12tmp
cp menu.lst fat12tmp
cp grldr fat12tmp
umount fat12tmp
bootlace.com --floppy --chs fat12grldr.img
3. build iso9660 CDROM image grldr.iso
mkdir iso_root
cp grldr iso_root
cp menu.lst iso_root
mkisofs -R -b grldr -no-emul-boot -boot-load-size 4 -o grldr.iso iso_roo
t
******************************************************************************
***
Use bootlace.com to install partition boot record
***
******************************************************************************
Since bootlace.com has not implemented the --install-partition option, you
need to use the already implemented --floppy=PartitionNumber option instead.
Hear is a way you might want to follow:
Step 1. Get the boot sectors of the partition and save to a file MYPART.TMP.
For NTFS, you need to get the beginning 16 sectors. For other type of
filesystems, you only need to get one sector, but getting more sectors
is also ok.
Step 2. Run this:
bootlace.com --floppy=Y --sectors-per-track=S --heads=H --start-sector=B
--total-sectors=C --vfat --ext2 --ntfs MYPART.TMP
where we suppose MYPART.TMP is for (hdX,Y) and the partition number Y
should be specified as in the --floppy=Y option.
Note that for FAT12/16/32/NTFS partitions, you can omit these options:
--sectors-per-track, --heads, --start-sector, --total-sectors,
--vfat and --ext2.
For NTFS partitions, you must specify --ntfs option.
For ext2 partitions, you can omit --vfat, --ntfs and --ext2 options,
but other options should be specified.
Step 3. Put MYPART.TMP back on to the boot sector(s) of your original partition
(hdX,Y).
Note: Only a few file systems(FAT12/16/32/NTFS/ext2/ext3) are supported by now.
Note2: Under Linux you may directly write the partition. That is to say, Step
1 and Step 3 are not needed. Simply use its device name instead of
MYPART.TMP.
Note3: grubinst has the feature of installing grldr boot code onto a
partition boot area.
******************************************************************************
***
Use a single key to select menu item
***
******************************************************************************
Some machines have a simplified keyboard. The keyborad might have only the
number keys 0 .. 9 plus a few other keys. When the menu displayed, the user
can strike a key for 8 times. When the menu handler detects the continuous
single keypress, it will assume the user want to use this key to select a menu
item and boot. This single key will act as the RIGHT-ARROW key for the user to
select a menu item. And 5 seconds later after the user stops the keypress,
the selected menu item will automatically boot. Any normal keys can be used as
a single key for this purpose, except for a few functional keys like b, e,
Enter, etc. Once another key is pressed, the feature of Single-Key-Selection
will disappear immediately.
******************************************************************************
***
Parameter file for bootlace running under DOS
***
******************************************************************************
You may move all or part of the command-line arguments into a file. The file
can have multi lines. Just like SPACEs and TABs, the CRs and LFs can also
delimit the commandline arguments in the parameter file.
Example:
bootlace < my_parafile
bootlace --read-only my_mbr < my_other_options
Note:
******************************************************************************
***
Use bootlace to create a triple MBR
***
******************************************************************************
This is typically used for USB drives, though it also works with hard drives.
Steps to create triple MBR:
1. Do a fresh FDISK to create a FAT12/16/32 partition starting at sector 95
(in LBA, that is, the begginning sector(MBR) is sector 0).
2. Install grldr boot sector onto the boot sector of this partition. See
section "Use bootlace.com to install partition boot record" above.
3. Get 96 sectors of the drive starting at sector 0(MBR), and save to file
MYMBR96.TMP.
4. Run bootlace.com:
bootlace.com MYMBR96.TMP
5. Put MYMBR96.TMP back onto the drive starting at MBR(sector 0).
Note: If the drive already has a triple MBR, then bootlace will cancel it
and restore the original partition layout.
******************************************************************************
***
Use 'pxe detect' in preset-menu
***
******************************************************************************
Now the "pxe" command has a new subcommand "detect":
pxe detect [BLOCK_SIZE] [MENU_FILE]
BLOCK_SIZE specifies the block size for PXE. If it is not specified or it is
0, then grub4dos will go through a probing process and get a proper value
larger than 0x10000(=64KB). Normally you want ADDR >= 0x1000000(=16MB), and
SIZE also >= 16MB. A large SIZE could speed up the progression of dd.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!!!!
!!!!
Caution! Both IF and OF can be a device name which stands for
!!!!
!!!!
all the sectors on the device. Take utmost care!
!!!!
!!!!______________________________________________________________________!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
******************************************************************************
***
New command 'uuid' to identify partitions
***
******************************************************************************
Usage:
uuid [DEVICE] [UUID]
If DEVICE is not specified, search for filesystem with UUID in all partitions
and set the partition containing the filesystem as new root (if UUID is
specified), or just list uuid's of all filesystems on all devices (if UUID is
not specified). If DEVICE is specified, return true or false according to
whether or not the DEVICE matches the specified UUID (if UUID is specified),
or just list the uuid of DEVICE (if UUID is not specified).
Example 1:
find --set-root uuid () 7f95820f-5e33-4e6c-8f50-0760bf06d79c
which will find a partition with uuid=7f95820f-5e33-4e6c-8f50-0760bf06d79c
and set the partition as root if found.
Example 2:
uuid ()
which will print the uuid of the current root device.
******************************************************************************
***
gfxmenu support in grub4dos
***
******************************************************************************
Gfxmenu support has been added to grub4dos. To use it, you must first find the
message file you need, then load it in menu.lst with command like this:
gfxmenu /message
This should be a gloabl command, that is, not inside any menu item. Also, it
can only be used in configure file, running it in console mode does not work.
gfxmenu does not work in conjunction with the password feature.
There are two major format of message file. Old format is created with gfxboot
3.2.* or older (size of message file is normally about 150K), while new format
is created with gfxboot 3.3.* and later (size of message file is normally above
300K). Both format are supported in grub4dos.
******************************************************************************
***
Use 'write' to write a string into a device or file
***
******************************************************************************
Usage:
write [--offset=SKIP] ADDR_OR_FILE INTEGER_OR_STRING
SKIP is an integer and defaults to 0.
If ADDR_OR_FILE is an integer, then it is treated as a memory address, and
INTEGER_OR_STRING must be an integer value. The integer INTEGER_OR_STRING
will be written to address (ADDR_OR_FILE + SKIP).
If ADDR_OR_FILE is a device or a file, then INTEGER_OR_STRING is treated as
a string which will be written to ADDR_OR_FILE at offset SKIP (in bytes).
The string is quoted with nothing, that is, neither with the single quote
char(') nor with the double quote char(").
Space char must be quoted with back slash(\). (Update: need not now)
Single quote char(') and double quote char(") are not interpreted specially
and can be used directly in the string.
Some C-style quote sequences are interpreted as follows:
\NNN
\\
backslash
\a
alert (BEL)
\b
backspace
\f
form feed
\n
new line
\r
carriage return
\t
horizontal tab
\v
vertical tab
\xHH
Just like dd, the write can neither enlarge nor reduce the size of the
destination file, the leftover tail of the string will be discarded.
The destination file cannot be a gzipped file.
Again like dd, the write command is also dangerous, use at your own risk.
And to be on the safe side, you should only write to memory files.
In some cases when writing a file in a NTFS volume, the write might fail.
If you attempt to write a device or a block file that is not in memory by
using write in a menu, you will safely be refused :-) (Update: no restrictions
now)
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!!~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~!!!!
!!!!
Caution! The file to write can be a device name which stands
!!!!
!!!!
for all the sectors on the device. Take utmost care!
!!!!
!!!!______________________________________________________________________!!!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
******************************************************************************
***
Item-by-item help text for menu entries
***
******************************************************************************
The help message at the bottom of the screen will vary as you choose the menu.
You may append your help text to the title line. The help text must begin
with "\n", for example:
title This is the title\nThis is the help text.\nAnd this is the 2nd lin
e of the help text.
Some C-style quote sequences are interpreted as stated in the section above.
******************************************************************************
***
initrd can load multiple cpio files for Linux 2.6 kernels
***
******************************************************************************
Usage:
initrd FILE [FILE ...]
Note 1: You should not load more than one oldstyle disk images in this way,
because this is not supported by Linux kernel.
Note 2: The FILEs should be specified in the same order as with syslinux.
******************************************************************************
***
access some internel variables at a fixed location
***
******************************************************************************
Address
=========
0000:8208
0000:8280
0000:8284
0000:8288
0000:828C
0000:8290
0000:8298
0000:829C
0000:82A0
0000:82A4
Note
Note
Note
Note
Note
1:
2:
3:
4:
5:
Length
========
4 (DWORD)
4 (DWORD)
4 (DWORD)
4 (DWORD)
4 (DWORD)
8 (QWORD)
4 (DWORD)
4 (DWORD)
4 (DWORD)
4 (DWORD)
Description
==============================================
install_partition (the boot partition)
boot_drive (the boot drive)
pxe_yip (your ip)
pxe_sip (server ip)
pxe_gip (gateway ip)
filesize (file size by last "cat --length=0")
saved_mem_upper (extended memory size in KB)
saved_partition (current root partition)
saved_drive (current root drive)
no_decompression (no auto gunzip)
use integer variables. You need not declare them, but use the memory
address directly. Usually you want to use variables as a logical
value or in a command for conditional test, e.g., of this form:
"checkrange RANGE read ADDR"
Note 6: no_decompression, saved_drive and saved_partition are writable.
******************************************************************************
***
possibility to run another menu.lst after gfxmenu
***
******************************************************************************
Notice the use of CONFIGFILE after GFXMENU in the following example:
# The menu.lst file for gfxmenu
default=0
timeout=5
gfxmenu /message
configfile /another.lst
title 0..........
................
title 1..........
................
title 2..........
................
# End of menu.lst
# Begin another.lst
default=0
timeout=5
title 0..........
................
title 1..........
................
title 2..........
................
# End of another.lst
This will try gfxmenu command first. On exit(or on failure) control will go
to another.lst file.
******************************************************************************
***
a range of drives can be unmapped
***
******************************************************************************
Usage:
map --unmap=RANGE
RANGE is a range of BIOS drive numbers to be unmapped. BIOS drive number 0
is for the first floppy, 1 is for the second floppy; 0x80 is for the first
hard drive, 0x81 is for the second hard drive, etc; virtual cdrom (hd32)
corresponds to BIOS drive number 0xA0, (hd33) corresponds to 0xA1, etc.
For description on RANGE, please refer to section `The New Command CHECKRANGE'
above.
Example 1:
map --unmap=0,0x80,0xff
This will unmap virtual floppy (fd0), virtual hard drive (hd0) and virtual
cdrom (0xff).
Example 2:
map --unmap=0:0xff
This will unmap all virtual floppies, all virtual hard drives and all virtual
cdroms.
Note 1: Normally a `map' command will add an item in the drive map table for
a virtual drive. But `--unmap' means items in the drive map table
(for the specified virtual drives) will be deleted.
Note 2: The --unhook option only breaks the INT13 hook(to the inerrupt
vector table). It will not affect the drive map table. And later on
execution of a `boot' command, the INT13 disk emulation routine will
automatically get hooked(to the interrupt vector table) when needed
(e.g., the drive map table is non-empty) even if it has been unhooked.
Note 3: Usually you want to do a `map --rehook' after you have changed the
drive map table.
******************************************************************************
***
geometry tune and sync
***
******************************************************************************
When a USB storage device is connected to a (or another) machine, the geometry
in the partition table or in the BPB of the volume could be invalid, and the
machine could hang at boot time. So you need to find out the correct geometry
for the drive (use `geometry --tune'), and then update the geometry in
partition table and BPB of the drive(use `geometry --sync').
The above steps are required if you are going to boot DOS, because DOS
requires the right geometry in the partition table and BPB. Windows/Linux may
also require it, since the boot process could run in real-mode.