// /*************************************************************************** // Aaru Data Preservation Suite // ---------------------------------------------------------------------------- // // Filename : Structs.cs // Author(s) : Natalia Portillo // // Component : Disk image plugins. // // --[ Description ] ---------------------------------------------------------- // // Contains structures for Digital Research's DISKCOPY disk images. // // --[ License ] -------------------------------------------------------------- // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as // published by the Free Software Foundation; either version 2.1 of the // License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, see . // // ---------------------------------------------------------------------------- // Copyright © 2011-2025 Natalia Portillo // ****************************************************************************/ using System.Runtime.InteropServices; namespace Aaru.Images; public sealed partial class DriDiskCopy { #region Nested type: Bpb [StructLayout(LayoutKind.Sequential, Pack = 1)] struct Bpb { /// Seems to be always 0x05 public byte five; /// A drive code that corresponds (but it not equal to) CMOS drive types public DriveCode _driveCode; /// Unknown seems to be always 2 public readonly ushort unknown; /// Cylinders public ushort cylinders; /// Seems to always be 0 public readonly byte unknown2; /// Bytes per sector public ushort bps; /// Sectors per cluster public readonly byte spc; /// Sectors between BPB and FAT public readonly ushort rsectors; /// How many FATs public readonly byte fats_no; /// Entries in root directory public readonly ushort root_entries; /// Total sectors public ushort sectors; /// Media descriptor public readonly byte media_descriptor; /// Sectors per FAT public readonly ushort spfat; /// Sectors per track public ushort sptrack; /// Heads public ushort heads; /// Hidden sectors before BPB public readonly uint hsectors; /// Drive number public readonly byte drive_no; /// Seems to be 0 public readonly ulong unknown3; /// Seems to be 0 public readonly byte unknown4; /// Sectors per track (again?) public ushort sptrack2; /// Seems to be 0 [MarshalAs(UnmanagedType.ByValArray, SizeConst = 144)] public byte[] unknown5; } #endregion #region Nested type: Footer [StructLayout(LayoutKind.Sequential, Pack = 1)] struct Footer { /// Signature: "DiskImage 2.01 (C) 1990,1991 Digital Research Inc\0" [MarshalAs(UnmanagedType.ByValArray, SizeConst = 51)] public byte[] signature; /// Information about the disk image, mostly imitates FAT BPB public Bpb bpb; /// Information about the disk image, mostly imitates FAT BPB, copy public Bpb bpbcopy; } #endregion }