// /*************************************************************************** // Aaru Data Preservation Suite // ---------------------------------------------------------------------------- // // Filename : Structs.cs // Author(s) : Natalia Portillo // // Component : BeOS 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.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; using Aaru.CommonTypes.Attributes; namespace Aaru.Filesystems; // Information from Practical Filesystem Design, ISBN 1-55860-497-9 /// /// Implements detection of the Be (new) filesystem [SuppressMessage("ReSharper", "UnusedMember.Local")] public sealed partial class BeFS { #region Nested type: SuperBlock /// Be superblock [StructLayout(LayoutKind.Sequential, Pack = 1)] [SwapEndian] partial struct SuperBlock { /// 0x000, Volume name, 32 bytes [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] public byte[] name; /// 0x020, "BFS1", 0x42465331 public uint magic1; /// 0x024, "BIGE", 0x42494745 public uint fs_byte_order; /// 0x028, Bytes per block public uint block_size; /// 0x02C, 1 << block_shift == block_size public uint block_shift; /// 0x030, Blocks in volume public long num_blocks; /// 0x038, Used blocks in volume public long used_blocks; /// 0x040, Bytes per inode public int inode_size; /// 0x044, 0xDD121031 public uint magic2; /// 0x048, Blocks per allocation group public int blocks_per_ag; /// 0x04C, 1 << ag_shift == blocks_per_ag public int ag_shift; /// 0x050, Allocation groups in volume public int num_ags; /// 0x054, 0x434c454e if clean, 0x44495254 if dirty public uint flags; /// 0x058, Allocation group of journal public int log_blocks_ag; /// 0x05C, Start block of journal, inside ag public ushort log_blocks_start; /// 0x05E, Length in blocks of journal, inside ag public ushort log_blocks_len; /// 0x060, Start of journal public long log_start; /// 0x068, End of journal public long log_end; /// 0x070, 0x15B6830E public uint magic3; /// 0x074, Allocation group where root folder's i-node resides public int root_dir_ag; /// 0x078, Start in ag of root folder's i-node public ushort root_dir_start; /// 0x07A, As this is part of inode_addr, this is 1 public ushort root_dir_len; /// 0x07C, Allocation group where indices' i-node resides public int indices_ag; /// 0x080, Start in ag of indices' i-node public ushort indices_start; /// 0x082, As this is part of inode_addr, this is 1 public ushort indices_len; } #endregion }