2017-07-19 16:31:08 +01:00
|
|
|
|
// /***************************************************************************
|
2020-02-27 12:31:25 +00:00
|
|
|
|
// Aaru Data Preservation Suite
|
2016-07-28 18:13:49 +01:00
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
//
|
2022-12-07 13:07:31 +00:00
|
|
|
|
// Filename : Info.cs
|
2016-07-28 18:13:49 +01:00
|
|
|
|
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
|
|
|
|
|
//
|
|
|
|
|
|
// Component : UNIX System V 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 <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
//
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
2022-12-03 16:07:10 +00:00
|
|
|
|
// Copyright © 2011-2023 Natalia Portillo
|
2016-07-28 18:13:49 +01:00
|
|
|
|
// ****************************************************************************/
|
2014-04-17 19:58:14 +00:00
|
|
|
|
|
2022-03-07 07:36:44 +00:00
|
|
|
|
// ReSharper disable NotAccessedField.Local
|
|
|
|
|
|
|
2012-08-07 06:20:13 +00:00
|
|
|
|
using System;
|
2017-12-22 08:43:22 +00:00
|
|
|
|
using System.Diagnostics.CodeAnalysis;
|
2017-12-21 07:08:26 +00:00
|
|
|
|
using System.Linq;
|
2017-07-19 16:31:08 +01:00
|
|
|
|
using System.Text;
|
2020-02-27 00:33:26 +00:00
|
|
|
|
using Aaru.CommonTypes;
|
2021-09-19 21:16:47 +01:00
|
|
|
|
using Aaru.CommonTypes.Enums;
|
2020-02-27 00:33:26 +00:00
|
|
|
|
using Aaru.CommonTypes.Interfaces;
|
2020-07-20 15:43:52 +01:00
|
|
|
|
using Aaru.Helpers;
|
2017-12-21 14:30:38 +00:00
|
|
|
|
using Schemas;
|
2012-08-07 06:20:13 +00:00
|
|
|
|
|
2022-11-15 15:58:43 +00:00
|
|
|
|
namespace Aaru.Filesystems;
|
|
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
// Information from the Linux kernel
|
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
|
|
/// <summary>Implements detection of the UNIX System V filesystem</summary>
|
|
|
|
|
|
[SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "UnusedMember.Local"),
|
|
|
|
|
|
SuppressMessage("ReSharper", "UnusedType.Local")]
|
2022-12-07 13:07:31 +00:00
|
|
|
|
public sealed partial class SysVfs
|
2012-08-07 06:20:13 +00:00
|
|
|
|
{
|
2021-08-17 14:25:12 +01:00
|
|
|
|
/// <inheritdoc />
|
2022-03-06 13:29:38 +00:00
|
|
|
|
public bool Identify(IMediaImage imagePlugin, Partition partition)
|
2014-04-14 02:29:13 +00:00
|
|
|
|
{
|
2022-03-06 13:29:38 +00:00
|
|
|
|
if(2 + partition.Start >= partition.End)
|
|
|
|
|
|
return false;
|
2014-07-09 19:49:14 +01:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
byte sb_size_in_sectors;
|
2014-04-14 01:14:20 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
if(imagePlugin.Info.SectorSize <=
|
|
|
|
|
|
0x400) // Check if underlying device sector size is smaller than SuperBlock size
|
|
|
|
|
|
sb_size_in_sectors = (byte)(0x400 / imagePlugin.Info.SectorSize);
|
|
|
|
|
|
else
|
|
|
|
|
|
sb_size_in_sectors = 1; // If not a single sector can store it
|
2014-04-14 01:14:20 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
if(partition.End <=
|
2022-11-15 15:58:43 +00:00
|
|
|
|
partition.Start + (4 * (ulong)sb_size_in_sectors) +
|
2022-03-06 13:29:38 +00:00
|
|
|
|
sb_size_in_sectors) // Device must be bigger than SB location + SB size + offset
|
|
|
|
|
|
return false;
|
2014-04-14 01:14:20 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
// Sectors in a cylinder
|
2022-11-15 15:58:43 +00:00
|
|
|
|
int spc = (int)(imagePlugin.Info.Heads * imagePlugin.Info.SectorsPerTrack);
|
2017-11-08 22:42:29 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
// Superblock can start on 0x000, 0x200, 0x600 and 0x800, not aligned, so we assume 16 (128 bytes/sector) sectors as a safe value
|
|
|
|
|
|
int[] locations =
|
|
|
|
|
|
{
|
|
|
|
|
|
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
// Superblock can also skip one cylinder (for boot)
|
|
|
|
|
|
spc
|
|
|
|
|
|
};
|
2017-11-08 22:42:29 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
foreach(int i in locations.TakeWhile(i => (ulong)i + partition.Start + sb_size_in_sectors <
|
|
|
|
|
|
imagePlugin.Info.Sectors))
|
|
|
|
|
|
{
|
|
|
|
|
|
ErrorNumber errno =
|
|
|
|
|
|
imagePlugin.ReadSectors((ulong)i + partition.Start, sb_size_in_sectors, out byte[] sb_sector);
|
|
|
|
|
|
|
|
|
|
|
|
if(errno != ErrorNumber.NoError ||
|
|
|
|
|
|
sb_sector.Length < 0x400)
|
|
|
|
|
|
continue;
|
|
|
|
|
|
|
2022-11-15 15:58:43 +00:00
|
|
|
|
uint magic = BitConverter.ToUInt32(sb_sector, 0x3F8);
|
2022-03-06 13:29:38 +00:00
|
|
|
|
|
2022-03-16 11:47:00 +00:00
|
|
|
|
if(magic is XENIX_MAGIC or XENIX_CIGAM or SYSV_MAGIC or SYSV_CIGAM)
|
2022-03-06 13:29:38 +00:00
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
|
|
magic = BitConverter.ToUInt32(sb_sector, 0x1F8); // System V magic location
|
|
|
|
|
|
|
2022-03-16 11:47:00 +00:00
|
|
|
|
if(magic is SYSV_MAGIC or SYSV_CIGAM)
|
2022-03-06 13:29:38 +00:00
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
|
|
magic = BitConverter.ToUInt32(sb_sector, 0x1F0); // XENIX 3 magic location
|
|
|
|
|
|
|
2022-03-16 11:47:00 +00:00
|
|
|
|
if(magic is XENIX_MAGIC or XENIX_CIGAM)
|
2022-03-06 13:29:38 +00:00
|
|
|
|
return true;
|
|
|
|
|
|
|
2022-11-15 15:58:43 +00:00
|
|
|
|
byte[] coherent_string = new byte[6];
|
2022-03-06 13:29:38 +00:00
|
|
|
|
Array.Copy(sb_sector, 0x1E4, coherent_string, 0, 6); // Coherent UNIX s_fname location
|
|
|
|
|
|
string s_fname = StringHandlers.CToString(coherent_string);
|
|
|
|
|
|
Array.Copy(sb_sector, 0x1EA, coherent_string, 0, 6); // Coherent UNIX s_fpack location
|
|
|
|
|
|
string s_fpack = StringHandlers.CToString(coherent_string);
|
|
|
|
|
|
|
2022-11-15 15:58:43 +00:00
|
|
|
|
if((s_fname == COH_FNAME && s_fpack == COH_FPACK) ||
|
|
|
|
|
|
(s_fname == COH_XXXXX && s_fpack == COH_XXXXX) ||
|
|
|
|
|
|
(s_fname == COH_XXXXS && s_fpack == COH_XXXXN))
|
2022-03-06 13:29:38 +00:00
|
|
|
|
return true;
|
|
|
|
|
|
|
|
|
|
|
|
// Now try to identify 7th edition
|
2022-11-15 15:58:43 +00:00
|
|
|
|
uint s_fsize = BitConverter.ToUInt32(sb_sector, 0x002);
|
|
|
|
|
|
ushort s_nfree = BitConverter.ToUInt16(sb_sector, 0x006);
|
|
|
|
|
|
ushort s_ninode = BitConverter.ToUInt16(sb_sector, 0x0D0);
|
2022-03-06 13:29:38 +00:00
|
|
|
|
|
2022-03-16 11:47:00 +00:00
|
|
|
|
if(s_fsize is <= 0 or >= 0xFFFFFFFF ||
|
|
|
|
|
|
s_nfree is <= 0 or >= 0xFFFF ||
|
|
|
|
|
|
s_ninode is <= 0 or >= 0xFFFF)
|
2022-03-06 13:29:38 +00:00
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
|
|
if((s_fsize & 0xFF) == 0x00 &&
|
|
|
|
|
|
(s_nfree & 0xFF) == 0x00 &&
|
|
|
|
|
|
(s_ninode & 0xFF) == 0x00)
|
2017-12-24 02:37:41 +00:00
|
|
|
|
{
|
2022-03-06 13:29:38 +00:00
|
|
|
|
// Byteswap
|
|
|
|
|
|
s_fsize = ((s_fsize & 0xFF) << 24) + ((s_fsize & 0xFF00) << 8) + ((s_fsize & 0xFF0000) >> 8) +
|
|
|
|
|
|
((s_fsize & 0xFF000000) >> 24);
|
2017-12-21 06:06:19 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
s_nfree = (ushort)(s_nfree >> 8);
|
|
|
|
|
|
s_ninode = (ushort)(s_ninode >> 8);
|
|
|
|
|
|
}
|
2017-12-21 06:06:19 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
if((s_fsize & 0xFF000000) != 0x00 ||
|
|
|
|
|
|
(s_nfree & 0xFF00) != 0x00 ||
|
|
|
|
|
|
(s_ninode & 0xFF00) != 0x00)
|
|
|
|
|
|
continue;
|
2017-12-21 06:06:19 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
if(s_fsize >= V7_MAXSIZE ||
|
|
|
|
|
|
s_nfree >= V7_NICFREE ||
|
|
|
|
|
|
s_ninode >= V7_NICINOD)
|
|
|
|
|
|
continue;
|
2014-04-14 02:29:13 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
if(s_fsize * 1024 == (partition.End - partition.Start) * imagePlugin.Info.SectorSize ||
|
|
|
|
|
|
s_fsize * 512 == (partition.End - partition.Start) * imagePlugin.Info.SectorSize)
|
|
|
|
|
|
return true;
|
2014-04-14 02:29:13 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc />
|
2022-03-07 07:36:44 +00:00
|
|
|
|
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information, Encoding encoding)
|
2022-03-06 13:29:38 +00:00
|
|
|
|
{
|
|
|
|
|
|
Encoding = encoding ?? Encoding.GetEncoding("iso-8859-15");
|
|
|
|
|
|
information = "";
|
|
|
|
|
|
|
|
|
|
|
|
var sb = new StringBuilder();
|
2022-11-15 15:58:43 +00:00
|
|
|
|
bool bigEndian = false; // Start in little endian until we know what are we handling here
|
|
|
|
|
|
int start = 0;
|
|
|
|
|
|
bool xenix = false;
|
|
|
|
|
|
bool sysv = false;
|
|
|
|
|
|
bool sys7th = false;
|
|
|
|
|
|
bool coherent = false;
|
|
|
|
|
|
bool xenix3 = false;
|
2022-03-06 13:29:38 +00:00
|
|
|
|
byte[] sb_sector;
|
|
|
|
|
|
byte sb_size_in_sectors;
|
2022-11-15 15:58:43 +00:00
|
|
|
|
int offset = 0;
|
2022-03-06 13:29:38 +00:00
|
|
|
|
|
|
|
|
|
|
if(imagePlugin.Info.SectorSize <=
|
|
|
|
|
|
0x400) // Check if underlying device sector size is smaller than SuperBlock size
|
|
|
|
|
|
sb_size_in_sectors = (byte)(0x400 / imagePlugin.Info.SectorSize);
|
|
|
|
|
|
else
|
|
|
|
|
|
sb_size_in_sectors = 1; // If not a single sector can store it
|
|
|
|
|
|
|
|
|
|
|
|
// Sectors in a cylinder
|
2022-11-15 15:58:43 +00:00
|
|
|
|
int spc = (int)(imagePlugin.Info.Heads * imagePlugin.Info.SectorsPerTrack);
|
2022-03-06 13:29:38 +00:00
|
|
|
|
|
|
|
|
|
|
// Superblock can start on 0x000, 0x200, 0x600 and 0x800, not aligned, so we assume 16 (128 bytes/sector) sectors as a safe value
|
|
|
|
|
|
int[] locations =
|
2014-04-14 02:29:13 +00:00
|
|
|
|
{
|
2022-03-06 13:29:38 +00:00
|
|
|
|
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
// Superblock can also skip one cylinder (for boot)
|
|
|
|
|
|
spc
|
|
|
|
|
|
};
|
2012-08-07 06:20:13 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
ErrorNumber errno;
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
foreach(int i in locations)
|
|
|
|
|
|
{
|
|
|
|
|
|
errno = imagePlugin.ReadSectors((ulong)i + partition.Start, sb_size_in_sectors, out sb_sector);
|
2017-11-08 22:42:29 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
if(errno != ErrorNumber.NoError)
|
|
|
|
|
|
continue;
|
2021-09-19 21:16:47 +01:00
|
|
|
|
|
2022-11-15 15:58:43 +00:00
|
|
|
|
uint magic = BitConverter.ToUInt32(sb_sector, 0x3F8);
|
2021-09-19 21:16:47 +01:00
|
|
|
|
|
2022-03-16 11:47:00 +00:00
|
|
|
|
if(magic is XENIX_MAGIC or SYSV_MAGIC)
|
2022-03-06 13:29:38 +00:00
|
|
|
|
{
|
|
|
|
|
|
if(magic == SYSV_MAGIC)
|
|
|
|
|
|
{
|
|
|
|
|
|
sysv = true;
|
|
|
|
|
|
offset = 0x200;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
xenix = true;
|
2021-09-19 21:16:47 +01:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
start = i;
|
2016-04-19 02:11:47 +01:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
break;
|
|
|
|
|
|
}
|
2018-06-22 08:08:38 +01:00
|
|
|
|
|
2022-03-16 11:47:00 +00:00
|
|
|
|
if(magic is XENIX_CIGAM or SYSV_CIGAM)
|
2022-03-06 13:29:38 +00:00
|
|
|
|
{
|
|
|
|
|
|
bigEndian = true; // Big endian
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
if(magic == SYSV_CIGAM)
|
|
|
|
|
|
{
|
|
|
|
|
|
sysv = true;
|
|
|
|
|
|
offset = 0x200;
|
2014-04-14 02:29:13 +00:00
|
|
|
|
}
|
2022-03-06 13:29:38 +00:00
|
|
|
|
else
|
|
|
|
|
|
xenix = true;
|
2017-12-19 20:33:03 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
start = i;
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
break;
|
|
|
|
|
|
}
|
2018-06-22 08:08:38 +01:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
magic = BitConverter.ToUInt32(sb_sector, 0x1F0); // XENIX 3 magic location
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
if(magic == XENIX_MAGIC)
|
|
|
|
|
|
{
|
|
|
|
|
|
xenix3 = true;
|
|
|
|
|
|
start = i;
|
2012-08-07 06:20:13 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
break;
|
|
|
|
|
|
}
|
2016-08-01 00:02:14 +01:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
if(magic == XENIX_CIGAM)
|
|
|
|
|
|
{
|
|
|
|
|
|
bigEndian = true; // Big endian
|
|
|
|
|
|
xenix3 = true;
|
|
|
|
|
|
start = i;
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
break;
|
|
|
|
|
|
}
|
2017-12-19 20:33:03 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
magic = BitConverter.ToUInt32(sb_sector, 0x1F8); // XENIX magic location
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
if(magic == SYSV_MAGIC)
|
|
|
|
|
|
{
|
|
|
|
|
|
sysv = true;
|
|
|
|
|
|
start = i;
|
2016-08-01 00:02:14 +01:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
break;
|
|
|
|
|
|
}
|
2016-04-19 02:11:47 +01:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
if(magic == SYSV_CIGAM)
|
|
|
|
|
|
{
|
|
|
|
|
|
bigEndian = true; // Big endian
|
|
|
|
|
|
sysv = true;
|
|
|
|
|
|
start = i;
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
break;
|
|
|
|
|
|
}
|
2017-12-19 20:33:03 +00:00
|
|
|
|
|
2022-11-15 15:58:43 +00:00
|
|
|
|
byte[] coherent_string = new byte[6];
|
2022-03-06 13:29:38 +00:00
|
|
|
|
Array.Copy(sb_sector, 0x1E4, coherent_string, 0, 6); // Coherent UNIX s_fname location
|
|
|
|
|
|
string s_fname = StringHandlers.CToString(coherent_string, Encoding);
|
|
|
|
|
|
Array.Copy(sb_sector, 0x1EA, coherent_string, 0, 6); // Coherent UNIX s_fpack location
|
|
|
|
|
|
string s_fpack = StringHandlers.CToString(coherent_string, Encoding);
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-11-15 15:58:43 +00:00
|
|
|
|
if((s_fname == COH_FNAME && s_fpack == COH_FPACK) ||
|
|
|
|
|
|
(s_fname == COH_XXXXX && s_fpack == COH_XXXXX) ||
|
|
|
|
|
|
(s_fname == COH_XXXXS && s_fpack == COH_XXXXN))
|
2022-03-06 13:29:38 +00:00
|
|
|
|
{
|
|
|
|
|
|
coherent = true;
|
|
|
|
|
|
start = i;
|
2012-08-07 06:20:13 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
break;
|
|
|
|
|
|
}
|
2016-04-19 02:11:47 +01:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
// Now try to identify 7th edition
|
2022-11-15 15:58:43 +00:00
|
|
|
|
uint s_fsize = BitConverter.ToUInt32(sb_sector, 0x002);
|
|
|
|
|
|
ushort s_nfree = BitConverter.ToUInt16(sb_sector, 0x006);
|
|
|
|
|
|
ushort s_ninode = BitConverter.ToUInt16(sb_sector, 0x0D0);
|
2022-03-06 13:29:38 +00:00
|
|
|
|
|
2022-03-16 11:47:00 +00:00
|
|
|
|
if(s_fsize is <= 0 or >= 0xFFFFFFFF ||
|
|
|
|
|
|
s_nfree is <= 0 or >= 0xFFFF ||
|
|
|
|
|
|
s_ninode is <= 0 or >= 0xFFFF)
|
2022-03-06 13:29:38 +00:00
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
|
|
if((s_fsize & 0xFF) == 0x00 &&
|
|
|
|
|
|
(s_nfree & 0xFF) == 0x00 &&
|
|
|
|
|
|
(s_ninode & 0xFF) == 0x00)
|
|
|
|
|
|
{
|
|
|
|
|
|
// Byteswap
|
|
|
|
|
|
s_fsize = ((s_fsize & 0xFF) << 24) + ((s_fsize & 0xFF00) << 8) + ((s_fsize & 0xFF0000) >> 8) +
|
|
|
|
|
|
((s_fsize & 0xFF000000) >> 24);
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
s_nfree = (ushort)(s_nfree >> 8);
|
|
|
|
|
|
s_ninode = (ushort)(s_ninode >> 8);
|
|
|
|
|
|
}
|
2012-08-07 06:20:13 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
if((s_fsize & 0xFF000000) != 0x00 ||
|
|
|
|
|
|
(s_nfree & 0xFF00) != 0x00 ||
|
|
|
|
|
|
(s_ninode & 0xFF00) != 0x00)
|
|
|
|
|
|
continue;
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
if(s_fsize >= V7_MAXSIZE ||
|
|
|
|
|
|
s_nfree >= V7_NICFREE ||
|
|
|
|
|
|
s_ninode >= V7_NICINOD)
|
|
|
|
|
|
continue;
|
2017-12-21 06:06:19 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
if(s_fsize * 1024 != (partition.End - partition.Start) * imagePlugin.Info.SectorSize &&
|
|
|
|
|
|
s_fsize * 512 != (partition.End - partition.Start) * imagePlugin.Info.SectorSize)
|
|
|
|
|
|
continue;
|
2017-12-21 06:06:19 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
sys7th = true;
|
|
|
|
|
|
start = i;
|
2017-12-21 06:06:19 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
break;
|
|
|
|
|
|
}
|
2017-12-21 06:06:19 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
if(!sys7th &&
|
|
|
|
|
|
!sysv &&
|
|
|
|
|
|
!coherent &&
|
|
|
|
|
|
!xenix &&
|
|
|
|
|
|
!xenix3)
|
|
|
|
|
|
return;
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
XmlFsType = new FileSystemType();
|
2017-12-19 20:33:03 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
if(xenix || xenix3)
|
|
|
|
|
|
{
|
2022-11-15 15:58:43 +00:00
|
|
|
|
byte[] xenix_strings = new byte[6];
|
|
|
|
|
|
var xnx_sb = new XenixSuperBlock();
|
2022-03-06 13:29:38 +00:00
|
|
|
|
errno = imagePlugin.ReadSectors((ulong)start + partition.Start, sb_size_in_sectors, out sb_sector);
|
2014-04-14 02:29:13 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
if(errno != ErrorNumber.NoError)
|
|
|
|
|
|
return;
|
2015-12-05 17:10:27 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
if(xenix3)
|
|
|
|
|
|
{
|
|
|
|
|
|
xnx_sb.s_isize = BitConverter.ToUInt16(sb_sector, 0x000);
|
|
|
|
|
|
xnx_sb.s_fsize = BitConverter.ToUInt32(sb_sector, 0x002);
|
|
|
|
|
|
xnx_sb.s_nfree = BitConverter.ToUInt16(sb_sector, 0x006);
|
|
|
|
|
|
xnx_sb.s_ninode = BitConverter.ToUInt16(sb_sector, 0x0D0);
|
|
|
|
|
|
xnx_sb.s_flock = sb_sector[0x19A];
|
|
|
|
|
|
xnx_sb.s_ilock = sb_sector[0x19B];
|
|
|
|
|
|
xnx_sb.s_fmod = sb_sector[0x19C];
|
|
|
|
|
|
xnx_sb.s_ronly = sb_sector[0x19D];
|
|
|
|
|
|
xnx_sb.s_time = BitConverter.ToInt32(sb_sector, 0x19E);
|
|
|
|
|
|
xnx_sb.s_tfree = BitConverter.ToUInt32(sb_sector, 0x1A2);
|
|
|
|
|
|
xnx_sb.s_tinode = BitConverter.ToUInt16(sb_sector, 0x1A6);
|
|
|
|
|
|
xnx_sb.s_cylblks = BitConverter.ToUInt16(sb_sector, 0x1A8);
|
|
|
|
|
|
xnx_sb.s_gapblks = BitConverter.ToUInt16(sb_sector, 0x1AA);
|
|
|
|
|
|
xnx_sb.s_dinfo0 = BitConverter.ToUInt16(sb_sector, 0x1AC);
|
|
|
|
|
|
xnx_sb.s_dinfo1 = BitConverter.ToUInt16(sb_sector, 0x1AE);
|
|
|
|
|
|
Array.Copy(sb_sector, 0x1B0, xenix_strings, 0, 6);
|
|
|
|
|
|
xnx_sb.s_fname = StringHandlers.CToString(xenix_strings, Encoding);
|
|
|
|
|
|
Array.Copy(sb_sector, 0x1B6, xenix_strings, 0, 6);
|
|
|
|
|
|
xnx_sb.s_fpack = StringHandlers.CToString(xenix_strings, Encoding);
|
|
|
|
|
|
xnx_sb.s_clean = sb_sector[0x1BC];
|
|
|
|
|
|
xnx_sb.s_magic = BitConverter.ToUInt32(sb_sector, 0x1F0);
|
|
|
|
|
|
xnx_sb.s_type = BitConverter.ToUInt32(sb_sector, 0x1F4);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
2014-04-14 02:29:13 +00:00
|
|
|
|
{
|
2022-03-06 13:29:38 +00:00
|
|
|
|
xnx_sb.s_isize = BitConverter.ToUInt16(sb_sector, 0x000);
|
|
|
|
|
|
xnx_sb.s_fsize = BitConverter.ToUInt32(sb_sector, 0x002);
|
|
|
|
|
|
xnx_sb.s_nfree = BitConverter.ToUInt16(sb_sector, 0x006);
|
|
|
|
|
|
xnx_sb.s_ninode = BitConverter.ToUInt16(sb_sector, 0x198);
|
|
|
|
|
|
xnx_sb.s_flock = sb_sector[0x262];
|
|
|
|
|
|
xnx_sb.s_ilock = sb_sector[0x263];
|
|
|
|
|
|
xnx_sb.s_fmod = sb_sector[0x264];
|
|
|
|
|
|
xnx_sb.s_ronly = sb_sector[0x265];
|
|
|
|
|
|
xnx_sb.s_time = BitConverter.ToInt32(sb_sector, 0x266);
|
|
|
|
|
|
xnx_sb.s_tfree = BitConverter.ToUInt32(sb_sector, 0x26A);
|
|
|
|
|
|
xnx_sb.s_tinode = BitConverter.ToUInt16(sb_sector, 0x26E);
|
|
|
|
|
|
xnx_sb.s_cylblks = BitConverter.ToUInt16(sb_sector, 0x270);
|
|
|
|
|
|
xnx_sb.s_gapblks = BitConverter.ToUInt16(sb_sector, 0x272);
|
|
|
|
|
|
xnx_sb.s_dinfo0 = BitConverter.ToUInt16(sb_sector, 0x274);
|
|
|
|
|
|
xnx_sb.s_dinfo1 = BitConverter.ToUInt16(sb_sector, 0x276);
|
|
|
|
|
|
Array.Copy(sb_sector, 0x278, xenix_strings, 0, 6);
|
|
|
|
|
|
xnx_sb.s_fname = StringHandlers.CToString(xenix_strings, Encoding);
|
|
|
|
|
|
Array.Copy(sb_sector, 0x27E, xenix_strings, 0, 6);
|
|
|
|
|
|
xnx_sb.s_fpack = StringHandlers.CToString(xenix_strings, Encoding);
|
|
|
|
|
|
xnx_sb.s_clean = sb_sector[0x284];
|
|
|
|
|
|
xnx_sb.s_magic = BitConverter.ToUInt32(sb_sector, 0x3F8);
|
|
|
|
|
|
xnx_sb.s_type = BitConverter.ToUInt32(sb_sector, 0x3FC);
|
|
|
|
|
|
}
|
2021-09-19 21:16:47 +01:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
if(bigEndian)
|
|
|
|
|
|
{
|
|
|
|
|
|
xnx_sb.s_isize = Swapping.Swap(xnx_sb.s_isize);
|
|
|
|
|
|
xnx_sb.s_fsize = Swapping.Swap(xnx_sb.s_fsize);
|
|
|
|
|
|
xnx_sb.s_nfree = Swapping.Swap(xnx_sb.s_nfree);
|
|
|
|
|
|
xnx_sb.s_ninode = Swapping.Swap(xnx_sb.s_ninode);
|
|
|
|
|
|
xnx_sb.s_time = Swapping.Swap(xnx_sb.s_time);
|
|
|
|
|
|
xnx_sb.s_tfree = Swapping.Swap(xnx_sb.s_tfree);
|
|
|
|
|
|
xnx_sb.s_tinode = Swapping.Swap(xnx_sb.s_tinode);
|
|
|
|
|
|
xnx_sb.s_cylblks = Swapping.Swap(xnx_sb.s_cylblks);
|
|
|
|
|
|
xnx_sb.s_gapblks = Swapping.Swap(xnx_sb.s_gapblks);
|
|
|
|
|
|
xnx_sb.s_dinfo0 = Swapping.Swap(xnx_sb.s_dinfo0);
|
|
|
|
|
|
xnx_sb.s_dinfo1 = Swapping.Swap(xnx_sb.s_dinfo1);
|
|
|
|
|
|
xnx_sb.s_magic = Swapping.Swap(xnx_sb.s_magic);
|
|
|
|
|
|
xnx_sb.s_type = Swapping.Swap(xnx_sb.s_type);
|
|
|
|
|
|
}
|
2016-04-19 02:11:47 +01:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
uint bs = 512;
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.AppendLine(Localization.XENIX_filesystem);
|
|
|
|
|
|
XmlFsType.Type = FS_TYPE_XENIX;
|
2019-05-11 21:12:53 +01:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
switch(xnx_sb.s_type)
|
|
|
|
|
|
{
|
|
|
|
|
|
case 1:
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.AppendLine(Localization._512_bytes_per_block);
|
2022-03-06 13:29:38 +00:00
|
|
|
|
XmlFsType.ClusterSize = 512;
|
2012-08-07 06:20:13 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
break;
|
|
|
|
|
|
case 2:
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.AppendLine(Localization._1024_bytes_per_block);
|
2022-03-06 13:29:38 +00:00
|
|
|
|
bs = 1024;
|
|
|
|
|
|
XmlFsType.ClusterSize = 1024;
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
break;
|
|
|
|
|
|
case 3:
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.AppendLine(Localization._2048_bytes_per_block);
|
2022-03-06 13:29:38 +00:00
|
|
|
|
bs = 2048;
|
|
|
|
|
|
XmlFsType.ClusterSize = 2048;
|
2017-12-19 20:33:03 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
break;
|
|
|
|
|
|
default:
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.AppendFormat(Localization.Unknown_s_type_value_0, xnx_sb.s_type).AppendLine();
|
2018-06-22 08:08:38 +01:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
break;
|
|
|
|
|
|
}
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-03-16 11:47:00 +00:00
|
|
|
|
if(imagePlugin.Info.SectorSize is 2336 or 2352 or 2448)
|
2022-03-06 13:29:38 +00:00
|
|
|
|
{
|
|
|
|
|
|
if(bs != 2048)
|
|
|
|
|
|
sb.
|
2022-11-28 02:59:53 +00:00
|
|
|
|
AppendFormat(Localization.WARNING_Filesystem_indicates_0_bytes_block_while_device_indicates_1_bytes_sector,
|
2022-03-06 13:29:38 +00:00
|
|
|
|
bs, 2048).AppendLine();
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
if(bs != imagePlugin.Info.SectorSize)
|
|
|
|
|
|
sb.
|
2022-11-28 02:59:53 +00:00
|
|
|
|
AppendFormat(Localization.WARNING_Filesystem_indicates_0_bytes_block_while_device_indicates_1_bytes_sector,
|
2022-03-06 13:29:38 +00:00
|
|
|
|
bs, imagePlugin.Info.SectorSize).AppendLine();
|
|
|
|
|
|
}
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.AppendFormat(Localization._0_zones_on_volume_1_bytes, xnx_sb.s_fsize, xnx_sb.s_fsize * bs).AppendLine();
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.AppendFormat(Localization._0_free_zones_on_volume_1_bytes, xnx_sb.s_tfree, xnx_sb.s_tfree * bs).
|
|
|
|
|
|
AppendLine();
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.AppendFormat(Localization._0_free_blocks_on_list_1_bytes, xnx_sb.s_nfree, xnx_sb.s_nfree * bs).
|
|
|
|
|
|
AppendLine();
|
|
|
|
|
|
|
|
|
|
|
|
sb.AppendFormat(Localization._0_blocks_per_cylinder_1_bytes, xnx_sb.s_cylblks, xnx_sb.s_cylblks * bs).
|
|
|
|
|
|
AppendLine();
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.AppendFormat(Localization._0_blocks_per_gap_1_bytes, xnx_sb.s_gapblks, xnx_sb.s_gapblks * bs).
|
2022-03-06 13:29:38 +00:00
|
|
|
|
AppendLine();
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.AppendFormat(Localization.First_data_zone_0, xnx_sb.s_isize).AppendLine();
|
|
|
|
|
|
sb.AppendFormat(Localization._0_free_inodes_on_volume, xnx_sb.s_tinode).AppendLine();
|
|
|
|
|
|
sb.AppendFormat(Localization._0_free_inodes_on_list, xnx_sb.s_ninode).AppendLine();
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
if(xnx_sb.s_flock > 0)
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.AppendLine(Localization.Free_block_list_is_locked);
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
if(xnx_sb.s_ilock > 0)
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.AppendLine(Localization.inode_cache_is_locked);
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
if(xnx_sb.s_fmod > 0)
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.AppendLine(Localization.Superblock_is_being_modified);
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
if(xnx_sb.s_ronly > 0)
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.AppendLine(Localization.Volume_is_mounted_read_only);
|
2018-06-22 08:08:38 +01:00
|
|
|
|
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.AppendFormat(Localization.Superblock_last_updated_on_0, DateHandlers.UnixToDateTime(xnx_sb.s_time)).
|
|
|
|
|
|
AppendLine();
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
if(xnx_sb.s_time != 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
XmlFsType.ModificationDate = DateHandlers.UnixToDateTime(xnx_sb.s_time);
|
|
|
|
|
|
XmlFsType.ModificationDateSpecified = true;
|
2014-04-14 02:29:13 +00:00
|
|
|
|
}
|
2012-08-07 06:20:13 +00:00
|
|
|
|
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.AppendFormat(Localization.Volume_name_0, xnx_sb.s_fname).AppendLine();
|
2022-03-06 13:29:38 +00:00
|
|
|
|
XmlFsType.VolumeName = xnx_sb.s_fname;
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.AppendFormat(Localization.Pack_name_0, xnx_sb.s_fpack).AppendLine();
|
2021-09-19 21:16:47 +01:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
if(xnx_sb.s_clean == 0x46)
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.AppendLine(Localization.Volume_is_clean);
|
2022-03-06 13:29:38 +00:00
|
|
|
|
else
|
|
|
|
|
|
{
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.AppendLine(Localization.Volume_is_dirty);
|
2022-03-06 13:29:38 +00:00
|
|
|
|
XmlFsType.Dirty = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2021-09-19 21:16:47 +01:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
if(sysv)
|
|
|
|
|
|
{
|
|
|
|
|
|
errno = imagePlugin.ReadSectors((ulong)start + partition.Start, sb_size_in_sectors, out sb_sector);
|
2012-08-07 06:20:13 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
if(errno != ErrorNumber.NoError)
|
|
|
|
|
|
return;
|
2019-05-11 21:12:53 +01:00
|
|
|
|
|
2022-11-15 15:58:43 +00:00
|
|
|
|
byte[] sysv_strings = new byte[6];
|
2019-05-11 21:12:53 +01:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
var sysv_sb = new SystemVRelease4SuperBlock
|
|
|
|
|
|
{
|
|
|
|
|
|
s_type = BitConverter.ToUInt32(sb_sector, 0x1FC + offset)
|
|
|
|
|
|
};
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
if(bigEndian)
|
|
|
|
|
|
sysv_sb.s_type = Swapping.Swap(sysv_sb.s_type);
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
uint bs = 512;
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
switch(sysv_sb.s_type)
|
|
|
|
|
|
{
|
|
|
|
|
|
case 1:
|
|
|
|
|
|
XmlFsType.ClusterSize = 512;
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
break;
|
|
|
|
|
|
case 2:
|
|
|
|
|
|
bs = 1024;
|
|
|
|
|
|
XmlFsType.ClusterSize = 1024;
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
break;
|
|
|
|
|
|
case 3:
|
|
|
|
|
|
bs = 2048;
|
|
|
|
|
|
XmlFsType.ClusterSize = 2048;
|
2017-12-19 20:33:03 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
break;
|
|
|
|
|
|
default:
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.AppendFormat(Localization.Unknown_s_type_value_0, sysv_sb.s_type).AppendLine();
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
break;
|
|
|
|
|
|
}
|
2017-11-08 17:04:15 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
sysv_sb.s_fsize = BitConverter.ToUInt32(sb_sector, 0x002 + offset);
|
2017-11-08 17:04:15 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
if(bigEndian)
|
|
|
|
|
|
sysv_sb.s_fsize = Swapping.Swap(sysv_sb.s_fsize);
|
2018-06-22 08:08:38 +01:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
bool sysvr4 = sysv_sb.s_fsize * bs <= 0 || sysv_sb.s_fsize * bs != partition.Size;
|
2019-05-11 21:12:53 +01:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
if(sysvr4)
|
|
|
|
|
|
{
|
|
|
|
|
|
sysv_sb.s_isize = BitConverter.ToUInt16(sb_sector, 0x000 + offset);
|
|
|
|
|
|
sysv_sb.s_state = BitConverter.ToUInt32(sb_sector, 0x1F4 + offset);
|
|
|
|
|
|
sysv_sb.s_magic = BitConverter.ToUInt32(sb_sector, 0x1F8 + offset);
|
|
|
|
|
|
sysv_sb.s_fsize = BitConverter.ToUInt32(sb_sector, 0x004 + offset);
|
|
|
|
|
|
sysv_sb.s_nfree = BitConverter.ToUInt16(sb_sector, 0x008 + offset);
|
|
|
|
|
|
sysv_sb.s_ninode = BitConverter.ToUInt16(sb_sector, 0x0D4 + offset);
|
|
|
|
|
|
sysv_sb.s_flock = sb_sector[0x1A0 + offset];
|
|
|
|
|
|
sysv_sb.s_ilock = sb_sector[0x1A1 + offset];
|
|
|
|
|
|
sysv_sb.s_fmod = sb_sector[0x1A2 + offset];
|
|
|
|
|
|
sysv_sb.s_ronly = sb_sector[0x1A3 + offset];
|
|
|
|
|
|
sysv_sb.s_time = BitConverter.ToUInt32(sb_sector, 0x1A4 + offset);
|
|
|
|
|
|
sysv_sb.s_cylblks = BitConverter.ToUInt16(sb_sector, 0x1A8 + offset);
|
|
|
|
|
|
sysv_sb.s_gapblks = BitConverter.ToUInt16(sb_sector, 0x1AA + offset);
|
|
|
|
|
|
sysv_sb.s_dinfo0 = BitConverter.ToUInt16(sb_sector, 0x1AC + offset);
|
|
|
|
|
|
sysv_sb.s_dinfo1 = BitConverter.ToUInt16(sb_sector, 0x1AE + offset);
|
|
|
|
|
|
sysv_sb.s_tfree = BitConverter.ToUInt32(sb_sector, 0x1B0 + offset);
|
|
|
|
|
|
sysv_sb.s_tinode = BitConverter.ToUInt16(sb_sector, 0x1B4 + offset);
|
|
|
|
|
|
Array.Copy(sb_sector, 0x1B6 + offset, sysv_strings, 0, 6);
|
|
|
|
|
|
sysv_sb.s_fname = StringHandlers.CToString(sysv_strings, Encoding);
|
|
|
|
|
|
Array.Copy(sb_sector, 0x1BC + offset, sysv_strings, 0, 6);
|
|
|
|
|
|
sysv_sb.s_fpack = StringHandlers.CToString(sysv_strings, Encoding);
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.AppendLine(Localization.System_V_Release_4_filesystem);
|
|
|
|
|
|
XmlFsType.Type = FS_TYPE_SVR4;
|
2022-03-06 13:29:38 +00:00
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
sysv_sb.s_isize = BitConverter.ToUInt16(sb_sector, 0x000 + offset);
|
|
|
|
|
|
sysv_sb.s_state = BitConverter.ToUInt32(sb_sector, 0x1F4 + offset);
|
|
|
|
|
|
sysv_sb.s_magic = BitConverter.ToUInt32(sb_sector, 0x1F8 + offset);
|
|
|
|
|
|
sysv_sb.s_fsize = BitConverter.ToUInt32(sb_sector, 0x002 + offset);
|
|
|
|
|
|
sysv_sb.s_nfree = BitConverter.ToUInt16(sb_sector, 0x006 + offset);
|
|
|
|
|
|
sysv_sb.s_ninode = BitConverter.ToUInt16(sb_sector, 0x0D0 + offset);
|
|
|
|
|
|
sysv_sb.s_flock = sb_sector[0x19A + offset];
|
|
|
|
|
|
sysv_sb.s_ilock = sb_sector[0x19B + offset];
|
|
|
|
|
|
sysv_sb.s_fmod = sb_sector[0x19C + offset];
|
|
|
|
|
|
sysv_sb.s_ronly = sb_sector[0x19D + offset];
|
|
|
|
|
|
sysv_sb.s_time = BitConverter.ToUInt32(sb_sector, 0x19E + offset);
|
|
|
|
|
|
sysv_sb.s_cylblks = BitConverter.ToUInt16(sb_sector, 0x1A2 + offset);
|
|
|
|
|
|
sysv_sb.s_gapblks = BitConverter.ToUInt16(sb_sector, 0x1A4 + offset);
|
|
|
|
|
|
sysv_sb.s_dinfo0 = BitConverter.ToUInt16(sb_sector, 0x1A6 + offset);
|
|
|
|
|
|
sysv_sb.s_dinfo1 = BitConverter.ToUInt16(sb_sector, 0x1A8 + offset);
|
|
|
|
|
|
sysv_sb.s_tfree = BitConverter.ToUInt32(sb_sector, 0x1AA + offset);
|
|
|
|
|
|
sysv_sb.s_tinode = BitConverter.ToUInt16(sb_sector, 0x1AE + offset);
|
|
|
|
|
|
Array.Copy(sb_sector, 0x1B0 + offset, sysv_strings, 0, 6);
|
|
|
|
|
|
sysv_sb.s_fname = StringHandlers.CToString(sysv_strings, Encoding);
|
|
|
|
|
|
Array.Copy(sb_sector, 0x1B6 + offset, sysv_strings, 0, 6);
|
|
|
|
|
|
sysv_sb.s_fpack = StringHandlers.CToString(sysv_strings, Encoding);
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.AppendLine(Localization.System_V_Release_2_filesystem);
|
|
|
|
|
|
XmlFsType.Type = FS_TYPE_SVR2;
|
2022-03-06 13:29:38 +00:00
|
|
|
|
}
|
2017-11-08 17:04:15 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
if(bigEndian)
|
|
|
|
|
|
{
|
|
|
|
|
|
sysv_sb.s_isize = Swapping.Swap(sysv_sb.s_isize);
|
|
|
|
|
|
sysv_sb.s_state = Swapping.Swap(sysv_sb.s_state);
|
|
|
|
|
|
sysv_sb.s_magic = Swapping.Swap(sysv_sb.s_magic);
|
|
|
|
|
|
sysv_sb.s_fsize = Swapping.Swap(sysv_sb.s_fsize);
|
|
|
|
|
|
sysv_sb.s_nfree = Swapping.Swap(sysv_sb.s_nfree);
|
|
|
|
|
|
sysv_sb.s_ninode = Swapping.Swap(sysv_sb.s_ninode);
|
|
|
|
|
|
sysv_sb.s_time = Swapping.Swap(sysv_sb.s_time);
|
|
|
|
|
|
sysv_sb.s_cylblks = Swapping.Swap(sysv_sb.s_cylblks);
|
|
|
|
|
|
sysv_sb.s_gapblks = Swapping.Swap(sysv_sb.s_gapblks);
|
|
|
|
|
|
sysv_sb.s_dinfo0 = Swapping.Swap(sysv_sb.s_dinfo0);
|
|
|
|
|
|
sysv_sb.s_dinfo1 = Swapping.Swap(sysv_sb.s_dinfo1);
|
|
|
|
|
|
sysv_sb.s_tfree = Swapping.Swap(sysv_sb.s_tfree);
|
|
|
|
|
|
sysv_sb.s_tinode = Swapping.Swap(sysv_sb.s_tinode);
|
|
|
|
|
|
}
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.AppendFormat(Localization._0_bytes_per_block, bs).AppendLine();
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
XmlFsType.Clusters = sysv_sb.s_fsize;
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.AppendFormat(Localization._0_zones_on_volume_1_bytes, sysv_sb.s_fsize, sysv_sb.s_fsize * bs).
|
|
|
|
|
|
AppendLine();
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.AppendFormat(Localization._0_free_zones_on_volume_1_bytes, sysv_sb.s_tfree, sysv_sb.s_tfree * bs).
|
|
|
|
|
|
AppendLine();
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.AppendFormat(Localization._0_free_blocks_on_list_1_bytes, sysv_sb.s_nfree, sysv_sb.s_nfree * bs).
|
2022-03-06 13:29:38 +00:00
|
|
|
|
AppendLine();
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.AppendFormat(Localization._0_blocks_per_cylinder_1_bytes, sysv_sb.s_cylblks, sysv_sb.s_cylblks * bs).
|
|
|
|
|
|
AppendLine();
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.AppendFormat(Localization._0_blocks_per_gap_1_bytes, sysv_sb.s_gapblks, sysv_sb.s_gapblks * bs).
|
|
|
|
|
|
AppendLine();
|
|
|
|
|
|
|
|
|
|
|
|
sb.AppendFormat(Localization.First_data_zone_0, sysv_sb.s_isize).AppendLine();
|
|
|
|
|
|
sb.AppendFormat(Localization._0_free_inodes_on_volume, sysv_sb.s_tinode).AppendLine();
|
|
|
|
|
|
sb.AppendFormat(Localization._0_free_inodes_on_list, sysv_sb.s_ninode).AppendLine();
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
if(sysv_sb.s_flock > 0)
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.AppendLine(Localization.Free_block_list_is_locked);
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
if(sysv_sb.s_ilock > 0)
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.AppendLine(Localization.inode_cache_is_locked);
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
if(sysv_sb.s_fmod > 0)
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.AppendLine(Localization.Superblock_is_being_modified);
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
if(sysv_sb.s_ronly > 0)
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.AppendLine(Localization.Volume_is_mounted_read_only);
|
2018-06-22 08:08:38 +01:00
|
|
|
|
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.AppendFormat(Localization.Superblock_last_updated_on_0,
|
|
|
|
|
|
DateHandlers.UnixUnsignedToDateTime(sysv_sb.s_time)).AppendLine();
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
if(sysv_sb.s_time != 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
XmlFsType.ModificationDate = DateHandlers.UnixUnsignedToDateTime(sysv_sb.s_time);
|
|
|
|
|
|
XmlFsType.ModificationDateSpecified = true;
|
2014-04-14 02:29:13 +00:00
|
|
|
|
}
|
2012-08-07 06:20:13 +00:00
|
|
|
|
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.AppendFormat(Localization.Volume_name_0, sysv_sb.s_fname).AppendLine();
|
2022-03-06 13:29:38 +00:00
|
|
|
|
XmlFsType.VolumeName = sysv_sb.s_fname;
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.AppendFormat(Localization.Pack_name_0, sysv_sb.s_fpack).AppendLine();
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
if(sysv_sb.s_state == 0x7C269D38 - sysv_sb.s_time)
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.AppendLine(Localization.Volume_is_clean);
|
2022-03-06 13:29:38 +00:00
|
|
|
|
else
|
|
|
|
|
|
{
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.AppendLine(Localization.Volume_is_dirty);
|
2022-03-06 13:29:38 +00:00
|
|
|
|
XmlFsType.Dirty = true;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
if(coherent)
|
|
|
|
|
|
{
|
|
|
|
|
|
errno = imagePlugin.ReadSectors((ulong)start + partition.Start, sb_size_in_sectors, out sb_sector);
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
if(errno != ErrorNumber.NoError)
|
|
|
|
|
|
return;
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-11-15 15:58:43 +00:00
|
|
|
|
var coh_sb = new CoherentSuperBlock();
|
|
|
|
|
|
byte[] coh_strings = new byte[6];
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
coh_sb.s_isize = BitConverter.ToUInt16(sb_sector, 0x000);
|
|
|
|
|
|
coh_sb.s_fsize = Swapping.PDPFromLittleEndian(BitConverter.ToUInt32(sb_sector, 0x002));
|
|
|
|
|
|
coh_sb.s_nfree = BitConverter.ToUInt16(sb_sector, 0x006);
|
|
|
|
|
|
coh_sb.s_ninode = BitConverter.ToUInt16(sb_sector, 0x108);
|
|
|
|
|
|
coh_sb.s_flock = sb_sector[0x1D2];
|
|
|
|
|
|
coh_sb.s_ilock = sb_sector[0x1D3];
|
|
|
|
|
|
coh_sb.s_fmod = sb_sector[0x1D4];
|
|
|
|
|
|
coh_sb.s_ronly = sb_sector[0x1D5];
|
|
|
|
|
|
coh_sb.s_time = Swapping.PDPFromLittleEndian(BitConverter.ToUInt32(sb_sector, 0x1D6));
|
|
|
|
|
|
coh_sb.s_tfree = Swapping.PDPFromLittleEndian(BitConverter.ToUInt32(sb_sector, 0x1DA));
|
|
|
|
|
|
coh_sb.s_tinode = BitConverter.ToUInt16(sb_sector, 0x1DE);
|
|
|
|
|
|
coh_sb.s_int_m = BitConverter.ToUInt16(sb_sector, 0x1E0);
|
|
|
|
|
|
coh_sb.s_int_n = BitConverter.ToUInt16(sb_sector, 0x1E2);
|
|
|
|
|
|
Array.Copy(sb_sector, 0x1E4, coh_strings, 0, 6);
|
|
|
|
|
|
coh_sb.s_fname = StringHandlers.CToString(coh_strings, Encoding);
|
|
|
|
|
|
Array.Copy(sb_sector, 0x1EA, coh_strings, 0, 6);
|
|
|
|
|
|
coh_sb.s_fpack = StringHandlers.CToString(coh_strings, Encoding);
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-11-28 02:59:53 +00:00
|
|
|
|
XmlFsType.Type = FS_TYPE_COHERENT;
|
2022-03-06 13:29:38 +00:00
|
|
|
|
XmlFsType.ClusterSize = 512;
|
|
|
|
|
|
XmlFsType.Clusters = coh_sb.s_fsize;
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.AppendLine(Localization.Coherent_UNIX_filesystem);
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
if(imagePlugin.Info.SectorSize != 512)
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.
|
|
|
|
|
|
AppendFormat(Localization.WARNING_Filesystem_indicates_0_bytes_block_while_device_indicates_1_bytes_sector,
|
|
|
|
|
|
512, 2048).AppendLine();
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.AppendFormat(Localization._0_zones_on_volume_1_bytes, coh_sb.s_fsize, coh_sb.s_fsize * 512).AppendLine();
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.AppendFormat(Localization._0_free_zones_on_volume_1_bytes, coh_sb.s_tfree, coh_sb.s_tfree * 512).
|
|
|
|
|
|
AppendLine();
|
2018-06-22 08:08:38 +01:00
|
|
|
|
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.AppendFormat(Localization._0_free_blocks_on_list_1_bytes, coh_sb.s_nfree, coh_sb.s_nfree * 512).
|
|
|
|
|
|
AppendLine();
|
2014-04-14 02:29:13 +00:00
|
|
|
|
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.AppendFormat(Localization.First_data_zone_0, coh_sb.s_isize).AppendLine();
|
|
|
|
|
|
sb.AppendFormat(Localization._0_free_inodes_on_volume, coh_sb.s_tinode).AppendLine();
|
|
|
|
|
|
sb.AppendFormat(Localization._0_free_inodes_on_list, coh_sb.s_ninode).AppendLine();
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
if(coh_sb.s_flock > 0)
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.AppendLine(Localization.Free_block_list_is_locked);
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
if(coh_sb.s_ilock > 0)
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.AppendLine(Localization.inode_cache_is_locked);
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
if(coh_sb.s_fmod > 0)
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.AppendLine(Localization.Superblock_is_being_modified);
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
if(coh_sb.s_ronly > 0)
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.AppendLine(Localization.Volume_is_mounted_read_only);
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.AppendFormat(Localization.Superblock_last_updated_on_0,
|
|
|
|
|
|
DateHandlers.UnixUnsignedToDateTime(coh_sb.s_time)).AppendLine();
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
if(coh_sb.s_time != 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
XmlFsType.ModificationDate = DateHandlers.UnixUnsignedToDateTime(coh_sb.s_time);
|
|
|
|
|
|
XmlFsType.ModificationDateSpecified = true;
|
|
|
|
|
|
}
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.AppendFormat(Localization.Volume_name_0, coh_sb.s_fname).AppendLine();
|
2022-03-06 13:29:38 +00:00
|
|
|
|
XmlFsType.VolumeName = coh_sb.s_fname;
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.AppendFormat(Localization.Pack_name_0, coh_sb.s_fpack).AppendLine();
|
2022-03-06 13:29:38 +00:00
|
|
|
|
}
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
if(sys7th)
|
|
|
|
|
|
{
|
|
|
|
|
|
errno = imagePlugin.ReadSectors((ulong)start + partition.Start, sb_size_in_sectors, out sb_sector);
|
2020-02-29 18:03:35 +00:00
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
if(errno != ErrorNumber.NoError)
|
|
|
|
|
|
return;
|
2018-06-22 08:08:38 +01:00
|
|
|
|
|
2022-11-15 15:58:43 +00:00
|
|
|
|
var v7_sb = new UNIX7thEditionSuperBlock();
|
|
|
|
|
|
byte[] sys7_strings = new byte[6];
|
2022-03-06 13:29:38 +00:00
|
|
|
|
|
|
|
|
|
|
v7_sb.s_isize = BitConverter.ToUInt16(sb_sector, 0x000);
|
|
|
|
|
|
v7_sb.s_fsize = BitConverter.ToUInt32(sb_sector, 0x002);
|
|
|
|
|
|
v7_sb.s_nfree = BitConverter.ToUInt16(sb_sector, 0x006);
|
|
|
|
|
|
v7_sb.s_ninode = BitConverter.ToUInt16(sb_sector, 0x0D0);
|
|
|
|
|
|
v7_sb.s_flock = sb_sector[0x19A];
|
|
|
|
|
|
v7_sb.s_ilock = sb_sector[0x19B];
|
|
|
|
|
|
v7_sb.s_fmod = sb_sector[0x19C];
|
|
|
|
|
|
v7_sb.s_ronly = sb_sector[0x19D];
|
|
|
|
|
|
v7_sb.s_time = BitConverter.ToUInt32(sb_sector, 0x19E);
|
|
|
|
|
|
v7_sb.s_tfree = BitConverter.ToUInt32(sb_sector, 0x1A2);
|
|
|
|
|
|
v7_sb.s_tinode = BitConverter.ToUInt16(sb_sector, 0x1A6);
|
|
|
|
|
|
v7_sb.s_int_m = BitConverter.ToUInt16(sb_sector, 0x1A8);
|
|
|
|
|
|
v7_sb.s_int_n = BitConverter.ToUInt16(sb_sector, 0x1AA);
|
|
|
|
|
|
Array.Copy(sb_sector, 0x1AC, sys7_strings, 0, 6);
|
|
|
|
|
|
v7_sb.s_fname = StringHandlers.CToString(sys7_strings, Encoding);
|
|
|
|
|
|
Array.Copy(sb_sector, 0x1B2, sys7_strings, 0, 6);
|
|
|
|
|
|
v7_sb.s_fpack = StringHandlers.CToString(sys7_strings, Encoding);
|
|
|
|
|
|
|
2022-11-28 02:59:53 +00:00
|
|
|
|
XmlFsType.Type = FS_TYPE_UNIX7;
|
2022-03-06 13:29:38 +00:00
|
|
|
|
XmlFsType.ClusterSize = 512;
|
|
|
|
|
|
XmlFsType.Clusters = v7_sb.s_fsize;
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.AppendLine(Localization.UNIX_7th_Edition_filesystem);
|
2022-03-06 13:29:38 +00:00
|
|
|
|
|
|
|
|
|
|
if(imagePlugin.Info.SectorSize != 512)
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.
|
|
|
|
|
|
AppendFormat(Localization.WARNING_Filesystem_indicates_0_bytes_block_while_device_indicates_1_bytes_sector,
|
|
|
|
|
|
512, 2048).AppendLine();
|
2022-03-06 13:29:38 +00:00
|
|
|
|
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.AppendFormat(Localization._0_zones_on_volume_1_bytes, v7_sb.s_fsize, v7_sb.s_fsize * 512).AppendLine();
|
2022-03-06 13:29:38 +00:00
|
|
|
|
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.AppendFormat(Localization._0_free_zones_on_volume_1_bytes, v7_sb.s_tfree, v7_sb.s_tfree * 512).
|
|
|
|
|
|
AppendLine();
|
|
|
|
|
|
|
|
|
|
|
|
sb.AppendFormat(Localization._0_free_blocks_on_list_1_bytes, v7_sb.s_nfree, v7_sb.s_nfree * 512).
|
|
|
|
|
|
AppendLine();
|
2022-03-06 13:29:38 +00:00
|
|
|
|
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.AppendFormat(Localization.First_data_zone_0, v7_sb.s_isize).AppendLine();
|
|
|
|
|
|
sb.AppendFormat(Localization._0_free_inodes_on_volume, v7_sb.s_tinode).AppendLine();
|
|
|
|
|
|
sb.AppendFormat(Localization._0_free_inodes_on_list, v7_sb.s_ninode).AppendLine();
|
2022-03-06 13:29:38 +00:00
|
|
|
|
|
|
|
|
|
|
if(v7_sb.s_flock > 0)
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.AppendLine(Localization.Free_block_list_is_locked);
|
2022-03-06 13:29:38 +00:00
|
|
|
|
|
|
|
|
|
|
if(v7_sb.s_ilock > 0)
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.AppendLine(Localization.inode_cache_is_locked);
|
2022-03-06 13:29:38 +00:00
|
|
|
|
|
|
|
|
|
|
if(v7_sb.s_fmod > 0)
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.AppendLine(Localization.Superblock_is_being_modified);
|
2022-03-06 13:29:38 +00:00
|
|
|
|
|
|
|
|
|
|
if(v7_sb.s_ronly > 0)
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.AppendLine(Localization.Volume_is_mounted_read_only);
|
2022-03-06 13:29:38 +00:00
|
|
|
|
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.AppendFormat(Localization.Superblock_last_updated_on_0,
|
|
|
|
|
|
DateHandlers.UnixUnsignedToDateTime(v7_sb.s_time)).AppendLine();
|
2022-03-06 13:29:38 +00:00
|
|
|
|
|
|
|
|
|
|
if(v7_sb.s_time != 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
XmlFsType.ModificationDate = DateHandlers.UnixUnsignedToDateTime(v7_sb.s_time);
|
|
|
|
|
|
XmlFsType.ModificationDateSpecified = true;
|
2014-04-14 02:29:13 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.AppendFormat(Localization.Volume_name_0, v7_sb.s_fname).AppendLine();
|
2022-03-06 13:29:38 +00:00
|
|
|
|
XmlFsType.VolumeName = v7_sb.s_fname;
|
2022-11-28 02:59:53 +00:00
|
|
|
|
sb.AppendFormat(Localization.Pack_name_0, v7_sb.s_fpack).AppendLine();
|
2014-04-14 02:29:13 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
|
information = sb.ToString();
|
|
|
|
|
|
}
|
2014-04-14 01:14:20 +00:00
|
|
|
|
}
|