public void Setup(DiskDrive hd, byte *aMBR) { partitions = new List <Partition>(); ParsePartition(0, hd, aMBR, 446); ParsePartition(1, hd, aMBR, 462); ParsePartition(2, hd, aMBR, 478); ParsePartition(3, hd, aMBR, 494); }
public void ParsePartition(uint no, DiskDrive hd, byte *aMBR, uint aLoc) { var info = (PartitionTableEntry *)(uint)aMBR; byte xSystemID = aMBR[aLoc + 4]; EBRLocation = 0; if (xSystemID == 0x5 || xSystemID == 0xF || xSystemID == 0x85) { EBRLocation = Utils.ToUInt32(aMBR, aLoc + 8); } else if (xSystemID != 0) { uint xStartSector = Utils.ToUInt32(aMBR, aLoc + 8); uint xSectorCount = Utils.ToUInt32(aMBR, aLoc + 12); Partition xPartInfo = new Partition(hd, xStartSector, xSectorCount, no); partitions.Add(xPartInfo); } }