📄 readme.txt
字号:
Project Name: GRUB for DOS
Definition: A GRUB build for DOS with extensions for disk drive emulation.
Current Version: 0.4.2
Author: Tinybit(tinybit@tom.com)
File Format: DOS EXE executable, Linux kernel
Purpose: Launch GRUB boot loader from within DOS
Circumstanced Use: in CONFIG.SYS or AUTOEXEC.BAT
Ability: Boot any installed operating system on your PC
Limitations: GRUB.EXE may run in real mode DOS. It cannot run from a DOS
BOX inside Windows, nor if some TSR programs are running.
Currently runs on MS-DOS 3.30, 4.0, 5.0, 6.0, 6.20. 6.21, 6.22,
7.0(Win95), 7.10(Win98), 8.0(WinME/NT/2000/XP), and
FreeDOS(build 2029 and hopefully more future builds).
Limited support for returning to DOS from GRUB.EXE, see below.
Copyright(C): Tinybit(tinybit@tom.com)
License: GNU GPL(see file COPYING)
source available as diff patches to the GNU GRUB release.
See the shell script COMPILE for more info.
WARRANTY: NO WARRANTY(see file COPYING)
TO DO: Let GRLDR.MBR support more filesystems.
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)
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
filenames because DOS-filenames won't access a file in a
Linux ext2 partition for example).(See Update 2 below)
Update: FILE can be the contents of a menu. Use semi-colon
to delimitate the embedded commands here in FILE. The FILE
can be enclosed with a pair of double-quotes. For example:
GRUB --config-file="root (hd0,0);chainloader +1"
This command will boot the system in (hd0,0).
Another example:
GRUB --config-file="reboot"
This command will reboot the machine.
One more example:
GRUB --config-file="halt"
This command will halt the machine.
if --bypass is specified, GRUB will exit to DOS when
timeout reached.
The option `--time-out=T' specifies the timeout value in
seconds. T defaults to 5 if --bypass is specified and defaults
to 0 if --bypass is not specified.
The default hot key value is 0x3920(for space bar). If this
key is pressed, GRUB will boot normally. If another key is
pressed, GRUB will terminate immediately and return back to
DOS. See "int 16 keyboard scan codes" below.
Each option can be specified only once at most.
Update 2: DOS filenames have been supported(patched by John
Cobb). If the beginning two characters of FILE are "#@", then
the rest of FILE is taken as a DOS filename. Example:
GRUB --config-file="#@c:\menu.lst"
Only the beginning 4KB of the DOS file will be used. The file
should be an uncompressed text file.
Note: You may also use the `direct DOS file access' with the
SHELL or INSTALL line in CONFIG.SYS, but should not use it
with the DEVICE line. The DOS document said that a DOS device
driver should not call the `open file' DOS call.
Compile: You should unzip the package under Linux in this way:
unzip grub_for_dos-*.zip
then cd into the grub_for_dos-* dir and do a make.
--------------------------------------------------------
Web site: http://sarovar.org/projects/grub4dos/
Web site: http://grub4dos.jot.com/
Web site: http://grub4dos.freespaces.com/
Web site: http://grub4dos.sourceforge.net/ (WinGRUB by bean123)
Web site: http://grub.linuxeden.com/ (scratchpad, mainly in Chinese)
Update 1: 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).
Notice! In the future, we will remove NTFS support. For Windows users,
please create an FAT partition and place GRLDR and menu.lst
there. From now on, please don't report bugs relevant to NTFS.
Someone reports that Windows XP with newer SPs and Windows
Vista have intentionally broken the compatiblity with many
things(including GRLDR). So you will get into trouble with
these systems.
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: Beginning at version 0.4.0, GRUB for DOS supports memdrives.
Example:
# boot into a floppy image
map --mem (hd0,0)/floppy.img (fd0)
map --hook
chainloader (fd0)+1
rootnoverify (fd0)
map --floppies=1
boot
Because the image will be copied to a memory area, the image
itself can be non-contiguous and even gzipped.
Another Example:
map --mem=-2880 (hd0,0)/floppy.img (fd0)
This memdrive (fd0) will occupy at least 1440 KB of memory.
This is useful when the size of a 1.44M-floppy image is less
than 1440 KB.
One more example:
map --mem --read-only (hd0,0)/hd.img (hd1)
This memdrive is a hard drive, and read-only. That means you
will not be able to write data to the memdrive (hd1).
You can use many memdrives and many ordinary virtual emulated
disk-based drives at the same time.
If the BIOS does not support int15/EAX=e820h, you will not be
able to use any memdrives.
Update 4: For memdrive emulation, a single-partition image can be used
instead of a whole-harddrive image. Example:
map --mem (hd0,7)/win98.img (hd0)
map --hook
chainloader (hd0)+1
rootnoverify (hd0)
map --harddrives=1
boot
Here win98.img is a partition image without the leading MBR
and partition table in it. Surely GRUB for DOS will build an
MBR and partition table for the memdrive (hd0).
Update 5: Now GRLDR can be used as a no-emulation-mode bootable CD-ROM
boot image. Example for Linux users:
mkdir iso_root
cp grldr iso_root
mkisofs -R -b grldr -no-emul-boot -boot-load-seg 0x1000 -o bootable.iso iso_root
Note: There are quite a lot of buggy BIOSes that cannot boot
the CD-ROM made with bootable.iso. The boot image of
bootable.iso is the whole GRLDR file, not solely the first
2048 bytes of GRLDR. Buggy BIOSes only load the beginning
2048 bytes of the boot image, and will hang the machine. For
Those buggy BIOSes, please use stage2_eltorito instead.
Do a compilation, and the stage2_eltorito will be created in
the grub-0.97/stage2/ directory. For detailed usage about
stage2_eltorito, google the Internet, please. Don't use the
above `mkisofs' line on stage2_eltorito. The line only works
for GRLDR. The stage2_eltorito has a different `mkisofs' line
as in the following:
mkdir -p iso_root/boot/grub
cp stage2_eltorito iso_root/boot/grub
mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot \
-boot-load-size 4 -boot-info-table \
-o stage2.iso iso_root
The option -boot-info-table should not be used with the GRLDR
line, while it must be used with stage2_eltorito.
Update 6: The Chinese special build is in the "chinese" subdirectory.
(patched by Gandalf, 2005-06-27)
The Chinese special build also has scdrom builtin.
(update: scdrom has been dropped since 2006-07-20)
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 0xff,
because 0xff is for the (md) device).
Update 9: Directly boot NTLDR of WinNT/2K/XP and IO.SYS of Win9x/ME and
KERNEL.SYS of FreeDOS. Examples:
chainloader --edx=0xPPYY (hd0,0)/ntldr
boot
chainloader --edx=0xYY (hd0,0)/io.sys
boot
chainloader --ebx=0xYY (hd0,0)/kernel.sys
boot
Hex YY specifies the boot drive number, and hex PP specifies
the boot partition number of NTLDR. If the boot drive is
floppy, PP should be the hex value ff, i.e., decimal 255.
For KERNEL.SYS of FreeDOS, the --edx won't work,
use --ebx please.
The option --edx ( --ebx ) can be omitted if the file is in
its normal place. But in some cases, those options are needed.
If, e.g., the ntldr file is in an ext2 partition called
(hd2,8) while you want it to think of the Windows partition
(hd0,7) as the boot partition, then --edx is required:
chainloader --edx=0x0780 (hd2,8)/ntldr
For DOS kernels(i.e., IO.SYS and KERNEL.SYS), the boot
partition number is meaningless, so you only need to specify
the correct boot drive number YY(but specifying the boot
partition number is harmless).
Tip: CMLDR (the ComMand LoaDeR, which is used to load the
Windows Fault Recovery Console) can be chainloaded as well
as NTLDR.
Bean has successfully decompressed and booted IO.SYS of WinME.
Thanks for the great job!
--------------------------------------------------------
There is no full documentation in English at present. Here are some
examples showing the usage of disk emulation commands:
1. Emulates HD partition C: as floppy drive A: and boot win98 from C:
map --read-only (hd0,0)+1 (fd0)
chainloader (hd0,0)+1
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -