// /*************************************************************************** // Aaru Data Preservation Suite // ---------------------------------------------------------------------------- // // Filename : Structs.cs // Author(s) : Natalia Portillo // // Component : Random Block File filesystem plugin // // --[ 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-2024 Natalia Portillo // ****************************************************************************/ using System.Runtime.InteropServices; namespace Aaru.Filesystems; /// /// Implements detection of the Locus filesystem public sealed partial class RBF { #region Nested type: IdSector /// Identification sector. Wherever the sector this resides on, becomes LSN 0. [StructLayout(LayoutKind.Sequential, Pack = 1)] readonly struct IdSector { /// Sectors on disk [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] public readonly byte[] dd_tot; /// Tracks public readonly byte dd_tks; /// Bytes in allocation map public readonly ushort dd_map; /// Sectors per cluster public readonly ushort dd_bit; /// LSN of root directory [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] public readonly byte[] dd_dir; /// Owner ID public readonly ushort dd_own; /// Attributes public readonly byte dd_att; /// Disk ID public readonly ushort dd_dsk; /// Format byte public readonly byte dd_fmt; /// Sectors per track public readonly ushort dd_spt; /// Reserved public readonly ushort dd_res; /// LSN of boot file [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] public readonly byte[] dd_bt; /// Size of boot file public readonly ushort dd_bsz; /// Creation date [MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)] public readonly byte[] dd_dat; /// Volume name [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] public readonly byte[] dd_nam; /// Path options [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] public readonly byte[] dd_opt; /// Reserved public readonly byte reserved; /// Magic number public readonly uint dd_sync; /// LSN of allocation map public readonly uint dd_maplsn; /// Size of an LSN public readonly ushort dd_lsnsize; /// Version ID public readonly ushort dd_versid; } #endregion #region Nested type: NewIdSector /// /// Identification sector. Wherever the sector this resides on, becomes LSN 0. Introduced on OS-9000, this can be /// big or little endian. /// [StructLayout(LayoutKind.Sequential, Pack = 1)] readonly struct NewIdSector { /// Magic number public readonly uint rid_sync; /// Disk ID public readonly uint rid_diskid; /// Sectors on disk public readonly uint rid_totblocks; /// Cylinders public readonly ushort rid_cylinders; /// Sectors in cylinder 0 public readonly ushort rid_cyl0size; /// Sectors per cylinder public readonly ushort rid_cylsize; /// Heads public readonly ushort rid_heads; /// Bytes per sector public readonly ushort rid_blocksize; /// Disk format public readonly ushort rid_format; /// Flags public readonly ushort rid_flags; /// Padding public readonly ushort rid_unused1; /// Sector of allocation bitmap public readonly uint rid_bitmap; /// Sector of debugger FD public readonly uint rid_firstboot; /// Sector of bootfile FD public readonly uint rid_bootfile; /// Sector of root directory FD public readonly uint rid_rootdir; /// Group owner of media public readonly ushort rid_group; /// Owner of media public readonly ushort rid_owner; /// Creation time public readonly uint rid_ctime; /// Last write time for this structure public readonly uint rid_mtime; /// Volume name [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] public readonly byte[] rid_name; /// Endian flag public readonly byte rid_endflag; /// Padding [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] public readonly byte[] rid_unused2; /// Parity public readonly uint rid_parity; } #endregion }