⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 readme.txt

📁 grub for dos ,people can use it in dos for calling linux
💻 TXT
📖 第 1 页 / 共 5 页
字号:
		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	8	OEM name string (of OS which formatted the disk).

0Bh	2	Bytes per sector. Must be 512.

0Dh	1	Sectors per cluster. Valid values are 1, 2, 4, 8, 16, 32, 64
		and 128. But a cluster size larger than 32K should not occur.

0Eh	2	Reserved sectors(number of sectors before the first FAT,
		including the boot sector), usually 1.

10h	1	Number of FATs(nearly always 2).

11h	2	(Maximum number of root directory entries)Must be 0.

13h	2	(Total number of sectors for small disks only)Must be 0.

15h	1	Media descriptor byte, pretty meaningless now (see below).

16h	2	(Sectors per FAT)Must be 0.

18h	2	Sectors per track.

1Ah	2	Total number of heads/sides.

1Ch	4	Number of hidden sectors (those preceding the boot sector).

		Also referred to as the starting sector of the partition.

		For floppies, it should be 0.

20h	4	Total number of sectors for large disks.

24h	4	FAT32 sectors per FAT.

28h	2	If bit 7 is clear then all FATs are updated, otherwise bits
		0-3 give the current active FAT, all other bits are reserved.

2Ah	2	High byte is major revision number, low byte is minor revision
		number, currently both are 0.

2Ch	4	Root directory starting cluster.

30h	2	File system information sector.

32h	2	If non-zero this gives the sector which holds a copy of the
		boot record, usually 6.

34h	12	Reserved, set to 0.

40h	1	BIOS drive number of the boot device.

		80h is first HDD, 00h is first FDD.

		Actually this byte is ignored for read. The boot code will
		write DL onto this byte. The BIOS or the caller should set
		drive number in DL.

		We assume all BIOSes pass correct drive number in DL.
		Buggy BIOSes are not supported!!

41h	1	Partition number of this filesystem in the boot drive.

		This byte is ignored for read. The boot code will write
		partition number onto this byte. See offset 5Dh below.

42h	1	Signature (must be 28h or 29h to be recognised by NT).

43h	4	Volume serial number.

47h	11	Volume label.

52h	8	File system ID. "FAT32   ".

5Ah	1	opcode for "cli".

5Bh	1	opcode for "cld".

5Ch	1	opcode for "mov dh, imm8".

5Dh	1	Partition number of this partition on the boot drive.

		0, 1, 2, 3 are primary partitions.
		4, 5, 6, ... are logical partitions in the extended partition.

		0xff is for whole drive. So for floppies, it should be 0xff.

5Eh	414	Machine code.

1FCh	4	Boot Signature AA550000h. (Win9x uses 4 bytes as magic value)

------------------------------------------------------------------------------

Appendix A: File System Information Sector of FAT32(not used by grldr)

Offset	Length	Description
======	======	==============================================================
0h	4	Leading Signature 41615252h.

4h	480	Reserved, set to 0.

1E4h	4	FSI structure signature 61417272h.

1E8h	4	Contains the last known count of free clusters, if this is
		equal to FFFFFFFFh, then the count is unknown.

1ECh	4	Cluster number at which you should begin a search for a free
		cluster, if this is equal to FFFFFFFFh then the field has not
		been set.

1F0h	12	Reserved, set to 0.

1FCh	4	Trailing Signature AA550000h.

------------------------------------------------------------------------------

Appendix B: Media Descriptor Byte(not used by grldr)

The Media descriptor byte is meaningless because of the duplications, F0h for
example.

Byte	Type of disk	Sectors	Heads	Tracks	Capacity
----	------------	-------	-----	------	--------
FFh	5 1/4"		8	2	40	320KB
FEh	5 1/4"		8	1	40	160KB
FDh	5 1/4"		9	2	40	360KB
FCh	5 1/4"		9	1	40	180KB
FBh	both		9	2	80	640KB
FAh	both		9	1	80	320KB
F9h	5 1/4"		15	2	80	1200KB
F9h	3 1/2"		9	2	80	720KB
F0h	3 1/2"		18 	2	80	1440KB
F0h	3 1/2"		36 	2	80	2880KB
F8h	hard disk	NA	NA	NA	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.

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.

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
			partition table(usually an OS boot sector)
		bit1=0: enable the boot of PREVIOUS MBR with invalid
			partition table(usually an OS boot sector)

		bit2 - bit6: reserved

		bit7=1: try to boot PREVIOUS MBR after the search for GRLDR
		bit7=0: try to boot PREVIOUS MBR before the search for GRLDR

03h	1	timeout in seconds to wait for a key press. 0xff stands for
		waiting all the time(endless).

