Beispiel #1
0
 public void Setup(BlockDevice hd, byte *aMBR)
 {
     partitions = new Partition[4];
     ParsePartition(0, hd, aMBR, 446);
     ParsePartition(1, hd, aMBR, 462);
     ParsePartition(2, hd, aMBR, 478);
     ParsePartition(3, hd, aMBR, 494);
 }
Beispiel #2
0
        private static void InitAta(ControllerIdEnum aControllerID, BusPositionEnum aBusPosition)
        {
            var xIO  = aControllerID == ControllerIdEnum.Primary ? baseIOGroup.ATA1 : baseIOGroup.ATA2;
            var xATA = new BlockDevice();

            xATA.Setup(xIO, aControllerID, aBusPosition);

            if (xATA.DriveType == SpecLevel.Null)
            {
                return;
            }
            if (xATA.DriveType != SpecLevel.ATA)
            {
                return;
            }
            DeviceManager.AllDevices.Add(xATA);
        }
Beispiel #3
0
            public void ParsePartition(int no, BlockDevice hd, byte *aMBR, uint aLoc)
            {
                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();
                    xPartInfo.Setup(hd, xStartSector, xSectorCount, xSystemID);
                    partitions[no] = xPartInfo;
                }
            }