* 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.
This commit is contained in:
2016-08-21 08:27:43 +01:00
parent 33abf2b0ed
commit 7d845a08cc
18 changed files with 1867 additions and 247 deletions

View File

@@ -32,6 +32,7 @@
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using DiscImageChef.Console;
namespace DiscImageChef.PartPlugins
@@ -52,10 +53,20 @@ namespace DiscImageChef.PartPlugins
SunStand = 0x0006,
SunVar = 0x0007,
SunHome = 0x0008,
SunAlt = 0x0009,
SunCache = 0x000A,
VxVmPublic = 0x000E,
VxVmPrivate = 0x000F,
LinuxSwap = 0x0082,
Linux = 0x0083,
LVM = 0x008E,
LinuxRaid = 0x00FD
LinuxRaid = 0x00FD,
NetBSD = 0x00FF,
FreeBSD_Swap = 0x0901,
FreeBSD_UFS = 0x0902,
FreeBSD_Vinum = 0x0903,
FreeBSD_ZFS = 0x0904,
FreeBSD_NANDFS = 0x0905
}
[Flags]
@@ -255,11 +266,13 @@ namespace DiscImageChef.PartPlugins
}
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct SunDiskLabel
{
/// <summary>
/// Offset 0x000: Informative string, 128 bytes
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)]
public string info;
/// <summary>
/// Offset 0x080: Volume Table Of Contents
@@ -276,6 +289,7 @@ namespace DiscImageChef.PartPlugins
/// <summary>
/// Offset 0x110: Unused, 148 bytes
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 148)]
public byte[] spare;
/// <summary>
/// Offset 0x1A4: Rotational speed
@@ -328,6 +342,7 @@ namespace DiscImageChef.PartPlugins
/// <summary>
/// Offset 0x1BC: Partitions
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public SunPartition[] partitions;
/// <summary>
/// Offset 0x1FC:
@@ -339,6 +354,7 @@ namespace DiscImageChef.PartPlugins
public ushort csum;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct SunVTOC
{
/// <summary>
@@ -348,6 +364,7 @@ namespace DiscImageChef.PartPlugins
/// <summary>
/// Offset 0x04: Volume name, 8 bytes
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public string volname;
/// <summary>
/// Offset 0x0C: Number of partitions
@@ -356,6 +373,7 @@ namespace DiscImageChef.PartPlugins
/// <summary>
/// Offset 0x0E: Partition information, 8 entries
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public SunInfo[] infos;
/// <summary>
/// Offset 0x2E: Padding
@@ -364,6 +382,7 @@ namespace DiscImageChef.PartPlugins
/// <summary>
/// Offset 0x30: Information needed by mboot, 3 entries
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
public uint[] bootinfo;
/// <summary>
/// Offset 0x3C: VTOC magic
@@ -372,13 +391,16 @@ namespace DiscImageChef.PartPlugins
/// <summary>
/// Offset 0x40: Reserved, 40 bytes
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 40)]
public byte[] reserved;
/// <summary>
/// Offset 0x68: Partition timestamps, 8 entries
/// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public uint[] timestamp;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct SunInfo
{
/// <summary>
@@ -391,6 +413,7 @@ namespace DiscImageChef.PartPlugins
public ushort flags;
}
[StructLayout(LayoutKind.Sequential, Pack = 1)]
public struct SunPartition
{
/// <summary>