diff --git a/DiscImageChef.Filesystems/ChangeLog b/DiscImageChef.Filesystems/ChangeLog index b110daca..67fa6e53 100644 --- a/DiscImageChef.Filesystems/ChangeLog +++ b/DiscImageChef.Filesystems/ChangeLog @@ -1,3 +1,7 @@ +2016-08-03 Natalia Portillo + + * SysV.cs: Corrected XENIX 3 superblock information. + 2016-08-01 Natalia Portillo * AssemblyInfo.cs: diff --git a/DiscImageChef.Filesystems/SysV.cs b/DiscImageChef.Filesystems/SysV.cs index 68ba6ec3..86526c48 100644 --- a/DiscImageChef.Filesystems/SysV.cs +++ b/DiscImageChef.Filesystems/SysV.cs @@ -124,7 +124,7 @@ namespace DiscImageChef.Filesystems if(magic == SYSV_MAGIC || magic == SYSV_CIGAM) return true; - magic = BitConverter.ToUInt32(sb_sector, 0x1F0); // Old XENIX magic location + magic = BitConverter.ToUInt32(sb_sector, 0x1F0); // XENIX 3 magic location if(magic == XENIX_MAGIC || magic == XENIX_CIGAM) return true; @@ -183,7 +183,7 @@ namespace DiscImageChef.Filesystems bool sysvr4 = false; bool sys7th = false; bool coherent = false; - bool xenixOld = false; + bool xenix3 = false; byte[] sb_sector; byte sb_size_in_sectors; @@ -211,18 +211,18 @@ namespace DiscImageChef.Filesystems break; } - magic = BigEndianBitConverter.ToUInt32(sb_sector, 0x1F0); // Old XENIX magic location + magic = BigEndianBitConverter.ToUInt32(sb_sector, 0x1F0); // XENIX 3 magic location if(magic == XENIX_MAGIC) { BigEndianBitConverter.IsLittleEndian = true; // Little endian - xenixOld = true; + xenix3 = true; break; } if(magic == XENIX_CIGAM) { BigEndianBitConverter.IsLittleEndian = false; // Big endian - xenixOld = true; + xenix3 = true; break; } @@ -283,28 +283,28 @@ namespace DiscImageChef.Filesystems } } } - if(!sys7th && !sysv && !coherent && !xenix && !xenixOld) + if(!sys7th && !sysv && !coherent && !xenix && !xenix3) return; xmlFSType = new Schemas.FileSystemType(); - if(xenix || xenixOld) + if(xenix || xenix3) { byte[] xenix_strings = new byte[6]; XenixSuperBlock xnx_sb = new XenixSuperBlock(); sb_sector = imagePlugin.ReadSectors((ulong)start + partitionStart, sb_size_in_sectors); - if(xenixOld) + if(xenix3) { xnx_sb.s_isize = BigEndianBitConverter.ToUInt16(sb_sector, 0x000); xnx_sb.s_fsize = BigEndianBitConverter.ToUInt32(sb_sector, 0x002); xnx_sb.s_nfree = BigEndianBitConverter.ToUInt16(sb_sector, 0x006); - xnx_sb.s_ninode = BigEndianBitConverter.ToUInt16(sb_sector, 0x12C); + xnx_sb.s_ninode = BigEndianBitConverter.ToUInt16(sb_sector, 0x0D0); xnx_sb.s_flock = sb_sector[0x19A]; xnx_sb.s_ilock = sb_sector[0x19B]; xnx_sb.s_fmod = sb_sector[0x19C]; xnx_sb.s_ronly = sb_sector[0x19D]; - xnx_sb.s_time = BigEndianBitConverter.ToUInt32(sb_sector, 0x19E); + xnx_sb.s_time = BigEndianBitConverter.ToInt32(sb_sector, 0x19E); xnx_sb.s_tfree = BigEndianBitConverter.ToUInt32(sb_sector, 0x1A2); xnx_sb.s_tinode = BigEndianBitConverter.ToUInt16(sb_sector, 0x1A6); xnx_sb.s_cylblks = BigEndianBitConverter.ToUInt16(sb_sector, 0x1A8); @@ -329,7 +329,7 @@ namespace DiscImageChef.Filesystems xnx_sb.s_ilock = sb_sector[0x263]; xnx_sb.s_fmod = sb_sector[0x264]; xnx_sb.s_ronly = sb_sector[0x265]; - xnx_sb.s_time = BigEndianBitConverter.ToUInt32(sb_sector, 0x266); + xnx_sb.s_time = BigEndianBitConverter.ToInt32(sb_sector, 0x266); xnx_sb.s_tfree = BigEndianBitConverter.ToUInt32(sb_sector, 0x26A); xnx_sb.s_tinode = BigEndianBitConverter.ToUInt16(sb_sector, 0x26E); xnx_sb.s_cylblks = BigEndianBitConverter.ToUInt16(sb_sector, 0x270); @@ -394,10 +394,10 @@ namespace DiscImageChef.Filesystems sb.AppendLine("Superblock is being modified"); if(xnx_sb.s_ronly > 0) sb.AppendLine("Volume is mounted read-only"); - sb.AppendFormat("Superblock last updated on {0}", DateHandlers.UNIXUnsignedToDateTime(xnx_sb.s_time)).AppendLine(); + sb.AppendFormat("Superblock last updated on {0}", DateHandlers.UNIXToDateTime(xnx_sb.s_time)).AppendLine(); if(xnx_sb.s_time != 0) { - xmlFSType.ModificationDate = DateHandlers.UNIXUnsignedToDateTime(xnx_sb.s_time); + xmlFSType.ModificationDate = DateHandlers.UNIXToDateTime(xnx_sb.s_time); xmlFSType.ModificationDateSpecified = true; } sb.AppendFormat("Volume name: {0}", xnx_sb.s_fname).AppendLine(); @@ -675,46 +675,46 @@ namespace DiscImageChef.Filesystems // the start of the free block list: /// 0x006, blocks in s_free, <=100 public ushort s_nfree; - /// 0x008, 100 entries, first free block list chunk + /// 0x008, 100 entries, 50 entries for Xenix 3, first free block list chunk public uint[] s_free; // the cache of free inodes: - /// 0x198, number of inodes in s_inode, <= 100 + /// 0x198 (0xD0), number of inodes in s_inode, <= 100 public ushort s_ninode; - /// 0x19A, 100 entries, some free inodes + /// 0x19A (0xD2), 100 entries, some free inodes public ushort[] s_inode; - /// 0x262, free block list manipulation lock + /// 0x262 (0x19A), free block list manipulation lock public byte s_flock; - /// 0x263, inode cache manipulation lock + /// 0x263 (0x19B), inode cache manipulation lock public byte s_ilock; - /// 0x264, superblock modification flag + /// 0x264 (0x19C), superblock modification flag public byte s_fmod; - /// 0x265, read-only mounted flag + /// 0x265 (0x19D), read-only mounted flag public byte s_ronly; - /// 0x266, time of last superblock update - public uint s_time; - /// 0x26A, total number of free zones + /// 0x266 (0x19E), time of last superblock update + public int s_time; + /// 0x26A (0x1A2), total number of free zones public uint s_tfree; - /// 0x26E, total number of free inodes + /// 0x26E (0x1A6), total number of free inodes public ushort s_tinode; - /// 0x270, blocks per cylinder + /// 0x270 (0x1A8), blocks per cylinder public ushort s_cylblks; - /// 0x272, blocks per gap + /// 0x272 (0x1AA), blocks per gap public ushort s_gapblks; - /// 0x274, device information ?? + /// 0x274 (0x1AC), device information ?? public ushort s_dinfo0; - /// 0x276, device information ?? + /// 0x276 (0x1AE), device information ?? public ushort s_dinfo1; - /// 0x278, 6 bytes, volume name + /// 0x278 (0x1B0), 6 bytes, volume name public string s_fname; - /// 0x27E, 6 bytes, pack name + /// 0x27E (0x1B6), 6 bytes, pack name public string s_fpack; - /// 0x284, 0x46 if volume is clean + /// 0x284 (0x1BC), 0x46 if volume is clean public byte s_clean; - /// 0x285, 371 bytes + /// 0x285 (0x1BD), 371 bytes, 51 bytes for Xenix 3 public byte[] s_fill; - /// 0x3F8, magic + /// 0x3F8 (0x1F0), magic public uint s_magic; - /// 0x3FC, filesystem type (1 = 512 bytes/blk, 2 = 1024 bytes/blk, 3 = 2048 bytes/blk) + /// 0x3FC (0x1F4), filesystem type (1 = 512 bytes/blk, 2 = 1024 bytes/blk, 3 = 2048 bytes/blk) public uint s_type; }