|
According to the specification as following:
******************************************************************************
*** 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.
I write the grldr.mbr to the disk mbr, but it looks wrong. The error information displays as "Missing helper...".
My code looks like this:
===code===
//buffer[], read from grldr.mbr
//c[],read the first sector from harddisk
for(int x=0x01b8;x<0x0200;x++)
{
buffer[x] = c[x];
}
//Then write buffer to disk.
===code===
Who can answer me why?
[ 本帖最后由 2011bigbarry 于 2012-5-3 18:57 编辑 ] |
|