2017-05-19 20:28:49 +01:00
|
|
|
// /***************************************************************************
|
2020-02-27 12:31:25 +00:00
|
|
|
// Aaru Data Preservation Suite
|
* DiscImageChef.Helpers/BigEndianStructure.cs:
* DiscImageChef.Helpers/DiscImageChef.Helpers.csproj:
Added code that directly marshals from a big-endian byte
array. But untested with nested structures.
* DiscImageChef.Partitions/Acorn.cs:
Added support for Acorn FileCore partition, closes #4.
* DiscImageChef.Partitions/BSD.cs:
Moved BSD partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
* DiscImageChef.Partitions/DEC.cs:
Added support for DEC disklabels, closes #11.
* DiscImageChef.Partitions/DragonFlyBSD.cs:
Added support for DragonFly BSD 64-bit disklabels.
* DiscImageChef.Partitions/PC98.cs:
Added support for NEC PC-9800 partitions.
* DiscImageChef.Partitions/RioKarma.cs:
Added support for Rio Karma partitions.
* DiscImageChef.Partitions/SGI.cs:
Added support for SGI DVHs, closes #9.
* DiscImageChef.Partitions/UNIX.cs:
Moved UNIX partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
* TODO:
* README.md:
* DiscImageChef.Partitions/DiscImageChef.Partitions.csproj:
Added support for Acorn FileCore partition, closes #4.
Added support for DEC disklabels, closes #11.
Added support for SGI DVHs, closes #9.
Moved BSD partitions from inside MBR code to separate code, as
they can (and do) appear on other architectures as the only
scheme.
Added support for DragonFly BSD 64-bit disklabels.
Added support for NEC PC-9800 partitions.
Added support for Rio Karma partitions.
Moved UNIX partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
* DiscImageChef.Partitions/GPT.cs:
Added new partition type UUIDs.
* DiscImageChef.Partitions/MBR.cs:
Moved BSD partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
Moved UNIX partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
* DiscImageChef.Partitions/Sun.cs:
Added new partition types.
Prepare structures for marshaling.
2016-08-21 08:27:43 +01:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
//
|
|
|
|
|
// Filename : SGI.cs
|
|
|
|
|
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
|
|
|
|
//
|
|
|
|
|
// Component : Partitioning scheme plugins.
|
|
|
|
|
//
|
|
|
|
|
// --[ Description ] ----------------------------------------------------------
|
|
|
|
|
//
|
2017-12-19 03:50:57 +00:00
|
|
|
// Manages SGI DVHs (Disk Volume Headers).
|
* DiscImageChef.Helpers/BigEndianStructure.cs:
* DiscImageChef.Helpers/DiscImageChef.Helpers.csproj:
Added code that directly marshals from a big-endian byte
array. But untested with nested structures.
* DiscImageChef.Partitions/Acorn.cs:
Added support for Acorn FileCore partition, closes #4.
* DiscImageChef.Partitions/BSD.cs:
Moved BSD partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
* DiscImageChef.Partitions/DEC.cs:
Added support for DEC disklabels, closes #11.
* DiscImageChef.Partitions/DragonFlyBSD.cs:
Added support for DragonFly BSD 64-bit disklabels.
* DiscImageChef.Partitions/PC98.cs:
Added support for NEC PC-9800 partitions.
* DiscImageChef.Partitions/RioKarma.cs:
Added support for Rio Karma partitions.
* DiscImageChef.Partitions/SGI.cs:
Added support for SGI DVHs, closes #9.
* DiscImageChef.Partitions/UNIX.cs:
Moved UNIX partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
* TODO:
* README.md:
* DiscImageChef.Partitions/DiscImageChef.Partitions.csproj:
Added support for Acorn FileCore partition, closes #4.
Added support for DEC disklabels, closes #11.
Added support for SGI DVHs, closes #9.
Moved BSD partitions from inside MBR code to separate code, as
they can (and do) appear on other architectures as the only
scheme.
Added support for DragonFly BSD 64-bit disklabels.
Added support for NEC PC-9800 partitions.
Added support for Rio Karma partitions.
Moved UNIX partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
* DiscImageChef.Partitions/GPT.cs:
Added new partition type UUIDs.
* DiscImageChef.Partitions/MBR.cs:
Moved BSD partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
Moved UNIX partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
* DiscImageChef.Partitions/Sun.cs:
Added new partition types.
Prepare structures for marshaling.
2016-08-21 08:27:43 +01:00
|
|
|
//
|
|
|
|
|
// --[ 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-02-18 10:02:53 +00:00
|
|
|
// Copyright © 2011-2022 Natalia Portillo
|
* DiscImageChef.Helpers/BigEndianStructure.cs:
* DiscImageChef.Helpers/DiscImageChef.Helpers.csproj:
Added code that directly marshals from a big-endian byte
array. But untested with nested structures.
* DiscImageChef.Partitions/Acorn.cs:
Added support for Acorn FileCore partition, closes #4.
* DiscImageChef.Partitions/BSD.cs:
Moved BSD partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
* DiscImageChef.Partitions/DEC.cs:
Added support for DEC disklabels, closes #11.
* DiscImageChef.Partitions/DragonFlyBSD.cs:
Added support for DragonFly BSD 64-bit disklabels.
* DiscImageChef.Partitions/PC98.cs:
Added support for NEC PC-9800 partitions.
* DiscImageChef.Partitions/RioKarma.cs:
Added support for Rio Karma partitions.
* DiscImageChef.Partitions/SGI.cs:
Added support for SGI DVHs, closes #9.
* DiscImageChef.Partitions/UNIX.cs:
Moved UNIX partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
* TODO:
* README.md:
* DiscImageChef.Partitions/DiscImageChef.Partitions.csproj:
Added support for Acorn FileCore partition, closes #4.
Added support for DEC disklabels, closes #11.
Added support for SGI DVHs, closes #9.
Moved BSD partitions from inside MBR code to separate code, as
they can (and do) appear on other architectures as the only
scheme.
Added support for DragonFly BSD 64-bit disklabels.
Added support for NEC PC-9800 partitions.
Added support for Rio Karma partitions.
Moved UNIX partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
* DiscImageChef.Partitions/GPT.cs:
Added new partition type UUIDs.
* DiscImageChef.Partitions/MBR.cs:
Moved BSD partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
Moved UNIX partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
* DiscImageChef.Partitions/Sun.cs:
Added new partition types.
Prepare structures for marshaling.
2016-08-21 08:27:43 +01:00
|
|
|
// ****************************************************************************/
|
|
|
|
|
|
2022-03-07 07:36:44 +00:00
|
|
|
#pragma warning disable 169
|
|
|
|
|
#pragma warning disable 649
|
|
|
|
|
|
|
|
|
|
namespace Aaru.Partitions;
|
|
|
|
|
|
* DiscImageChef.Helpers/BigEndianStructure.cs:
* DiscImageChef.Helpers/DiscImageChef.Helpers.csproj:
Added code that directly marshals from a big-endian byte
array. But untested with nested structures.
* DiscImageChef.Partitions/Acorn.cs:
Added support for Acorn FileCore partition, closes #4.
* DiscImageChef.Partitions/BSD.cs:
Moved BSD partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
* DiscImageChef.Partitions/DEC.cs:
Added support for DEC disklabels, closes #11.
* DiscImageChef.Partitions/DragonFlyBSD.cs:
Added support for DragonFly BSD 64-bit disklabels.
* DiscImageChef.Partitions/PC98.cs:
Added support for NEC PC-9800 partitions.
* DiscImageChef.Partitions/RioKarma.cs:
Added support for Rio Karma partitions.
* DiscImageChef.Partitions/SGI.cs:
Added support for SGI DVHs, closes #9.
* DiscImageChef.Partitions/UNIX.cs:
Moved UNIX partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
* TODO:
* README.md:
* DiscImageChef.Partitions/DiscImageChef.Partitions.csproj:
Added support for Acorn FileCore partition, closes #4.
Added support for DEC disklabels, closes #11.
Added support for SGI DVHs, closes #9.
Moved BSD partitions from inside MBR code to separate code, as
they can (and do) appear on other architectures as the only
scheme.
Added support for DragonFly BSD 64-bit disklabels.
Added support for NEC PC-9800 partitions.
Added support for Rio Karma partitions.
Moved UNIX partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
* DiscImageChef.Partitions/GPT.cs:
Added new partition type UUIDs.
* DiscImageChef.Partitions/MBR.cs:
Moved BSD partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
Moved UNIX partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
* DiscImageChef.Partitions/Sun.cs:
Added new partition types.
Prepare structures for marshaling.
2016-08-21 08:27:43 +01:00
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
2017-12-22 16:53:11 +00:00
|
|
|
using System.Diagnostics.CodeAnalysis;
|
* DiscImageChef.Helpers/BigEndianStructure.cs:
* DiscImageChef.Helpers/DiscImageChef.Helpers.csproj:
Added code that directly marshals from a big-endian byte
array. But untested with nested structures.
* DiscImageChef.Partitions/Acorn.cs:
Added support for Acorn FileCore partition, closes #4.
* DiscImageChef.Partitions/BSD.cs:
Moved BSD partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
* DiscImageChef.Partitions/DEC.cs:
Added support for DEC disklabels, closes #11.
* DiscImageChef.Partitions/DragonFlyBSD.cs:
Added support for DragonFly BSD 64-bit disklabels.
* DiscImageChef.Partitions/PC98.cs:
Added support for NEC PC-9800 partitions.
* DiscImageChef.Partitions/RioKarma.cs:
Added support for Rio Karma partitions.
* DiscImageChef.Partitions/SGI.cs:
Added support for SGI DVHs, closes #9.
* DiscImageChef.Partitions/UNIX.cs:
Moved UNIX partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
* TODO:
* README.md:
* DiscImageChef.Partitions/DiscImageChef.Partitions.csproj:
Added support for Acorn FileCore partition, closes #4.
Added support for DEC disklabels, closes #11.
Added support for SGI DVHs, closes #9.
Moved BSD partitions from inside MBR code to separate code, as
they can (and do) appear on other architectures as the only
scheme.
Added support for DragonFly BSD 64-bit disklabels.
Added support for NEC PC-9800 partitions.
Added support for Rio Karma partitions.
Moved UNIX partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
* DiscImageChef.Partitions/GPT.cs:
Added new partition type UUIDs.
* DiscImageChef.Partitions/MBR.cs:
Moved BSD partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
Moved UNIX partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
* DiscImageChef.Partitions/Sun.cs:
Added new partition types.
Prepare structures for marshaling.
2016-08-21 08:27:43 +01:00
|
|
|
using System.Runtime.InteropServices;
|
2021-09-19 21:16:47 +01:00
|
|
|
using Aaru.CommonTypes.Enums;
|
2020-02-27 00:33:26 +00:00
|
|
|
using Aaru.CommonTypes.Interfaces;
|
|
|
|
|
using Aaru.Console;
|
2020-07-20 15:43:52 +01:00
|
|
|
using Aaru.Helpers;
|
2020-02-27 00:33:26 +00:00
|
|
|
using Marshal = Aaru.Helpers.Marshal;
|
2017-12-24 03:11:33 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
/// <inheritdoc />
|
|
|
|
|
/// <summary>Implements decoding of the SGI Disk Volume Header</summary>
|
|
|
|
|
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
|
|
|
|
public sealed class SGI : IPartition
|
* DiscImageChef.Helpers/BigEndianStructure.cs:
* DiscImageChef.Helpers/DiscImageChef.Helpers.csproj:
Added code that directly marshals from a big-endian byte
array. But untested with nested structures.
* DiscImageChef.Partitions/Acorn.cs:
Added support for Acorn FileCore partition, closes #4.
* DiscImageChef.Partitions/BSD.cs:
Moved BSD partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
* DiscImageChef.Partitions/DEC.cs:
Added support for DEC disklabels, closes #11.
* DiscImageChef.Partitions/DragonFlyBSD.cs:
Added support for DragonFly BSD 64-bit disklabels.
* DiscImageChef.Partitions/PC98.cs:
Added support for NEC PC-9800 partitions.
* DiscImageChef.Partitions/RioKarma.cs:
Added support for Rio Karma partitions.
* DiscImageChef.Partitions/SGI.cs:
Added support for SGI DVHs, closes #9.
* DiscImageChef.Partitions/UNIX.cs:
Moved UNIX partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
* TODO:
* README.md:
* DiscImageChef.Partitions/DiscImageChef.Partitions.csproj:
Added support for Acorn FileCore partition, closes #4.
Added support for DEC disklabels, closes #11.
Added support for SGI DVHs, closes #9.
Moved BSD partitions from inside MBR code to separate code, as
they can (and do) appear on other architectures as the only
scheme.
Added support for DragonFly BSD 64-bit disklabels.
Added support for NEC PC-9800 partitions.
Added support for Rio Karma partitions.
Moved UNIX partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
* DiscImageChef.Partitions/GPT.cs:
Added new partition type UUIDs.
* DiscImageChef.Partitions/MBR.cs:
Moved BSD partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
Moved UNIX partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
* DiscImageChef.Partitions/Sun.cs:
Added new partition types.
Prepare structures for marshaling.
2016-08-21 08:27:43 +01:00
|
|
|
{
|
2022-03-06 13:29:38 +00:00
|
|
|
const int SGI_MAGIC = 0x0BE5A941;
|
|
|
|
|
|
2021-08-17 14:25:12 +01:00
|
|
|
/// <inheritdoc />
|
2022-03-06 13:29:38 +00:00
|
|
|
public string Name => "SGI Disk Volume Header";
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
|
public Guid Id => new("AEF5AB45-4880-4CE8-8735-F0A402E2E5F2");
|
|
|
|
|
/// <inheritdoc />
|
|
|
|
|
public string Author => "Natalia Portillo";
|
* DiscImageChef.Helpers/BigEndianStructure.cs:
* DiscImageChef.Helpers/DiscImageChef.Helpers.csproj:
Added code that directly marshals from a big-endian byte
array. But untested with nested structures.
* DiscImageChef.Partitions/Acorn.cs:
Added support for Acorn FileCore partition, closes #4.
* DiscImageChef.Partitions/BSD.cs:
Moved BSD partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
* DiscImageChef.Partitions/DEC.cs:
Added support for DEC disklabels, closes #11.
* DiscImageChef.Partitions/DragonFlyBSD.cs:
Added support for DragonFly BSD 64-bit disklabels.
* DiscImageChef.Partitions/PC98.cs:
Added support for NEC PC-9800 partitions.
* DiscImageChef.Partitions/RioKarma.cs:
Added support for Rio Karma partitions.
* DiscImageChef.Partitions/SGI.cs:
Added support for SGI DVHs, closes #9.
* DiscImageChef.Partitions/UNIX.cs:
Moved UNIX partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
* TODO:
* README.md:
* DiscImageChef.Partitions/DiscImageChef.Partitions.csproj:
Added support for Acorn FileCore partition, closes #4.
Added support for DEC disklabels, closes #11.
Added support for SGI DVHs, closes #9.
Moved BSD partitions from inside MBR code to separate code, as
they can (and do) appear on other architectures as the only
scheme.
Added support for DragonFly BSD 64-bit disklabels.
Added support for NEC PC-9800 partitions.
Added support for Rio Karma partitions.
Moved UNIX partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
* DiscImageChef.Partitions/GPT.cs:
Added new partition type UUIDs.
* DiscImageChef.Partitions/MBR.cs:
Moved BSD partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
Moved UNIX partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
* DiscImageChef.Partitions/Sun.cs:
Added new partition types.
Prepare structures for marshaling.
2016-08-21 08:27:43 +01:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
/// <inheritdoc />
|
2022-03-07 07:36:44 +00:00
|
|
|
public bool GetInformation(IMediaImage imagePlugin, out List<CommonTypes.Partition> partitions, ulong sectorOffset)
|
2022-03-06 13:29:38 +00:00
|
|
|
{
|
|
|
|
|
partitions = new List<CommonTypes.Partition>();
|
2020-02-29 18:03:35 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
ErrorNumber errno = imagePlugin.ReadSector(sectorOffset, out byte[] sector);
|
* DiscImageChef.Helpers/BigEndianStructure.cs:
* DiscImageChef.Helpers/DiscImageChef.Helpers.csproj:
Added code that directly marshals from a big-endian byte
array. But untested with nested structures.
* DiscImageChef.Partitions/Acorn.cs:
Added support for Acorn FileCore partition, closes #4.
* DiscImageChef.Partitions/BSD.cs:
Moved BSD partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
* DiscImageChef.Partitions/DEC.cs:
Added support for DEC disklabels, closes #11.
* DiscImageChef.Partitions/DragonFlyBSD.cs:
Added support for DragonFly BSD 64-bit disklabels.
* DiscImageChef.Partitions/PC98.cs:
Added support for NEC PC-9800 partitions.
* DiscImageChef.Partitions/RioKarma.cs:
Added support for Rio Karma partitions.
* DiscImageChef.Partitions/SGI.cs:
Added support for SGI DVHs, closes #9.
* DiscImageChef.Partitions/UNIX.cs:
Moved UNIX partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
* TODO:
* README.md:
* DiscImageChef.Partitions/DiscImageChef.Partitions.csproj:
Added support for Acorn FileCore partition, closes #4.
Added support for DEC disklabels, closes #11.
Added support for SGI DVHs, closes #9.
Moved BSD partitions from inside MBR code to separate code, as
they can (and do) appear on other architectures as the only
scheme.
Added support for DragonFly BSD 64-bit disklabels.
Added support for NEC PC-9800 partitions.
Added support for Rio Karma partitions.
Moved UNIX partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
* DiscImageChef.Partitions/GPT.cs:
Added new partition type UUIDs.
* DiscImageChef.Partitions/MBR.cs:
Moved BSD partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
Moved UNIX partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
* DiscImageChef.Partitions/Sun.cs:
Added new partition types.
Prepare structures for marshaling.
2016-08-21 08:27:43 +01:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(errno != ErrorNumber.NoError ||
|
|
|
|
|
sector.Length < 512)
|
|
|
|
|
return false;
|
2020-02-29 18:03:35 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
Label dvh = Marshal.ByteArrayToStructureBigEndian<Label>(sector);
|
2019-02-27 08:49:42 +00:00
|
|
|
|
2022-03-07 07:36:44 +00:00
|
|
|
for(var i = 0; i < dvh.volume.Length; i++)
|
2022-03-06 13:29:38 +00:00
|
|
|
dvh.volume[i] = (Volume)Marshal.SwapStructureMembersEndian(dvh.volume[i]);
|
2017-07-27 01:15:22 +01:00
|
|
|
|
2022-03-07 07:36:44 +00:00
|
|
|
for(var i = 0; i < dvh.partitions.Length; i++)
|
2022-03-06 13:29:38 +00:00
|
|
|
dvh.partitions[i] = (Partition)Marshal.SwapStructureMembersEndian(dvh.partitions[i]);
|
* DiscImageChef.Helpers/BigEndianStructure.cs:
* DiscImageChef.Helpers/DiscImageChef.Helpers.csproj:
Added code that directly marshals from a big-endian byte
array. But untested with nested structures.
* DiscImageChef.Partitions/Acorn.cs:
Added support for Acorn FileCore partition, closes #4.
* DiscImageChef.Partitions/BSD.cs:
Moved BSD partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
* DiscImageChef.Partitions/DEC.cs:
Added support for DEC disklabels, closes #11.
* DiscImageChef.Partitions/DragonFlyBSD.cs:
Added support for DragonFly BSD 64-bit disklabels.
* DiscImageChef.Partitions/PC98.cs:
Added support for NEC PC-9800 partitions.
* DiscImageChef.Partitions/RioKarma.cs:
Added support for Rio Karma partitions.
* DiscImageChef.Partitions/SGI.cs:
Added support for SGI DVHs, closes #9.
* DiscImageChef.Partitions/UNIX.cs:
Moved UNIX partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
* TODO:
* README.md:
* DiscImageChef.Partitions/DiscImageChef.Partitions.csproj:
Added support for Acorn FileCore partition, closes #4.
Added support for DEC disklabels, closes #11.
Added support for SGI DVHs, closes #9.
Moved BSD partitions from inside MBR code to separate code, as
they can (and do) appear on other architectures as the only
scheme.
Added support for DragonFly BSD 64-bit disklabels.
Added support for NEC PC-9800 partitions.
Added support for Rio Karma partitions.
Moved UNIX partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
* DiscImageChef.Partitions/GPT.cs:
Added new partition type UUIDs.
* DiscImageChef.Partitions/MBR.cs:
Moved BSD partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
Moved UNIX partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
* DiscImageChef.Partitions/Sun.cs:
Added new partition types.
Prepare structures for marshaling.
2016-08-21 08:27:43 +01:00
|
|
|
|
2022-03-07 07:36:44 +00:00
|
|
|
AaruConsole.DebugWriteLine("SGIVH plugin", "dvh.magic = 0x{0:X8} (should be 0x{1:X8})", dvh.magic, SGI_MAGIC);
|
* DiscImageChef.Helpers/BigEndianStructure.cs:
* DiscImageChef.Helpers/DiscImageChef.Helpers.csproj:
Added code that directly marshals from a big-endian byte
array. But untested with nested structures.
* DiscImageChef.Partitions/Acorn.cs:
Added support for Acorn FileCore partition, closes #4.
* DiscImageChef.Partitions/BSD.cs:
Moved BSD partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
* DiscImageChef.Partitions/DEC.cs:
Added support for DEC disklabels, closes #11.
* DiscImageChef.Partitions/DragonFlyBSD.cs:
Added support for DragonFly BSD 64-bit disklabels.
* DiscImageChef.Partitions/PC98.cs:
Added support for NEC PC-9800 partitions.
* DiscImageChef.Partitions/RioKarma.cs:
Added support for Rio Karma partitions.
* DiscImageChef.Partitions/SGI.cs:
Added support for SGI DVHs, closes #9.
* DiscImageChef.Partitions/UNIX.cs:
Moved UNIX partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
* TODO:
* README.md:
* DiscImageChef.Partitions/DiscImageChef.Partitions.csproj:
Added support for Acorn FileCore partition, closes #4.
Added support for DEC disklabels, closes #11.
Added support for SGI DVHs, closes #9.
Moved BSD partitions from inside MBR code to separate code, as
they can (and do) appear on other architectures as the only
scheme.
Added support for DragonFly BSD 64-bit disklabels.
Added support for NEC PC-9800 partitions.
Added support for Rio Karma partitions.
Moved UNIX partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
* DiscImageChef.Partitions/GPT.cs:
Added new partition type UUIDs.
* DiscImageChef.Partitions/MBR.cs:
Moved BSD partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
Moved UNIX partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
* DiscImageChef.Partitions/Sun.cs:
Added new partition types.
Prepare structures for marshaling.
2016-08-21 08:27:43 +01:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(dvh.magic != SGI_MAGIC)
|
|
|
|
|
return false;
|
2020-02-29 18:03:35 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
AaruConsole.DebugWriteLine("SGIVH plugin", "dvh.root_part_num = {0}", dvh.root_part_num);
|
|
|
|
|
AaruConsole.DebugWriteLine("SGIVH plugin", "dvh.swap_part_num = {0}", dvh.swap_part_num);
|
2020-02-29 18:03:35 +00:00
|
|
|
|
2022-03-07 07:36:44 +00:00
|
|
|
AaruConsole.DebugWriteLine("SGIVH plugin", "dvh.boot_file = \"{0}\"", StringHandlers.CToString(dvh.boot_file));
|
2020-02-29 18:03:35 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
AaruConsole.DebugWriteLine("SGIVH plugin", "dvh.device_params.dp_skew = {0}", dvh.device_params.dp_skew);
|
|
|
|
|
AaruConsole.DebugWriteLine("SGIVH plugin", "dvh.device_params.dp_gap1 = {0}", dvh.device_params.dp_gap1);
|
|
|
|
|
AaruConsole.DebugWriteLine("SGIVH plugin", "dvh.device_params.dp_gap2 = {0}", dvh.device_params.dp_gap2);
|
2020-02-29 18:03:35 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
AaruConsole.DebugWriteLine("SGIVH plugin", "dvh.device_params.dp_spares_cyl = {0}",
|
|
|
|
|
dvh.device_params.dp_spares_cyl);
|
2020-02-29 18:03:35 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
AaruConsole.DebugWriteLine("SGIVH plugin", "dvh.device_params.dp_cyls = {0}", dvh.device_params.dp_cyls);
|
|
|
|
|
AaruConsole.DebugWriteLine("SGIVH plugin", "dvh.device_params.dp_shd0 = {0}", dvh.device_params.dp_shd0);
|
|
|
|
|
AaruConsole.DebugWriteLine("SGIVH plugin", "dvh.device_params.dp_trks0 = {0}", dvh.device_params.dp_trks0);
|
2020-02-29 18:03:35 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
AaruConsole.DebugWriteLine("SGIVH plugin", "dvh.device_params.dp_ctq_depth = {0}",
|
|
|
|
|
dvh.device_params.dp_ctq_depth);
|
2020-02-29 18:03:35 +00:00
|
|
|
|
2022-03-07 07:36:44 +00:00
|
|
|
AaruConsole.DebugWriteLine("SGIVH plugin", "dvh.device_params.dp_cylshi = {0}", dvh.device_params.dp_cylshi);
|
2020-02-29 18:03:35 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
AaruConsole.DebugWriteLine("SGIVH plugin", "dvh.device_params.dp_secs = {0}", dvh.device_params.dp_secs);
|
2020-02-29 18:03:35 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
AaruConsole.DebugWriteLine("SGIVH plugin", "dvh.device_params.dp_secbytes = {0}",
|
|
|
|
|
dvh.device_params.dp_secbytes);
|
2020-02-29 18:03:35 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
AaruConsole.DebugWriteLine("SGIVH plugin", "dvh.device_params.dp_interleave = {0}",
|
|
|
|
|
dvh.device_params.dp_interleave);
|
2020-02-29 18:03:35 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
AaruConsole.DebugWriteLine("SGIVH plugin", "dvh.device_params.dp_flags = {0}", dvh.device_params.dp_flags);
|
2020-02-29 18:03:35 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
AaruConsole.DebugWriteLine("SGIVH plugin", "dvh.device_params.dp_datarate = {0}",
|
|
|
|
|
dvh.device_params.dp_datarate);
|
2020-02-29 18:03:35 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
AaruConsole.DebugWriteLine("SGIVH plugin", "dvh.device_params.dp_nretries = {0}",
|
|
|
|
|
dvh.device_params.dp_nretries);
|
2020-02-29 18:03:35 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
AaruConsole.DebugWriteLine("SGIVH plugin", "dvh.device_params.dp_mspw = {0}", dvh.device_params.dp_mspw);
|
|
|
|
|
AaruConsole.DebugWriteLine("SGIVH plugin", "dvh.device_params.dp_xgap1 = {0}", dvh.device_params.dp_xgap1);
|
|
|
|
|
AaruConsole.DebugWriteLine("SGIVH plugin", "dvh.device_params.dp_xsync = {0}", dvh.device_params.dp_xsync);
|
|
|
|
|
AaruConsole.DebugWriteLine("SGIVH plugin", "dvh.device_params.dp_xrdly = {0}", dvh.device_params.dp_xrdly);
|
|
|
|
|
AaruConsole.DebugWriteLine("SGIVH plugin", "dvh.device_params.dp_xgap2 = {0}", dvh.device_params.dp_xgap2);
|
2020-02-29 18:03:35 +00:00
|
|
|
|
2022-03-07 07:36:44 +00:00
|
|
|
AaruConsole.DebugWriteLine("SGIVH plugin", "dvh.device_params.dp_xrgate = {0}", dvh.device_params.dp_xrgate);
|
2017-07-27 01:15:22 +01:00
|
|
|
|
2022-03-07 07:36:44 +00:00
|
|
|
AaruConsole.DebugWriteLine("SGIVH plugin", "dvh.device_params.dp_xwcont = {0}", dvh.device_params.dp_xwcont);
|
* DiscImageChef.Helpers/BigEndianStructure.cs:
* DiscImageChef.Helpers/DiscImageChef.Helpers.csproj:
Added code that directly marshals from a big-endian byte
array. But untested with nested structures.
* DiscImageChef.Partitions/Acorn.cs:
Added support for Acorn FileCore partition, closes #4.
* DiscImageChef.Partitions/BSD.cs:
Moved BSD partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
* DiscImageChef.Partitions/DEC.cs:
Added support for DEC disklabels, closes #11.
* DiscImageChef.Partitions/DragonFlyBSD.cs:
Added support for DragonFly BSD 64-bit disklabels.
* DiscImageChef.Partitions/PC98.cs:
Added support for NEC PC-9800 partitions.
* DiscImageChef.Partitions/RioKarma.cs:
Added support for Rio Karma partitions.
* DiscImageChef.Partitions/SGI.cs:
Added support for SGI DVHs, closes #9.
* DiscImageChef.Partitions/UNIX.cs:
Moved UNIX partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
* TODO:
* README.md:
* DiscImageChef.Partitions/DiscImageChef.Partitions.csproj:
Added support for Acorn FileCore partition, closes #4.
Added support for DEC disklabels, closes #11.
Added support for SGI DVHs, closes #9.
Moved BSD partitions from inside MBR code to separate code, as
they can (and do) appear on other architectures as the only
scheme.
Added support for DragonFly BSD 64-bit disklabels.
Added support for NEC PC-9800 partitions.
Added support for Rio Karma partitions.
Moved UNIX partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
* DiscImageChef.Partitions/GPT.cs:
Added new partition type UUIDs.
* DiscImageChef.Partitions/MBR.cs:
Moved BSD partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
Moved UNIX partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
* DiscImageChef.Partitions/Sun.cs:
Added new partition types.
Prepare structures for marshaling.
2016-08-21 08:27:43 +01:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
ulong counter = 0;
|
* DiscImageChef.Helpers/BigEndianStructure.cs:
* DiscImageChef.Helpers/DiscImageChef.Helpers.csproj:
Added code that directly marshals from a big-endian byte
array. But untested with nested structures.
* DiscImageChef.Partitions/Acorn.cs:
Added support for Acorn FileCore partition, closes #4.
* DiscImageChef.Partitions/BSD.cs:
Moved BSD partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
* DiscImageChef.Partitions/DEC.cs:
Added support for DEC disklabels, closes #11.
* DiscImageChef.Partitions/DragonFlyBSD.cs:
Added support for DragonFly BSD 64-bit disklabels.
* DiscImageChef.Partitions/PC98.cs:
Added support for NEC PC-9800 partitions.
* DiscImageChef.Partitions/RioKarma.cs:
Added support for Rio Karma partitions.
* DiscImageChef.Partitions/SGI.cs:
Added support for SGI DVHs, closes #9.
* DiscImageChef.Partitions/UNIX.cs:
Moved UNIX partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
* TODO:
* README.md:
* DiscImageChef.Partitions/DiscImageChef.Partitions.csproj:
Added support for Acorn FileCore partition, closes #4.
Added support for DEC disklabels, closes #11.
Added support for SGI DVHs, closes #9.
Moved BSD partitions from inside MBR code to separate code, as
they can (and do) appear on other architectures as the only
scheme.
Added support for DragonFly BSD 64-bit disklabels.
Added support for NEC PC-9800 partitions.
Added support for Rio Karma partitions.
Moved UNIX partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
* DiscImageChef.Partitions/GPT.cs:
Added new partition type UUIDs.
* DiscImageChef.Partitions/MBR.cs:
Moved BSD partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
Moved UNIX partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
* DiscImageChef.Partitions/Sun.cs:
Added new partition types.
Prepare structures for marshaling.
2016-08-21 08:27:43 +01:00
|
|
|
|
2022-03-07 07:36:44 +00:00
|
|
|
for(var i = 0; i < dvh.partitions.Length; i++)
|
2017-12-24 03:11:33 +00:00
|
|
|
{
|
2022-03-06 13:29:38 +00:00
|
|
|
AaruConsole.DebugWriteLine("SGIVH plugin", "dvh.partitions[{0}].num_blocks = {1}", i,
|
|
|
|
|
dvh.partitions[i].num_blocks);
|
|
|
|
|
|
|
|
|
|
AaruConsole.DebugWriteLine("SGIVH plugin", "dvh.partitions[{0}].first_block = {1}", i,
|
|
|
|
|
dvh.partitions[i].first_block);
|
|
|
|
|
|
|
|
|
|
// TODO: Solve big endian marshal with enumerations
|
|
|
|
|
dvh.partitions[i].type = (SGIType)Swapping.Swap((uint)dvh.partitions[i].type);
|
|
|
|
|
AaruConsole.DebugWriteLine("SGIVH plugin", "dvh.partitions[{0}].type = {1}", i, dvh.partitions[i].type);
|
|
|
|
|
|
|
|
|
|
var part = new CommonTypes.Partition
|
2017-12-24 03:11:33 +00:00
|
|
|
{
|
2022-03-06 13:29:38 +00:00
|
|
|
Start = dvh.partitions[i].first_block * dvh.device_params.dp_secbytes / imagePlugin.Info.SectorSize,
|
|
|
|
|
Offset = dvh.partitions[i].first_block * dvh.device_params.dp_secbytes,
|
|
|
|
|
Length = dvh.partitions[i].num_blocks * dvh.device_params.dp_secbytes / imagePlugin.Info.SectorSize,
|
|
|
|
|
Size = dvh.partitions[i].num_blocks * dvh.device_params.dp_secbytes,
|
|
|
|
|
Type = TypeToString(dvh.partitions[i].type),
|
|
|
|
|
Sequence = counter,
|
|
|
|
|
Scheme = Name
|
|
|
|
|
};
|
|
|
|
|
|
2022-03-16 11:47:00 +00:00
|
|
|
if(part.Size <= 0 ||
|
|
|
|
|
dvh.partitions[i].type is SGIType.Header or SGIType.Volume)
|
2022-03-06 13:29:38 +00:00
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
partitions.Add(part);
|
|
|
|
|
counter++;
|
2017-12-24 03:11:33 +00:00
|
|
|
}
|
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
return true;
|
|
|
|
|
}
|
* DiscImageChef.Helpers/BigEndianStructure.cs:
* DiscImageChef.Helpers/DiscImageChef.Helpers.csproj:
Added code that directly marshals from a big-endian byte
array. But untested with nested structures.
* DiscImageChef.Partitions/Acorn.cs:
Added support for Acorn FileCore partition, closes #4.
* DiscImageChef.Partitions/BSD.cs:
Moved BSD partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
* DiscImageChef.Partitions/DEC.cs:
Added support for DEC disklabels, closes #11.
* DiscImageChef.Partitions/DragonFlyBSD.cs:
Added support for DragonFly BSD 64-bit disklabels.
* DiscImageChef.Partitions/PC98.cs:
Added support for NEC PC-9800 partitions.
* DiscImageChef.Partitions/RioKarma.cs:
Added support for Rio Karma partitions.
* DiscImageChef.Partitions/SGI.cs:
Added support for SGI DVHs, closes #9.
* DiscImageChef.Partitions/UNIX.cs:
Moved UNIX partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
* TODO:
* README.md:
* DiscImageChef.Partitions/DiscImageChef.Partitions.csproj:
Added support for Acorn FileCore partition, closes #4.
Added support for DEC disklabels, closes #11.
Added support for SGI DVHs, closes #9.
Moved BSD partitions from inside MBR code to separate code, as
they can (and do) appear on other architectures as the only
scheme.
Added support for DragonFly BSD 64-bit disklabels.
Added support for NEC PC-9800 partitions.
Added support for Rio Karma partitions.
Moved UNIX partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
* DiscImageChef.Partitions/GPT.cs:
Added new partition type UUIDs.
* DiscImageChef.Partitions/MBR.cs:
Moved BSD partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
Moved UNIX partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
* DiscImageChef.Partitions/Sun.cs:
Added new partition types.
Prepare structures for marshaling.
2016-08-21 08:27:43 +01:00
|
|
|
|
2022-11-13 19:59:24 +00:00
|
|
|
static string TypeToString(SGIType typ) => typ switch
|
|
|
|
|
{
|
|
|
|
|
SGIType.Header => "Volume header",
|
|
|
|
|
SGIType.TrkRepl => "Track replacements",
|
|
|
|
|
SGIType.SecRepl => "Sector replacements",
|
|
|
|
|
SGIType.Swap => "Raw data (swap)",
|
|
|
|
|
SGIType.Bsd => "4.2BSD Fast File System",
|
|
|
|
|
SGIType.SystemV => "UNIX System V",
|
|
|
|
|
SGIType.Volume => "Whole device",
|
|
|
|
|
SGIType.EFS => "EFS",
|
|
|
|
|
SGIType.Lvol => "Logical volume",
|
|
|
|
|
SGIType.Rlvol => "Raw logical volume",
|
|
|
|
|
SGIType.XFS => "XFS",
|
|
|
|
|
SGIType.Xlvol => "XFS log device",
|
|
|
|
|
SGIType.Rxlvol => "XLV volume",
|
|
|
|
|
SGIType.Xvm => "SGI XVM",
|
|
|
|
|
SGIType.LinuxSwap => "Linux swap",
|
|
|
|
|
SGIType.Linux => "Linux",
|
|
|
|
|
SGIType.LinuxRAID => "Linux RAID",
|
|
|
|
|
_ => "Unknown"
|
|
|
|
|
};
|
* DiscImageChef.Helpers/BigEndianStructure.cs:
* DiscImageChef.Helpers/DiscImageChef.Helpers.csproj:
Added code that directly marshals from a big-endian byte
array. But untested with nested structures.
* DiscImageChef.Partitions/Acorn.cs:
Added support for Acorn FileCore partition, closes #4.
* DiscImageChef.Partitions/BSD.cs:
Moved BSD partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
* DiscImageChef.Partitions/DEC.cs:
Added support for DEC disklabels, closes #11.
* DiscImageChef.Partitions/DragonFlyBSD.cs:
Added support for DragonFly BSD 64-bit disklabels.
* DiscImageChef.Partitions/PC98.cs:
Added support for NEC PC-9800 partitions.
* DiscImageChef.Partitions/RioKarma.cs:
Added support for Rio Karma partitions.
* DiscImageChef.Partitions/SGI.cs:
Added support for SGI DVHs, closes #9.
* DiscImageChef.Partitions/UNIX.cs:
Moved UNIX partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
* TODO:
* README.md:
* DiscImageChef.Partitions/DiscImageChef.Partitions.csproj:
Added support for Acorn FileCore partition, closes #4.
Added support for DEC disklabels, closes #11.
Added support for SGI DVHs, closes #9.
Moved BSD partitions from inside MBR code to separate code, as
they can (and do) appear on other architectures as the only
scheme.
Added support for DragonFly BSD 64-bit disklabels.
Added support for NEC PC-9800 partitions.
Added support for Rio Karma partitions.
Moved UNIX partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
* DiscImageChef.Partitions/GPT.cs:
Added new partition type UUIDs.
* DiscImageChef.Partitions/MBR.cs:
Moved BSD partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
Moved UNIX partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
* DiscImageChef.Partitions/Sun.cs:
Added new partition types.
Prepare structures for marshaling.
2016-08-21 08:27:43 +01:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
|
|
|
|
readonly struct Label
|
|
|
|
|
{
|
|
|
|
|
/// <summary></summary>
|
|
|
|
|
public readonly uint magic;
|
|
|
|
|
/// <summary></summary>
|
|
|
|
|
public readonly short root_part_num;
|
|
|
|
|
/// <summary></summary>
|
|
|
|
|
public readonly short swap_part_num;
|
|
|
|
|
/// <summary></summary>
|
|
|
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
|
|
|
|
|
public readonly byte[] boot_file;
|
|
|
|
|
/// <summary></summary>
|
|
|
|
|
public readonly DeviceParameters device_params;
|
|
|
|
|
/// <summary></summary>
|
|
|
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 15)]
|
|
|
|
|
public readonly Volume[] volume;
|
|
|
|
|
/// <summary></summary>
|
|
|
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
|
|
|
|
|
public readonly Partition[] partitions;
|
|
|
|
|
/// <summary></summary>
|
|
|
|
|
public readonly uint csum;
|
|
|
|
|
/// <summary></summary>
|
|
|
|
|
public readonly uint padding;
|
|
|
|
|
}
|
2017-07-27 01:15:22 +01:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
|
|
|
|
readonly struct Volume
|
|
|
|
|
{
|
|
|
|
|
/// <summary></summary>
|
|
|
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
|
|
|
|
|
public readonly byte[] name;
|
|
|
|
|
/// <summary></summary>
|
|
|
|
|
public readonly uint block_num;
|
|
|
|
|
/// <summary></summary>
|
|
|
|
|
public readonly uint num_bytes;
|
|
|
|
|
}
|
2017-07-27 01:15:22 +01:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
enum SGIType : uint
|
|
|
|
|
{
|
2022-03-07 07:36:44 +00:00
|
|
|
Header = 0,
|
|
|
|
|
TrkRepl = 1,
|
|
|
|
|
SecRepl = 2,
|
|
|
|
|
Swap = 3,
|
|
|
|
|
Bsd = 4,
|
|
|
|
|
SystemV = 5,
|
|
|
|
|
Volume = 6,
|
|
|
|
|
EFS = 7,
|
|
|
|
|
Lvol = 8,
|
|
|
|
|
Rlvol = 9,
|
|
|
|
|
XFS = 0xA,
|
|
|
|
|
Xlvol = 0xB,
|
|
|
|
|
Rxlvol = 0xC,
|
|
|
|
|
Xvm = 0x0D,
|
|
|
|
|
LinuxSwap = 0x82,
|
|
|
|
|
Linux = 0x83,
|
|
|
|
|
LinuxRAID = 0xFD
|
2022-03-06 13:29:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
|
|
|
|
struct Partition
|
|
|
|
|
{
|
|
|
|
|
/// <summary></summary>
|
|
|
|
|
public readonly uint num_blocks;
|
|
|
|
|
/// <summary></summary>
|
|
|
|
|
public readonly uint first_block;
|
|
|
|
|
/// <summary></summary>
|
|
|
|
|
public SGIType type;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
struct DeviceParameters
|
|
|
|
|
{
|
|
|
|
|
public byte dp_skew;
|
|
|
|
|
public byte dp_gap1;
|
|
|
|
|
public byte dp_gap2;
|
|
|
|
|
public byte dp_spares_cyl;
|
|
|
|
|
public ushort dp_cyls;
|
|
|
|
|
public ushort dp_shd0;
|
|
|
|
|
public ushort dp_trks0;
|
|
|
|
|
public byte dp_ctq_depth;
|
|
|
|
|
public byte dp_cylshi;
|
|
|
|
|
public ushort dp_unused;
|
|
|
|
|
public ushort dp_secs;
|
|
|
|
|
public ushort dp_secbytes;
|
|
|
|
|
public ushort dp_interleave;
|
|
|
|
|
public uint dp_flags;
|
|
|
|
|
public uint dp_datarate;
|
|
|
|
|
public uint dp_nretries;
|
|
|
|
|
public uint dp_mspw;
|
|
|
|
|
public ushort dp_xgap1;
|
|
|
|
|
public ushort dp_xsync;
|
|
|
|
|
public ushort dp_xrdly;
|
|
|
|
|
public ushort dp_xgap2;
|
|
|
|
|
public ushort dp_xrgate;
|
|
|
|
|
public ushort dp_xwcont;
|
* DiscImageChef.Helpers/BigEndianStructure.cs:
* DiscImageChef.Helpers/DiscImageChef.Helpers.csproj:
Added code that directly marshals from a big-endian byte
array. But untested with nested structures.
* DiscImageChef.Partitions/Acorn.cs:
Added support for Acorn FileCore partition, closes #4.
* DiscImageChef.Partitions/BSD.cs:
Moved BSD partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
* DiscImageChef.Partitions/DEC.cs:
Added support for DEC disklabels, closes #11.
* DiscImageChef.Partitions/DragonFlyBSD.cs:
Added support for DragonFly BSD 64-bit disklabels.
* DiscImageChef.Partitions/PC98.cs:
Added support for NEC PC-9800 partitions.
* DiscImageChef.Partitions/RioKarma.cs:
Added support for Rio Karma partitions.
* DiscImageChef.Partitions/SGI.cs:
Added support for SGI DVHs, closes #9.
* DiscImageChef.Partitions/UNIX.cs:
Moved UNIX partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
* TODO:
* README.md:
* DiscImageChef.Partitions/DiscImageChef.Partitions.csproj:
Added support for Acorn FileCore partition, closes #4.
Added support for DEC disklabels, closes #11.
Added support for SGI DVHs, closes #9.
Moved BSD partitions from inside MBR code to separate code, as
they can (and do) appear on other architectures as the only
scheme.
Added support for DragonFly BSD 64-bit disklabels.
Added support for NEC PC-9800 partitions.
Added support for Rio Karma partitions.
Moved UNIX partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
* DiscImageChef.Partitions/GPT.cs:
Added new partition type UUIDs.
* DiscImageChef.Partitions/MBR.cs:
Moved BSD partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
Moved UNIX partitions from inside MBR code to separate code,
as they can (and do) appear on other architectures as the
only scheme.
* DiscImageChef.Partitions/Sun.cs:
Added new partition types.
Prepare structures for marshaling.
2016-08-21 08:27:43 +01:00
|
|
|
}
|
|
|
|
|
}
|