2017-07-19 16:31:08 +01:00
|
|
|
|
// /***************************************************************************
|
2016-07-28 18:13:49 +01:00
|
|
|
|
// The Disc Image Chef
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
//
|
|
|
|
|
|
// Filename : BFS.cs
|
|
|
|
|
|
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
|
|
|
|
|
//
|
|
|
|
|
|
// Component : BeOS filesystem plugin.
|
|
|
|
|
|
//
|
|
|
|
|
|
// --[ Description ] ----------------------------------------------------------
|
|
|
|
|
|
//
|
|
|
|
|
|
// Identifies the BeOS filesystem and shows information.
|
|
|
|
|
|
//
|
|
|
|
|
|
// --[ 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 <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
//
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
2017-05-19 20:28:49 +01:00
|
|
|
|
// Copyright © 2011-2017 Natalia Portillo
|
2016-07-28 18:13:49 +01:00
|
|
|
|
// ****************************************************************************/
|
2014-04-17 19:58:14 +00:00
|
|
|
|
|
2011-03-28 13:46:30 +00:00
|
|
|
|
using System;
|
2016-07-21 17:16:08 +01:00
|
|
|
|
using System.Collections.Generic;
|
2017-07-19 16:31:08 +01:00
|
|
|
|
using System.Text;
|
|
|
|
|
|
using DiscImageChef.CommonTypes;
|
2011-03-28 13:46:30 +00:00
|
|
|
|
|
2016-07-21 16:15:39 +01:00
|
|
|
|
namespace DiscImageChef.Filesystems
|
2011-03-28 13:46:30 +00:00
|
|
|
|
{
|
2016-07-28 22:25:26 +01:00
|
|
|
|
// Information from Practical Filesystem Design, ISBN 1-55860-497-9
|
2017-07-01 03:26:08 +01:00
|
|
|
|
public class BeFS : Filesystem
|
2014-04-14 02:29:13 +00:00
|
|
|
|
{
|
|
|
|
|
|
// Little endian constants (that is, as read by .NET :p)
|
2016-07-28 22:25:26 +01:00
|
|
|
|
const uint BEFS_MAGIC1 = 0x42465331;
|
|
|
|
|
|
const uint BEFS_MAGIC2 = 0xDD121031;
|
|
|
|
|
|
const uint BEFS_MAGIC3 = 0x15B6830E;
|
|
|
|
|
|
const uint BEFS_ENDIAN = 0x42494745;
|
2014-04-14 02:29:13 +00:00
|
|
|
|
// Big endian constants
|
2016-07-28 22:25:26 +01:00
|
|
|
|
const uint BEFS_CIGAM1 = 0x31534642;
|
|
|
|
|
|
const uint BEFS_NAIDNE = 0x45474942;
|
2014-04-14 02:29:13 +00:00
|
|
|
|
// Common constants
|
2016-07-28 22:25:26 +01:00
|
|
|
|
const uint BEFS_CLEAN = 0x434C454E;
|
|
|
|
|
|
const uint BEFS_DIRTY = 0x44495254;
|
2012-08-05 00:43:49 +00:00
|
|
|
|
|
2015-10-05 20:04:05 +01:00
|
|
|
|
public BeFS()
|
2011-03-28 13:46:30 +00:00
|
|
|
|
{
|
2014-04-14 02:29:13 +00:00
|
|
|
|
Name = "Be Filesystem";
|
|
|
|
|
|
PluginUUID = new Guid("dc8572b3-b6ad-46e4-8de9-cbe123ff6672");
|
2017-06-06 21:23:20 +01:00
|
|
|
|
CurrentEncoding = Encoding.GetEncoding("iso-8859-15");
|
2011-03-28 13:46:30 +00:00
|
|
|
|
}
|
2014-04-14 01:14:20 +00:00
|
|
|
|
|
2017-07-19 16:31:08 +01:00
|
|
|
|
public BeFS(ImagePlugins.ImagePlugin imagePlugin, Partition partition, Encoding encoding)
|
2016-07-27 13:32:45 +01:00
|
|
|
|
{
|
|
|
|
|
|
Name = "Be Filesystem";
|
|
|
|
|
|
PluginUUID = new Guid("dc8572b3-b6ad-46e4-8de9-cbe123ff6672");
|
2017-06-06 21:23:20 +01:00
|
|
|
|
if(encoding == null)
|
|
|
|
|
|
CurrentEncoding = Encoding.GetEncoding("iso-8859-15");
|
2016-07-27 13:32:45 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2017-07-19 16:31:08 +01:00
|
|
|
|
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, Partition partition)
|
2014-04-14 02:29:13 +00:00
|
|
|
|
{
|
2017-07-19 16:37:11 +01:00
|
|
|
|
if((2 + partition.Start) >= partition.End)
|
2014-07-09 19:49:14 +01:00
|
|
|
|
return false;
|
|
|
|
|
|
|
2016-07-28 22:25:26 +01:00
|
|
|
|
uint magic;
|
|
|
|
|
|
uint magic_be;
|
2014-04-14 02:29:13 +00:00
|
|
|
|
|
2017-07-19 16:37:11 +01:00
|
|
|
|
byte[] sb_sector = imagePlugin.ReadSector(0 + partition.Start);
|
2014-04-14 01:14:20 +00:00
|
|
|
|
|
2014-04-14 02:29:13 +00:00
|
|
|
|
magic = BitConverter.ToUInt32(sb_sector, 0x20);
|
|
|
|
|
|
magic_be = BigEndianBitConverter.ToUInt32(sb_sector, 0x20);
|
2014-04-14 01:14:20 +00:00
|
|
|
|
|
2016-04-19 02:11:47 +01:00
|
|
|
|
if(magic == BEFS_MAGIC1 || magic_be == BEFS_MAGIC1)
|
2014-04-14 02:29:13 +00:00
|
|
|
|
return true;
|
2015-11-09 19:42:00 +00:00
|
|
|
|
|
2016-04-19 02:11:47 +01:00
|
|
|
|
if(sb_sector.Length >= 0x400)
|
2015-11-09 22:17:45 +00:00
|
|
|
|
{
|
|
|
|
|
|
magic = BitConverter.ToUInt32(sb_sector, 0x220);
|
|
|
|
|
|
magic_be = BigEndianBitConverter.ToUInt32(sb_sector, 0x220);
|
|
|
|
|
|
}
|
2015-11-09 19:42:00 +00:00
|
|
|
|
|
2016-04-19 02:11:47 +01:00
|
|
|
|
if(magic == BEFS_MAGIC1 || magic_be == BEFS_MAGIC1)
|
2015-11-09 19:42:00 +00:00
|
|
|
|
return true;
|
|
|
|
|
|
|
2017-07-19 16:37:11 +01:00
|
|
|
|
sb_sector = imagePlugin.ReadSector(1 + partition.Start);
|
2016-04-19 02:11:47 +01:00
|
|
|
|
|
2014-04-14 02:29:13 +00:00
|
|
|
|
magic = BitConverter.ToUInt32(sb_sector, 0x20);
|
|
|
|
|
|
magic_be = BigEndianBitConverter.ToUInt32(sb_sector, 0x20);
|
2011-03-28 22:56:20 +00:00
|
|
|
|
|
2016-04-19 02:11:47 +01:00
|
|
|
|
if(magic == BEFS_MAGIC1 || magic_be == BEFS_MAGIC1)
|
2014-04-14 02:29:13 +00:00
|
|
|
|
return true;
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
2014-04-14 01:14:20 +00:00
|
|
|
|
|
2017-07-19 16:31:08 +01:00
|
|
|
|
public override void GetInformation(ImagePlugins.ImagePlugin imagePlugin, Partition partition, out string information)
|
2014-04-14 02:29:13 +00:00
|
|
|
|
{
|
|
|
|
|
|
information = "";
|
|
|
|
|
|
byte[] name_bytes = new byte[32];
|
|
|
|
|
|
|
|
|
|
|
|
StringBuilder sb = new StringBuilder();
|
2016-04-19 02:11:47 +01:00
|
|
|
|
|
2014-04-14 02:29:13 +00:00
|
|
|
|
BeSuperBlock besb = new BeSuperBlock();
|
2014-04-14 01:14:20 +00:00
|
|
|
|
|
2017-07-19 16:37:11 +01:00
|
|
|
|
byte[] sb_sector = imagePlugin.ReadSector(0 + partition.Start);
|
2014-04-14 01:14:20 +00:00
|
|
|
|
|
2014-04-14 02:29:13 +00:00
|
|
|
|
BigEndianBitConverter.IsLittleEndian = true; // Default for little-endian
|
2014-04-14 01:14:20 +00:00
|
|
|
|
|
2014-04-14 02:29:13 +00:00
|
|
|
|
besb.magic1 = BigEndianBitConverter.ToUInt32(sb_sector, 0x20);
|
2016-04-19 02:11:47 +01:00
|
|
|
|
if(besb.magic1 == BEFS_MAGIC1 || besb.magic1 == BEFS_CIGAM1) // Magic is at offset
|
2014-04-14 02:29:13 +00:00
|
|
|
|
{
|
|
|
|
|
|
BigEndianBitConverter.IsLittleEndian &= besb.magic1 != BEFS_CIGAM1;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
2017-07-19 16:37:11 +01:00
|
|
|
|
sb_sector = imagePlugin.ReadSector(1 + partition.Start);
|
2014-04-14 02:29:13 +00:00
|
|
|
|
besb.magic1 = BigEndianBitConverter.ToUInt32(sb_sector, 0x20);
|
2016-04-19 02:11:47 +01:00
|
|
|
|
|
|
|
|
|
|
if(besb.magic1 == BEFS_MAGIC1 || besb.magic1 == BEFS_CIGAM1) // There is a boot sector
|
2014-04-14 02:29:13 +00:00
|
|
|
|
{
|
|
|
|
|
|
BigEndianBitConverter.IsLittleEndian &= besb.magic1 != BEFS_CIGAM1;
|
|
|
|
|
|
}
|
2016-04-19 02:11:47 +01:00
|
|
|
|
else if(sb_sector.Length >= 0x400)
|
2015-11-09 19:42:00 +00:00
|
|
|
|
{
|
2017-07-19 16:37:11 +01:00
|
|
|
|
byte[] temp = imagePlugin.ReadSector(0 + partition.Start);
|
2015-11-09 19:42:00 +00:00
|
|
|
|
besb.magic1 = BigEndianBitConverter.ToUInt32(temp, 0x220);
|
|
|
|
|
|
|
2016-04-19 02:11:47 +01:00
|
|
|
|
if(besb.magic1 == BEFS_MAGIC1 || besb.magic1 == BEFS_CIGAM1) // There is a boot sector
|
2015-11-09 19:42:00 +00:00
|
|
|
|
{
|
|
|
|
|
|
BigEndianBitConverter.IsLittleEndian &= besb.magic1 != BEFS_CIGAM1;
|
2016-04-19 02:11:47 +01:00
|
|
|
|
sb_sector = new byte[0x200];
|
2015-11-09 19:42:00 +00:00
|
|
|
|
Array.Copy(temp, 0x200, sb_sector, 0, 0x200);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
2015-11-09 22:17:45 +00:00
|
|
|
|
else
|
|
|
|
|
|
return;
|
2014-04-14 02:29:13 +00:00
|
|
|
|
}
|
2012-08-05 00:43:49 +00:00
|
|
|
|
|
2014-04-14 02:29:13 +00:00
|
|
|
|
Array.Copy(sb_sector, 0x000, name_bytes, 0, 0x20);
|
2017-06-06 21:23:20 +01:00
|
|
|
|
besb.name = StringHandlers.CToString(name_bytes, CurrentEncoding);
|
2014-04-14 02:29:13 +00:00
|
|
|
|
besb.magic1 = BigEndianBitConverter.ToUInt32(sb_sector, 0x20);
|
2015-11-09 19:42:00 +00:00
|
|
|
|
besb.fs_byte_order = BigEndianBitConverter.ToUInt32(sb_sector, 0x24);
|
|
|
|
|
|
besb.block_size = BigEndianBitConverter.ToUInt32(sb_sector, 0x28);
|
|
|
|
|
|
besb.block_shift = BigEndianBitConverter.ToUInt32(sb_sector, 0x2C);
|
|
|
|
|
|
besb.num_blocks = BigEndianBitConverter.ToInt64(sb_sector, 0x30);
|
|
|
|
|
|
besb.used_blocks = BigEndianBitConverter.ToInt64(sb_sector, 0x38);
|
|
|
|
|
|
besb.inode_size = BigEndianBitConverter.ToInt32(sb_sector, 0x40);
|
|
|
|
|
|
besb.magic2 = BigEndianBitConverter.ToUInt32(sb_sector, 0x44);
|
|
|
|
|
|
besb.blocks_per_ag = BigEndianBitConverter.ToInt32(sb_sector, 0x48);
|
|
|
|
|
|
besb.ag_shift = BigEndianBitConverter.ToInt32(sb_sector, 0x4C);
|
|
|
|
|
|
besb.num_ags = BigEndianBitConverter.ToInt32(sb_sector, 0x50);
|
|
|
|
|
|
besb.flags = BigEndianBitConverter.ToUInt32(sb_sector, 0x54);
|
|
|
|
|
|
besb.log_blocks_ag = BigEndianBitConverter.ToInt32(sb_sector, 0x58);
|
|
|
|
|
|
besb.log_blocks_start = BigEndianBitConverter.ToUInt16(sb_sector, 0x5C);
|
|
|
|
|
|
besb.log_blocks_len = BigEndianBitConverter.ToUInt16(sb_sector, 0x5E);
|
|
|
|
|
|
besb.log_start = BigEndianBitConverter.ToInt64(sb_sector, 0x60);
|
|
|
|
|
|
besb.log_end = BigEndianBitConverter.ToInt64(sb_sector, 0x68);
|
|
|
|
|
|
besb.magic3 = BigEndianBitConverter.ToUInt32(sb_sector, 0x70);
|
|
|
|
|
|
besb.root_dir_ag = BigEndianBitConverter.ToInt32(sb_sector, 0x74);
|
|
|
|
|
|
besb.root_dir_start = BigEndianBitConverter.ToUInt16(sb_sector, 0x78);
|
|
|
|
|
|
besb.root_dir_len = BigEndianBitConverter.ToUInt16(sb_sector, 0x7A);
|
|
|
|
|
|
besb.indices_ag = BigEndianBitConverter.ToInt32(sb_sector, 0x7C);
|
|
|
|
|
|
besb.indices_start = BigEndianBitConverter.ToUInt16(sb_sector, 0x80);
|
|
|
|
|
|
besb.indices_len = BigEndianBitConverter.ToUInt16(sb_sector, 0x82);
|
2016-04-19 02:11:47 +01:00
|
|
|
|
|
|
|
|
|
|
if(!BigEndianBitConverter.IsLittleEndian) // Big-endian filesystem
|
|
|
|
|
|
sb.AppendLine("Little-endian BeFS");
|
2014-04-14 02:29:13 +00:00
|
|
|
|
else
|
2015-11-10 06:16:23 +00:00
|
|
|
|
sb.AppendLine("Big-endian BeFS");
|
2016-04-19 02:11:47 +01:00
|
|
|
|
|
|
|
|
|
|
if(besb.magic1 != BEFS_MAGIC1 || besb.fs_byte_order != BEFS_ENDIAN ||
|
2014-04-14 02:29:13 +00:00
|
|
|
|
besb.magic2 != BEFS_MAGIC2 || besb.magic3 != BEFS_MAGIC3 ||
|
|
|
|
|
|
besb.root_dir_len != 1 || besb.indices_len != 1 ||
|
|
|
|
|
|
(1 << (int)besb.block_shift) != besb.block_size)
|
|
|
|
|
|
{
|
|
|
|
|
|
sb.AppendLine("Superblock seems corrupt, following information may be incorrect");
|
|
|
|
|
|
sb.AppendFormat("Magic 1: 0x{0:X8} (Should be 0x42465331)", besb.magic1).AppendLine();
|
|
|
|
|
|
sb.AppendFormat("Magic 2: 0x{0:X8} (Should be 0xDD121031)", besb.magic2).AppendLine();
|
|
|
|
|
|
sb.AppendFormat("Magic 3: 0x{0:X8} (Should be 0x15B6830E)", besb.magic3).AppendLine();
|
|
|
|
|
|
sb.AppendFormat("Filesystem endianness: 0x{0:X8} (Should be 0x42494745)", besb.fs_byte_order).AppendLine();
|
|
|
|
|
|
sb.AppendFormat("Root folder's i-node size: {0} blocks (Should be 1)", besb.root_dir_len).AppendLine();
|
|
|
|
|
|
sb.AppendFormat("Indices' i-node size: {0} blocks (Should be 1)", besb.indices_len).AppendLine();
|
|
|
|
|
|
sb.AppendFormat("1 << block_shift == block_size => 1 << {0} == {1} (Should be {2})", besb.block_shift,
|
|
|
|
|
|
1 << (int)besb.block_shift, besb.block_size).AppendLine();
|
|
|
|
|
|
}
|
2016-04-19 02:11:47 +01:00
|
|
|
|
|
|
|
|
|
|
if(besb.flags == BEFS_CLEAN)
|
2014-04-14 02:29:13 +00:00
|
|
|
|
{
|
2016-04-19 02:11:47 +01:00
|
|
|
|
if(besb.log_start == besb.log_end)
|
2014-04-14 02:29:13 +00:00
|
|
|
|
sb.AppendLine("Filesystem is clean");
|
|
|
|
|
|
else
|
|
|
|
|
|
sb.AppendLine("Filesystem is dirty");
|
|
|
|
|
|
}
|
2016-04-19 02:11:47 +01:00
|
|
|
|
else if(besb.flags == BEFS_DIRTY)
|
2014-04-14 02:29:13 +00:00
|
|
|
|
sb.AppendLine("Filesystem is dirty");
|
|
|
|
|
|
else
|
|
|
|
|
|
sb.AppendFormat("Unknown flags: {0:X8}", besb.flags).AppendLine();
|
2016-04-19 02:11:47 +01:00
|
|
|
|
|
2014-04-14 02:29:13 +00:00
|
|
|
|
sb.AppendFormat("Volume name: {0}", besb.name).AppendLine();
|
|
|
|
|
|
sb.AppendFormat("{0} bytes per block", besb.block_size).AppendLine();
|
|
|
|
|
|
sb.AppendFormat("{0} blocks in volume ({1} bytes)", besb.num_blocks, besb.num_blocks * besb.block_size).AppendLine();
|
|
|
|
|
|
sb.AppendFormat("{0} used blocks ({1} bytes)", besb.used_blocks, besb.used_blocks * besb.block_size).AppendLine();
|
|
|
|
|
|
sb.AppendFormat("{0} bytes per i-node", besb.inode_size).AppendLine();
|
|
|
|
|
|
sb.AppendFormat("{0} blocks per allocation group ({1} bytes)", besb.blocks_per_ag, besb.blocks_per_ag * besb.block_size).AppendLine();
|
|
|
|
|
|
sb.AppendFormat("{0} allocation groups in volume", besb.num_ags).AppendLine();
|
|
|
|
|
|
sb.AppendFormat("Journal resides in block {0} of allocation group {1} and runs for {2} blocks ({3} bytes)", besb.log_blocks_start,
|
|
|
|
|
|
besb.log_blocks_ag, besb.log_blocks_len, besb.log_blocks_len * besb.block_size).AppendLine();
|
|
|
|
|
|
sb.AppendFormat("Journal starts in byte {0} and ends in byte {1}", besb.log_start, besb.log_end).AppendLine();
|
|
|
|
|
|
sb.AppendFormat("Root folder's i-node resides in block {0} of allocation group {1} and runs for {2} blocks ({3} bytes)", besb.root_dir_start,
|
|
|
|
|
|
besb.root_dir_ag, besb.root_dir_len, besb.root_dir_len * besb.block_size).AppendLine();
|
|
|
|
|
|
sb.AppendFormat("Indices' i-node resides in block {0} of allocation group {1} and runs for {2} blocks ({3} bytes)", besb.indices_start,
|
|
|
|
|
|
besb.indices_ag, besb.indices_len, besb.indices_len * besb.block_size).AppendLine();
|
2016-04-19 02:11:47 +01:00
|
|
|
|
|
2014-04-14 02:29:13 +00:00
|
|
|
|
information = sb.ToString();
|
2015-12-05 17:10:27 +00:00
|
|
|
|
|
|
|
|
|
|
xmlFSType = new Schemas.FileSystemType();
|
|
|
|
|
|
xmlFSType.Clusters = besb.num_blocks;
|
|
|
|
|
|
xmlFSType.ClusterSize = (int)besb.block_size;
|
|
|
|
|
|
xmlFSType.Dirty = besb.flags == BEFS_DIRTY;
|
|
|
|
|
|
xmlFSType.FreeClusters = besb.num_blocks - besb.used_blocks;
|
2015-12-06 05:09:31 +00:00
|
|
|
|
xmlFSType.FreeClustersSpecified = true;
|
2015-12-05 17:10:27 +00:00
|
|
|
|
xmlFSType.Type = "BeFS";
|
|
|
|
|
|
xmlFSType.VolumeName = besb.name;
|
2014-04-14 02:29:13 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
2015-12-06 07:18:36 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Be superblock
|
|
|
|
|
|
/// </summary>
|
2014-04-14 02:29:13 +00:00
|
|
|
|
struct BeSuperBlock
|
|
|
|
|
|
{
|
2015-12-06 07:18:36 +00:00
|
|
|
|
/// <summary>0x000, Volume name, 32 bytes</summary>
|
2014-04-14 02:29:13 +00:00
|
|
|
|
public string name;
|
2015-12-06 07:18:36 +00:00
|
|
|
|
/// <summary>0x020, "BFS1", 0x42465331</summary>
|
2016-07-28 22:25:26 +01:00
|
|
|
|
public uint magic1;
|
2015-12-06 07:18:36 +00:00
|
|
|
|
/// <summary>0x024, "BIGE", 0x42494745</summary>
|
2016-07-28 22:25:26 +01:00
|
|
|
|
public uint fs_byte_order;
|
2015-12-06 07:18:36 +00:00
|
|
|
|
/// <summary>0x028, Bytes per block</summary>
|
2016-07-28 22:25:26 +01:00
|
|
|
|
public uint block_size;
|
2015-12-06 07:18:36 +00:00
|
|
|
|
/// <summary>0x02C, 1 << block_shift == block_size</summary>
|
2016-07-28 22:25:26 +01:00
|
|
|
|
public uint block_shift;
|
2015-12-06 07:18:36 +00:00
|
|
|
|
/// <summary>0x030, Blocks in volume</summary>
|
2016-07-28 22:25:26 +01:00
|
|
|
|
public long num_blocks;
|
2015-12-06 07:18:36 +00:00
|
|
|
|
/// <summary>0x038, Used blocks in volume</summary>
|
2016-07-28 22:25:26 +01:00
|
|
|
|
public long used_blocks;
|
2015-12-06 07:18:36 +00:00
|
|
|
|
/// <summary>0x040, Bytes per inode</summary>
|
2016-07-28 22:25:26 +01:00
|
|
|
|
public int inode_size;
|
2015-12-06 07:18:36 +00:00
|
|
|
|
/// <summary>0x044, 0xDD121031</summary>
|
2016-07-28 22:25:26 +01:00
|
|
|
|
public uint magic2;
|
2015-12-06 07:18:36 +00:00
|
|
|
|
/// <summary>0x048, Blocks per allocation group</summary>
|
2016-07-28 22:25:26 +01:00
|
|
|
|
public int blocks_per_ag;
|
2015-12-06 07:18:36 +00:00
|
|
|
|
/// <summary>0x04C, 1 << ag_shift == blocks_per_ag</summary>
|
2016-07-28 22:25:26 +01:00
|
|
|
|
public int ag_shift;
|
2015-12-06 07:18:36 +00:00
|
|
|
|
/// <summary>0x050, Allocation groups in volume</summary>
|
2016-07-28 22:25:26 +01:00
|
|
|
|
public int num_ags;
|
2015-12-06 07:18:36 +00:00
|
|
|
|
/// <summary>0x054, 0x434c454e if clean, 0x44495254 if dirty</summary>
|
2016-07-28 22:25:26 +01:00
|
|
|
|
public uint flags;
|
2015-12-06 07:18:36 +00:00
|
|
|
|
/// <summary>0x058, Allocation group of journal</summary>
|
2016-07-28 22:25:26 +01:00
|
|
|
|
public int log_blocks_ag;
|
2015-12-06 07:18:36 +00:00
|
|
|
|
/// <summary>0x05C, Start block of journal, inside ag</summary>
|
2016-07-28 22:25:26 +01:00
|
|
|
|
public ushort log_blocks_start;
|
2015-12-06 07:18:36 +00:00
|
|
|
|
/// <summary>0x05E, Length in blocks of journal, inside ag</summary>
|
2016-07-28 22:25:26 +01:00
|
|
|
|
public ushort log_blocks_len;
|
2015-12-06 07:18:36 +00:00
|
|
|
|
/// <summary>0x060, Start of journal</summary>
|
2016-07-28 22:25:26 +01:00
|
|
|
|
public long log_start;
|
2015-12-06 07:18:36 +00:00
|
|
|
|
/// <summary>0x068, End of journal</summary>
|
2016-07-28 22:25:26 +01:00
|
|
|
|
public long log_end;
|
2015-12-06 07:18:36 +00:00
|
|
|
|
/// <summary>0x070, 0x15B6830E</summary>
|
2016-07-28 22:25:26 +01:00
|
|
|
|
public uint magic3;
|
2015-12-06 07:18:36 +00:00
|
|
|
|
/// <summary>0x074, Allocation group where root folder's i-node resides</summary>
|
2016-07-28 22:25:26 +01:00
|
|
|
|
public int root_dir_ag;
|
2015-12-06 07:18:36 +00:00
|
|
|
|
/// <summary>0x078, Start in ag of root folder's i-node</summary>
|
2016-07-28 22:25:26 +01:00
|
|
|
|
public ushort root_dir_start;
|
2015-12-06 07:18:36 +00:00
|
|
|
|
/// <summary>0x07A, As this is part of inode_addr, this is 1</summary>
|
2016-07-28 22:25:26 +01:00
|
|
|
|
public ushort root_dir_len;
|
2015-12-06 07:18:36 +00:00
|
|
|
|
/// <summary>0x07C, Allocation group where indices' i-node resides</summary>
|
2016-07-28 22:25:26 +01:00
|
|
|
|
public int indices_ag;
|
2015-12-06 07:18:36 +00:00
|
|
|
|
/// <summary>0x080, Start in ag of indices' i-node</summary>
|
2016-07-28 22:25:26 +01:00
|
|
|
|
public ushort indices_start;
|
2015-12-06 07:18:36 +00:00
|
|
|
|
/// <summary>0x082, As this is part of inode_addr, this is 1</summary>
|
2016-07-28 22:25:26 +01:00
|
|
|
|
public ushort indices_len;
|
2014-04-14 02:29:13 +00:00
|
|
|
|
}
|
2016-07-21 17:16:08 +01:00
|
|
|
|
|
|
|
|
|
|
public override Errno Mount()
|
|
|
|
|
|
{
|
|
|
|
|
|
return Errno.NotImplemented;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2016-07-22 00:43:22 +01:00
|
|
|
|
public override Errno Mount(bool debug)
|
|
|
|
|
|
{
|
|
|
|
|
|
return Errno.NotImplemented;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2016-07-21 17:16:08 +01:00
|
|
|
|
public override Errno Unmount()
|
|
|
|
|
|
{
|
|
|
|
|
|
return Errno.NotImplemented;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override Errno MapBlock(string path, long fileBlock, ref long deviceBlock)
|
|
|
|
|
|
{
|
|
|
|
|
|
return Errno.NotImplemented;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override Errno GetAttributes(string path, ref FileAttributes attributes)
|
|
|
|
|
|
{
|
|
|
|
|
|
return Errno.NotImplemented;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override Errno ListXAttr(string path, ref List<string> xattrs)
|
|
|
|
|
|
{
|
|
|
|
|
|
return Errno.NotImplemented;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override Errno GetXattr(string path, string xattr, ref byte[] buf)
|
|
|
|
|
|
{
|
|
|
|
|
|
return Errno.NotImplemented;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override Errno Read(string path, long offset, long size, ref byte[] buf)
|
|
|
|
|
|
{
|
|
|
|
|
|
return Errno.NotImplemented;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override Errno ReadDir(string path, ref List<string> contents)
|
|
|
|
|
|
{
|
|
|
|
|
|
return Errno.NotImplemented;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override Errno StatFs(ref FileSystemInfo stat)
|
|
|
|
|
|
{
|
|
|
|
|
|
return Errno.NotImplemented;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override Errno Stat(string path, ref FileEntryInfo stat)
|
|
|
|
|
|
{
|
|
|
|
|
|
return Errno.NotImplemented;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override Errno ReadLink(string path, ref string dest)
|
|
|
|
|
|
{
|
|
|
|
|
|
return Errno.NotImplemented;
|
|
|
|
|
|
}
|
2014-04-14 02:29:13 +00:00
|
|
|
|
}
|
2014-04-14 01:14:20 +00:00
|
|
|
|
}
|