|
楼主 |
发表于 2009-3-21 07:49:18
|
显示全部楼层
原帖由 Climbing 于 2009-3-21 01:21 发表
只想提醒楼主:虽然grubinst一直没有更新,但你有没有研究过grubinst的命令行参数?
你的程序支持所有的这些命令行参数吗?将grub4dos引导代码写进MBR绝不仅仅是将代码写进去那么简单。
事实上我根本没有研究它的命令行参数,也没打算研究和支持它所有的参数,我只是参考了 Grub4Dos 的 README_GRUB4DOS.txt 中的如下片段,以及各类型分区的说明部分。此程序仅提供引导程序的安装,对于其它部分,还没有研究过,呵呵。
******************************************************************************
*** 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.
事实上将 GRUB4DOS 写进 MBR 就这么简单,除了设置相应参数字节外,当然还要检查原来是否具有 MBR 和是否需要备份原有 MBR。仅此而已,Climbing 把问题考虑得太复杂了,呵呵
[ 本帖最后由 Pauly 于 2009-5-27 13:09 编辑 ] |
|