2017-05-19 20:28:49 +01:00
|
|
|
// /***************************************************************************
|
2016-02-05 05:39:15 +00:00
|
|
|
// The Disc Image Chef
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
//
|
|
|
|
|
// Filename : Sun.cs
|
2016-07-28 18:13:49 +01:00
|
|
|
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
2016-02-05 05:39:15 +00:00
|
|
|
//
|
2016-07-28 18:13:49 +01:00
|
|
|
// Component : Partitioning scheme plugins.
|
2016-02-05 05:39:15 +00:00
|
|
|
//
|
|
|
|
|
// --[ Description ] ----------------------------------------------------------
|
|
|
|
|
//
|
2016-07-28 18:13:49 +01:00
|
|
|
// Manages Sun disklabels.
|
2016-02-05 05:39:15 +00:00
|
|
|
//
|
|
|
|
|
// --[ License ] --------------------------------------------------------------
|
|
|
|
|
//
|
2016-07-28 18:13:49 +01:00
|
|
|
// 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
|
2016-02-05 05:39:15 +00:00
|
|
|
// License, or (at your option) any later version.
|
|
|
|
|
//
|
2016-07-28 18:13:49 +01:00
|
|
|
// 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.
|
2016-02-05 05:39:15 +00:00
|
|
|
//
|
2016-07-28 18:13:49 +01:00
|
|
|
// 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/>.
|
2016-02-05 05:39:15 +00:00
|
|
|
//
|
|
|
|
|
// ----------------------------------------------------------------------------
|
2017-05-19 20:28:49 +01:00
|
|
|
// Copyright © 2011-2017 Natalia Portillo
|
2016-02-05 05:39:15 +00:00
|
|
|
// ****************************************************************************/
|
2016-07-28 18:13:49 +01:00
|
|
|
|
2016-02-05 05:39:15 +00:00
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
* 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;
|
2016-02-05 05:39:15 +00:00
|
|
|
using DiscImageChef.Console;
|
|
|
|
|
|
|
|
|
|
namespace DiscImageChef.PartPlugins
|
|
|
|
|
{
|
2017-07-01 20:54:02 +01:00
|
|
|
public class SunDisklabel : PartPlugin
|
2016-02-05 05:39:15 +00:00
|
|
|
{
|
2017-07-30 15:53:42 +01:00
|
|
|
/// <summary>Sun disklabel magic number</summary>
|
|
|
|
|
const ushort DKL_MAGIC = 0xDABE;
|
|
|
|
|
/// <summary>Sun VTOC magic number</summary>
|
|
|
|
|
const uint VTOC_SANE = 0x600DDEEE;
|
|
|
|
|
/// <summary>Sun disklabel magic number, byte-swapped</summary>
|
|
|
|
|
const ushort DKL_CIGAM = 0xBEDA;
|
|
|
|
|
/// <summary>Sun VTOC magic number, byte-swapped</summary>
|
|
|
|
|
const uint VTOC_ENAS = 0xEEDE0D60;
|
|
|
|
|
/// <summary># of logical partitions</summary>
|
|
|
|
|
const int NDKMAP = 8;
|
|
|
|
|
/// <summary># of logical partitions</summary>
|
|
|
|
|
const int NDKMAP16 = 16;
|
|
|
|
|
/// <summary>Disk label size</summary>
|
|
|
|
|
const int DK_LABEL_SIZE = 512;
|
|
|
|
|
/// <summary>Volume label size</summary>
|
|
|
|
|
const int LEN_DKL_ASCII = 128;
|
|
|
|
|
/// <summary>Length of v_volume</summary>
|
|
|
|
|
const int LEN_DKL_VVOL = 8;
|
|
|
|
|
/// <summary>Size of padding in SunOS disk label</summary>
|
|
|
|
|
const int LEN_DKL_PAD = DK_LABEL_SIZE - (LEN_DKL_ASCII + NDKMAP * 8 + 14 * 2);
|
|
|
|
|
/// <summary>Size of padding in Solaris disk label with 8 partitions</summary>
|
|
|
|
|
const int LEN_DKL_PAD8 = DK_LABEL_SIZE - (LEN_DKL_ASCII +
|
|
|
|
|
136 + // sizeof(dk_vtoc8)
|
|
|
|
|
(NDKMAP * 8) + 14 * 2 + 2 * 2);
|
|
|
|
|
const int LEN_DKL_PAD16 = DK_LABEL_SIZE -
|
|
|
|
|
(456 + // sizeof(dk_vtoc16)
|
|
|
|
|
4 * 4 + 12 * 2 + 2 * 2);
|
2016-02-05 05:39:15 +00:00
|
|
|
|
2017-07-30 15:53:42 +01:00
|
|
|
public enum SunTag : ushort
|
2016-02-05 05:39:15 +00:00
|
|
|
{
|
|
|
|
|
SunEmpty = 0x0000,
|
|
|
|
|
SunBoot = 0x0001,
|
|
|
|
|
SunRoot = 0x0002,
|
|
|
|
|
SunSwap = 0x0003,
|
|
|
|
|
SunUsr = 0x0004,
|
|
|
|
|
SunWholeDisk = 0x0005,
|
|
|
|
|
SunStand = 0x0006,
|
|
|
|
|
SunVar = 0x0007,
|
|
|
|
|
SunHome = 0x0008,
|
* 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
|
|
|
SunAlt = 0x0009,
|
|
|
|
|
SunCache = 0x000A,
|
2017-07-30 15:53:42 +01:00
|
|
|
SunReserved = 0x000B,
|
* 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
|
|
|
VxVmPublic = 0x000E,
|
|
|
|
|
VxVmPrivate = 0x000F,
|
2016-02-05 05:39:15 +00:00
|
|
|
LinuxSwap = 0x0082,
|
|
|
|
|
Linux = 0x0083,
|
|
|
|
|
LVM = 0x008E,
|
* 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
|
|
|
LinuxRaid = 0x00FD,
|
|
|
|
|
NetBSD = 0x00FF,
|
|
|
|
|
FreeBSD_Swap = 0x0901,
|
|
|
|
|
FreeBSD_UFS = 0x0902,
|
|
|
|
|
FreeBSD_Vinum = 0x0903,
|
|
|
|
|
FreeBSD_ZFS = 0x0904,
|
|
|
|
|
FreeBSD_NANDFS = 0x0905
|
2016-02-05 05:39:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[Flags]
|
|
|
|
|
public enum SunFlags : ushort
|
|
|
|
|
{
|
|
|
|
|
NoMount = 0x0001,
|
|
|
|
|
ReadOnly = 0x0010,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public SunDisklabel()
|
|
|
|
|
{
|
|
|
|
|
Name = "Sun Disklabel";
|
|
|
|
|
PluginUUID = new Guid("50F35CC4-8375-4445-8DCB-1BA550C931A3");
|
|
|
|
|
}
|
|
|
|
|
|
2017-07-24 23:35:33 +01:00
|
|
|
public override bool GetInformation(ImagePlugins.ImagePlugin imagePlugin, out List<CommonTypes.Partition> partitions, ulong sectorOffset)
|
2016-02-05 05:39:15 +00:00
|
|
|
{
|
|
|
|
|
partitions = new List<CommonTypes.Partition>();
|
|
|
|
|
|
2016-08-22 00:49:48 +01:00
|
|
|
if(imagePlugin.GetSectorSize() < 512)
|
|
|
|
|
return false;
|
|
|
|
|
|
2017-11-08 17:05:00 +00:00
|
|
|
if(sectorOffset + 2 >= imagePlugin.GetSectors())
|
|
|
|
|
return false;
|
|
|
|
|
|
2017-07-30 15:53:42 +01:00
|
|
|
bool useDkl = false, useDkl8 = false, useDkl16 = false;
|
|
|
|
|
|
2017-07-24 23:35:33 +01:00
|
|
|
byte[] sunSector = imagePlugin.ReadSector(sectorOffset);
|
2017-07-30 15:53:42 +01:00
|
|
|
|
|
|
|
|
GCHandle handle = GCHandle.Alloc(sunSector, GCHandleType.Pinned);
|
|
|
|
|
dk_label dkl = (dk_label)Marshal.PtrToStructure(handle.AddrOfPinnedObject(), typeof(dk_label));
|
|
|
|
|
dk_label8 dkl8 = (dk_label8)Marshal.PtrToStructure(handle.AddrOfPinnedObject(), typeof(dk_label8));
|
|
|
|
|
dk_label16 dkl16 = (dk_label16)Marshal.PtrToStructure(handle.AddrOfPinnedObject(), typeof(dk_label16));
|
|
|
|
|
handle.Free();
|
|
|
|
|
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl.dkl_magic = 0x{0:X4}", dkl.dkl_magic);
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl8.dkl_vtoc.v_sanity = 0x{0:X8}", dkl8.dkl_vtoc.v_sanity);
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl16.dkl_vtoc.v_sanity = 0x{0:X8}", dkl16.dkl_vtoc.v_sanity);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(dkl.dkl_magic == DKL_MAGIC || dkl.dkl_magic == DKL_CIGAM)
|
2016-02-05 05:39:15 +00:00
|
|
|
{
|
2017-07-30 15:53:42 +01:00
|
|
|
if(dkl16.dkl_vtoc.v_sanity == VTOC_SANE || dkl16.dkl_vtoc.v_sanity == VTOC_ENAS)
|
|
|
|
|
useDkl16 = true;
|
|
|
|
|
else if(dkl8.dkl_vtoc.v_sanity == VTOC_SANE || dkl8.dkl_vtoc.v_sanity == VTOC_ENAS)
|
|
|
|
|
useDkl8 = true;
|
|
|
|
|
else
|
|
|
|
|
useDkl = true;
|
2016-02-05 05:39:15 +00:00
|
|
|
}
|
2017-07-30 15:53:42 +01:00
|
|
|
|
|
|
|
|
if(!useDkl && !useDkl8 && !useDkl16)
|
2016-02-05 05:39:15 +00:00
|
|
|
{
|
2017-07-30 15:53:42 +01:00
|
|
|
sunSector = imagePlugin.ReadSector(sectorOffset + 1);
|
|
|
|
|
|
|
|
|
|
handle = GCHandle.Alloc(sunSector, GCHandleType.Pinned);
|
|
|
|
|
dkl = (dk_label)Marshal.PtrToStructure(handle.AddrOfPinnedObject(), typeof(dk_label));
|
|
|
|
|
dkl8 = (dk_label8)Marshal.PtrToStructure(handle.AddrOfPinnedObject(), typeof(dk_label8));
|
|
|
|
|
dkl16 = (dk_label16)Marshal.PtrToStructure(handle.AddrOfPinnedObject(), typeof(dk_label16));
|
|
|
|
|
handle.Free();
|
|
|
|
|
|
|
|
|
|
if(dkl.dkl_magic == DKL_MAGIC || dkl.dkl_magic == DKL_CIGAM)
|
2017-07-23 22:54:36 +01:00
|
|
|
{
|
2017-07-30 15:53:42 +01:00
|
|
|
if(dkl16.dkl_vtoc.v_sanity == VTOC_SANE || dkl16.dkl_vtoc.v_sanity == VTOC_ENAS)
|
|
|
|
|
useDkl16 = true;
|
|
|
|
|
else if(dkl8.dkl_vtoc.v_sanity == VTOC_SANE || dkl8.dkl_vtoc.v_sanity == VTOC_ENAS)
|
|
|
|
|
useDkl8 = true;
|
|
|
|
|
else
|
|
|
|
|
useDkl = true;
|
|
|
|
|
}
|
2016-02-05 05:39:15 +00:00
|
|
|
}
|
|
|
|
|
|
2017-07-30 15:53:42 +01:00
|
|
|
if(!useDkl && !useDkl8 && !useDkl16)
|
|
|
|
|
return false;
|
2016-02-05 05:39:15 +00:00
|
|
|
|
2017-07-30 15:53:42 +01:00
|
|
|
if(useDkl16 && dkl16.dkl_magic == DKL_CIGAM)
|
|
|
|
|
dkl16 = SwapDiskLabel(dkl16);
|
|
|
|
|
else if(useDkl8 && dkl8.dkl_magic == DKL_CIGAM)
|
|
|
|
|
dkl8 = SwapDiskLabel(dkl8);
|
|
|
|
|
else if(useDkl && dkl.dkl_magic == DKL_CIGAM)
|
|
|
|
|
dkl = SwapDiskLabel(dkl);
|
2016-02-05 05:39:15 +00:00
|
|
|
|
2017-07-30 15:53:42 +01:00
|
|
|
if(useDkl)
|
2016-02-05 05:39:15 +00:00
|
|
|
{
|
2017-07-30 15:53:42 +01:00
|
|
|
ulong sectorsPerCylinder = (ulong)(dkl.dkl_nsect * dkl.dkl_nhead);
|
|
|
|
|
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl.dkl_asciilabel = \"{0}\"", StringHandlers.CToString(dkl.dkl_asciilabel));
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl.dkl_rpm = {0}", dkl.dkl_rpm);
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl.dkl_pcyl = {0}", dkl.dkl_pcyl);
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl.dkl_apc = {0}", dkl.dkl_apc);
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl.dkl_gap1 = {0}", dkl.dkl_gap1);
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl.dkl_gap2 = {0}", dkl.dkl_gap2);
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl.dkl_intrlv = {0}", dkl.dkl_intrlv);
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl.dkl_ncyl = {0}", dkl.dkl_ncyl);
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl.dkl_acyl = {0}", dkl.dkl_acyl);
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl.dkl_nhead = {0}", dkl.dkl_nhead);
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl.dkl_nsect = {0}", dkl.dkl_nsect);
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl.dkl_bhead = {0}", dkl.dkl_bhead);
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl.dkl_ppart = {0}", dkl.dkl_ppart);
|
|
|
|
|
for(int i = 0; i < NDKMAP; i++)
|
|
|
|
|
{
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl.dkl_map[{0}].dkl_cylno = {1}", i, dkl.dkl_map[i].dkl_cylno);
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl.dkl_map[{0}].dkl_nblk = {1}", i, dkl.dkl_map[i].dkl_nblk);
|
|
|
|
|
}
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl.dkl_magic = 0x{0:X4}", dkl.dkl_magic);
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl.dkl_cksum = 0x{0:X4}", dkl.dkl_cksum);
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "sectorsPerCylinder = {0}", sectorsPerCylinder);
|
|
|
|
|
|
|
|
|
|
for(int i = 0; i < NDKMAP; i++)
|
|
|
|
|
{
|
|
|
|
|
if(dkl.dkl_map[i].dkl_cylno > 0 && dkl.dkl_map[i].dkl_nblk > 0)
|
|
|
|
|
{
|
|
|
|
|
CommonTypes.Partition part = new CommonTypes.Partition
|
|
|
|
|
{
|
|
|
|
|
Size = (ulong)dkl.dkl_map[i].dkl_nblk * DK_LABEL_SIZE,
|
|
|
|
|
Length = (ulong)((dkl.dkl_map[i].dkl_nblk * DK_LABEL_SIZE) / imagePlugin.GetSectorSize()),
|
|
|
|
|
Sequence = (ulong)i,
|
|
|
|
|
Offset = ((ulong)dkl.dkl_map[i].dkl_cylno * sectorsPerCylinder + sectorOffset) * DK_LABEL_SIZE,
|
|
|
|
|
Start = (((ulong)dkl.dkl_map[i].dkl_cylno * sectorsPerCylinder + sectorOffset) * DK_LABEL_SIZE) / imagePlugin.GetSectorSize(),
|
|
|
|
|
Type = "SunOS partition",
|
|
|
|
|
Scheme = Name
|
|
|
|
|
};
|
|
|
|
|
if(part.Start < imagePlugin.GetSectors() && part.End <= imagePlugin.GetSectors())
|
|
|
|
|
partitions.Add(part);
|
|
|
|
|
}
|
|
|
|
|
}
|
2016-02-05 05:39:15 +00:00
|
|
|
}
|
2017-07-30 15:53:42 +01:00
|
|
|
else if(useDkl8)
|
2016-02-05 05:39:15 +00:00
|
|
|
{
|
2017-07-30 15:53:42 +01:00
|
|
|
ulong sectorsPerCylinder = (ulong)(dkl8.dkl_nsect * dkl8.dkl_nhead);
|
2016-02-05 05:39:15 +00:00
|
|
|
|
2017-07-30 15:53:42 +01:00
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl8.dkl_asciilabel = \"{0}\"", StringHandlers.CToString(dkl8.dkl_asciilabel));
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl8.dkl_vtoc.v_version = {0}", dkl8.dkl_vtoc.v_version);
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl8.dkl_vtoc.v_volume = \"{0}\"", StringHandlers.CToString(dkl8.dkl_vtoc.v_volume));
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl8.dkl_vtoc.v_nparts = {0}", dkl8.dkl_vtoc.v_nparts);
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl8.dkl_vtoc.v_sanity = 0x{0:X8}", dkl8.dkl_vtoc.v_sanity);
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl8.dkl_write_reinstruct = {0}", dkl8.dkl_write_reinstruct);
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl8.dkl_read_reinstruct = {0}", dkl8.dkl_read_reinstruct);
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl8.dkl_rpm = {0}", dkl8.dkl_rpm);
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl8.dkl_pcyl = {0}", dkl8.dkl_pcyl);
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl8.dkl_apc = {0}", dkl8.dkl_apc);
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl8.dkl_obs1 = {0}", dkl8.dkl_obs1);
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl8.dkl_obs2 = {0}", dkl8.dkl_obs2);
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl8.dkl_intrlv = {0}", dkl8.dkl_intrlv);
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl8.dkl_ncyl = {0}", dkl8.dkl_ncyl);
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl8.dkl_acyl = {0}", dkl8.dkl_acyl);
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl8.dkl_nhead = {0}", dkl8.dkl_nhead);
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl8.dkl_nsect = {0}", dkl8.dkl_nsect);
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl8.dkl_obs3 = {0}", dkl8.dkl_obs3);
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl8.dkl_obs4 = {0}", dkl8.dkl_obs4);
|
|
|
|
|
for(int i = 0; i < NDKMAP; i++)
|
|
|
|
|
{
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl8.dkl_map[{0}].dkl_cylno = {1}", i, dkl8.dkl_map[i].dkl_cylno);
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl8.dkl_map[{0}].dkl_nblk = {1}", i, dkl8.dkl_map[i].dkl_nblk);
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl8.dkl_vtoc.v_part[{0}].p_tag = {1} ({2})", i, dkl8.dkl_vtoc.v_part[i].p_tag, (ushort)dkl8.dkl_vtoc.v_part[i].p_tag);
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl8.dkl_vtoc.v_part[{0}].p_flag = {1} ({2})", i, dkl8.dkl_vtoc.v_part[i].p_flag, (ushort)dkl8.dkl_vtoc.v_part[i].p_flag);
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl8.dkl_vtoc.v_timestamp[{0}] = {1}", i, DateHandlers.UNIXToDateTime(dkl8.dkl_vtoc.v_timestamp[i]));
|
|
|
|
|
}
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl8.dkl_magic = 0x{0:X4}", dkl8.dkl_magic);
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl8.dkl_cksum = 0x{0:X4}", dkl8.dkl_cksum);
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "sectorsPerCylinder = {0}", sectorsPerCylinder);
|
2016-02-05 05:39:15 +00:00
|
|
|
|
2017-07-30 15:53:42 +01:00
|
|
|
if(dkl8.dkl_vtoc.v_nparts > NDKMAP)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
for(int i = 0; i < dkl8.dkl_vtoc.v_nparts; i++)
|
|
|
|
|
{
|
|
|
|
|
if(dkl8.dkl_map[i].dkl_nblk > 0 &&
|
|
|
|
|
dkl8.dkl_vtoc.v_part[i].p_tag != SunTag.SunEmpty && dkl8.dkl_vtoc.v_part[i].p_tag != SunTag.SunWholeDisk)
|
|
|
|
|
{
|
|
|
|
|
CommonTypes.Partition part = new CommonTypes.Partition
|
|
|
|
|
{
|
|
|
|
|
Description = SunFlagsToString(dkl8.dkl_vtoc.v_part[i].p_flag),
|
|
|
|
|
Size = (ulong)dkl8.dkl_map[i].dkl_nblk * DK_LABEL_SIZE,
|
|
|
|
|
Length = (ulong)((dkl8.dkl_map[i].dkl_nblk * DK_LABEL_SIZE) / imagePlugin.GetSectorSize()),
|
|
|
|
|
Sequence = (ulong)i,
|
|
|
|
|
Offset = ((ulong)dkl8.dkl_map[i].dkl_cylno * sectorsPerCylinder + sectorOffset) * DK_LABEL_SIZE,
|
|
|
|
|
Start = (((ulong)dkl8.dkl_map[i].dkl_cylno * sectorsPerCylinder + sectorOffset) * DK_LABEL_SIZE) / imagePlugin.GetSectorSize(),
|
|
|
|
|
Type = SunIdToString(dkl8.dkl_vtoc.v_part[i].p_tag),
|
|
|
|
|
Scheme = Name
|
|
|
|
|
};
|
|
|
|
|
if(dkl8.dkl_vtoc.v_timestamp[i] != 0)
|
|
|
|
|
part.Description += string.Format("\nPartition timestamped on {0}", DateHandlers.UNIXToDateTime(dkl8.dkl_vtoc.v_timestamp[i]));
|
2016-02-05 05:39:15 +00:00
|
|
|
|
2017-07-30 15:53:42 +01:00
|
|
|
if(part.Start < imagePlugin.GetSectors() && part.End <= imagePlugin.GetSectors())
|
|
|
|
|
partitions.Add(part);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if(useDkl16)
|
2016-02-05 05:39:15 +00:00
|
|
|
{
|
2017-07-30 15:53:42 +01:00
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl16.dkl_vtoc.v_sanity = 0x{0:X8}", dkl16.dkl_vtoc.v_sanity);
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl16.dkl_vtoc.v_version = {0}", dkl16.dkl_vtoc.v_version);
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl16.dkl_vtoc.v_volume = \"{0}\"", StringHandlers.CToString(dkl16.dkl_vtoc.v_volume));
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl16.dkl_vtoc.v_sectorsz = {0}", dkl16.dkl_vtoc.v_sectorsz);
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl16.dkl_vtoc.v_nparts = {0}", dkl16.dkl_vtoc.v_nparts);
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl16.dkl_vtoc.v_asciilabel = \"{0}\"", StringHandlers.CToString(dkl16.dkl_vtoc.v_asciilabel));
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl16.dkl_pcyl = {0}", dkl16.dkl_pcyl);
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl16.dkl_ncyl = {0}", dkl16.dkl_ncyl);
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl16.dkl_acyl = {0}", dkl16.dkl_acyl);
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl16.dkl_bcyl = {0}", dkl16.dkl_bcyl);
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl16.dkl_nhead = {0}", dkl16.dkl_nhead);
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl16.dkl_nsect = {0}", dkl16.dkl_nsect);
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl16.dkl_intrlv = {0}", dkl16.dkl_intrlv);
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl16.dkl_skew = {0}", dkl16.dkl_skew);
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl16.dkl_apc = {0}", dkl16.dkl_apc);
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl16.dkl_rpm = {0}", dkl16.dkl_rpm);
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl16.dkl_write_reinstruct = {0}", dkl16.dkl_write_reinstruct);
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl16.dkl_read_reinstruct = {0}", dkl16.dkl_read_reinstruct);
|
|
|
|
|
for(int i = 0; i < NDKMAP16; i++)
|
|
|
|
|
{
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl16.dkl_vtoc.v_part[{0}].p_start = {1}", i, dkl16.dkl_vtoc.v_part[i].p_start);
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl16.dkl_vtoc.v_part[{0}].p_size = {1}", i, dkl16.dkl_vtoc.v_part[i].p_size);
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl16.dkl_vtoc.v_part[{0}].p_tag = {1} ({2})", i, dkl16.dkl_vtoc.v_part[i].p_tag, (ushort)dkl16.dkl_vtoc.v_part[i].p_tag);
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl16.dkl_vtoc.v_part[{0}].p_flag = {1} ({2})", i, dkl16.dkl_vtoc.v_part[i].p_flag, (ushort)dkl16.dkl_vtoc.v_part[i].p_flag);
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl16.dkl_vtoc.v_timestamp[{0}] = {1}", i, DateHandlers.UNIXToDateTime(dkl16.dkl_vtoc.v_timestamp[i]));
|
|
|
|
|
}
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl16.dkl_magic = 0x{0:X4}", dkl16.dkl_magic);
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "dkl16.dkl_cksum = 0x{0:X4}", dkl16.dkl_cksum);
|
|
|
|
|
|
|
|
|
|
if(dkl16.dkl_vtoc.v_nparts > NDKMAP16)
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
for(int i = 0; i < dkl16.dkl_vtoc.v_nparts; i++)
|
2016-02-05 05:39:15 +00:00
|
|
|
{
|
2017-07-30 15:53:42 +01:00
|
|
|
if(dkl16.dkl_vtoc.v_part[i].p_size > 0 &&
|
|
|
|
|
dkl16.dkl_vtoc.v_part[i].p_tag != SunTag.SunEmpty && dkl16.dkl_vtoc.v_part[i].p_tag != SunTag.SunWholeDisk)
|
2017-07-23 22:54:36 +01:00
|
|
|
{
|
2017-07-30 15:53:42 +01:00
|
|
|
CommonTypes.Partition part = new CommonTypes.Partition
|
|
|
|
|
{
|
|
|
|
|
Description = SunFlagsToString(dkl16.dkl_vtoc.v_part[i].p_flag),
|
|
|
|
|
Size = (ulong)dkl16.dkl_vtoc.v_part[i].p_size * dkl16.dkl_vtoc.v_sectorsz,
|
|
|
|
|
Length = (ulong)((dkl16.dkl_vtoc.v_part[i].p_size * dkl16.dkl_vtoc.v_sectorsz) / imagePlugin.GetSectorSize()),
|
|
|
|
|
Sequence = (ulong)i,
|
|
|
|
|
Offset = ((ulong)dkl16.dkl_vtoc.v_part[i].p_start + sectorOffset) * dkl16.dkl_vtoc.v_sectorsz,
|
|
|
|
|
Start = (((ulong)dkl16.dkl_vtoc.v_part[i].p_start + sectorOffset) * dkl16.dkl_vtoc.v_sectorsz) / imagePlugin.GetSectorSize(),
|
|
|
|
|
Type = SunIdToString(dkl16.dkl_vtoc.v_part[i].p_tag),
|
|
|
|
|
Scheme = Name
|
|
|
|
|
};
|
|
|
|
|
if(dkl16.dkl_vtoc.v_timestamp[i] != 0)
|
|
|
|
|
part.Description += string.Format("\nPartition timestamped on {0}", DateHandlers.UNIXToDateTime(dkl16.dkl_vtoc.v_timestamp[i]));
|
|
|
|
|
if(part.Start < imagePlugin.GetSectors() && part.End <= imagePlugin.GetSectors())
|
|
|
|
|
partitions.Add(part);
|
|
|
|
|
}
|
2016-02-05 05:39:15 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-07-30 15:53:42 +01:00
|
|
|
return
|
|
|
|
|
partitions.Count > 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static dk_label SwapDiskLabel(dk_label label)
|
|
|
|
|
{
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "Swapping dk_label");
|
|
|
|
|
dk_label lebal = BigEndianMarshal.SwapStructureMembersEndian(label);
|
|
|
|
|
for(int i = 0; i < label.dkl_map.Length; i++)
|
|
|
|
|
lebal.dkl_map[i] = BigEndianMarshal.SwapStructureMembersEndian(label.dkl_map[i]);
|
|
|
|
|
|
|
|
|
|
return lebal;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static dk_label8 SwapDiskLabel(dk_label8 label)
|
|
|
|
|
{
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "Swapping dk_label8");
|
|
|
|
|
dk_label8 lebal = BigEndianMarshal.SwapStructureMembersEndian(label);
|
|
|
|
|
lebal.dkl_vtoc = BigEndianMarshal.SwapStructureMembersEndian(label.dkl_vtoc);
|
|
|
|
|
for(int i = 0; i < label.dkl_map.Length; i++)
|
|
|
|
|
lebal.dkl_map[i] = BigEndianMarshal.SwapStructureMembersEndian(label.dkl_map[i]);
|
|
|
|
|
for(int i = 0; i < label.dkl_vtoc.v_bootinfo.Length; i++)
|
|
|
|
|
lebal.dkl_vtoc.v_bootinfo[i] = Swapping.Swap(label.dkl_vtoc.v_bootinfo[i]);
|
|
|
|
|
for(int i = 0; i < label.dkl_vtoc.v_part.Length; i++)
|
|
|
|
|
{
|
|
|
|
|
lebal.dkl_vtoc.v_part[i].p_flag = (SunFlags)Swapping.Swap((ushort)label.dkl_vtoc.v_part[i].p_flag);
|
|
|
|
|
lebal.dkl_vtoc.v_part[i].p_tag = (SunTag)Swapping.Swap((ushort)label.dkl_vtoc.v_part[i].p_tag);
|
|
|
|
|
}
|
|
|
|
|
for(int i = 0; i < label.dkl_vtoc.v_timestamp.Length; i++)
|
|
|
|
|
lebal.dkl_vtoc.v_timestamp[i] = Swapping.Swap(label.dkl_vtoc.v_timestamp[i]);
|
|
|
|
|
for(int i = 0; i < label.dkl_vtoc.v_reserved.Length; i++)
|
|
|
|
|
lebal.dkl_vtoc.v_reserved[i] = Swapping.Swap(label.dkl_vtoc.v_reserved[i]);
|
|
|
|
|
|
|
|
|
|
return lebal;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static dk_label16 SwapDiskLabel(dk_label16 label)
|
|
|
|
|
{
|
|
|
|
|
DicConsole.DebugWriteLine("Sun plugin", "Swapping dk_label16");
|
|
|
|
|
dk_label16 lebal = BigEndianMarshal.SwapStructureMembersEndian(label);
|
|
|
|
|
lebal.dkl_vtoc = BigEndianMarshal.SwapStructureMembersEndian(label.dkl_vtoc);
|
|
|
|
|
for(int i = 0; i < label.dkl_vtoc.v_bootinfo.Length; i++)
|
|
|
|
|
lebal.dkl_vtoc.v_bootinfo[i] = Swapping.Swap(label.dkl_vtoc.v_bootinfo[i]);
|
|
|
|
|
for(int i = 0; i < label.dkl_vtoc.v_part.Length; i++)
|
|
|
|
|
{
|
|
|
|
|
lebal.dkl_vtoc.v_part[i].p_flag = (SunFlags)Swapping.Swap((ushort)label.dkl_vtoc.v_part[i].p_flag);
|
|
|
|
|
lebal.dkl_vtoc.v_part[i].p_tag = (SunTag)Swapping.Swap((ushort)label.dkl_vtoc.v_part[i].p_tag);
|
|
|
|
|
lebal.dkl_vtoc.v_part[i].p_size = Swapping.Swap(label.dkl_vtoc.v_part[i].p_size);
|
|
|
|
|
lebal.dkl_vtoc.v_part[i].p_start = Swapping.Swap(label.dkl_vtoc.v_part[i].p_start);
|
|
|
|
|
}
|
|
|
|
|
for(int i = 0; i < label.dkl_vtoc.v_timestamp.Length; i++)
|
|
|
|
|
lebal.dkl_vtoc.v_timestamp[i] = Swapping.Swap(label.dkl_vtoc.v_timestamp[i]);
|
|
|
|
|
for(int i = 0; i < label.dkl_vtoc.v_reserved.Length; i++)
|
|
|
|
|
lebal.dkl_vtoc.v_reserved[i] = Swapping.Swap(label.dkl_vtoc.v_reserved[i]);
|
|
|
|
|
|
|
|
|
|
return lebal;
|
2016-02-05 05:39:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static string SunFlagsToString(SunFlags flags)
|
|
|
|
|
{
|
|
|
|
|
System.Text.StringBuilder sb = new System.Text.StringBuilder();
|
2016-04-19 02:11:47 +01:00
|
|
|
if(flags.HasFlag(SunFlags.NoMount))
|
2016-02-05 05:39:15 +00:00
|
|
|
sb.AppendLine("Unmountable");
|
2016-04-19 02:11:47 +01:00
|
|
|
if(flags.HasFlag(SunFlags.ReadOnly))
|
2016-02-05 05:39:15 +00:00
|
|
|
sb.AppendLine("Read-only");
|
|
|
|
|
return sb.ToString();
|
|
|
|
|
}
|
|
|
|
|
|
2017-07-30 15:53:42 +01:00
|
|
|
public static string SunIdToString(SunTag id)
|
2016-02-05 05:39:15 +00:00
|
|
|
{
|
2016-04-19 02:11:47 +01:00
|
|
|
switch(id)
|
2016-02-05 05:39:15 +00:00
|
|
|
{
|
2017-07-30 15:53:42 +01:00
|
|
|
case SunTag.Linux:
|
2016-02-05 05:39:15 +00:00
|
|
|
return "Linux";
|
2017-07-30 15:53:42 +01:00
|
|
|
case SunTag.LinuxRaid:
|
2016-04-19 02:11:47 +01:00
|
|
|
return "Linux RAID";
|
2017-07-30 15:53:42 +01:00
|
|
|
case SunTag.LinuxSwap:
|
2016-02-05 05:39:15 +00:00
|
|
|
return "Linux swap";
|
2017-07-30 15:53:42 +01:00
|
|
|
case SunTag.LVM:
|
2016-02-05 05:39:15 +00:00
|
|
|
return "LVM";
|
2017-07-30 15:53:42 +01:00
|
|
|
case SunTag.SunBoot:
|
2016-02-05 05:39:15 +00:00
|
|
|
return "Sun boot";
|
2017-07-30 15:53:42 +01:00
|
|
|
case SunTag.SunEmpty:
|
2016-02-05 05:39:15 +00:00
|
|
|
return "Empty";
|
2017-07-30 15:53:42 +01:00
|
|
|
case SunTag.SunHome:
|
2016-02-05 05:39:15 +00:00
|
|
|
return "Sun /home";
|
2017-07-30 15:53:42 +01:00
|
|
|
case SunTag.SunRoot:
|
2016-02-05 05:39:15 +00:00
|
|
|
return "Sun /";
|
2017-07-30 15:53:42 +01:00
|
|
|
case SunTag.SunStand:
|
2016-02-05 05:39:15 +00:00
|
|
|
return "Sun /stand";
|
2017-07-30 15:53:42 +01:00
|
|
|
case SunTag.SunSwap:
|
2016-02-05 05:39:15 +00:00
|
|
|
return "Sun swap";
|
2017-07-30 15:53:42 +01:00
|
|
|
case SunTag.SunUsr:
|
2016-02-05 05:39:15 +00:00
|
|
|
return "Sun /usr";
|
2017-07-30 15:53:42 +01:00
|
|
|
case SunTag.SunVar:
|
2016-02-05 05:39:15 +00:00
|
|
|
return "Sun /var";
|
2017-07-30 15:53:42 +01:00
|
|
|
case SunTag.SunWholeDisk:
|
2016-02-05 05:39:15 +00:00
|
|
|
return "Whole disk";
|
2017-07-30 15:53:42 +01:00
|
|
|
case SunTag.SunAlt:
|
|
|
|
|
return "Replacement sectors";
|
|
|
|
|
case SunTag.SunCache:
|
|
|
|
|
return "Sun cachefs";
|
|
|
|
|
case SunTag.SunReserved:
|
|
|
|
|
return "Reserved for SMI";
|
|
|
|
|
case SunTag.VxVmPublic:
|
|
|
|
|
return "Veritas public";
|
|
|
|
|
case SunTag.VxVmPrivate:
|
|
|
|
|
return "Veritas private";
|
|
|
|
|
case SunTag.NetBSD:
|
|
|
|
|
return "NetBSD";
|
|
|
|
|
case SunTag.FreeBSD_Swap:
|
|
|
|
|
return "FreeBSD swap";
|
|
|
|
|
case SunTag.FreeBSD_UFS:
|
|
|
|
|
return "FreeBSD";
|
|
|
|
|
case SunTag.FreeBSD_Vinum:
|
|
|
|
|
return "Vinum";
|
|
|
|
|
case SunTag.FreeBSD_ZFS:
|
|
|
|
|
return "FreeBSD ZFS";
|
|
|
|
|
case SunTag.FreeBSD_NANDFS:
|
|
|
|
|
return "FreeBSD nandfs";
|
2016-02-05 05:39:15 +00:00
|
|
|
default:
|
|
|
|
|
return "Unknown";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-07-30 15:53:42 +01:00
|
|
|
/// <summary>SunOS logical partitions</summary>
|
* 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
|
|
|
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
2017-07-30 15:53:42 +01:00
|
|
|
struct dk_map
|
2016-02-05 05:39:15 +00:00
|
|
|
{
|
2017-07-30 15:53:42 +01:00
|
|
|
/// <summary>starting cylinder</summary>
|
|
|
|
|
public int dkl_cylno;
|
|
|
|
|
/// <summary>number of blocks</summary>
|
|
|
|
|
public int dkl_nblk;
|
2016-02-05 05:39:15 +00:00
|
|
|
}
|
|
|
|
|
|
2017-07-30 15:53:42 +01:00
|
|
|
/// <summary>SunOS disk label</summary>
|
* 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
|
|
|
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
2017-07-30 15:53:42 +01:00
|
|
|
struct dk_label
|
2016-02-05 05:39:15 +00:00
|
|
|
{
|
2017-07-30 15:53:42 +01:00
|
|
|
/// <summary>Informative string</summary>
|
|
|
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = LEN_DKL_ASCII)]
|
|
|
|
|
public byte[] dkl_asciilabel;
|
|
|
|
|
/// <summary>Padding</summary>
|
|
|
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = LEN_DKL_PAD)]
|
|
|
|
|
public byte[] dkl_pad;
|
|
|
|
|
/// <summary>rotations per minute</summary>
|
|
|
|
|
public ushort dkl_rpm;
|
|
|
|
|
/// <summary># physical cylinders</summary>
|
|
|
|
|
public ushort dkl_pcyl;
|
|
|
|
|
/// <summary>alternates per cylinder</summary>
|
|
|
|
|
public ushort dkl_apc;
|
|
|
|
|
/// <summary>size of gap 1</summary>
|
|
|
|
|
public ushort dkl_gap1;
|
|
|
|
|
/// <summary>size of gap 2</summary>
|
|
|
|
|
public ushort dkl_gap2;
|
|
|
|
|
/// <summary>interleave factor</summary>
|
|
|
|
|
public ushort dkl_intrlv;
|
|
|
|
|
/// <summary># of data cylinders</summary>
|
|
|
|
|
public ushort dkl_ncyl;
|
|
|
|
|
/// <summary># of alternate cylinders</summary>
|
|
|
|
|
public ushort dkl_acyl;
|
|
|
|
|
/// <summary># of heads in this partition</summary>
|
|
|
|
|
public ushort dkl_nhead;
|
|
|
|
|
/// <summary># of 512 byte sectors per track</summary>
|
|
|
|
|
public ushort dkl_nsect;
|
|
|
|
|
/// <summary>identifies proper label location</summary>
|
|
|
|
|
public ushort dkl_bhead;
|
|
|
|
|
/// <summary>physical partition #</summary>
|
|
|
|
|
public ushort dkl_ppart;
|
|
|
|
|
/// <summary>Logical partitions</summary>
|
|
|
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = NDKMAP)]
|
|
|
|
|
public dk_map[] dkl_map;
|
|
|
|
|
/// <summary>identifies this label format</summary>
|
|
|
|
|
public ushort dkl_magic;
|
|
|
|
|
/// <summary>xor checksum of sector</summary>
|
|
|
|
|
public ushort dkl_cksum;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>Solaris logical partition for small disk label</summary>
|
|
|
|
|
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
|
|
|
|
struct dk_map2
|
|
|
|
|
{
|
|
|
|
|
/// <summary> ID tag of partition</summary>
|
|
|
|
|
public SunTag p_tag;
|
|
|
|
|
/// <summary> permission flag</summary>
|
|
|
|
|
public SunFlags p_flag;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>Solaris logical partition</summary>
|
|
|
|
|
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
|
|
|
|
struct dkl_partition
|
|
|
|
|
{
|
|
|
|
|
/// <summary>ID tag of partition</summary>
|
|
|
|
|
public SunTag p_tag;
|
|
|
|
|
/// <summary>permision flags</summary>
|
|
|
|
|
public SunFlags p_flag;
|
|
|
|
|
/// <summary>start sector no of partition</summary>
|
|
|
|
|
public int p_start;
|
|
|
|
|
/// <summary># of blocks in partition</summary>
|
|
|
|
|
public int p_size;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
|
|
|
|
struct dk_vtoc8
|
|
|
|
|
{
|
|
|
|
|
/// <summary> layout version</summary>
|
|
|
|
|
public uint v_version;
|
|
|
|
|
/// <summary> volume name</summary>
|
|
|
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = LEN_DKL_VVOL)]
|
|
|
|
|
public byte[] v_volume;
|
|
|
|
|
/// <summary> number of partitions </summary>
|
|
|
|
|
public ushort v_nparts;
|
|
|
|
|
/// <summary> partition hdrs, sec 2</summary>
|
|
|
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = NDKMAP)]
|
|
|
|
|
public dk_map2[] v_part;
|
|
|
|
|
/// <summary>Alignment</summary>
|
2016-02-05 05:39:15 +00:00
|
|
|
public ushort padding;
|
2017-07-30 15:53:42 +01:00
|
|
|
/// <summary> info needed by mboot</summary>
|
|
|
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
|
|
|
|
|
public uint[] v_bootinfo;
|
|
|
|
|
/// <summary> to verify vtoc sanity</summary>
|
|
|
|
|
public uint v_sanity;
|
|
|
|
|
/// <summary> free space</summary>
|
|
|
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)]
|
|
|
|
|
public uint[] v_reserved;
|
|
|
|
|
/// <summary> partition timestamp</summary>
|
|
|
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = NDKMAP)]
|
|
|
|
|
public int[] v_timestamp;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
|
|
|
|
struct dk_vtoc16
|
|
|
|
|
{
|
|
|
|
|
/// <summary>info needed by mboot</summary>
|
* 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
|
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
|
2017-07-30 15:53:42 +01:00
|
|
|
public uint[] v_bootinfo;
|
|
|
|
|
/// <summary>to verify vtoc sanity</summary>
|
|
|
|
|
public uint v_sanity;
|
|
|
|
|
/// <summary>layout version</summary>
|
|
|
|
|
public uint v_version;
|
|
|
|
|
/// <summary>volume name</summary>
|
|
|
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = LEN_DKL_VVOL)]
|
|
|
|
|
public byte[] v_volume;
|
|
|
|
|
/// <summary>sector size in bytes</summary>
|
|
|
|
|
public ushort v_sectorsz;
|
|
|
|
|
/// <summary>number of partitions</summary>
|
|
|
|
|
public ushort v_nparts;
|
|
|
|
|
/// <summary>free space</summary>
|
|
|
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)]
|
|
|
|
|
public uint[] v_reserved;
|
|
|
|
|
/// <summary>partition headers</summary>
|
|
|
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = NDKMAP16)]
|
|
|
|
|
public dkl_partition[] v_part;
|
|
|
|
|
/// <summary>partition timestamp</summary>
|
|
|
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = NDKMAP16)]
|
|
|
|
|
public int[] v_timestamp;
|
|
|
|
|
/// <summary>for compatibility</summary>
|
|
|
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = LEN_DKL_ASCII)]
|
|
|
|
|
public byte[] v_asciilabel;
|
2016-02-05 05:39:15 +00:00
|
|
|
}
|
|
|
|
|
|
* 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
|
|
|
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
2017-07-30 15:53:42 +01:00
|
|
|
struct dk_label8
|
2016-02-05 05:39:15 +00:00
|
|
|
{
|
2017-07-30 15:53:42 +01:00
|
|
|
/// <summary>for compatibility</summary>
|
|
|
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = LEN_DKL_ASCII)]
|
|
|
|
|
public byte[] dkl_asciilabel;
|
|
|
|
|
/// <summary>vtoc inclusions from AT&T SVr4</summary>
|
|
|
|
|
public dk_vtoc8 dkl_vtoc;
|
|
|
|
|
/// <summary># sectors to skip, writes</summary>
|
|
|
|
|
public ushort dkl_write_reinstruct;
|
|
|
|
|
/// <summary># sectors to skip, reads</summary>
|
|
|
|
|
public ushort dkl_read_reinstruct;
|
|
|
|
|
/// <summary>unused part of 512 bytes</summary>
|
|
|
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = LEN_DKL_PAD8)]
|
|
|
|
|
public byte[] dkl_pad;
|
|
|
|
|
/// <summary>rotations per minute</summary>
|
|
|
|
|
public ushort dkl_rpm;
|
|
|
|
|
/// <summary># physical cylinders</summary>
|
|
|
|
|
public ushort dkl_pcyl;
|
|
|
|
|
/// <summary>alternates per cylinder</summary>
|
|
|
|
|
public ushort dkl_apc;
|
|
|
|
|
/// <summary>obsolete</summary>
|
|
|
|
|
public ushort dkl_obs1;
|
|
|
|
|
/// <summary>obsolete</summary>
|
|
|
|
|
public ushort dkl_obs2;
|
|
|
|
|
/// <summary>interleave factor</summary>
|
|
|
|
|
public ushort dkl_intrlv;
|
|
|
|
|
/// <summary># of data cylinders</summary>
|
|
|
|
|
public ushort dkl_ncyl;
|
|
|
|
|
/// <summary># of alternate cylinders</summary>
|
|
|
|
|
public ushort dkl_acyl;
|
|
|
|
|
/// <summary># of heads in this partition</summary>
|
|
|
|
|
public ushort dkl_nhead;
|
|
|
|
|
/// <summary># of 512 byte sectors per track</summary>
|
|
|
|
|
public ushort dkl_nsect;
|
|
|
|
|
/// <summary>obsolete</summary>
|
|
|
|
|
public ushort dkl_obs3;
|
|
|
|
|
/// <summary>obsolete</summary>
|
|
|
|
|
public ushort dkl_obs4;
|
|
|
|
|
/// <summary>logical partition headers</summary>
|
|
|
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = NDKMAP)]
|
|
|
|
|
public dk_map[] dkl_map;
|
|
|
|
|
/// <summary>identifies this label format</summary>
|
|
|
|
|
public ushort dkl_magic;
|
|
|
|
|
/// <summary>xor checksum of sector</summary>
|
|
|
|
|
public ushort dkl_cksum;
|
2016-02-05 05:39:15 +00:00
|
|
|
}
|
|
|
|
|
|
* 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
|
|
|
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
2017-07-30 15:53:42 +01:00
|
|
|
struct dk_label16
|
2016-02-05 05:39:15 +00:00
|
|
|
{
|
2017-07-30 15:53:42 +01:00
|
|
|
/// <summary>vtoc inclusions from AT&T SVr4</summary>
|
|
|
|
|
public dk_vtoc16 dkl_vtoc;
|
|
|
|
|
/// <summary># of physical cylinders</summary>
|
|
|
|
|
public uint dkl_pcyl;
|
|
|
|
|
/// <summary># of data cylinders</summary>
|
|
|
|
|
public uint dkl_ncyl;
|
|
|
|
|
/// <summary># of alternate cylinders</summary>
|
|
|
|
|
public ushort dkl_acyl;
|
|
|
|
|
/// <summary>cyl offset (for fixed head area)</summary>
|
|
|
|
|
public ushort dkl_bcyl;
|
|
|
|
|
/// <summary># of heads</summary>
|
|
|
|
|
public uint dkl_nhead;
|
|
|
|
|
/// <summary># of data sectors per track</summary>
|
|
|
|
|
public uint dkl_nsect;
|
|
|
|
|
/// <summary>interleave factor</summary>
|
|
|
|
|
public ushort dkl_intrlv;
|
|
|
|
|
/// <summary>skew factor</summary>
|
|
|
|
|
public ushort dkl_skew;
|
|
|
|
|
/// <summary>alternates per cyl (SCSI only) </summary>
|
|
|
|
|
public ushort dkl_apc;
|
|
|
|
|
/// <summary>revolutions per minute</summary>
|
|
|
|
|
public ushort dkl_rpm;
|
|
|
|
|
/// <summary># sectors to skip, writes</summary>
|
|
|
|
|
public ushort dkl_write_reinstruct;
|
|
|
|
|
/// <summary># sectors to skip, reads </summary>
|
|
|
|
|
public ushort dkl_read_reinstruct;
|
|
|
|
|
/// <summary>for compatible expansion</summary>
|
|
|
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
|
|
|
|
|
public ushort[] dkl_extra;
|
|
|
|
|
/// <summary>unused part of 512 bytes</summary>
|
|
|
|
|
[MarshalAs(UnmanagedType.ByValArray, SizeConst = LEN_DKL_PAD16)]
|
|
|
|
|
public byte[] dkl_pad;
|
|
|
|
|
/// <summary>identifies this label format</summary>
|
|
|
|
|
public ushort dkl_magic;
|
|
|
|
|
/// <summary>xor checksum of sector</summary>
|
|
|
|
|
public ushort dkl_cksum;
|
2016-02-05 05:39:15 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|