internal void ReadDiskHeader() { if (DiskInfo == null || AllocationMap == null) { DiskInfo = new OS9DiskInfo(ReadSector(IdentificationSector)); AllocationMap = new OS9AllocationMap(ReadSector(AllocationMapSector), DiskInfo.AllocationMapSize); } }
/// <summary> /// Event handler for the SectorWritten event of the associated disk object. /// </summary> /// <param name="obj"></param> /// <param name="e"></param> private void SectorWrittenHandler(Object obj, SectorWrittenEventArgs e) { int lsn = SectorToLsn(e.Head, e.Track, e.Sector); if (lsn == IdentificationSector || lsn == AllocationMapSector) { DiskInfo = null; AllocationMap = null; } }
public OS9(IDisk disk, bool iswriteable) { if (disk == null) { throw new ArgumentNullException(); } Disk = disk; IsWriteable = iswriteable; DiskInfo = new OS9DiskInfo(Disk.ReadSector(0, 0, 1)); Tracks = Disk.Tracks; Sectors = DiskInfo.Sectors * Disk.Heads; Disk.SectorWritten += SectorWrittenHandler; }
public OS9(IDisk disk, bool iswriteable) { if (disk == null) throw new ArgumentNullException(); Disk = disk; IsWriteable = iswriteable; DiskInfo = new OS9DiskInfo(Disk.ReadSector(0, 0, 1)); Tracks = Disk.Tracks; Sectors = DiskInfo.Sectors * Disk.Heads; Disk.SectorWritten += SectorWrittenHandler; }