04h	2	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	1	preferred boot drive number, 0xff for no-drive
07h	1	preferred partition number, 0xff for whole drive

		if the preferred boot drive number is 0xff, the order of the
		search for GRLDR will be:

			(hd0,0), (hd0,1), ..., (hd0,L),(L=max partition number) 
			(hd1,0), (hd0,1), ..., (hd0,M),(M=max partition number)
			... ... ... ... ... ... ... ... 
			(hdX,0), (hd0,1), ..., (hd0,N),(N=max partition number)
						       (X=max harddrive number)
			(fd0)

		otherwise, if the preferred boot drive number is Y(not equal to
		0xff) and the preferred partition number is K, then the order of
		the search for GRLDR will be:

			(Y) if K=0xff; or (Y,K) otherwise
			(hd0,0), (hd0,1), ..., (hd0,L),(L=max partition number) 
			(hd1,0), (hd0,1), ..., (hd0,M),(M=max partition number)
			... ... ... ... ... ... ... ... 
			(hdX,0), (hd0,1), ..., (hd0,N),(N=max partition number)
						       (X=max harddrive number)
			(fd0)

		Note: if Y < 0x80, then (Y) is floppy, else (Y) is harddrive,
		      and (Y,K) is partition number K on harddrive (Y).


******************************************************************************
***        bootlace.com - Install GRLDR.MBR bootstrap code to MBR          ***
******************************************************************************

BOOTLACE.COM installs GRLDR.MBR boot record to the MBR of a harddrive or of a
harddrive image file, or to the boot sector of a floppy or a floppy image.

Usage:

	bootlace.com  [OPTIONS]  DEVICE_OR_FILE

OPTIONS:

	--read-only		do everything except the actual write to the
				specified DEVICE_OR_FILE

	--no-backup-mbr		do not copy the old MBR to the second sector of
				DEVICE_OR_FILE

	--force-backup-mbr	force the copy of old MBR to the second sector
				of DEVICE_OR_FILE

	--mbr-enable-floppy	enable the search for GRLDR on floppy

	--mbr-disable-floppy	disable the search for GRLDR on floppy

	--mbr-enable-osbr	enable the boot of PREVIOUS MBR with invalid
				partition table(usually an OS boot sector)

	--mbr-disable-osbr	disable the boot of PREVIOUS MBR with invalid
				partition table(usually an OS boot sector)

	--boot-prevmbr-first	try to boot PREVIOUS MBR before the search for
				GRLDR

	--boot-prevmbr-last	try to boot PREVIOUS MBR after the search for
				GRLDR

	--preferred-drive=D	preferred boot drive number, 0 <= D < 255

	--preferred-partition=P	preferred partition number, 0 <= P < 255

	--time-out=T		wait T seconds before booting PREVIOUS MBR. if
				T is 0xff, wait forever. The default is 5.
	
	--hot-key=K		if the desired key K is pressed, start GRUB
				before booting PREVIOUS MBR. K is a word
				value, just as the value in AX register
				returned from int16/AH=1. The high byte is the
				scan code and the low byte is ASCII code. The
				default is 0x3920 for space bar. See "int 16
				keyboard scan codes" below.

	--floppy		if DEVICE_OR_FILE is floppy, use this option.

	--floppy=N		if DEVICE_OR_FILE is a partition on a hard
				drive, use this option. N is used to specify
				the partition number: 0,1,2 and 3 for the
				primary partitions, and 4,5,6,... for the
				logical partitions.

	--sectors-per-track=S	specifies sectors per track for --floppy.
				1 <= S <= 63, default is 63.

	--heads=H		specifies number of heads for --floppy.
				1 <= H <= 256, default is 255.

	--start-sector=B	specifies hidden sectors for --floppy=N.

	--total-sectors=C	specifies total sectors for --floppy.
				default is 0.

	--lba			use lba mode for --floppy. If the floppy BIOS
				has LBA support, you can specify --lba here.
				It is assumed that all floppy BIOSes have CHS
				support. So you would rather specify --chs.
				If neither --chs nor --lba is specified, then
				the LBA indicator(i.e., the third byte of the
				boot sector) will not be touched.

	--chs			use chs mode for --floppy. You should specify
				--chs if the floppy BIOS does not support LBA.
				We assume all floppy BIOSes have CHS support.
				So it is likely you want to specify --chs.
				If neither --chs nor --lba is specified, then
				the LBA indicator(i.e., the third byte of the
				boot sector) will not be touched.

	--fat12			FAT12 is allowed to be installed for --floppy.

	--fat16			FAT16 is allowed to be installed for --floppy.

	--fat32			FAT32 is allowed to be installed for --floppy.

	--vfat			FAT12/16/32 are allowed to be installed for
				--floppy.

	--ntfs			NTFS is allowed to be installed for --floppy.

	--ext2			EXT2 is allowed to be installed for --floppy.

	--install-partition=I	Install the boot record onto the boot area of
				partition number I of the specified hard drive
				or harddrive image DEVICE_OR_FILE.

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

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -