// /*************************************************************************** // Aaru Data Preservation Suite // ---------------------------------------------------------------------------- // // Filename : Structs.cs // Author(s) : Natalia Portillo // // Component : MINIX 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-2025 Natalia Portillo // ****************************************************************************/ using System.Runtime.InteropServices; using Aaru.CommonTypes.Attributes; namespace Aaru.Filesystems; // Information from the Linux kernel /// /// Implements detection of the MINIX filesystem public sealed partial class MinixFS { #region Nested type: SuperBlock /// Superblock for Minix v1 and V2 filesystems [StructLayout(LayoutKind.Sequential, Pack = 1)] [SwapEndian] partial struct SuperBlock { /// 0x00, inodes on volume public ushort s_ninodes; /// 0x02, zones on volume public ushort s_nzones; /// 0x04, blocks on inode map public short s_imap_blocks; /// 0x06, blocks on zone map public short s_zmap_blocks; /// 0x08, first data zone public ushort s_firstdatazone; /// 0x0A, log2 of blocks/zone public short s_log_zone_size; /// 0x0C, max file size public uint s_max_size; /// 0x10, magic public ushort s_magic; /// 0x12, filesystem state public ushort s_state; /// 0x14, number of zones public uint s_zones; } #endregion #region Nested type: SuperBlock3 /// Superblock for Minix v3 filesystems [StructLayout(LayoutKind.Sequential, Pack = 1)] [SwapEndian] partial struct SuperBlock3 { /// 0x00, inodes on volume public uint s_ninodes; /// 0x02, old zones on volume public ushort s_nzones; /// 0x06, blocks on inode map public ushort s_imap_blocks; /// 0x08, blocks on zone map public ushort s_zmap_blocks; /// 0x0A, first data zone public ushort s_firstdatazone; /// 0x0C, log2 of blocks/zone public ushort s_log_zone_size; /// 0x0E, padding public ushort s_pad1; /// 0x10, max file size public uint s_max_size; /// 0x14, number of zones public uint s_zones; /// 0x18, magic public ushort s_magic; /// 0x1A, padding public ushort s_pad2; /// 0x1C, bytes in a block public ushort s_blocksize; /// 0x1E, on-disk structures version public byte s_disk_version; } #endregion }