Bootcode [446] boot code are generally fixed for guiding x86, not control.
Define the partition table is as follows:
typedef struct {
uchar BootFlag; / / start flag
CHS StartCHS; / / partition begins cylinder, head, sector
uchar SystemID; / / partition type
CHS EndCHS; / / partition end of the cylinder, head, sector
ulong RelativeSectors; / / partition starting sector number, refers to the partition with respect to the recording of the partition of a partitioned table fan
Difference between the position of the area (the partition table: LBA = 0x0).
ulong TotalSectors;//Total number of sectors partition
}PartitionTable;
Where CHS is a cylinder, head, sector structure, is defined as follows:
struct CHS {
uchar Head; //head
unsigned Sector : 6; //sector
unsigned CyH2: 2; / / cylinder (high two).
uchar CyL8; / / cylinder (low eight).
ulong Cylinder () {return (uint (CyH2) * 256 + CyL8);} / / returns the column nominal value
void SetCylinder (uint Cylinder) / / Set column nominal value {
CyH2 = (Cylinder >> 8) &0x3; CyL8 = (Cylinder & 0xff);
}
};
Example: 80 01 01 00 0B FC FE BF 3f 00 00 00 7 86 00 BB