Example #1
0
        /// <summary>
        /// Read a sector from the disk
        /// </summary>
        /// <param name="lsn">Logical sector number to read</param>
        /// <returns>Array of bytes containing sector data</returns>
        private byte[] ReadLSN(int lsn)
        {
            if (lsn == 0)
            {
                return(DiskImage.ReadSector(0, 0, 1));
            }

            int track  = lsn / (LogicalSectors * LogicalHeads);
            int head   = (lsn / LogicalSectors) % LogicalHeads;
            int sector = (lsn % LogicalSectors) + 1;

            return(DiskImage.ReadSector(track, head, sector));
        }
Example #2
0
 public byte[] ReadSector(int track, int head, int sector)
 {
     return(DiskImage.ReadSector(track, head, sector));
 }