public MasterBootBlock(IDiskDevice diskDevice) { this.diskDevice = diskDevice; this.valid = false; // needs to be read first partitions = new GenericPartition[MaxMBRPartitions]; code = null; ReadMasterBootBlock(); }
public MasterBootBlock (IDiskDevice diskDevice) { this.diskDevice = diskDevice; this.valid = false; // needs to be read first partitions = new GenericPartition[MaxMBRPartitions]; code = null; ReadMasterBootBlock (); }
/// <summary> /// Initializes a new instance of the <see cref="MasterBootBlock"/> class. /// </summary> /// <param name="diskDevice">The disk device.</param> public MasterBootBlock(IDiskDevice diskDevice) { this.diskDevice = diskDevice; Partitions = new GenericPartition[MaxMBRPartitions]; for (uint i = 0; i < MaxMBRPartitions; i++) { Partitions[i] = new GenericPartition(i); } Read(); }
/// <summary> /// Initializes a new instance of the <see cref="PartitionDevice"/> class. /// </summary> /// <param name="diskDevice">The disk device.</param> /// <param name="partition">The partition.</param> /// <param name="readOnly">if set to <c>true</c> [read only].</param> public PartitionDevice(IDiskDevice diskDevice, GenericPartition partition, bool readOnly) { this.diskDevice = diskDevice; startBlock = partition.StartLBA; blockCount = partition.TotalBlocks; this.readOnly = readOnly; base.Parent = diskDevice as Device; base.Name = base.Parent.Name + "/Partition" + (partition.Index + 1).ToString(); // need to give it a unique name base.DeviceStatus = DeviceStatus.Online; }
/// <summary> /// Initializes a new instance of the <see cref="PartitionDevice"/> class. /// </summary> /// <param name="diskDevice">The disk device.</param> /// <param name="readOnly">if set to <c>true</c> [read only].</param> public PartitionDevice(IDiskDevice diskDevice, bool readOnly) { this.diskDevice = diskDevice; startBlock = 0; blockCount = diskDevice.TotalBlocks; this.readOnly = readOnly; base.Parent = diskDevice as Device; base.Name = base.Parent.Name + "/Raw"; // need to give it a unique name base.DeviceStatus = DeviceStatus.Online; }
/// <summary> /// Initializes a new instance of the <see cref="PartitionDevice"/> class. /// </summary> /// <param name="diskDevice">The disk device.</param> /// <param name="partition">The partition.</param> /// <param name="readOnly">if set to <c>true</c> [read only].</param> public PartitionDevice(IDiskDevice diskDevice, GenericPartition partition, bool readOnly) { this.diskDevice = diskDevice; this.startBlock = partition.StartLBA; this.blockCount = partition.TotalBlocks; this.readOnly = readOnly; base.parent = diskDevice as Device; base.name = base.parent.Name + "/Partition" + (partition.Index + 1).ToString(); // need to give it a unique name base.deviceStatus = DeviceStatus.Online; }
/// <summary> /// Initializes a new instance of the <see cref="PartitionDevice"/> class. /// </summary> /// <param name="diskDevice">The disk device.</param> /// <param name="readOnly">if set to <c>true</c> [read only].</param> public PartitionDevice(IDiskDevice diskDevice, bool readOnly) { this.diskDevice = diskDevice; this.startBlock = 0; this.blockCount = diskDevice.TotalBlocks; this.readOnly = readOnly; base.parent = diskDevice as Device; base.name = base.parent.Name + "/Raw"; // need to give it a unique name base.deviceStatus = DeviceStatus.Online; }
public static unsafe void Init(IDiskDevice dev) { SharedDisk = dev; var port = Serial.COM2; Serial.SetupPort(port); //var path = "os/App.Shell.bin"; //StartProcess(path); }
public PartitionDevice(GenericPartition partition, IDiskDevice diskDevice, bool readOnly) { this.diskDevice = diskDevice; this.start = partition.StartLBA; this.blockCount = partition.TotalBlocks; this.readOnly = readOnly; base.parent = diskDevice as Device; base.name = base.parent.Name + "/Partition" + (partition.Index + 1).ToString(); // need to give it a unique name base.deviceStatus = DeviceStatus.Online; DeviceManager.Add(this); }
public override void Initialize() { var configuration = Device.Configuration as DiskPartitionConfiguration; StartBlock = configuration.StartLBA; BlockCount = configuration.TotalBlocks; ReadOnly = configuration.ReadOnly; diskDevice = Device.Parent.DeviceDriver as IDiskDevice; BlockSize = diskDevice.BlockSize; Device.ComponentID = StartBlock; if (StartBlock == 0) { Device.Name = Device.Parent.Name + "/Raw"; } else { Device.Name = Device.Parent.Name + "/Partition" + (configuration.Index + 1).ToString(); } }
/// <summary> /// Creates the partition devices. /// </summary> public void CreatePartitionDevices() { // FIXME: Do not create multiple partition devices if this method executed more than once // Find all online disk devices foreach (IDevice device in deviceManager.GetDevices(new FindDevice.IsDiskDevice(), new FindDevice.IsOnline())) { IDiskDevice diskDevice = device as IDiskDevice; MasterBootBlock mbr = new MasterBootBlock(diskDevice); if (mbr.Valid) { for (uint i = 0; i < MasterBootBlock.MaxMBRPartitions; i++) { if (mbr.Partitions[i].PartitionType != PartitionType.Empty) { deviceManager.Add(new PartitionDevice(diskDevice, mbr.Partitions[i], false)); } } } } }
public T GetCustomDevice <T> (T device) where T : class, IDevice { IDiskDevice disk_device = device as IDiskDevice; IVolume volume = device as IVolume; if (volume != null && CheckStorageCaps(volume.Parent) && CheckVolume(volume)) { return(AsPodSleuthDevice <T> (volume, device)); } else if (disk_device == null || !CheckStorageCaps(device)) { return(device); } foreach (IVolume child_volume in disk_device.Volumes) { if (CheckVolume(child_volume)) { return(AsPodSleuthDevice <T> (child_volume, device)); } } return(device); }
/// <summary> /// Initializes a new instance of the <see cref="GUIDPartitionTable"/> class. /// </summary> /// <param name="diskDevice">The disk device.</param> public GUIDPartitionTable(IDiskDevice diskDevice) { this.diskDevice = diskDevice; }
/// <summary> /// Initializes a new instance of the <see cref="MasterBootBlock"/> class. /// </summary> /// <param name="diskDevice">The disk device.</param> public MasterBootBlock(IDiskDevice diskDevice) { this.diskDevice = diskDevice; Partitions = new GenericPartition[MaxMBRPartitions]; for (uint i = 0; i < MaxMBRPartitions; i++) Partitions[i] = new GenericPartition(i); Read(); }
public DiskReplaceRecommendation(IDiskDevice disk, string explanation) { _source = disk; Explanation = explanation; }