diff --git a/DiscImageChef.Filesystems/ChangeLog b/DiscImageChef.Filesystems/ChangeLog index c0d6cd0c6..e299086d2 100644 --- a/DiscImageChef.Filesystems/ChangeLog +++ b/DiscImageChef.Filesystems/ChangeLog @@ -1,3 +1,11 @@ +2016-02-10 Natalia Portillo + + * FFS.cs: + Added support for superblock offset in Atari UNIX. + + * SysV.cs: + Corrected big endian magic. + 2016-02-05 Natalia Portillo * Acorn.cs: diff --git a/DiscImageChef.Filesystems/FFS.cs b/DiscImageChef.Filesystems/FFS.cs index e3a9ef8b1..fd6ecc81b 100644 --- a/DiscImageChef.Filesystems/FFS.cs +++ b/DiscImageChef.Filesystems/FFS.cs @@ -104,6 +104,15 @@ namespace DiscImageChef.Plugins return true; } + if (imagePlugin.GetSectors() > (partitionStart + sb_start_atari / imagePlugin.GetSectorSize() + sb_size_in_sectors)) + { + ufs_sb_sectors = imagePlugin.ReadSectors(partitionStart + (sb_start_atari / imagePlugin.GetSectorSize()), sb_size_in_sectors); + magic = BigEndianBitConverter.ToUInt32(ufs_sb_sectors, 0x055C); + + if (magic == UFS_MAGIC || magic == UFS_MAGIC_BW || magic == UFS2_MAGIC || magic == UFS_CIGAM || magic == UFS_BAD_MAGIC) + return true; + } + return false; } @@ -166,13 +175,24 @@ namespace DiscImageChef.Plugins { ufs_sb_sectors = imagePlugin.ReadSectors(partitionStart + sb_start_piggy * sb_size_in_sectors, sb_size_in_sectors); magic = BigEndianBitConverter.ToUInt32(ufs_sb_sectors, 0x055C); - + if (magic == UFS_MAGIC || magic == UFS_MAGIC_BW || magic == UFS2_MAGIC || magic == UFS_CIGAM || magic == UFS_BAD_MAGIC) sb_offset = partitionStart + sb_start_piggy * sb_size_in_sectors; else magic = 0; } + if (imagePlugin.GetSectors() > (partitionStart + sb_start_atari / imagePlugin.GetSectorSize() + sb_size_in_sectors) && magic == 0) + { + ufs_sb_sectors = imagePlugin.ReadSectors(partitionStart + sb_start_atari / imagePlugin.GetSectorSize(), sb_size_in_sectors); + magic = BigEndianBitConverter.ToUInt32(ufs_sb_sectors, 0x055C); + + if (magic == UFS_MAGIC || magic == UFS_MAGIC_BW || magic == UFS2_MAGIC || magic == UFS_CIGAM || magic == UFS_BAD_MAGIC) + sb_offset = partitionStart + sb_start_atari / imagePlugin.GetSectorSize(); + else + magic = 0; + } + if (magic == 0) { information = "Not a UFS filesystem, I shouldn't have arrived here!"; @@ -734,6 +754,8 @@ namespace DiscImageChef.Plugins const ulong sb_start_ufs1 = 1; // For UFS2, start at offset 65536 const ulong sb_start_ufs2 = 8; + // Atari strange starting for Atari UNIX, in bytes not blocks + const ulong sb_start_atari = 110080; // For piggy devices (?), start at offset 262144 const ulong sb_start_piggy = 32; diff --git a/DiscImageChef.Filesystems/SysV.cs b/DiscImageChef.Filesystems/SysV.cs index 4b1ca0b9f..2976243c1 100644 --- a/DiscImageChef.Filesystems/SysV.cs +++ b/DiscImageChef.Filesystems/SysV.cs @@ -48,7 +48,7 @@ namespace DiscImageChef.Plugins const UInt32 XENIX_MAGIC = 0x002B5544; const UInt32 XENIX_CIGAM = 0x44552B00; const UInt32 SYSV_MAGIC = 0xFD187E20; - const UInt32 SYSV_CIGAM = 0xFD187E20; + const UInt32 SYSV_CIGAM = 0x207E18FD; // Rest have no magic. // Per a Linux kernel, Coherent fs has following: const string COH_FNAME = "nonamexxxxx "; diff --git a/DiscImageChef.Partitions/Atari.cs b/DiscImageChef.Partitions/Atari.cs index fc7158c4a..83f4e3f43 100644 --- a/DiscImageChef.Partitions/Atari.cs +++ b/DiscImageChef.Partitions/Atari.cs @@ -57,6 +57,10 @@ namespace DiscImageChef.PartPlugins const UInt32 TypeRAW = 0x00524157; const UInt32 TypeNetBSD = 0x004E4244; const UInt32 TypeNetBSDSwap = 0x004E4253; + const UInt32 TypeSysV = 0x00554E58; + const UInt32 TypeMac = 0x004D4143; + const UInt32 TypeMinix = 0x004D4958; + const UInt32 TypeMinix2 = 0x004D4E58; public AtariPartitions() { @@ -139,7 +143,9 @@ namespace DiscImageChef.PartPlugins UInt32 type = table.entries[i].type & 0x00FFFFFF; if (type == TypeGEMDOS || type == TypeBigGEMDOS || type == TypeLinux || - type == TypeSwap || type == TypeRAW || type == TypeNetBSD || type == TypeNetBSDSwap) + type == TypeSwap || type == TypeRAW || type == TypeNetBSD || + type == TypeNetBSDSwap || type == TypeSysV || type == TypeMac || + type == TypeMinix || type == TypeMinix2) { validTable = true; @@ -189,6 +195,16 @@ namespace DiscImageChef.PartPlugins case TypeNetBSDSwap: part.PartitionDescription = "NetBSD swap partition"; break; + case TypeSysV: + part.PartitionDescription = "Atari UNIX partition"; + break; + case TypeMac: + part.PartitionDescription = "Macintosh partition"; + break; + case TypeMinix: + case TypeMinix2: + part.PartitionDescription = "MINIX partition"; + break; default: part.PartitionDescription = "Unknown partition type"; break; @@ -217,7 +233,9 @@ namespace DiscImageChef.PartPlugins UInt32 extendedType = extendedTable.entries[j].type & 0x00FFFFFF; if (extendedType == TypeGEMDOS || extendedType == TypeBigGEMDOS || extendedType == TypeLinux || - extendedType == TypeSwap || extendedType == TypeRAW || extendedType == TypeNetBSD || extendedType == TypeNetBSDSwap) + extendedType == TypeSwap || extendedType == TypeRAW || extendedType == TypeNetBSD || + extendedType == TypeNetBSDSwap || extendedType == TypeSysV || extendedType == TypeMac || + extendedType == TypeMinix || extendedType == TypeMinix2) { validTable = true; if (extendedTable.entries[j].start <= imagePlugin.GetSectors()) @@ -266,6 +284,16 @@ namespace DiscImageChef.PartPlugins case TypeNetBSDSwap: part.PartitionDescription = "NetBSD swap partition"; break; + case TypeSysV: + part.PartitionDescription = "Atari UNIX partition"; + break; + case TypeMac: + part.PartitionDescription = "Macintosh partition"; + break; + case TypeMinix: + case TypeMinix2: + part.PartitionDescription = "MINIX partition"; + break; default: part.PartitionDescription = "Unknown partition type"; break; @@ -286,7 +314,9 @@ namespace DiscImageChef.PartPlugins UInt32 type = table.icdEntries[i].type & 0x00FFFFFF; if (type == TypeGEMDOS || type == TypeBigGEMDOS || type == TypeLinux || - type == TypeSwap || type == TypeRAW || type == TypeNetBSD || type == TypeNetBSDSwap) + type == TypeSwap || type == TypeRAW || type == TypeNetBSD || + type == TypeNetBSDSwap || type == TypeSysV || type == TypeMac || + type == TypeMinix || type == TypeMinix2) { if (table.icdEntries[i].start <= imagePlugin.GetSectors()) { @@ -334,6 +364,16 @@ namespace DiscImageChef.PartPlugins case TypeNetBSDSwap: part.PartitionDescription = "NetBSD swap partition"; break; + case TypeSysV: + part.PartitionDescription = "Atari UNIX partition"; + break; + case TypeMac: + part.PartitionDescription = "Macintosh partition"; + break; + case TypeMinix: + case TypeMinix2: + part.PartitionDescription = "MINIX partition"; + break; default: part.PartitionDescription = "Unknown partition type"; break; diff --git a/DiscImageChef.Partitions/ChangeLog b/DiscImageChef.Partitions/ChangeLog index 98b16888f..9fc506e12 100644 --- a/DiscImageChef.Partitions/ChangeLog +++ b/DiscImageChef.Partitions/ChangeLog @@ -1,3 +1,8 @@ +2016-02-10 Natalia Portillo + + * Atari.cs: + Added support for Atari UNIX, MINIX and HFS partitions. + 2016-02-05 Natalia Portillo * GPT.cs: