diff --git a/DiscImageChef.Partitions/RDB.cs b/DiscImageChef.Partitions/RDB.cs index da1565521..803183707 100644 --- a/DiscImageChef.Partitions/RDB.cs +++ b/DiscImageChef.Partitions/RDB.cs @@ -93,13 +93,13 @@ namespace DiscImageChef.PartPlugins /// const uint TypeIDFFS2 = 0x444F5307; /// - /// Type ID for Amiga UNIX System V filesystem - /// - const uint TypeIDAMIXSysV = 0x554E4900; - /// /// Type ID for Amiga UNIX boot filesystem /// - const uint TypeIDAMIXBoot = 0x554E4901; + const uint TypeIDAMIXBoot = 0x554E4900; + /// + /// Type ID for Amiga UNIX System V filesystem + /// + const uint TypeIDAMIXSysV = 0x554E4901; /// /// Type ID for Amiga UNIX BSD filesystem /// diff --git a/DiscImageChef.Tests/Filesystems/AFFS.cs b/DiscImageChef.Tests/Filesystems/AFFS.cs new file mode 100644 index 000000000..0b6c4638e --- /dev/null +++ b/DiscImageChef.Tests/Filesystems/AFFS.cs @@ -0,0 +1,1485 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : FAT12.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program 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 General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using System.IO; +using DiscImageChef.CommonTypes; +using DiscImageChef.Filesystems; +using DiscImageChef.Filters; +using DiscImageChef.ImagePlugins; +using NUnit.Framework; + +namespace DiscImageChef.Tests.Filesystems +{ + [TestFixture] + public class FAT12 + { + readonly string[] testfiles = { + // Concurrent DOS 6.00 + "concurrentdos_6.00_dshd.img.lz", "concurrentdos_6.00_mf2dd.img.lz", "concurrentdos_6.00_mf2hd.img.lz", + // DR-DOS 3.40 + "drdos_3.40_dsdd.img.lz", "drdos_3.40_dsdd8.img.lz", "drdos_3.40_dshd.img.lz", "drdos_3.40_mf2dd.img.lz", + "drdos_3.40_mf2hd.img.lz", "drdos_3.40_ssdd.img.lz", "drdos_3.40_ssdd8.img.lz", + // DR-DOS 3.41 + "drdos_3.41_dsdd.img.lz", "drdos_3.41_dsdd8.img.lz", "drdos_3.41_dshd.img.lz", "drdos_3.41_mf2dd.img.lz", + "drdos_3.41_mf2hd.img.lz", "drdos_3.41_ssdd.img.lz", "drdos_3.41_ssdd8.img.lz", + // DR-DOS 5.00 + "drdos_5.00_dsdd.img.lz", "drdos_5.00_dsdd8.img.lz", "drdos_5.00_dshd.img.lz", "drdos_5.00_mf2dd.img.lz", + "drdos_5.00_mf2hd.img.lz", "drdos_5.00_ssdd.img.lz", "drdos_5.00_ssdd8.img.lz", + // DR-DOS 6.00 + "drdos_6.00_dsdd.img.lz", "drdos_6.00_dsdd8.img.lz", "drdos_6.00_dshd.img.lz", "drdos_6.00_mf2dd.img.lz", + "drdos_6.00_mf2ed.img.lz", "drdos_6.00_mf2hd.img.lz", "drdos_6.00_ssdd.img.lz", "drdos_6.00_ssdd8.img.lz", + // DR-DOS 7.02 + "drdos_7.02_dsdd.img.lz", "drdos_7.02_dsdd8.img.lz", "drdos_7.02_dshd.img.lz", "drdos_7.02_mf2dd.img.lz", + "drdos_7.02_mf2ed.img.lz", "drdos_7.02_mf2hd.img.lz", "drdos_7.02_ssdd.img.lz", "drdos_7.02_ssdd8.img.lz", + // DR-DOS 7.03 + "drdos_7.03_dsdd.img.lz", "drdos_7.03_dsdd8.img.lz", "drdos_7.03_dshd.img.lz", "drdos_7.03_mf2dd.img.lz", + "drdos_7.03_mf2ed.img.lz", "drdos_7.03_mf2hd.img.lz", + // DR-DOS 8.00 + "drdos_8.00_dsdd.img.lz", "drdos_8.00_dsdd8.img.lz", "drdos_8.00_dshd.img.lz", "drdos_8.00_mf2dd.img.lz", + "drdos_8.00_mf2ed.img.lz", "drdos_8.00_mf2hd.img.lz", "drdos_8.00_ssdd.img.lz", "drdos_8.00_ssdd8.img.lz", + // MS-DOS 3.30A + "msdos_3.30A_dsdd.img.lz","msdos_3.30A_dsdd8.img.lz","msdos_3.30A_dshd.img.lz","msdos_3.30A_mf2dd.img.lz", + "msdos_3.30A_mf2ed.img.lz","msdos_3.30A_mf2hd.img.lz","msdos_3.30A_ssdd.img.lz","msdos_3.30A_ssdd8.img.lz", + // MS-DOS 3.31 + "msdos_3.31_dsdd.img.lz","msdos_3.31_dsdd8.img.lz","msdos_3.31_dshd.img.lz","msdos_3.31_mf2dd.img.lz", + "msdos_3.31_mf2ed.img.lz","msdos_3.31_mf2hd.img.lz","msdos_3.31_ssdd.img.lz","msdos_3.31_ssdd8.img.lz", + // MS-DOS 4.01 + "msdos_4.01_dsdd.img.lz","msdos_4.01_dsdd8.img.lz","msdos_4.01_dshd.img.lz","msdos_4.01_mf2dd.img.lz", + "msdos_4.01_mf2hd.img.lz","msdos_4.01_ssdd.img.lz","msdos_4.01_ssdd8.img.lz", + // MS-DOS 5.00 + "msdos_5.00_dsdd.img.lz","msdos_5.00_dsdd8.img.lz","msdos_5.00_dshd.img.lz","msdos_5.00_mf2dd.img.lz", + "msdos_5.00_mf2ed.img.lz","msdos_5.00_mf2hd.img.lz","msdos_5.00_ssdd.img.lz","msdos_5.00_ssdd8.img.lz", + // MS-DOS 6.00 + "msdos_6.00_dsdd.img.lz","msdos_6.00_dsdd8.img.lz","msdos_6.00_dshd.img.lz","msdos_6.00_mf2dd.img.lz", + "msdos_6.00_mf2ed.img.lz","msdos_6.00_mf2hd.img.lz","msdos_6.00_ssdd.img.lz","msdos_6.00_ssdd8.img.lz", + // MS-DOS 6.20 + "msdos_6.20_dsdd.img.lz","msdos_6.20_dsdd8.img.lz","msdos_6.20_dshd.img.lz","msdos_6.20_mf2dd.img.lz", + "msdos_6.20_mf2ed.img.lz","msdos_6.20_mf2hd.img.lz","msdos_6.20_ssdd.img.lz","msdos_6.20_ssdd8.img.lz", + // MS-DOS 6.20 RC1 + "msdos_6.20rc1_dsdd.img.lz","msdos_6.20rc1_dsdd8.img.lz","msdos_6.20rc1_dshd.img.lz","msdos_6.20rc1_mf2dd.img.lz", + "msdos_6.20rc1_mf2ed.img.lz","msdos_6.20rc1_mf2hd.img.lz","msdos_6.20rc1_ssdd.img.lz","msdos_6.20rc1_ssdd8.img.lz", + // MS-DOS 6.21 + "msdos_6.21_dsdd.img.lz","msdos_6.21_dsdd8.img.lz","msdos_6.21_dshd.img.lz","msdos_6.21_mf2dd.img.lz", + "msdos_6.21_mf2ed.img.lz","msdos_6.21_mf2hd.img.lz","msdos_6.21_ssdd.img.lz","msdos_6.21_ssdd8.img.lz", + // MS-DOS 6.22 + "msdos_6.22_dsdd.img.lz","msdos_6.22_dsdd8.img.lz","msdos_6.22_dshd.img.lz","msdos_6.22_mf2dd.img.lz", + "msdos_6.22_mf2ed.img.lz","msdos_6.22_mf2hd.img.lz","msdos_6.22_ssdd.img.lz","msdos_6.22_ssdd8.img.lz", + // MS-DOS 7.10 + "msdos_7.10_dsdd.img.lz","msdos_7.10_dsdd8.img.lz","msdos_7.10_dshd.img.lz","msdos_7.10_mf2dd.img.lz", + "msdos_7.10_mf2ed.img.lz","msdos_7.10_mf2hd.img.lz","msdos_7.10_ssdd.img.lz","msdos_7.10_ssdd8.img.lz", + // MS-DOS 3.20 for Amstrad + "msdos_amstrad_3.20_dsdd.img.lz","msdos_amstrad_3.20_dsdd8.img.lz","msdos_amstrad_3.20_dshd.img.lz", + "msdos_amstrad_3.20_mf2dd.img.lz","msdos_amstrad_3.20_ssdd.img.lz","msdos_amstrad_3.20_ssdd8.img.lz", + // MS-DOS 2.11 for AT&T + "msdos_att_2.11_dsdd.img.lz", + // MS-DOS 3.30 for DeLL + "msdos_dell_3.30_dsdd.img.lz","msdos_dell_3.30_dsdd8.img.lz","msdos_dell_3.30_dshd.img.lz", + "msdos_dell_3.30_mf2dd.img.lz","msdos_dell_3.30_mf2hd.img.lz","msdos_dell_3.30_ssdd.img.lz", + "msdos_dell_3.30_ssdd8.img.lz", + // MS-DOS 3.10 for Epson + "msdos_epson_3.10_dsdd.img.lz","msdos_epson_3.10_dsdd8.img.lz","msdos_epson_3.10_dshd.img.lz", + // MS-DOS 3.20 for Epson + "msdos_epson_3.20_dsdd.img.lz","msdos_epson_3.20_dsdd8.img.lz","msdos_epson_3.20_dshd.img.lz", + "msdos_epson_3.20_mf2dd.img.lz","msdos_epson_3.20_ssdd.img.lz","msdos_epson_3.20_ssdd8.img.lz", + // MS-DOS 3.20 for HP + "msdos_hp_3.20_dsdd.img.lz","msdos_hp_3.20_dsdd8.img.lz","msdos_hp_3.20_dshd.img.lz", + "msdos_hp_3.20_mf2dd.img.lz","msdos_hp_3.20_mf2hd.img.lz","msdos_hp_3.20_ssdd.img.lz", + "msdos_hp_3.20_ssdd8.img.lz", + // MS-DOS 3.21 for Hyosung + "msdos_hyonsung_3.21_dsdd.img.lz","msdos_hyonsung_3.21_dsdd8.img.lz","msdos_hyonsung_3.21_dshd.img.lz", + "msdos_hyonsung_3.21_mf2dd.img.lz","msdos_hyonsung_3.21_mf2hd.img.lz","msdos_hyonsung_3.21_ssdd.img.lz", + "msdos_hyonsung_3.21_ssdd8.img.lz", + // MS-DOS 3.21 for Kaypro + "msdos_kaypro_3.21_dsdd.img.lz","msdos_kaypro_3.21_dsdd8.img.lz","msdos_kaypro_3.21_dshd.img.lz", + "msdos_kaypro_3.21_mf2dd.img.lz","msdos_kaypro_3.21_mf2hd.img.lz","msdos_kaypro_3.21_ssdd.img.lz", + //"msdos_kaypro_3.21_ssdd8.img.lz", + // MS-DOS 3.10 for Olivetti + "msdos_olivetti_3.10_dsdd.img.lz","msdos_olivetti_3.10_dshd.img.lz","msdos_olivetti_3.10_ssdd.img.lz", + // MS-DOS 3.30 for Toshiba + "msdos_toshiba_3.30_dsdd.img.lz","msdos_toshiba_3.30_dsdd8.img.lz","msdos_toshiba_3.30_dshd.img.lz", + "msdos_toshiba_3.30_mf2dd.img.lz","msdos_toshiba_3.30_mf2hd.img.lz","msdos_toshiba_3.30_ssdd.img.lz", + "msdos_toshiba_3.30_ssdd8.img.lz", + // MS-DOS 4.01 for Toshiba + "msdos_toshiba_4.01_dsdd.img.lz","msdos_toshiba_4.01_dsdd8.img.lz","msdos_toshiba_4.01_dshd.img.lz", + "msdos_toshiba_4.01_mf2dd.img.lz","msdos_toshiba_4.01_mf2hd.img.lz","msdos_toshiba_4.01_ssdd.img.lz", + "msdos_toshiba_4.01_ssdd8.img.lz", + // Novell DOS 7.00 + "novelldos_7.00_dsdd.img.lz","novelldos_7.00_dsdd8.img.lz","novelldos_7.00_dshd.img.lz","novelldos_7.00_mf2dd.img.lz", + "novelldos_7.00_mf2ed.img.lz","novelldos_7.00_mf2hd.img.lz","novelldos_7.00_ssdd.img.lz","novelldos_7.00_ssdd8.img.lz", + // OpenDOS 7.01 + "opendos_7.01_dsdd.img.lz","opendos_7.01_dsdd8.img.lz","opendos_7.01_dshd.img.lz","opendos_7.01_mf2dd.img.lz", + "opendos_7.01_mf2ed.img.lz","opendos_7.01_mf2hd.img.lz","opendos_7.01_ssdd.img.lz","opendos_7.01_ssdd8.img.lz", + // PC-DOS 2.00 + "pcdos_2.00_dsdd.img.lz", + // PC-DOS 2.10 + "pcdos_2.10_dsdd.img.lz", + // PC-DOS 2000 + "pcdos_2000_dsdd.img.lz","pcdos_2000_dsdd8.img.lz","pcdos_2000_dshd.img.lz","pcdos_2000_mf2dd.img.lz", + "pcdos_2000_mf2ed.img.lz","pcdos_2000_mf2hd.img.lz","pcdos_2000_ssdd.img.lz","pcdos_2000_ssdd8.img.lz", + // PC-DOS 3.00 + "pcdos_3.00_dshd.img.lz", + // PC-DOS 3.10 + "pcdos_3.10_dshd.img.lz", + // PC-DOS 3.30 + "pcdos_3.30_dshd.img.lz","pcdos_3.30_mf2hd.img.lz", + // PC-DOS 4.00 + "pcdos_4.00_dshd.img.lz","pcdos_4.00_mf2hd.img.lz", + // PC-DOS 5.00 + "pcdos_5.00_dsdd.img.lz","pcdos_5.00_dsdd8.img.lz","pcdos_5.00_dshd.img.lz","pcdos_5.00_mf2dd.img.lz", + "pcdos_5.00_mf2ed.img.lz","pcdos_5.00_mf2hd.img.lz","pcdos_5.00_ssdd.img.lz","pcdos_5.00_ssdd8.img.lz", + // PC-DOS 5.02 + "pcdos_5.02_dsdd.img.lz","pcdos_5.02_dsdd8.img.lz","pcdos_5.02_dshd.img.lz","pcdos_5.02_mf2dd.img.lz", + "pcdos_5.02_mf2ed.img.lz","pcdos_5.02_mf2hd.img.lz","pcdos_5.02_ssdd.img.lz","pcdos_5.02_ssdd8.img.lz", + // PC-DOS 6.10 + "pcdos_6.10_dsdd.img.lz","pcdos_6.10_dsdd8.img.lz","pcdos_6.10_dshd.img.lz","pcdos_6.10_mf2dd.img.lz", + "pcdos_6.10_mf2ed.img.lz","pcdos_6.10_mf2hd.img.lz","pcdos_6.10_ssdd.img.lz","pcdos_6.10_ssdd8.img.lz", + // PC-DOS 6.30 + "pcdos_6.30_dsdd.img.lz","pcdos_6.30_dsdd8.img.lz","pcdos_6.30_dshd.img.lz","pcdos_6.30_mf2dd.img.lz", + "pcdos_6.30_mf2ed.img.lz","pcdos_6.30_mf2hd.img.lz","pcdos_6.30_ssdd.img.lz","pcdos_6.30_ssdd8.img.lz", + // mkfs.vfat + "mkfs.vfat_dshd.img.lz","mkfs.vfat_mf2dd.img.lz","mkfs.vfat_mf2ed.img.lz","mkfs.vfat_mf2hd.img.lz", + // mkfs.vfat for Atari + "mkfs.vfat_atari_dshd.img.lz","mkfs.vfat_atari_mf2dd.img.lz","mkfs.vfat_atari_mf2ed.img.lz","mkfs.vfat_atari_mf2hd.img.lz", + // Microsoft OS/2 1.00 for Tandy + "msos2_1.00_tandy_dsdd.img.lz","msos2_1.00_tandy_dshd.img.lz","msos2_1.00_tandy_mf2dd.img.lz","msos2_1.00_tandy_mf2hd.img.lz", + // Microsoft OS/2 1.10 for AST + "msos2_1.10_ast_dsdd.img.lz","msos2_1.10_ast_dshd.img.lz","msos2_1.10_ast_mf2dd.img.lz","msos2_1.10_ast_mf2hd.img.lz", + // Microsoft OS/2 1.10 for Nokia + "msos2_1.10_nokia_dsdd.img.lz","msos2_1.10_nokia_dshd.img.lz","msos2_1.10_nokia_mf2dd.img.lz","msos2_1.10_nokia_mf2hd.img.lz", + // Microsoft OS/2 1.21 + "msos2_1.21_dsdd.img.lz","msos2_1.21_dshd.img.lz","msos2_1.21_mf2dd.img.lz","msos2_1.21_mf2hd.img.lz", + // Microsoft OS/2 1.30.1 + "msos2_1.30.1_dsdd.img.lz","msos2_1.30.1_dshd.img.lz","msos2_1.30.1_mf2dd.img.lz","msos2_1.30.1_mf2ed.img.lz","msos2_1.30.1_mf2hd.img.lz", + // OS/2 1.20 + "os2_1.20_dsdd.img.lz","os2_1.20_dshd.img.lz","os2_1.20_mf2dd.img.lz","os2_1.20_mf2hd.img.lz", + // OS/2 1.30 + "os2_1.30_dsdd.img.lz","os2_1.30_dshd.img.lz","os2_1.30_mf2dd.img.lz","os2_1.30_mf2hd.img.lz", + // OS/2 2.00 + "os2_6.307_dsdd.img.lz","os2_6.307_dshd.img.lz","os2_6.307_mf2dd.img.lz","os2_6.307_mf2ed.img.lz","os2_6.307_mf2hd.img.lz", + // OS/2 2.10 + "os2_6.514_dsdd.img.lz","os2_6.514_dshd.img.lz","os2_6.514_mf2dd.img.lz","os2_6.514_mf2ed.img.lz","os2_6.514_mf2hd.img.lz", + // OS/2 2.11 + "os2_6.617_dsdd.img.lz","os2_6.617_dshd.img.lz","os2_6.617_mf2dd.img.lz","os2_6.617_mf2ed.img.lz","os2_6.617_mf2hd.img.lz", + // OS/2 Warp 3 + "os2_8.162_dshd.img.lz","os2_8.162_mf2dd.img.lz","os2_8.162_mf2ed.img.lz","os2_8.162_mf2hd.img.lz", + // OS/2 Warp 4 + "os2_9.023_dshd.img.lz","os2_9.023_mf2dd.img.lz","os2_9.023_mf2ed.img.lz","os2_9.023_mf2hd.img.lz", + // eComStation + "ecs_dshd.img.lz","ecs_mf2dd.img.lz","ecs_mf2ed.img.lz","ecs_mf2hd.img.lz", + // Windows 95 + "win95_dsdd8.img.lz","win95_dsdd.img.lz","win95_dshd.img.lz","win95_mf2dd.img.lz", + "win95_mf2ed.img.lz","win95_mf2hd.img.lz","win95_ssdd8.img.lz","win95_ssdd.img.lz", + // Windows 95 OSR 2 + "win95osr2_dsdd8.img.lz","win95osr2_dsdd.img.lz","win95osr2_dshd.img.lz","win95osr2_mf2dd.img.lz", + "win95osr2_mf2ed.img.lz","win95osr2_mf2hd.img.lz","win95osr2_ssdd8.img.lz","win95osr2_ssdd.img.lz", + /// Windows 95 OSR 2.1 + "win95osr2.1_dsdd8.img.lz","win95osr2.1_dsdd.img.lz","win95osr2.1_dshd.img.lz","win95osr2.1_mf2dd.img.lz", + "win95osr2.1_mf2ed.img.lz","win95osr2.1_mf2hd.img.lz","win95osr2.1_ssdd8.img.lz","win95osr2.1_ssdd.img.lz", + // Windows 95 OSR 2.5 + "win95osr2.5_dsdd8.img.lz","win95osr2.5_dsdd.img.lz","win95osr2.5_dshd.img.lz","win95osr2.5_mf2dd.img.lz", + "win95osr2.5_mf2ed.img.lz","win95osr2.5_mf2hd.img.lz","win95osr2.5_ssdd8.img.lz","win95osr2.5_ssdd.img.lz", + // Windows 98 + "win98_dsdd8.img.lz","win98_dsdd.img.lz","win98_dshd.img.lz","win98_mf2dd.img.lz", + "win98_mf2ed.img.lz","win98_mf2hd.img.lz","win98_ssdd8.img.lz","win98_ssdd.img.lz", + // Windows 98 Second Edition + "win98se_dsdd8.img.lz","win98se_dsdd.img.lz","win98se_dshd.img.lz","win98se_mf2dd.img.lz", + "win98se_mf2ed.img.lz","win98se_mf2hd.img.lz","win98se_ssdd8.img.lz","win98se_ssdd.img.lz", + // Windows Me + "winme_dsdd.img.lz","winme_dshd.img.lz","winme_mf2dd.img.lz","winme_mf2ed.img.lz","winme_mf2hd.img.lz", + // Windows NT 3.10 + "winnt_3.10_dshd.img.lz","winnt_3.10_mf2dd.img.lz","winnt_3.10_mf2ed.img.lz","winnt_3.10_mf2hd.img.lz", + // Windows NT 3.50 + "winnt_3.50_dshd.img.lz","winnt_3.50_mf2dd.img.lz","winnt_3.50_mf2ed.img.lz","winnt_3.50_mf2hd.img.lz", + // Windows NT 3.51 + "winnt_3.51_dshd.img.lz","winnt_3.51_mf2dd.img.lz","winnt_3.51_mf2ed.img.lz","winnt_3.51_mf2hd.img.lz", + // Windows NT 4.00 + "winnt_4_dsdd.img.lz","winnt_4_dshd.img.lz","winnt_4_mf2dd.img.lz","winnt_4_mf2ed.img.lz", + "winnt_4_mf2hd.img.lz","winnt_4_ssdd.img.lz", + // Windows 2000 + "win2000_dsdd.img.lz","win2000_dshd.img.lz","win2000_mf2dd.img.lz","win2000_mf2ed.img.lz","win2000_mf2hd.img.lz", + // Windows Vista + "winvista_dsdd.img.lz","winvista_dshd.img.lz","winvista_mf2dd.img.lz","winvista_mf2ed.img.lz","winvista_mf2hd.img.lz", + // BeOS R4.5 + "beos_r4.5_mf2hd.img.lz", + }; + + readonly MediaType[] mediatypes = { + // Concurrent DOS 6.00 + MediaType.DOS_525_HD, MediaType.DOS_35_DS_DD_9, MediaType.DOS_35_HD, + // DR-DOS 3.40 + MediaType.DOS_525_DS_DD_9, MediaType.DOS_525_DS_DD_8, MediaType.DOS_525_HD, MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_HD, MediaType.DOS_525_SS_DD_9, MediaType.DOS_525_SS_DD_8, + // DR-DOS 3.41 + MediaType.DOS_525_DS_DD_9, MediaType.DOS_525_DS_DD_8, MediaType.DOS_525_HD, MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_HD, MediaType.DOS_525_SS_DD_9, MediaType.DOS_525_SS_DD_8, + // DR-DOS 5.00 + MediaType.DOS_525_DS_DD_9, MediaType.DOS_525_DS_DD_8, MediaType.DOS_525_HD, MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_HD, MediaType.DOS_525_SS_DD_9, MediaType.DOS_525_SS_DD_8, + // DR-DOS 6.00 + MediaType.DOS_525_DS_DD_9, MediaType.DOS_525_DS_DD_8, MediaType.DOS_525_HD, MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_ED, MediaType.DOS_35_HD, MediaType.DOS_525_SS_DD_9, MediaType.DOS_525_SS_DD_8, + // DR-DOS 7.02 + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_ED,MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_9,MediaType.DOS_525_SS_DD_8, + // DR-DOS 7.03 + MediaType.DOS_525_DS_DD_9, MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_ED,MediaType.DOS_35_HD, + // DR-DOS 8.00 + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_ED,MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_9,MediaType.DOS_525_SS_DD_8, + // MS-DOS 3.30A + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_ED,MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_9,MediaType.DOS_525_SS_DD_8, + // MS-DOS 3.31 + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_ED,MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_9,MediaType.DOS_525_SS_DD_8, + // MS-DOS 4.01 + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_9,MediaType.DOS_525_SS_DD_8, + // MS-DOS 5.00 + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_ED,MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_9,MediaType.DOS_525_SS_DD_8, + // MS-DOS 6.00 + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_ED,MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_9,MediaType.DOS_525_SS_DD_8, + // MS-DOS 6.20 + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_ED,MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_9,MediaType.DOS_525_SS_DD_8, + // MS-DOS 6.20 RC1 + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_ED,MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_9,MediaType.DOS_525_SS_DD_8, + // MS-DOS 6.21 + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_ED,MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_9,MediaType.DOS_525_SS_DD_8, + // MS-DOS 6.22 + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_ED,MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_9,MediaType.DOS_525_SS_DD_8, + // MS-DOS 7.10 + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_ED,MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_9,MediaType.DOS_525_SS_DD_8, + // MS-DOS 3.20 for Amstrad + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_525_SS_DD_9,MediaType.DOS_525_SS_DD_8, + // MS-DOS 2.11 for AT&T + MediaType.DOS_525_DS_DD_9, + // MS-DOS 3.30 for DeLL + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_9,MediaType.DOS_525_SS_DD_8, + // MS-DOS 3.10 for Epson + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_HD, + // MS-DOS 3.20 for Epson + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_525_SS_DD_9,MediaType.DOS_525_SS_DD_8, + // MS-DOS 3.20 for HP + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_9,MediaType.DOS_525_SS_DD_8, + // MS-DOS 3.21 for Hyosung + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_9,MediaType.DOS_525_SS_DD_8, + // MS-DOS 3.21 for Kaypro + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_9,MediaType.DOS_525_SS_DD_8, + // MS-DOS 3.10 for Olivetti + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_HD,MediaType.DOS_525_SS_DD_9, + // MS-DOS 3.30 for Toshiba + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_9,MediaType.DOS_525_SS_DD_8, + // MS-DOS 4.01 for Toshiba + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_9,MediaType.DOS_525_SS_DD_8, + // Novell DOS 7.00 + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_ED,MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_9,MediaType.DOS_525_SS_DD_8, + // OpenDOS 7.01 + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_ED,MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_9,MediaType.DOS_525_SS_DD_8, + // PC-DOS 2.00 + MediaType.DOS_525_DS_DD_9, + // PC-DOS 2.10 + MediaType.DOS_525_DS_DD_9, + // PC-DOS 2000 + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_ED,MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_9,MediaType.DOS_525_SS_DD_8, + // PC-DOS 3.00 + MediaType.DOS_525_HD, + // PC-DOS 3.10 + MediaType.DOS_525_HD, + // PC-DOS 3.30 + MediaType.DOS_525_HD,MediaType.DOS_35_HD, + // PC-DOS 4.00 + MediaType.DOS_525_HD,MediaType.DOS_35_HD, + // PC-DOS 5.00 + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_ED,MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_9,MediaType.DOS_525_SS_DD_8, + // PC-DOS 5.02 + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_ED,MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_9,MediaType.DOS_525_SS_DD_8, + // PC-DOS 6.10 + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_ED,MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_9,MediaType.DOS_525_SS_DD_8, + // PC-DOS 6.30 + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_ED,MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_9,MediaType.DOS_525_SS_DD_8, + // mkfs.vfat + MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_ED,MediaType.DOS_35_HD, + // mkfs.vfat for Atari + MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_ED,MediaType.DOS_35_HD, + // Microsoft OS/2 1.00 for Tandy + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_HD, + // Microsoft OS/2 1.10 for AST + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_HD, + // Microsoft OS/2 1.10 for Nokia + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_HD, + // Microsoft OS/2 1.21 + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_HD, + // Microsoft OS/2 1.30.1 + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_ED,MediaType.DOS_35_HD, + // OS/2 1.20 + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_HD, + // OS/2 1.30 + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_HD, + // OS/2 2.00 + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_ED,MediaType.DOS_35_HD, + // OS/2 2.10 + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_ED,MediaType.DOS_35_HD, + // OS/2 2.11 + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_ED,MediaType.DOS_35_HD, + // OS/2 Warp 3 + MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_ED,MediaType.DOS_35_HD, + // OS/2 Warp 4 + MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_ED,MediaType.DOS_35_HD, + // eComStation + MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_ED,MediaType.DOS_35_HD, + // Windows 95 + MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_ED,MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_8,MediaType.DOS_525_SS_DD_9, + // Windows 95 OSR 2 + MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_ED,MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_8,MediaType.DOS_525_SS_DD_9, + /// Windows 95 OSR 2.1 + MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_ED,MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_8,MediaType.DOS_525_SS_DD_9, + // Windows 95 OSR 2.5 + MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_ED,MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_8,MediaType.DOS_525_SS_DD_9, + // Windows 98 + MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_ED,MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_8,MediaType.DOS_525_SS_DD_9, + // Windows 98 Second Edition + MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_ED,MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_8,MediaType.DOS_525_SS_DD_9, + // Windows Me + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_ED,MediaType.DOS_35_HD, + // Windows NT 3.10 + MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_ED,MediaType.DOS_35_HD, + // Windows NT 3.50 + MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_ED,MediaType.DOS_35_HD, + // Windows NT 3.51 + MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_ED,MediaType.DOS_35_HD, + // Windows NT 4.00 + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_ED, + MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_9, + // Windows 2000 + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_ED,MediaType.DOS_35_HD, + // Windows Vista + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_ED,MediaType.DOS_35_HD, + // BeOS R4.5 + MediaType.DOS_35_HD, + }; + + readonly ulong[] sectors = { + // Concurrent DOS 6.00 + 2400, 1440, 2880, + // DR-DOS 3.40 + 720, 640, 2400, 1440, 2880, 360, 320, + // DR-DOS 3.41 + 720,640,2400,1440,2880,360,320, + // DR-DOS 5.00 + 720,640,2400,1440,2880,360,320, + // DR-DOS 6.00 + 720,640,2400,1440,5760,2880,360,320, + // DR-DOS 7.02 + 720,640,2400,1440,5760,2880,360,320, + // DR-DOS 7.03 + 720,640,2400,1440,5760,2880, + // DR-DOS 8.00 + 720,640,2400,1440,5760,2880,360,320, + // MS-DOS 3.30A + 720,640,2400,1440,5760,2880,360,320, + // MS-DOS 3.31 + 720,640,2400,1440,5760,2880,360,320, + // MS-DOS 4.01 + 720,640,2400,1440,2880,360,320, + // MS-DOS 5.00 + 720,640,2400,1440,5760,2880,360,320, + // MS-DOS 6.00 + 720,640,2400,1440,5760,2880,360,320, + // MS-DOS 6.20 + 720,640,2400,1440,5760,2880,360,320, + // MS-DOS 6.20 RC1 + 720,640,2400,1440,5760,2880,360,320, + // MS-DOS 6.21 + 720,640,2400,1440,5760,2880,360,320, + // MS-DOS 6.22 + 720,640,2400,1440,5760,2880,360,320, + // MS-DOS 7.10 + 720,640,2400,1440,5760,2880,360,320, + // MS-DOS 3.20 for Amstrad + 720,640,2400,1440,360,320, + // MS-DOS 2.11 for AT&T + 720, + // MS-DOS 3.30 for DeLL + 720,640,2400,1440,2880,360,320, + // MS-DOS 3.10 for Epson + 720,640,2400, + // MS-DOS 3.20 for Epson + 720,640,2400,1440,360,320, + // MS-DOS 3.20 for HP + 720,640,2400,1440,2880,360,320, + // MS-DOS 3.21 for Hyosung + 720,640,2400,1440,2880,360,320, + // MS-DOS 3.21 for Kaypro + 720,640,2400,1440,2880,360,320, + // MS-DOS 3.10 for Olivetti + 720,2400,360, + // MS-DOS 3.30 for Toshiba + 720,640,2400,1440,2880,360,320, + // MS-DOS 4.01 for Toshiba + 720,640,2400,1440,2880,360,320, + // Novell DOS 7.00 + 720,640,2400,1440,5760,2880,360,320, + // OpenDOS 7.01 + 720,640,2400,1440,5760,2880,360,320, + // PC-DOS 2.00 + 720, + // PC-DOS 2.10 + 720, + // PC-DOS 2000 + 720,640,2400,1440,5760,2880,360,320, + // PC-DOS 3.00 + 2400, + // PC-DOS 3.10 + 2400, + // PC-DOS 3.30 + 2400,2880, + // PC-DOS 4.00 + 2400,2880, + // PC-DOS 5.00 + 720,640,2400,1440,5760,2880,360,320, + // PC-DOS 5.02 + 720,640,2400,1440,5760,2880,360,320, + // PC-DOS 6.10 + 720,640,2400,1440,5760,2880,360,320, + // PC-DOS 6.30 + 720,640,2400,1440,5760,2880,360,320, + // mkfs.vfat + 2400,1440,5760,2880, + // mkfs.vfat for Atari + 2400,1440,5760,2880, + // Microsoft OS/2 1.00 for Tandy + 720,2400,1440,2880, + // Microsoft OS/2 1.10 for AST + 720,2400,1440,2880, + // Microsoft OS/2 1.10 for Nokia + 720,2400,1440,2880, + // Microsoft OS/2 1.21 + 720,2400,1440,2880, + // Microsoft OS/2 1.30.1 + 720,2400,1440,5760,2880, + // OS/2 1.20 + 720,2400,1440,2880, + // OS/2 1.30 + 720,2400,1440,2880, + // OS/2 2.00 + 720,2400,1440,5760,2880, + // OS/2 2.10 + 720,2400,1440,5760,2880, + // OS/2 2.11 + 720,2400,1440,5760,2880, + // OS/2 Warp 3 + 2400,1440,5760,2880, + // OS/2 Warp 4 + 2400,1440,5760,2880, + // eComStation + 2400,1440,5760,2880, + // Windows 95 + 640,720,2400,1440,5760,2880,320,360, + // Windows 95 OSR 2 + 640,720,2400,1440,5760,2880,320,360, + /// Windows 95 OSR 2.1 + 640,720,2400,1440,5760,2880,320,360, + // Windows 95 OSR 2.5 + 640,720,2400,1440,5760,2880,320,360, + // Windows 98 + 640,720,2400,1440,5760,2880,320,360, + // Windows 98 Second Edition + 640,720,2400,1440,5760,2880,320,360, + // Windows Me + 720,2400,1440,5760,2880, + // Windows NT 3.10 + 2400,1440,5760,2880, + // Windows NT 3.50 + 2400,1440,5760,2880, + // Windows NT 3.51 + 2400,1440,5760,2880, + // Windows NT 4.00 + 720,2400,1440,5760,2880,360, + // Windows 2000 + 720,2400,1440,5760,2880, + // Windows Vista + 720,2400,1440,5760,2880, + // BeOS R4.5 + 2880, + }; + + readonly uint[] sectorsize = { + // Concurrent DOS 6.00 + 512, 512, 512, + // DR-DOS 3.40 + 512, 512, 512, 512, 512, 512, 512, + // DR-DOS 3.41 + 512,512,512,512,512,512,512, + // DR-DOS 5.00 + 512,512,512,512,512,512,512, + // DR-DOS 6.00 + 512,512,512,512,512,512,512,512, + // DR-DOS 7.02 + 512,512,512,512,512,512,512,512, + // DR-DOS 7.03 + 512,512,512,512,512,512, + // DR-DOS 8.00 + 512,512,512,512,512,512,512,512, + // MS-DOS 3.30A + 512,512,512,512,512,512,512,512, + // MS-DOS 3.31 + 512,512,512,512,512,512,512,512, + // MS-DOS 4.01 + 512,512,512,512,512,512,512, + // MS-DOS 5.00 + 512,512,512,512,512,512,512,512, + // MS-DOS 6.00 + 512,512,512,512,512,512,512,512, + // MS-DOS 6.20 + 512,512,512,512,512,512,512,512, + // MS-DOS 6.20 RC1 + 512,512,512,512,512,512,512,512, + // MS-DOS 6.21 + 512,512,512,512,512,512,512,512, + // MS-DOS 6.22 + 512,512,512,512,512,512,512,512, + // MS-DOS 7.10 + 512,512,512,512,512,512,512,512, + // MS-DOS 3.20 for Amstrad + 512,512,512,512,512,512, + // MS-DOS 2.11 for AT&T + 512, + // MS-DOS 3.30 for DeLL + 512,512,512,512,512,512,512, + // MS-DOS 3.10 for Epson + 512,512,512, + // MS-DOS 3.20 for Epson + 512,512,512,512,512,512, + // MS-DOS 3.20 for HP + 512,512,512,512,512,512,512, + // MS-DOS 3.21 for Hyosung + 512,512,512,512,512,512,512, + // MS-DOS 3.21 for Kaypro + 512,512,512,512,512,512,512, + // MS-DOS 3.10 for Olivetti + 512,512,512, + // MS-DOS 3.30 for Toshiba + 512,512,512,512,512,512,512, + // MS-DOS 4.01 for Toshiba + 512,512,512,512,512,512,512, + // Novell DOS 7.00 + 512,512,512,512,512,512,512,512, + // OpenDOS 7.01 + 512,512,512,512,512,512,512,512, + // PC-DOS 2.00 + 512, + // PC-DOS 2.10 + 512, + // PC-DOS 2000 + 512,512,512,512,512,512,512,512, + // PC-DOS 3.00 + 512, + // PC-DOS 3.10 + 512, + // PC-DOS 3.30 + 512,512, + // PC-DOS 4.00 + 512,512, + // PC-DOS 5.00 + 512,512,512,512,512,512,512,512, + // PC-DOS 5.02 + 512,512,512,512,512,512,512,512, + // PC-DOS 6.10 + 512,512,512,512,512,512,512,512, + // PC-DOS 6.30 + 512,512,512,512,512,512,512,512, + // mkfs.vfat + 512,512,512,512, + // mkfs.vfat for Atari + 512,512,512,512, + // Microsoft OS/2 1.00 for Tandy + 512,512,512,512, + // Microsoft OS/2 1.10 for AST + 512,512,512,512, + // Microsoft OS/2 1.10 for Nokia + 512,512,512,512, + // Microsoft OS/2 1.21 + 512,512,512,512, + // Microsoft OS/2 1.30.1 + 512,512,512,512,512, + // OS/2 1.20 + 512,512,512,512, + // OS/2 1.30 + 512,512,512,512, + // OS/2 2.00 + 512,512,512,512,512, + // OS/2 2.10 + 512,512,512,512,512, + // OS/2 2.11 + 512,512,512,512,512, + // OS/2 Warp 3 + 512,512,512,512, + // OS/2 Warp 4 + 512,512,512,512, + // eComStation + 512,512,512,512, + // Windows 95 + 512,512,512,512,512,512,512,512, + // Windows 95 OSR 2 + 512,512,512,512,512,512,512,512, + /// Windows 95 OSR 2.1 + 512,512,512,512,512,512,512,512, + // Windows 95 OSR 2.5 + 512,512,512,512,512,512,512,512, + // Windows 98 + 512,512,512,512,512,512,512,512, + // Windows 98 Second Edition + 512,512,512,512,512,512,512,512, + // Windows Me + 512,512,512,512,512, + // Windows NT 3.10 + 512,512,512,512, + // Windows NT 3.50 + 512,512,512,512, + // Windows NT 3.51 + 512,512,512,512, + // Windows NT 4.00 + 512,512,512,512,512,512, + // Windows 2000 + 512,512,512,512,512, + // Windows Vista + 512,512,512,512,512, + // BeOS R4.5 + 512, + }; + + readonly long[] clusters = { + // Concurrent DOS 6.00 + 2400, 720, 2880, + // DR-DOS 3.40 + 360,320,2400,720,2880,360,320, + // DR-DOS 3.41 + 360,320,2400,720,2880,360,320, + // DR-DOS 5.00 + 360,320,2400,720,2880,360,320, + // DR-DOS 6.00 + 360,320,2400,720,2880,2880,360,320, + // DR-DOS 7.02 + 360,320,2400,720,2880,2880,360,320, + // DR-DOS 7.03 + 360,320,2400,720,2880,2880, + // DR-DOS 8.00 + 360,320,2400,720,2880,2880,360,320, + // MS-DOS 3.30A + 360,320,2400,720,5760,2880,360,320, + // MS-DOS 3.31 + 360,320,2400,720,5760,2880,360,320, + // MS-DOS 4.01 + 360,320,2400,720,2880,360,320, + // MS-DOS 5.00 + 360,320,2400,720,2880,2880,360,320, + // MS-DOS 6.00 + 360,320,2400,720,2880,2880,360,320, + // MS-DOS 6.20 + 360,320,2400,720,2880,2880,360,320, + // MS-DOS 6.20 RC1 + 360,320,2400,720,2880,2880,360,320, + // MS-DOS 6.21 + 360,320,2400,720,2880,2880,360,320, + // MS-DOS 6.22 + 360,320,2400,720,2880,2880,360,320, + // MS-DOS 7.10 + 360,320,2400,720,2880,2880,360,320, + // MS-DOS 3.20 for Amstrad + 360,320,2400,720,360,320, + // MS-DOS 2.11 for AT&T + 360, + // MS-DOS 3.30 for DeLL + 360,320,2400,720,2880,360,320, + // MS-DOS 3.10 for Epson + 360,320,2400, + // MS-DOS 3.20 for Epson + 360,320,2400,720,360,320, + // MS-DOS 3.20 for HP + 360,320,2400,720,2880,360,320, + // MS-DOS 3.21 for Hyosung + 360,320,2400,720,2880,360,320, + // MS-DOS 3.21 for Kaypro + 360,320,2400,720,2880,360,320, + // MS-DOS 3.10 for Olivetti + 360,2400,360, + // MS-DOS 3.30 for Toshiba + 360,320,2400,720,2880,360,320, + // MS-DOS 4.01 for Toshiba + 360,320,2400,720,2880,360,320, + // Novell DOS 7.00 + 360,320,2400,720,2880,2880,360,320, + // OpenDOS 7.01 + 360,320,2400,720,2880,2880,360,320, + // PC-DOS 2.00 + 360, + // PC-DOS 2.10 + 360, + // PC-DOS 2000 + 360,320,2400,720,2880,2880,360,320, + // PC-DOS 3.00 + 2400, + // PC-DOS 3.10 + 2400, + // PC-DOS 3.30 + 2400,2880, + // PC-DOS 4.00 + 2400,2880, + // PC-DOS 5.00 + 360,320,2400,720,2880,2880,360,320, + // PC-DOS 5.02 + 360,320,2400,720,2880,2880,360,320, + // PC-DOS 6.10 + 360,320,2400,720,2880,2880,360,320, + // PC-DOS 6.30 + 360,320,2400,720,2880,2880,360,320, + // mkfs.vfat + 2400,720,2880,2880, + // mkfs.vfat for Atari + 1200,720,2880,1440, + // Microsoft OS/2 1.00 for Tandy + 360,2400,720,2880, + // Microsoft OS/2 1.10 for AST + 360,2400,720,2880, + // Microsoft OS/2 1.10 for Nokia + 360,2400,720,2880, + // Microsoft OS/2 1.21 + 360,2400,720,2880, + // Microsoft OS/2 1.30.1 + 360,2400,720,2880,2880, + // OS/2 1.20 + 360,2400,720,2880, + // OS/2 1.30 + 360,2400,720,2880, + // OS/2 2.00 + 360,2400,720,2880,2880, + // OS/2 2.10 + 360,2400,720,2880,2880, + // OS/2 2.11 + 360,2400,720,2880,2880, + // OS/2 Warp 3 + 2400,720,2880,2880, + // OS/2 Warp 4 + 2400,720,2880,2880, + // eComStation + 2400,720,2880,2880, + // Windows 95 + 320,360,2400,720,2880,2880,320,360, + // Windows 95 OSR 2 + 320,360,2400,720,2880,2880,320,360, + /// Windows 95 OSR 2.1 + 320,360,2400,720,2880,2880,320,360, + // Windows 95 OSR 2.5 + 320,360,2400,720,2880,2880,320,360, + // Windows 98 + 320,360,2400,720,2880,2880,320,360, + // Windows 98 Second Edition + 320,360,2400,720,2880,2880,320,360, + // Windows Me + 360,2400,720,2880,2880, + // Windows NT 3.10 + 2400,720,2880,2880, + // Windows NT 3.50 + 2400,720,2880,2880, + // Windows NT 3.51 + 2400,720,2880,2880, + // Windows NT 4.00 + 360,2400,720,2880,2880,360, + // Windows 2000 + 360,2400,720,2880,2880, + // Windows Vista + 360,2400,720,2880,2880, + // BeOS R4.5 + 2880, + }; + + readonly int[] clustersize = { + // Concurrent DOS 6.00 + 512, 1024, 512, + // DR-DOS 3.40 + 1024,1024,512,1024,512,512,512, + // DR-DOS 3.41 + 1024,1024,512,1024,512,512,512, + // DR-DOS 5.00 + 1024,1024,512,1024,512,512,512, + // DR-DOS 6.00 + 1024,1024,512,1024,1024,512,512,512, + // DR-DOS 7.02 + 1024,1024,512,1024,1024,512,512,512, + // DR-DOS 7.03 + 1024,1024,512,1024,1024,512, + // DR-DOS 8.00 + 1024,1024,512,1024,1024,512,512,512, + // MS-DOS 3.30A + 1024,1024,512,1024,512,512,512,512, + // MS-DOS 3.31 + 1024,1024,512,1024,512,512,512,512, + // MS-DOS 4.01 + 1024,1024,512,1024,512,512,512, + // MS-DOS 5.00 + 1024,1024,512,1024,1024,512,512,512, + // MS-DOS 6.00 + 1024,1024,512,1024,1024,512,512,512, + // MS-DOS 6.20 + 1024,1024,512,1024,1024,512,512,512, + // MS-DOS 6.20 RC1 + 1024,1024,512,1024,1024,512,512,512, + // MS-DOS 6.21 + 1024,1024,512,1024,1024,512,512,512, + // MS-DOS 6.22 + 1024,1024,512,1024,1024,512,512,512, + // MS-DOS 7.10 + 1024,1024,512,1024,1024,512,512,512, + // MS-DOS 3.20 for Amstrad + 1024,1024,512,1024,512,512, + // MS-DOS 2.11 for AT&T + 1024, + // MS-DOS 3.30 for DeLL + 1024,1024,512,1024,512,512,512, + // MS-DOS 3.10 for Epson + 1024,1024,512, + // MS-DOS 3.20 for Epson + 1024,1024,512,1024,512,512, + // MS-DOS 3.20 for HP + 1024,1024,512,1024,512,512,512, + // MS-DOS 3.21 for Hyosung + 1024,1024,512,1024,512,512,512, + // MS-DOS 3.21 for Kaypro + 1024,1024,512,1024,512,512,512, + // MS-DOS 3.10 for Olivetti + 1024,512,512, + // MS-DOS 3.30 for Toshiba + 1024,1024,512,1024,512,512,512, + // MS-DOS 4.01 for Toshiba + 1024,1024,512,1024,512,512,512, + // Novell DOS 7.00 + 1024,1024,512,1024,1024,512,512,512, + // OpenDOS 7.01 + 1024,1024,512,1024,1024,512,512,512, + // PC-DOS 2.00 + 1024, + // PC-DOS 2.10 + 1024, + // PC-DOS 2000 + 1024,1024,512,1024,1024,512,512,512, + // PC-DOS 3.00 + 512, + // PC-DOS 3.10 + 512, + // PC-DOS 3.30 + 512,512, + // PC-DOS 4.00 + 512,512, + // PC-DOS 5.00 + 1024,1024,512,1024,1024,512,512,512, + // PC-DOS 5.02 + 1024,1024,512,1024,1024,512,512,512, + // PC-DOS 6.10 + 1024,1024,512,1024,1024,512,512,512, + // PC-DOS 6.30 + 1024,1024,512,1024,1024,512,512,512, + // mkfs.vfat + 512,1024,1024,512, + // mkfs.vfat for Atari + 1024,1024,1024,1024, + // Microsoft OS/2 1.00 for Tandy + 1024,512,1024,512, + // Microsoft OS/2 1.10 for AST + 1024,512,1024,512, + // Microsoft OS/2 1.10 for Nokia + 1024,512,1024,512, + // Microsoft OS/2 1.21 + 1024,512,1024,512, + // Microsoft OS/2 1.30.1 + 1024,512,1024,1024,512, + // OS/2 1.20 + 1024,512,1024,512, + // OS/2 1.30 + 1024,512,1024,512, + // OS/2 2.00 + 1024,512,1024,1024,512, + // OS/2 2.10 + 1024,512,1024,1024,512, + // OS/2 2.11 + 1024,512,1024,1024,512, + // OS/2 Warp 3 + 512,1024,1024,512, + // OS/2 Warp 4 + 512,1024,1024,512, + // eComStation + 512,1024,1024,512, + // Windows 95 + 1024,1024,512,1024,1024,512,512,512, + // Windows 95 OSR 2 + 1024,1024,512,1024,1024,512,512,512, + /// Windows 95 OSR 2.1 + 1024,1024,512,1024,1024,512,512,512, + // Windows 95 OSR 2.5 + 1024,1024,512,1024,1024,512,512,512, + // Windows 98 + 1024,1024,512,1024,1024,512,512,512, + // Windows 98 Second Edition + 1024,1024,512,1024,1024,512,512,512, + // Windows Me + 1024,512,1024,1024,512, + // Windows NT 3.10 + 512,1024,1024,512, + // Windows NT 3.50 + 512,1024,1024,512, + // Windows NT 3.51 + 512,1024,1024,512, + // Windows NT 4.00 + 1024,512,1024,512,512,512, + // Windows 2000 + 1024,512,1024,1024,512, + // Windows Vista + 1024,512,1024,1024,512, + // BeOS R4.5 + 512, + }; + + readonly string[] volumename = { + // Concurrent DOS 6.00 + null, null, null, + // DR-DOS 3.40 + null, null, null, null, null, null, null, + // DR-DOS 3.41 + null, null, null, null, null, null, null, + // DR-DOS 5.00 + null, null, null, null, null, null, null, + // DR-DOS 6.00 + null, null, null, null, null, null, null, null, + // DR-DOS 7.02 + "VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL", + // DR-DOS 7.03 + "VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL", + // DR-DOS 8.00 + "VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL", + // MS-DOS 3.30A + null, null, null, null, null, null, null,null, + // MS-DOS 3.31 + null, null, null, null, null, null, null,null, + // MS-DOS 4.01 + "VOLUMELABEL",null,"VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL",null, + // MS-DOS 5.00 + "VOLUMELABEL",null,"VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL",null, + // MS-DOS 6.00 + "VOLUMELABEL",null,"VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL",null, + // MS-DOS 6.20 + "VOLUMELABEL",null,"VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL",null, + // MS-DOS 6.20 RC1 + "VOLUMELABEL",null,"VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL",null, + // MS-DOS 6.21 + "VOLUMELABEL",null,"VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL",null, + // MS-DOS 6.22 + "VOLUMELABEL",null,"VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL",null, + // MS-DOS 7.10 + "VOLUMELABEL",null,"VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL",null, + // MS-DOS 3.20 for Amstrad + null,null,null,null,null,null, + // MS-DOS 2.11 for AT&T + null, + // MS-DOS 3.30 for DeLL + null,null,null,null,null,null,null, + // MS-DOS 3.10 for Epson + null,null,null, + // MS-DOS 3.20 for Epson + null,null,null,null,null,null, + // MS-DOS 3.20 for HP + null,null,null,null,null,null,null, + // MS-DOS 3.21 for Hyosung + null,null,null,null,null,null,null, + // MS-DOS 3.21 for Kaypro + null,null,null,null,null,null,null, + // MS-DOS 3.10 for Olivetti + null,null,null, + // MS-DOS 3.30 for Toshiba + null,null,null,null,null,null,null, + // MS-DOS 4.01 for Toshiba + "VOLUMELABEL","NO NAME ","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","NO NAME ", + // Novell DOS 7.00 + "VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL", + // OpenDOS 7.01 + "VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL", + // PC-DOS 2.00 + null, + // PC-DOS 2.10 + null, + // PC-DOS 2000 + "VOLUMELABEL",null,"VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL",null, + // PC-DOS 3.00 + null, + // PC-DOS 3.10 + null, + // PC-DOS 3.30 + null,null, + // PC-DOS 4.00 + "VOLUMELABEL","VOLUMELABEL", + // PC-DOS 5.00 + "VOLUMELABEL",null,"VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL",null, + // PC-DOS 5.02 + "VOLUMELABEL",null,"VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL",null, + // PC-DOS 6.10 + "VOLUMELABEL",null,"VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL",null, + // PC-DOS 6.30 + "VOLUMELABEL",null,"VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL",null, + // mkfs.vfat + "VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL", + // mkfs.vfat for Atari + null,null,null,null, + // Microsoft OS/2 1.00 for Tandy + null,null,null,null, + // Microsoft OS/2 1.10 for AST + null,null,null,null, + // Microsoft OS/2 1.10 for Nokia + null,null,null,null, + // Microsoft OS/2 1.21 + "NO NAME ","NO NAME ","NO NAME ","NO NAME ", + // Microsoft OS/2 1.30.1 + "NO NAME ","NO NAME ","NO NAME ","NO NAME ","NO NAME ", + // OS/2 1.20 + "NO NAME ","NO NAME ","NO NAME ","NO NAME ", + // OS/2 1.30 + "NO NAME ","NO NAME ","NO NAME ","NO NAME ", + // OS/2 2.00 + "NO NAME ","NO NAME ","NO NAME ","NO NAME ","NO NAME ", + // OS/2 2.10 + "NO NAME ","NO NAME ","NO NAME ","NO NAME ","NO NAME ", + // OS/2 2.11 + "NO NAME ","NO NAME ","NO NAME ","NO NAME ","NO NAME ", + // OS/2 Warp 3 + "NO NAME ","NO NAME ","NO NAME ","NO NAME ", + // OS/2 Warp 4 + "NO NAME ","NO NAME ","NO NAME ","NO NAME ", + // eComStation + "NO NAME ","NO NAME ","NO NAME ","NO NAME ", + // Windows 95 + null,"VOLUMELABEL","VOLUMELABEL","VOLUMELABEL", + "VOLUMELABEL","VOLUMELABEL",null,"VOLUMELABEL", + // Windows 95 OSR 2 + null,"VOLUMELABEL","VOLUMELABEL","VOLUMELABEL", + "VOLUMELABEL","VOLUMELABEL",null,"VOLUMELABEL", + /// Windows 95 OSR 2.1 + null,"VOLUMELABEL","VOLUMELABEL","VOLUMELABEL", + "VOLUMELABEL","VOLUMELABEL",null,"VOLUMELABEL", + // Windows 95 OSR 2.5 + null,"VOLUMELABEL","VOLUMELABEL","VOLUMELABEL", + "VOLUMELABEL","VOLUMELABEL",null,"VOLUMELABEL", + // Windows 98 + null,"VOLUMELABEL","VOLUMELABEL","VOLUMELABEL", + "VOLUMELABEL","VOLUMELABEL",null,"VOLUMELABEL", + // Windows 98 Second Edition + null,"VOLUMELABEL","VOLUMELABEL","VOLUMELABEL", + "VOLUMELABEL","VOLUMELABEL",null,"VOLUMELABEL", + // Windows Me + "VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL", + // Windows NT 3.10 + "NO NAME ","NO NAME ","NO NAME ","NO NAME ", + // Windows NT 3.50 + "NO NAME ","NO NAME ","NO NAME ","NO NAME ", + // Windows NT 3.51 + "NO NAME ","NO NAME ","NO NAME ","NO NAME ", + // Windows NT 4.00 + "NO NAME ","NO NAME ","NO NAME ","NO NAME ", + "NO NAME ","NO NAME ", + // Windows 2000 + "NO NAME ","NO NAME ","NO NAME ","NO NAME ","NO NAME ", + // Windows Vista + "NO NAME ","NO NAME ","NO NAME ","NO NAME ","NO NAME ", + // BeOS R4.5 + "NO NAME ", + }; + + readonly string[] volumeserial = { + // Concurrent DOS 6.00 + null, null, null, + // DR-DOS 3.40 + null, null, null, null, null, null, null, + // DR-DOS 3.41 + null, null, null, null, null, null, null, + // DR-DOS 5.00 + null, null, null, null, null, null, null, + // DR-DOS 6.00 + null, null, null, null, null, null, null, null, + // DR-DOS 7.02 + "1BF63C69","1BF70E75","1BF7185F","1BF80C4F","1BF90F1D","1BF82777","1BF72430","1BF72F1E", + // DR-DOS 7.03 + "0C1A2013","0CE22B5B","0CEA1D3E","0CEE102F","0CEE3760","0CEF2739", + // DR-DOS 8.00 + "1BFD1977","1BFD2D3F","1BFD3531","1BFC3231","1BFA1D58","1BFC117D","1BFE0971","1BFE1423", + // MS-DOS 3.30A + null, null, null, null, null, null, null,null, + // MS-DOS 3.31 + null, null, null, null, null, null, null,null, + // MS-DOS 4.01 + "122C190A",null,"2480190A","2D471909","0F5A1908","2F3D190A",null, + // MS-DOS 5.00 + "0B6018F8",null,"1E3518F8","285A18FB","231D18FE","415118FC","316118F8",null, + // MS-DOS 6.00 + "067B18F6",null,"193418F6","1F3A18F5","165318F3","172418F4","234918F6",null, + // MS-DOS 6.20 + "265418ED",null,"0B7018EE","127418F0","137F18F2","364C18F0","185C18EE",null, + // MS-DOS 6.20 RC1 + "064B18EB",null,"192518EB","244C18EA","3C3118E7","344118E9","267E18EB",null, + // MS-DOS 6.21 + "2A41181B",null,"0641181C","3B26181C","082518E2","237118E1","123F181C",null, + // MS-DOS 6.22 + "317C1818",null,"0D3A1819","3C251817","387A1815","185E1817","18231819",null, + // MS-DOS 7.10 + "1156180A",null,"2951180A","3057180B","2B4A1811","344B180C","352D180A",null, + // MS-DOS 3.20 for Amstrad + null,null,null,null,null,null, + // MS-DOS 2.11 for AT&T + null, + // MS-DOS 3.30 for DeLL + null,null,null,null,null,null,null, + // MS-DOS 3.10 for Epson + null,null,null, + // MS-DOS 3.20 for Epson + null,null,null,null,null,null, + // MS-DOS 3.20 for HP + null,null,null,null,null,null,null, + // MS-DOS 3.21 for Hyosung + null,null,null,null,null,null,null, + // MS-DOS 3.21 for Kaypro + null,null,null,null,null,null,null, + // MS-DOS 3.10 for Olivetti + null,null,null, + // MS-DOS 3.30 for Toshiba + null,null,null,null,null,null,null, + // MS-DOS 4.01 for Toshiba + "0B2519E7","163419E7","1E3119E7","133919E9","177419EA","317E19E7","3B7319E7", + // Novell DOS 7.00 + "1BE7254C","1BE73024","1BE7397C","1BE63635","1BE51661","1BE61143","1BE80A5D","1BE8144C", + // OpenDOS 7.01 + "1BE93E2B","1BEA234D","1BEA325D","1BEB294F","1BEC2C2E","1BEC0C5D","1BEA3E60","1BEB0E26", + // PC-DOS 2.00 + null, + // PC-DOS 2.10 + null, + // PC-DOS 2000 + "2634100E",null,"3565100E","3B6B1012","3B2D1013","1D491013","4136100E",null, + // PC-DOS 3.00 + null, + // PC-DOS 3.10 + null, + // PC-DOS 3.30 + null,null, + // PC-DOS 4.00 + "3C240FE3","2E3E0FE1", + // PC-DOS 5.00 + "33260FF9",null,"11550FFA","234F0FFB","2F600FFC","0D550FFC","1D630FFA",null, + // PC-DOS 5.02 + "06231000",null,"1A3E1000","1F3B0FFF","3D750FFD","3F4F0FFE","26471000",null, + // PC-DOS 6.10 + "25551004",null,"3E5F1004","142D1006","17541007","355A1006","0D5E1005",null, + // PC-DOS 6.30 + "2B22100C",null,"3B47100C","0C55100C","1B80100A","0B59100B","0A3A100D",null, + // mkfs.vfat + "20C279B1","20FD9501","2132D70A","2118F1AA", + // mkfs.vfat for Atari + null,null,null,null, + // Microsoft OS/2 1.00 for Tandy + "9C170C15","9BFB0C15","9C13FC15","9BF99C15", + // Microsoft OS/2 1.10 for AST + "66A42C15","67696C15","66DEBC15","66DC4C15", + // Microsoft OS/2 1.10 for Nokia + "676B4C15","67768C15","9C12DC15","66A74C15", + // Microsoft OS/2 1.21 + "9C074C15","66BCFC15","66C1AC15","66C7FC15", + // Microsoft OS/2 1.30.1 + "66C47C15","66CBEC15","9C167C15","9C147C15","9C0FEC15", + // OS/2 1.20 + "5BF5E015","5BE61015","5C26F015","5C376015", + // OS/2 1.30 + "5C418015","5BE20015","5C7F1015","5B83C015", + // OS/2 2.00 + "5C3BD015","5B807015","5BE69015","5C187015","5C390015", + // OS/2 2.10 + "1BFCB414","E6C6C414","E6CCF414","E6AF6414","1C005414", + // OS/2 2.11 + "E6AEB414","1C00D414","1C03B414","E6C90414","E6B6E414", + // OS/2 Warp 3 + "E6AF7414","E6D63414","E6A65414","E6AE6414", + // OS/2 Warp 4 + "E6CD9414","1BFAD414","E6DFF414","E6D4C414", + // eComStation + "E6CA5814","E6CBC814","E6B81814","1C013814", + // Windows 95 + null,"3B360D0D","24240D0D","3C260D11", + "30050D10","275A0D11",null,"3B100D0F", + // Windows 95 OSR 2 + null,"1C5B0D19","11510D19","0F1F0D15", + "40200D17","3D610D14",null,"280B0D19", + /// Windows 95 OSR 2.1 + null,"1F3B0D1C","14470D1C","1C510DE4", + "2E250DE2","10640DE4",null,"2B3E0D1C", + // Windows 95 OSR 2.5 + null,"18190DFB","0A240DFB","1E320DE7", + "33230DE8","125B0DE7",null,"21410DFB", + // Windows 98 + null,"40090E0F","28140E0F","0E620E0A", + "14390E0D","0E081246",null,"30600E10", + // Windows 98 Second Edition + null,"1B550EEC","1B100EEB","08410EE6", + "0E0F0EE8","325D0EE4",null,"13380EEC", + // Windows Me + "2F200F02","103A0F01","2F1C0EFC","21570EFF","07040EFB", + // Windows NT 3.10 + "60EA50BC","6C857D51","4009440C","30761EDC", + // Windows NT 3.50 + "0C478404","7CBEB35B","7C1E8DCB","ECB276AF", + // Windows NT 3.51 + "482D8681","8889C95E","54DE6C39","F47D2516", + // Windows NT 4.00 + "D8CAAC1F","E0BB6D70","C08C3C60","9C44B411", + "4C7DD099","4CD82982", + // Windows 2000 + "4019989C","78F30AF8","E4217DDE","80B3B996","28043527", + // Windows Vista + "3C9F0BD2","3A8E465C","B2EFB822","3C30C632","16DAB07A", + // BeOS R4.5 + "00000000", + }; + + readonly string[] oemid = { + // Concurrent DOS 6.00 + "DIGITAL ", "DIGITAL ", "DIGITAL ", + // DR-DOS 3.40 + "DIGITAL ", "DIGITAL ", "DIGITAL ", "DIGITAL ", "DIGITAL ", "DIGITAL ", "DIGITAL ", + // DR-DOS 3.41 + "DIGITAL ", "DIGITAL ", "DIGITAL ", "DIGITAL ", "DIGITAL ", "DIGITAL ", "DIGITAL ", + // DR-DOS 5.00 + "IBM 3.3", "IBM 3.3", "IBM 3.3", "IBM 3.3", "IBM 3.3", "IBM 3.3", "IBM 3.3", + // DR-DOS 6.00 + "IBM 3.3", "IBM 3.3", "IBM 3.3", "IBM 3.3", "IBM 3.3", "IBM 3.3", "IBM 3.3", "IBM 3.3", + // DR-DOS 7.02 + "DRDOS 7","DRDOS 7","DRDOS 7","DRDOS 7","DRDOS 7","DRDOS 7","DRDOS 7","DRDOS 7", + // DR-DOS 7.03 + "DRDOS 7","DRDOS 7","DRDOS 7","DRDOS 7","DRDOS 7","DRDOS 7", + // DR-DOS 8.00 + "DRDOS 7","DRDOS 7","DRDOS 7","DRDOS 7","DRDOS 7","DRDOS 7","DRDOS 7","DRDOS 7", + // MS-DOS 3.30A + "MSDOS3.3",null,"MSDOS3.3","MSDOS3.3","MSDOS3.3","MSDOS3.3","MSDOS3.3",null, + // MS-DOS 3.31 + "IBM 3.3",null,"IBM 3.3","IBM 3.3","IBM 3.3","IBM 3.3","IBM 3.3",null, + // MS-DOS 4.01 + "MSDOS4.0",null,"MSDOS4.0","MSDOS4.0","MSDOS4.0","MSDOS4.0",null, + // MS-DOS 5.00 + "MSDOS5.0",null,"MSDOS5.0","MSDOS5.0","MSDOS5.0","MSDOS5.0","MSDOS5.0",null, + // MS-DOS 6.00 + "MSDOS5.0",null,"MSDOS5.0","MSDOS5.0","MSDOS5.0","MSDOS5.0","MSDOS5.0",null, + // MS-DOS 6.20 + "MSDOS5.0",null,"MSDOS5.0","MSDOS5.0","MSDOS5.0","MSDOS5.0","MSDOS5.0",null, + // MS-DOS 6.20 RC1 + "MSDOS5.0",null,"MSDOS5.0","MSDOS5.0","MSDOS5.0","MSDOS5.0","MSDOS5.0",null, + // MS-DOS 6.21 + "MSDOS5.0",null,"MSDOS5.0","MSDOS5.0","MSDOS5.0","MSDOS5.0","MSDOS5.0",null, + // MS-DOS 6.22 + "MSDOS5.0",null,"MSDOS5.0","MSDOS5.0","MSDOS5.0","MSDOS5.0","MSDOS5.0",null, + // MS-DOS 7.10 + "MSWIN4.1",null,"MSWIN4.1","MSWIN4.1","MSWIN4.1","MSWIN4.1","MSWIN4.1",null, + // MS-DOS 3.20 for Amstrad + "MSDOS3.2",null,"MSDOS3.2","MSDOS3.2","MSDOS3.2",null, + // MS-DOS 2.11 for AT&T + "PSA 1.04", + // MS-DOS 3.30 for DeLL + "IBM 3.3",null,"IBM 3.3","IBM 3.3","IBM 3.3","IBM 3.3",null, + // MS-DOS 3.10 for Epson + "EPS 3.10","EPS 3.10","EPS 3.10", + // MS-DOS 3.20 for Epson + "IBM 3.2","IBM 3.2","IBM 3.2","IBM 3.2","IBM 3.2","IBM 3.2", + // MS-DOS 3.20 for HP + "MSDOS3.2",null,"MSDOS3.2","MSDOS3.2","MSDOS3.2","MSDOS3.2",null, + // MS-DOS 3.21 for Hyosung + "MSDOS3.2",null,"MSDOS3.2","MSDOS3.2","MSDOS3.2","MSDOS3.2",null, + // MS-DOS 3.21 for Kaypro + "MSDOS3.2",null,"MSDOS3.2","MSDOS3.2","MSDOS3.2","MSDOS3.2",null, + // MS-DOS 3.10 for Olivetti + "IBM 3.1","IBM 3.1","IBM 3.1", + // MS-DOS 3.30 for Toshiba + "IBM 3.3",null,"IBM 3.3","IBM 3.3","IBM 3.3","IBM 3.3",null, + // MS-DOS 4.01 for Toshiba + "T V4.00 ","T V4.00 ","T V4.00 ","T V4.00 ","T V4.00 ","T V4.00 ","T V4.00 ", + // Novell DOS 7.00 + "NWDOS7.0","NWDOS7.0","NWDOS7.0","NWDOS7.0","NWDOS7.0","NWDOS7.0","NWDOS7.0","NWDOS7.0", + // OpenDOS 7.01 + "OPENDOS7","OPENDOS7","OPENDOS7","OPENDOS7","OPENDOS7","OPENDOS7","OPENDOS7","OPENDOS7", + // PC-DOS 2.00 + "IBM 2.0", + // PC-DOS 2.10 + "IBM 2.0", + // PC-DOS 2000 + "IBM 7.0",null,"IBM 7.0","IBM 7.0","IBM 7.0","IBM 7.0","IBM 7.0",null, + // PC-DOS 3.00 + "IBM 3.0", + // PC-DOS 3.10 + "IBM 3.1", + // PC-DOS 3.30 + "IBM 3.3","IBM 3.3", + // PC-DOS 4.00 + "IBM 4.0","IBM 4.0", + // PC-DOS 5.00 + "IBM 5.0",null,"IBM 5.0","IBM 5.0","IBM 5.0","IBM 5.0","IBM 5.0",null, + // PC-DOS 5.02 + "IBM 5.0",null,"IBM 5.0","IBM 5.0","IBM 5.0","IBM 5.0","IBM 5.0",null, + // PC-DOS 6.10 + "IBM 6.0",null,"IBM 6.0","IBM 6.0","IBM 6.0","IBM 6.0","IBM 6.0",null, + // PC-DOS 6.30 + "IBM 6.0",null,"IBM 6.0","IBM 6.0","IBM 6.0","IBM 6.0","IBM 6.0",null, + // mkfs.vfat + "mkfs.fat","mkfs.fat","mkfs.fat","mkfs.fat", + // mkfs.vfat for Atari + null,null,null,null, + // Microsoft OS/2 1.00 for Tandy + "TAN 10.0","TAN 10.0","TAN 10.0","TAN 10.0", + // Microsoft OS/2 1.10 for AST + "IBM 10.1","IBM 10.1","IBM 10.1","IBM 10.1", + // Microsoft OS/2 1.10 for Nokia + "IBM 10.1","IBM 10.1","IBM 10.1","IBM 10.1", + // Microsoft OS/2 1.21 + "IBM 10.2","IBM 10.2","IBM 10.2","IBM 10.2", + // Microsoft OS/2 1.30.1 + "IBM 10.2","IBM 10.2","IBM 10.2","IBM 10.2","IBM 10.2", + // OS/2 1.20 + "IBM 10.2","IBM 10.2","IBM 10.2","IBM 10.2", + // OS/2 1.30 + "IBM 10.2","IBM 10.2","IBM 10.2","IBM 10.2", + // OS/2 2.00 + "IBM 20.0","IBM 20.0","IBM 20.0","IBM 20.0","IBM 20.0", + // OS/2 2.10 + "IBM 20.0","IBM 20.0","IBM 20.0","IBM 20.0","IBM 20.0", + // OS/2 2.11 + "IBM 20.0","IBM 20.0","IBM 20.0","IBM 20.0","IBM 20.0", + // OS/2 Warp 3 + "IBM 20.0","IBM 20.0","IBM 20.0","IBM 20.0", + // OS/2 Warp 4 + "IBM 20.0","IBM 20.0","IBM 20.0","IBM 20.0", + // eComStation + "IBM 4.50","IBM 4.50","IBM 4.50","IBM 4.50", + // Windows 95 + null,"MSWIN4.0","MSWIN4.0","MSWIN4.0", + "MSWIN4.0","MSWIN4.0",null,"MSWIN4.0", + // Windows 95 OSR 2 + null,"MSWIN4.1","MSWIN4.1","MSWIN4.1", + "MSWIN4.1","MSWIN4.1",null,"MSWIN4.1", + /// Windows 95 OSR 2.1 + null,"MSWIN4.1","MSWIN4.1","MSWIN4.1", + "MSWIN4.1","MSWIN4.1",null,"MSWIN4.1", + // Windows 95 OSR 2.5 + null,"MSWIN4.1","MSWIN4.1","MSWIN4.1", + "MSWIN4.1","MSWIN4.1",null,"MSWIN4.1", + // Windows 98 + null,"MSWIN4.1","MSWIN4.1","MSWIN4.1", + "MSWIN4.1","MSWIN4.1",null,"MSWIN4.1", + // Windows 98 Second Edition + null,"MSWIN4.1","MSWIN4.1","MSWIN4.1", + "MSWIN4.1","MSWIN4.1",null,"MSWIN4.1", + // Windows Me + "MSWIN4.1","MSWIN4.1","MSWIN4.1","MSWIN4.1","MSWIN4.1", + // Windows NT 3.10 + "MSDOS5.0","MSDOS5.0","MSDOS5.0","MSDOS5.0", + // Windows NT 3.50 + "MSDOS5.0","MSDOS5.0","MSDOS5.0","MSDOS5.0", + // Windows NT 3.51 + "MSDOS5.0","MSDOS5.0","MSDOS5.0","MSDOS5.0", + // Windows NT 4.00 + "MSDOS5.0","MSDOS5.0","MSDOS5.0","MSDOS5.0", + "MSDOS5.0","MSDOS5.0", + // Windows 2000 + "MSDOS5.0","MSDOS5.0","MSDOS5.0","MSDOS5.0","MSDOS5.0", + // Windows Vista + "MSDOS5.0","MSDOS5.0","MSDOS5.0","MSDOS5.0","MSDOS5.0", + // BeOS R4.5 + "BeOS ", + }; + + [Test] + public void Test() + { + for(int i = 0; i < testfiles.Length; i++) + { + string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "fat12", testfiles[i]); + Filter filter = new LZip(); + filter.Open(location); + ImagePlugin image = new ZZZRawImage(); + Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]); + Assert.AreEqual(mediatypes[i], image.ImageInfo.mediaType, testfiles[i]); + Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]); + Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); + Filesystem fs = new FAT(); + Assert.AreEqual(true, fs.Identify(image, 0, image.ImageInfo.sectors - 1), testfiles[i]); + fs.GetInformation(image, 0, image.ImageInfo.sectors - 1, out string information); + Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]); + Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]); + Assert.AreEqual("FAT12", fs.XmlFSType.Type, testfiles[i]); + Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); + Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); + Assert.AreEqual(oemid[i], fs.XmlFSType.SystemIdentifier, testfiles[i]); + } + } + } +} diff --git a/DiscImageChef.Tests/Filesystems/AFFS2_RDB.cs b/DiscImageChef.Tests/Filesystems/AFFS2_RDB.cs new file mode 100644 index 000000000..0b7e88a4a --- /dev/null +++ b/DiscImageChef.Tests/Filesystems/AFFS2_RDB.cs @@ -0,0 +1,122 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : SFS_RDB.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program 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 General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using System.Collections.Generic; +using System.IO; +using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using DiscImageChef.Filesystems; +using DiscImageChef.Filters; +using DiscImageChef.ImagePlugins; +using DiscImageChef.PartPlugins; +using NUnit.Framework; + +namespace DiscImageChef.Tests.Filesystems +{ + [TestFixture] + public class SFS_RDB + { + readonly string[] testfiles = { + "uae.vdi.lz", + }; + + readonly ulong[] sectors = { + 1024128, + }; + + readonly uint[] sectorsize = { + 512, + }; + + readonly long[] clusters = { + 127000, + }; + + readonly int[] clustersize = { + 2048, + }; + + readonly string[] volumename = { + null, + }; + + readonly string[] volumeserial = { + null, + }; + + readonly string[] oemid = { + null, + }; + + [Test] + public void Test() + { + for(int i = 0; i < testfiles.Length; i++) + { + string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "sfs_rdb", testfiles[i]); + Filter filter = new LZip(); + filter.Open(location); + ImagePlugin image = new VDI(); + Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]); + Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]); + Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); + PartPlugin parts = new AmigaRigidDiskBlock(); + Assert.AreEqual(true, parts.GetInformation(image, out List partitions), testfiles[i]); + Filesystem fs = new DiscImageChef.Filesystems.SFS(); + int part = -1; + for(int j = 0; j < partitions.Count; j++) + { + System.Console.WriteLine("{0}", partitions[j].PartitionType); + if(partitions[j].PartitionType == "\"SFS\\0\"") + { + part = j; + break; + } + } + Assert.AreNotEqual(-1, part, "Partition not found"); + Assert.AreEqual(true, fs.Identify(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1), testfiles[i]); + fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information); + Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]); + Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]); + Assert.AreEqual("SmartFileSystem", fs.XmlFSType.Type, testfiles[i]); + Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); + Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); + Assert.AreEqual(oemid[i], fs.XmlFSType.SystemIdentifier, testfiles[i]); + } + } + } +} diff --git a/DiscImageChef.Tests/Filesystems/AFFS_MBR.cs b/DiscImageChef.Tests/Filesystems/AFFS_MBR.cs new file mode 100644 index 000000000..d0898dd95 --- /dev/null +++ b/DiscImageChef.Tests/Filesystems/AFFS_MBR.cs @@ -0,0 +1,124 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : AFFS_RDB.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program 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 General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using System.Collections.Generic; +using System.IO; +using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using DiscImageChef.Filesystems; +using DiscImageChef.Filters; +using DiscImageChef.ImagePlugins; +using DiscImageChef.PartPlugins; +using NUnit.Framework; + +namespace DiscImageChef.Tests.Filesystems +{ + [TestFixture] + public class AFFS_RDB + { + readonly string[] testfiles = { + "amigaos_3.9.vdi.lz","amigaos_3.9_intl.vdi.lz","aros.vdi.lz","aros_intl.vdi.lz", + "amigaos_4.0.vdi.lz","amigaos_4.0_intl.vdi.lz","amigaos_4.0_cache.vdi.lz" + }; + + readonly ulong[] sectors = { + 1024128,1024128,409600,409600, + 1024128,1024128,1024128, + }; + + readonly uint[] sectorsize = { + 512,512,512,512, + 512,512,512, + }; + + readonly long[] clusters = { + 1020064,1020064,407232,407232, + 1020064,1020064,1020064, + }; + + readonly int[] clustersize = { + 512,512,512,512, + 512,512,512, + }; + + readonly string[] volumename = { + "Volume label","Volume label","Volume label","Volume label", + "Volume label","Volume label","Volume label", + }; + + readonly string[] volumeserial = { + null,null,null,null, + null,null,null, + }; + + [Test] + public void Test() + { + for(int i = 0; i < testfiles.Length; i++) + { + string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "affs_rdb", testfiles[i]); + Filter filter = new LZip(); + filter.Open(location); + ImagePlugin image = new VDI(); + Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]); + Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]); + Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); + PartPlugin parts = new AmigaRigidDiskBlock(); + Assert.AreEqual(true, parts.GetInformation(image, out List partitions), testfiles[i]); + Filesystem fs = new DiscImageChef.Filesystems.AmigaDOSPlugin(); + int part = -1; + for(int j = 0; j < partitions.Count; j++) + { + System.Console.WriteLine("{0}", partitions[j].PartitionType); + if(partitions[j].PartitionType == "\"DOS\\1\"" || partitions[j].PartitionType == "\"DOS\\3\"" || partitions[j].PartitionType == "\"DOS\\5\"") + { + part = j; + break; + } + } + Assert.AreNotEqual(-1, part, "Partition not found"); + Assert.AreEqual(true, fs.Identify(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1), testfiles[i]); + fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information); + Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]); + Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]); + Assert.AreEqual("Amiga FFS", fs.XmlFSType.Type, testfiles[i]); + Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); + Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); + } + } + } +} diff --git a/DiscImageChef.Tests/Filesystems/AFFS_MBR_RDB.cs b/DiscImageChef.Tests/Filesystems/AFFS_MBR_RDB.cs new file mode 100644 index 000000000..56a0e6d52 --- /dev/null +++ b/DiscImageChef.Tests/Filesystems/AFFS_MBR_RDB.cs @@ -0,0 +1,116 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : AFFS_MBR.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program 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 General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using System.Collections.Generic; +using System.IO; +using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using DiscImageChef.Filesystems; +using DiscImageChef.Filters; +using DiscImageChef.ImagePlugins; +using DiscImageChef.PartPlugins; +using NUnit.Framework; + +namespace DiscImageChef.Tests.Filesystems +{ + [TestFixture] + public class AFFS_MBR + { + readonly string[] testfiles = { + "aros.vdi.lz","aros_intl.vdi.lz", + }; + + readonly ulong[] sectors = { + 409600,409600, + }; + + readonly uint[] sectorsize = { + 512,512, + }; + + readonly long[] clusters = { + 408240,408240, + }; + + readonly int[] clustersize = { + 512,512, + }; + + readonly string[] volumename = { + "Volume label","Volume label", + }; + + readonly string[] volumeserial = { + null,null, + }; + + [Test] + public void Test() + { + for(int i = 0; i < testfiles.Length; i++) + { + string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "affs_mbr", testfiles[i]); + Filter filter = new LZip(); + filter.Open(location); + ImagePlugin image = new VDI(); + Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]); + Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]); + Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); + PartPlugin parts = new MBR(); + Assert.AreEqual(true, parts.GetInformation(image, out List partitions), testfiles[i]); + Filesystem fs = new DiscImageChef.Filesystems.AmigaDOSPlugin(); + int part = -1; + for(int j = 0; j < partitions.Count; j++) + { + if(partitions[j].PartitionType == "0x2D") + { + part = j; + break; + } + } + Assert.AreNotEqual(-1, part, "Partition not found"); + Assert.AreEqual(true, fs.Identify(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1), testfiles[i]); + fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information); + Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]); + Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]); + Assert.AreEqual("Amiga FFS", fs.XmlFSType.Type, testfiles[i]); + Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); + Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); + } + } + } +} diff --git a/DiscImageChef.Tests/Filesystems/AFFS_RDB.cs b/DiscImageChef.Tests/Filesystems/AFFS_RDB.cs new file mode 100644 index 000000000..0b7e88a4a --- /dev/null +++ b/DiscImageChef.Tests/Filesystems/AFFS_RDB.cs @@ -0,0 +1,122 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : SFS_RDB.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program 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 General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using System.Collections.Generic; +using System.IO; +using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using DiscImageChef.Filesystems; +using DiscImageChef.Filters; +using DiscImageChef.ImagePlugins; +using DiscImageChef.PartPlugins; +using NUnit.Framework; + +namespace DiscImageChef.Tests.Filesystems +{ + [TestFixture] + public class SFS_RDB + { + readonly string[] testfiles = { + "uae.vdi.lz", + }; + + readonly ulong[] sectors = { + 1024128, + }; + + readonly uint[] sectorsize = { + 512, + }; + + readonly long[] clusters = { + 127000, + }; + + readonly int[] clustersize = { + 2048, + }; + + readonly string[] volumename = { + null, + }; + + readonly string[] volumeserial = { + null, + }; + + readonly string[] oemid = { + null, + }; + + [Test] + public void Test() + { + for(int i = 0; i < testfiles.Length; i++) + { + string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "sfs_rdb", testfiles[i]); + Filter filter = new LZip(); + filter.Open(location); + ImagePlugin image = new VDI(); + Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]); + Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]); + Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); + PartPlugin parts = new AmigaRigidDiskBlock(); + Assert.AreEqual(true, parts.GetInformation(image, out List partitions), testfiles[i]); + Filesystem fs = new DiscImageChef.Filesystems.SFS(); + int part = -1; + for(int j = 0; j < partitions.Count; j++) + { + System.Console.WriteLine("{0}", partitions[j].PartitionType); + if(partitions[j].PartitionType == "\"SFS\\0\"") + { + part = j; + break; + } + } + Assert.AreNotEqual(-1, part, "Partition not found"); + Assert.AreEqual(true, fs.Identify(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1), testfiles[i]); + fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information); + Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]); + Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]); + Assert.AreEqual("SmartFileSystem", fs.XmlFSType.Type, testfiles[i]); + Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); + Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); + Assert.AreEqual(oemid[i], fs.XmlFSType.SystemIdentifier, testfiles[i]); + } + } + } +} diff --git a/DiscImageChef.Tests/Filesystems/AOFS.cs b/DiscImageChef.Tests/Filesystems/AOFS.cs new file mode 100644 index 000000000..9a3288c5d --- /dev/null +++ b/DiscImageChef.Tests/Filesystems/AOFS.cs @@ -0,0 +1,106 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : AFFS.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program 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 General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using System.IO; +using DiscImageChef.CommonTypes; +using DiscImageChef.Filesystems; +using DiscImageChef.Filters; +using DiscImageChef.ImagePlugins; +using NUnit.Framework; + +namespace DiscImageChef.Tests.Filesystems +{ + [TestFixture] + public class AFFS + { + readonly string[] testfiles = { + "amigaos_3.9.adf.lz", "amigaos_3.9_intl.adf.lz", + }; + + readonly MediaType[] mediatypes = { + MediaType.CBM_AMIGA_35_DD, MediaType.CBM_AMIGA_35_DD, + }; + + readonly ulong[] sectors = { + 1760, 1760, + }; + + readonly uint[] sectorsize = { + 512, 512, + }; + + readonly long[] clusters = { + 1760, 1760, + }; + + readonly int[] clustersize = { + 512, 512, + }; + + readonly string[] volumename = { + "Volume label", "Volume label", + }; + + readonly string[] volumeserial = { + null, null, + }; + + [Test] + public void Test() + { + for(int i = 0; i < testfiles.Length; i++) + { + string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "affs", testfiles[i]); + Filter filter = new LZip(); + filter.Open(location); + ImagePlugin image = new ZZZRawImage(); + Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]); + Assert.AreEqual(mediatypes[i], image.ImageInfo.mediaType, testfiles[i]); + Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]); + Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); + Filesystem fs = new AmigaDOSPlugin(); + Assert.AreEqual(true, fs.Identify(image, 0, image.ImageInfo.sectors - 1), testfiles[i]); + fs.GetInformation(image, 0, image.ImageInfo.sectors - 1, out string information); + Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]); + Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]); + Assert.AreEqual("Amiga FFS", fs.XmlFSType.Type, testfiles[i]); + Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); + Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); + } + } + } +} diff --git a/DiscImageChef.Tests/Filesystems/AOFS_MBR.cs b/DiscImageChef.Tests/Filesystems/AOFS_MBR.cs new file mode 100644 index 000000000..d0898dd95 --- /dev/null +++ b/DiscImageChef.Tests/Filesystems/AOFS_MBR.cs @@ -0,0 +1,124 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : AFFS_RDB.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program 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 General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using System.Collections.Generic; +using System.IO; +using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using DiscImageChef.Filesystems; +using DiscImageChef.Filters; +using DiscImageChef.ImagePlugins; +using DiscImageChef.PartPlugins; +using NUnit.Framework; + +namespace DiscImageChef.Tests.Filesystems +{ + [TestFixture] + public class AFFS_RDB + { + readonly string[] testfiles = { + "amigaos_3.9.vdi.lz","amigaos_3.9_intl.vdi.lz","aros.vdi.lz","aros_intl.vdi.lz", + "amigaos_4.0.vdi.lz","amigaos_4.0_intl.vdi.lz","amigaos_4.0_cache.vdi.lz" + }; + + readonly ulong[] sectors = { + 1024128,1024128,409600,409600, + 1024128,1024128,1024128, + }; + + readonly uint[] sectorsize = { + 512,512,512,512, + 512,512,512, + }; + + readonly long[] clusters = { + 1020064,1020064,407232,407232, + 1020064,1020064,1020064, + }; + + readonly int[] clustersize = { + 512,512,512,512, + 512,512,512, + }; + + readonly string[] volumename = { + "Volume label","Volume label","Volume label","Volume label", + "Volume label","Volume label","Volume label", + }; + + readonly string[] volumeserial = { + null,null,null,null, + null,null,null, + }; + + [Test] + public void Test() + { + for(int i = 0; i < testfiles.Length; i++) + { + string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "affs_rdb", testfiles[i]); + Filter filter = new LZip(); + filter.Open(location); + ImagePlugin image = new VDI(); + Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]); + Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]); + Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); + PartPlugin parts = new AmigaRigidDiskBlock(); + Assert.AreEqual(true, parts.GetInformation(image, out List partitions), testfiles[i]); + Filesystem fs = new DiscImageChef.Filesystems.AmigaDOSPlugin(); + int part = -1; + for(int j = 0; j < partitions.Count; j++) + { + System.Console.WriteLine("{0}", partitions[j].PartitionType); + if(partitions[j].PartitionType == "\"DOS\\1\"" || partitions[j].PartitionType == "\"DOS\\3\"" || partitions[j].PartitionType == "\"DOS\\5\"") + { + part = j; + break; + } + } + Assert.AreNotEqual(-1, part, "Partition not found"); + Assert.AreEqual(true, fs.Identify(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1), testfiles[i]); + fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information); + Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]); + Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]); + Assert.AreEqual("Amiga FFS", fs.XmlFSType.Type, testfiles[i]); + Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); + Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); + } + } + } +} diff --git a/DiscImageChef.Tests/Filesystems/AOFS_MBR_RDB.cs b/DiscImageChef.Tests/Filesystems/AOFS_MBR_RDB.cs new file mode 100644 index 000000000..1910a3c67 --- /dev/null +++ b/DiscImageChef.Tests/Filesystems/AOFS_MBR_RDB.cs @@ -0,0 +1,116 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : AOFS_MBR.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program 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 General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using System.Collections.Generic; +using System.IO; +using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using DiscImageChef.Filesystems; +using DiscImageChef.Filters; +using DiscImageChef.ImagePlugins; +using DiscImageChef.PartPlugins; +using NUnit.Framework; + +namespace DiscImageChef.Tests.Filesystems +{ + [TestFixture] + public class AOFS_MBR + { + readonly string[] testfiles = { + "aros.vdi.lz","aros_intl.vdi.lz", + }; + + readonly ulong[] sectors = { + 409600,409600, + }; + + readonly uint[] sectorsize = { + 512,512, + }; + + readonly long[] clusters = { + 408240,408240, + }; + + readonly int[] clustersize = { + 512,512, + }; + + readonly string[] volumename = { + "Volume label","Volume label", + }; + + readonly string[] volumeserial = { + null,null, + }; + + [Test] + public void Test() + { + for(int i = 0; i < testfiles.Length; i++) + { + string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "aofs_mbr", testfiles[i]); + Filter filter = new LZip(); + filter.Open(location); + ImagePlugin image = new VDI(); + Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]); + Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]); + Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); + PartPlugin parts = new MBR(); + Assert.AreEqual(true, parts.GetInformation(image, out List partitions), testfiles[i]); + Filesystem fs = new DiscImageChef.Filesystems.AmigaDOSPlugin(); + int part = -1; + for(int j = 0; j < partitions.Count; j++) + { + if(partitions[j].PartitionType == "0x2C") + { + part = j; + break; + } + } + Assert.AreNotEqual(-1, part, "Partition not found"); + Assert.AreEqual(true, fs.Identify(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1), testfiles[i]); + fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information); + Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]); + Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]); + Assert.AreEqual("Amiga OFS", fs.XmlFSType.Type, testfiles[i]); + Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); + Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); + } + } + } +} diff --git a/DiscImageChef.Tests/Filesystems/AOFS_RDB.cs b/DiscImageChef.Tests/Filesystems/AOFS_RDB.cs new file mode 100644 index 000000000..0b7e88a4a --- /dev/null +++ b/DiscImageChef.Tests/Filesystems/AOFS_RDB.cs @@ -0,0 +1,122 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : SFS_RDB.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program 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 General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using System.Collections.Generic; +using System.IO; +using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using DiscImageChef.Filesystems; +using DiscImageChef.Filters; +using DiscImageChef.ImagePlugins; +using DiscImageChef.PartPlugins; +using NUnit.Framework; + +namespace DiscImageChef.Tests.Filesystems +{ + [TestFixture] + public class SFS_RDB + { + readonly string[] testfiles = { + "uae.vdi.lz", + }; + + readonly ulong[] sectors = { + 1024128, + }; + + readonly uint[] sectorsize = { + 512, + }; + + readonly long[] clusters = { + 127000, + }; + + readonly int[] clustersize = { + 2048, + }; + + readonly string[] volumename = { + null, + }; + + readonly string[] volumeserial = { + null, + }; + + readonly string[] oemid = { + null, + }; + + [Test] + public void Test() + { + for(int i = 0; i < testfiles.Length; i++) + { + string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "sfs_rdb", testfiles[i]); + Filter filter = new LZip(); + filter.Open(location); + ImagePlugin image = new VDI(); + Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]); + Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]); + Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); + PartPlugin parts = new AmigaRigidDiskBlock(); + Assert.AreEqual(true, parts.GetInformation(image, out List partitions), testfiles[i]); + Filesystem fs = new DiscImageChef.Filesystems.SFS(); + int part = -1; + for(int j = 0; j < partitions.Count; j++) + { + System.Console.WriteLine("{0}", partitions[j].PartitionType); + if(partitions[j].PartitionType == "\"SFS\\0\"") + { + part = j; + break; + } + } + Assert.AreNotEqual(-1, part, "Partition not found"); + Assert.AreEqual(true, fs.Identify(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1), testfiles[i]); + fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information); + Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]); + Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]); + Assert.AreEqual("SmartFileSystem", fs.XmlFSType.Type, testfiles[i]); + Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); + Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); + Assert.AreEqual(oemid[i], fs.XmlFSType.SystemIdentifier, testfiles[i]); + } + } + } +} diff --git a/DiscImageChef.Tests/Filesystems/BeFS_GPT.cs b/DiscImageChef.Tests/Filesystems/BeFS_GPT.cs new file mode 100644 index 000000000..1fc45d68f --- /dev/null +++ b/DiscImageChef.Tests/Filesystems/BeFS_GPT.cs @@ -0,0 +1,121 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : BeFS_APM.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program 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 General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using System.Collections.Generic; +using System.IO; +using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using DiscImageChef.Filesystems; +using DiscImageChef.Filters; +using DiscImageChef.ImagePlugins; +using DiscImageChef.PartPlugins; +using NUnit.Framework; + +namespace DiscImageChef.Tests.Filesystems +{ + [TestFixture] + public class BeFS_APM + { + readonly string[] testfiles = { + "beos_r3.1.vdi.lz", "beos_r4.5.vdi.lz", + }; + + readonly ulong[] sectors = { + 1572864, 1572864, + }; + + readonly uint[] sectorsize = { + 512, 512, + }; + + readonly long[] clusters = { + 786400, 785232, + }; + + readonly int[] clustersize = { + 1024, 1024, + }; + + readonly string[] volumename = { + "Volume label","Volume label", + }; + + readonly string[] volumeserial = { + null,null, + }; + + readonly string[] oemid = { + null,null, + }; + + [Test] + public void Test() + { + for(int i = 0; i < testfiles.Length; i++) + { + string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "befs_apm", testfiles[i]); + Filter filter = new LZip(); + filter.Open(location); + ImagePlugin image = new VDI(); + Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]); + Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]); + Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); + PartPlugin parts = new AppleMap(); + Assert.AreEqual(true, parts.GetInformation(image, out List partitions), testfiles[i]); + Filesystem fs = new DiscImageChef.Filesystems.BeFS(); + int part = -1; + for(int j = 0; j < partitions.Count; j++) + { + if(partitions[j].PartitionType == "Be_BFS") + { + part = j; + break; + } + } + Assert.AreNotEqual(-1, part, "Partition not found"); + Assert.AreEqual(true, fs.Identify(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1), testfiles[i]); + fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information); + Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]); + Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]); + Assert.AreEqual("BeFS", fs.XmlFSType.Type, testfiles[i]); + Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); + Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); + Assert.AreEqual(oemid[i], fs.XmlFSType.SystemIdentifier, testfiles[i]); + } + } + } +} diff --git a/DiscImageChef.Tests/Filesystems/FAT16_Atari.cs b/DiscImageChef.Tests/Filesystems/FAT16_Atari.cs new file mode 100644 index 000000000..3c5adc8e9 --- /dev/null +++ b/DiscImageChef.Tests/Filesystems/FAT16_Atari.cs @@ -0,0 +1,121 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : FAT16_APM.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program 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 General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using System.Collections.Generic; +using System.IO; +using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using DiscImageChef.Filesystems; +using DiscImageChef.Filters; +using DiscImageChef.ImagePlugins; +using DiscImageChef.PartPlugins; +using NUnit.Framework; + +namespace DiscImageChef.Tests.Filesystems +{ + [TestFixture] + public class FAT16_APM + { + readonly string[] testfiles = { + "macosx_10.11.vdi.lz", + }; + + readonly ulong[] sectors = { + 1024000, + }; + + readonly uint[] sectorsize = { + 512, + }; + + readonly long[] clusters = { + 63995, + }; + + readonly int[] clustersize = { + 8192, + }; + + readonly string[] volumename = { + "VOLUMELABEL", + }; + + readonly string[] volumeserial = { + "063D1F09", + }; + + readonly string[] oemid = { + "BSD 4.4", + }; + + [Test] + public void Test() + { + for(int i = 0; i < testfiles.Length; i++) + { + string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "fat16_apm", testfiles[i]); + Filter filter = new LZip(); + filter.Open(location); + ImagePlugin image = new VDI(); + Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]); + Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]); + Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); + PartPlugin parts = new AppleMap(); + Assert.AreEqual(true, parts.GetInformation(image, out List partitions), testfiles[i]); + Filesystem fs = new DiscImageChef.Filesystems.FAT(); + int part = -1; + for(int j = 0; j < partitions.Count; j++) + { + if(partitions[j].PartitionType == "DOS_FAT_16") + { + part = j; + break; + } + } + Assert.AreNotEqual(-1, part, "Partition not found"); + Assert.AreEqual(true, fs.Identify(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1), testfiles[i]); + fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information); + Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]); + Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]); + Assert.AreEqual("FAT16", fs.XmlFSType.Type, testfiles[i]); + Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); + Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); + Assert.AreEqual(oemid[i], fs.XmlFSType.SystemIdentifier, testfiles[i]); + } + } + } +} diff --git a/DiscImageChef.Tests/Filesystems/FAT16_RDB.cs b/DiscImageChef.Tests/Filesystems/FAT16_RDB.cs new file mode 100644 index 000000000..4ff00542b --- /dev/null +++ b/DiscImageChef.Tests/Filesystems/FAT16_RDB.cs @@ -0,0 +1,123 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : AFFS_RDB.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program 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 General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using System.Collections.Generic; +using System.IO; +using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using DiscImageChef.Filesystems; +using DiscImageChef.Filters; +using DiscImageChef.ImagePlugins; +using DiscImageChef.PartPlugins; +using NUnit.Framework; + +namespace DiscImageChef.Tests.Filesystems +{ + [TestFixture] + public class AFFS_RDB + { + readonly string[] testfiles = { + "amigaos_3.9.vdi.lz","amigaos_3.9_intl.vdi.lz","aros.vdi.lz","aros_intl.vdi.lz", + "amigaos_4.0.vdi.lz","amigaos_4.0_intl.vdi.lz","amigaos_4.0_cache.vdi.lz" + }; + + readonly ulong[] sectors = { + 1024128,1024128,409600,409600, + 1024128,1024128,1024128, + }; + + readonly uint[] sectorsize = { + 512,512,512,512, + 512,512,512, + }; + + readonly long[] clusters = { + 1020064,1020064,407232,407232, + 1020064,1020064,1020064, + }; + + readonly int[] clustersize = { + 512,512,512,512, + 512,512,512, + }; + + readonly string[] volumename = { + "Volume label","Volume label","Volume label","Volume label", + "Volume label","Volume label","Volume label", + }; + + readonly string[] volumeserial = { + null,null,null,null, + null,null,null, + }; + + [Test] + public void Test() + { + for(int i = 0; i < testfiles.Length; i++) + { + string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "affs_rdb", testfiles[i]); + Filter filter = new LZip(); + filter.Open(location); + ImagePlugin image = new VDI(); + Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]); + Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]); + Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); + PartPlugin parts = new AmigaRigidDiskBlock(); + Assert.AreEqual(true, parts.GetInformation(image, out List partitions), testfiles[i]); + Filesystem fs = new DiscImageChef.Filesystems.AmigaDOSPlugin(); + int part = -1; + for(int j = 0; j < partitions.Count; j++) + { + if(partitions[j].PartitionType == "\"DOS\\1\"" || partitions[j].PartitionType == "\"DOS\\3\"" || partitions[j].PartitionType == "\"DOS\\5\"") + { + part = j; + break; + } + } + Assert.AreNotEqual(-1, part, "Partition not found"); + Assert.AreEqual(true, fs.Identify(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1), testfiles[i]); + fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information); + Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]); + Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]); + Assert.AreEqual("Amiga FFS", fs.XmlFSType.Type, testfiles[i]); + Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); + Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); + } + } + } +} diff --git a/DiscImageChef.Tests/Filesystems/HAMMER_MBR.cs b/DiscImageChef.Tests/Filesystems/HAMMER_MBR.cs new file mode 100644 index 000000000..feb60c914 --- /dev/null +++ b/DiscImageChef.Tests/Filesystems/HAMMER_MBR.cs @@ -0,0 +1,121 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : HFSX_MBR.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program 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 General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using System.Collections.Generic; +using System.IO; +using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using DiscImageChef.Filesystems; +using DiscImageChef.Filters; +using DiscImageChef.ImagePlugins; +using DiscImageChef.PartPlugins; +using NUnit.Framework; + +namespace DiscImageChef.Tests.Filesystems +{ + [TestFixture] + public class HFSX_MBR + { + readonly string[] testfiles = { + "macosx_10.11.vdi.lz", "macosx_10.11_journal.vdi.lz", "linux.vdi.lz", "linux_journal.vdi.lz", + }; + + readonly ulong[] sectors = { + 393216, 409600, 262144, 262144, + }; + + readonly uint[] sectorsize = { + 512, 512, 512, 512, + }; + + readonly long[] clusters = { + 102390, 153590, 32512, 32512, + }; + + readonly int[] clustersize = { + 4096, 4096, 4096, 4096 + }; + + readonly string[] volumename = { + "Volume label", "Volume label", "Volume label", "Volume label", + }; + + readonly string[] volumeserial = { + "UNKNOWN","UNKNOWN","0000000000000000","0000000000000000" + }; + + readonly string[] oemid = { + "10.0","HFSJ","10.0","10.0" + }; + + [Test] + public void Test() + { + for(int i = 0; i < testfiles.Length; i++) + { + string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "hfsx_mbr", testfiles[i]); + Filter filter = new LZip(); + filter.Open(location); + ImagePlugin image = new VDI(); + Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]); + Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]); + Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); + PartPlugin parts = new MBR(); + Assert.AreEqual(true, parts.GetInformation(image, out List partitions), testfiles[i]); + Filesystem fs = new DiscImageChef.Filesystems.AppleHFSPlus(); + int part = -1; + for(int j = 0; j < partitions.Count; j++) + { + if(partitions[j].PartitionType == "0xAF") + { + part = j; + break; + } + } + Assert.AreNotEqual(-1, part, "Partition not found"); + Assert.AreEqual(true, fs.Identify(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1), testfiles[i]); + fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information); + Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]); + Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]); + Assert.AreEqual("HFSX", fs.XmlFSType.Type, testfiles[i]); + Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); + Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); + Assert.AreEqual(oemid[i], fs.XmlFSType.SystemIdentifier, testfiles[i]); + } + } + } +} diff --git a/DiscImageChef.Tests/Filesystems/HFS.cs b/DiscImageChef.Tests/Filesystems/HFS.cs new file mode 100644 index 000000000..f65f369d4 --- /dev/null +++ b/DiscImageChef.Tests/Filesystems/HFS.cs @@ -0,0 +1,1622 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : FAT12.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program 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 General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using System.IO; +using DiscImageChef.CommonTypes; +using DiscImageChef.Filesystems; +using DiscImageChef.Filters; +using DiscImageChef.ImagePlugins; +using NUnit.Framework; + +namespace DiscImageChef.Tests.Filesystems +{ + [TestFixture] + public class FAT12 + { + readonly string[] testfiles = { + // Concurrent DOS 6.00 + "concurrentdos_6.00_dshd.img.lz", "concurrentdos_6.00_mf2dd.img.lz", "concurrentdos_6.00_mf2hd.img.lz", + // DR-DOS 3.40 + "drdos_3.40_dsdd.img.lz", "drdos_3.40_dsdd8.img.lz", "drdos_3.40_dshd.img.lz", "drdos_3.40_mf2dd.img.lz", + "drdos_3.40_mf2hd.img.lz", "drdos_3.40_ssdd.img.lz", "drdos_3.40_ssdd8.img.lz", + // DR-DOS 3.41 + "drdos_3.41_dsdd.img.lz", "drdos_3.41_dsdd8.img.lz", "drdos_3.41_dshd.img.lz", "drdos_3.41_mf2dd.img.lz", + "drdos_3.41_mf2hd.img.lz", "drdos_3.41_ssdd.img.lz", "drdos_3.41_ssdd8.img.lz", + // DR-DOS 5.00 + "drdos_5.00_dsdd.img.lz", "drdos_5.00_dsdd8.img.lz", "drdos_5.00_dshd.img.lz", "drdos_5.00_mf2dd.img.lz", + "drdos_5.00_mf2hd.img.lz", "drdos_5.00_ssdd.img.lz", "drdos_5.00_ssdd8.img.lz", + // DR-DOS 6.00 + "drdos_6.00_dsdd.img.lz", "drdos_6.00_dsdd8.img.lz", "drdos_6.00_dshd.img.lz", "drdos_6.00_mf2dd.img.lz", + "drdos_6.00_mf2ed.img.lz", "drdos_6.00_mf2hd.img.lz", "drdos_6.00_ssdd.img.lz", "drdos_6.00_ssdd8.img.lz", + // DR-DOS 7.02 + "drdos_7.02_dsdd.img.lz", "drdos_7.02_dsdd8.img.lz", "drdos_7.02_dshd.img.lz", "drdos_7.02_mf2dd.img.lz", + "drdos_7.02_mf2ed.img.lz", "drdos_7.02_mf2hd.img.lz", "drdos_7.02_ssdd.img.lz", "drdos_7.02_ssdd8.img.lz", + // DR-DOS 7.03 + "drdos_7.03_dsdd.img.lz", "drdos_7.03_dsdd8.img.lz", "drdos_7.03_dshd.img.lz", "drdos_7.03_mf2dd.img.lz", + "drdos_7.03_mf2ed.img.lz", "drdos_7.03_mf2hd.img.lz", + // DR-DOS 8.00 + "drdos_8.00_dsdd.img.lz", "drdos_8.00_dsdd8.img.lz", "drdos_8.00_dshd.img.lz", "drdos_8.00_mf2dd.img.lz", + "drdos_8.00_mf2ed.img.lz", "drdos_8.00_mf2hd.img.lz", "drdos_8.00_ssdd.img.lz", "drdos_8.00_ssdd8.img.lz", + // MS-DOS 3.30A + "msdos_3.30A_dsdd.img.lz","msdos_3.30A_dsdd8.img.lz","msdos_3.30A_dshd.img.lz","msdos_3.30A_mf2dd.img.lz", + "msdos_3.30A_mf2ed.img.lz","msdos_3.30A_mf2hd.img.lz","msdos_3.30A_ssdd.img.lz","msdos_3.30A_ssdd8.img.lz", + // MS-DOS 3.31 + "msdos_3.31_dsdd.img.lz","msdos_3.31_dsdd8.img.lz","msdos_3.31_dshd.img.lz","msdos_3.31_mf2dd.img.lz", + "msdos_3.31_mf2ed.img.lz","msdos_3.31_mf2hd.img.lz","msdos_3.31_ssdd.img.lz","msdos_3.31_ssdd8.img.lz", + // MS-DOS 4.01 + "msdos_4.01_dsdd.img.lz","msdos_4.01_dsdd8.img.lz","msdos_4.01_dshd.img.lz","msdos_4.01_mf2dd.img.lz", + "msdos_4.01_mf2hd.img.lz","msdos_4.01_ssdd.img.lz","msdos_4.01_ssdd8.img.lz", + // MS-DOS 5.00 + "msdos_5.00_dsdd.img.lz","msdos_5.00_dsdd8.img.lz","msdos_5.00_dshd.img.lz","msdos_5.00_mf2dd.img.lz", + "msdos_5.00_mf2ed.img.lz","msdos_5.00_mf2hd.img.lz","msdos_5.00_ssdd.img.lz","msdos_5.00_ssdd8.img.lz", + // MS-DOS 6.00 + "msdos_6.00_dsdd.img.lz","msdos_6.00_dsdd8.img.lz","msdos_6.00_dshd.img.lz","msdos_6.00_mf2dd.img.lz", + "msdos_6.00_mf2ed.img.lz","msdos_6.00_mf2hd.img.lz","msdos_6.00_ssdd.img.lz","msdos_6.00_ssdd8.img.lz", + // MS-DOS 6.20 + "msdos_6.20_dsdd.img.lz","msdos_6.20_dsdd8.img.lz","msdos_6.20_dshd.img.lz","msdos_6.20_mf2dd.img.lz", + "msdos_6.20_mf2ed.img.lz","msdos_6.20_mf2hd.img.lz","msdos_6.20_ssdd.img.lz","msdos_6.20_ssdd8.img.lz", + // MS-DOS 6.20 RC1 + "msdos_6.20rc1_dsdd.img.lz","msdos_6.20rc1_dsdd8.img.lz","msdos_6.20rc1_dshd.img.lz","msdos_6.20rc1_mf2dd.img.lz", + "msdos_6.20rc1_mf2ed.img.lz","msdos_6.20rc1_mf2hd.img.lz","msdos_6.20rc1_ssdd.img.lz","msdos_6.20rc1_ssdd8.img.lz", + // MS-DOS 6.21 + "msdos_6.21_dsdd.img.lz","msdos_6.21_dsdd8.img.lz","msdos_6.21_dshd.img.lz","msdos_6.21_mf2dd.img.lz", + "msdos_6.21_mf2ed.img.lz","msdos_6.21_mf2hd.img.lz","msdos_6.21_ssdd.img.lz","msdos_6.21_ssdd8.img.lz", + // MS-DOS 6.22 + "msdos_6.22_dsdd.img.lz","msdos_6.22_dsdd8.img.lz","msdos_6.22_dshd.img.lz","msdos_6.22_mf2dd.img.lz", + "msdos_6.22_mf2ed.img.lz","msdos_6.22_mf2hd.img.lz","msdos_6.22_ssdd.img.lz","msdos_6.22_ssdd8.img.lz", + // MS-DOS 7.10 + "msdos_7.10_dsdd.img.lz","msdos_7.10_dsdd8.img.lz","msdos_7.10_dshd.img.lz","msdos_7.10_mf2dd.img.lz", + "msdos_7.10_mf2ed.img.lz","msdos_7.10_mf2hd.img.lz","msdos_7.10_ssdd.img.lz","msdos_7.10_ssdd8.img.lz", + // MS-DOS 3.20 for Amstrad + "msdos_amstrad_3.20_dsdd.img.lz","msdos_amstrad_3.20_dsdd8.img.lz","msdos_amstrad_3.20_dshd.img.lz", + "msdos_amstrad_3.20_mf2dd.img.lz","msdos_amstrad_3.20_ssdd.img.lz","msdos_amstrad_3.20_ssdd8.img.lz", + // MS-DOS 2.11 for AT&T + "msdos_att_2.11_dsdd.img.lz", + // MS-DOS 3.30 for DeLL + "msdos_dell_3.30_dsdd.img.lz","msdos_dell_3.30_dsdd8.img.lz","msdos_dell_3.30_dshd.img.lz", + "msdos_dell_3.30_mf2dd.img.lz","msdos_dell_3.30_mf2hd.img.lz","msdos_dell_3.30_ssdd.img.lz", + "msdos_dell_3.30_ssdd8.img.lz", + // MS-DOS 3.10 for Epson + "msdos_epson_3.10_dsdd.img.lz","msdos_epson_3.10_dsdd8.img.lz","msdos_epson_3.10_dshd.img.lz", + // MS-DOS 3.20 for Epson + "msdos_epson_3.20_dsdd.img.lz","msdos_epson_3.20_dsdd8.img.lz","msdos_epson_3.20_dshd.img.lz", + "msdos_epson_3.20_mf2dd.img.lz","msdos_epson_3.20_ssdd.img.lz","msdos_epson_3.20_ssdd8.img.lz", + // MS-DOS 3.20 for HP + "msdos_hp_3.20_dsdd.img.lz","msdos_hp_3.20_dsdd8.img.lz","msdos_hp_3.20_dshd.img.lz", + "msdos_hp_3.20_mf2dd.img.lz","msdos_hp_3.20_mf2hd.img.lz","msdos_hp_3.20_ssdd.img.lz", + "msdos_hp_3.20_ssdd8.img.lz", + // MS-DOS 3.21 for Hyosung + "msdos_hyonsung_3.21_dsdd.img.lz","msdos_hyonsung_3.21_dsdd8.img.lz","msdos_hyonsung_3.21_dshd.img.lz", + "msdos_hyonsung_3.21_mf2dd.img.lz","msdos_hyonsung_3.21_mf2hd.img.lz","msdos_hyonsung_3.21_ssdd.img.lz", + "msdos_hyonsung_3.21_ssdd8.img.lz", + // MS-DOS 3.21 for Kaypro + "msdos_kaypro_3.21_dsdd.img.lz","msdos_kaypro_3.21_dsdd8.img.lz","msdos_kaypro_3.21_dshd.img.lz", + "msdos_kaypro_3.21_mf2dd.img.lz","msdos_kaypro_3.21_mf2hd.img.lz","msdos_kaypro_3.21_ssdd.img.lz", + //"msdos_kaypro_3.21_ssdd8.img.lz", + // MS-DOS 3.10 for Olivetti + "msdos_olivetti_3.10_dsdd.img.lz","msdos_olivetti_3.10_dshd.img.lz","msdos_olivetti_3.10_ssdd.img.lz", + // MS-DOS 3.30 for Toshiba + "msdos_toshiba_3.30_dsdd.img.lz","msdos_toshiba_3.30_dsdd8.img.lz","msdos_toshiba_3.30_dshd.img.lz", + "msdos_toshiba_3.30_mf2dd.img.lz","msdos_toshiba_3.30_mf2hd.img.lz","msdos_toshiba_3.30_ssdd.img.lz", + "msdos_toshiba_3.30_ssdd8.img.lz", + // MS-DOS 4.01 for Toshiba + "msdos_toshiba_4.01_dsdd.img.lz","msdos_toshiba_4.01_dsdd8.img.lz","msdos_toshiba_4.01_dshd.img.lz", + "msdos_toshiba_4.01_mf2dd.img.lz","msdos_toshiba_4.01_mf2hd.img.lz","msdos_toshiba_4.01_ssdd.img.lz", + "msdos_toshiba_4.01_ssdd8.img.lz", + // Novell DOS 7.00 + "novelldos_7.00_dsdd.img.lz","novelldos_7.00_dsdd8.img.lz","novelldos_7.00_dshd.img.lz","novelldos_7.00_mf2dd.img.lz", + "novelldos_7.00_mf2ed.img.lz","novelldos_7.00_mf2hd.img.lz","novelldos_7.00_ssdd.img.lz","novelldos_7.00_ssdd8.img.lz", + // OpenDOS 7.01 + "opendos_7.01_dsdd.img.lz","opendos_7.01_dsdd8.img.lz","opendos_7.01_dshd.img.lz","opendos_7.01_mf2dd.img.lz", + "opendos_7.01_mf2ed.img.lz","opendos_7.01_mf2hd.img.lz","opendos_7.01_ssdd.img.lz","opendos_7.01_ssdd8.img.lz", + // PC-DOS 2.00 + "pcdos_2.00_dsdd.img.lz", + // PC-DOS 2.10 + "pcdos_2.10_dsdd.img.lz", + // PC-DOS 2000 + "pcdos_2000_dsdd.img.lz","pcdos_2000_dsdd8.img.lz","pcdos_2000_dshd.img.lz","pcdos_2000_mf2dd.img.lz", + "pcdos_2000_mf2ed.img.lz","pcdos_2000_mf2hd.img.lz","pcdos_2000_ssdd.img.lz","pcdos_2000_ssdd8.img.lz", + // PC-DOS 3.00 + "pcdos_3.00_dshd.img.lz", + // PC-DOS 3.10 + "pcdos_3.10_dshd.img.lz", + // PC-DOS 3.30 + "pcdos_3.30_dshd.img.lz","pcdos_3.30_mf2hd.img.lz", + // PC-DOS 4.00 + "pcdos_4.00_dshd.img.lz","pcdos_4.00_mf2hd.img.lz", + // PC-DOS 5.00 + "pcdos_5.00_dsdd.img.lz","pcdos_5.00_dsdd8.img.lz","pcdos_5.00_dshd.img.lz","pcdos_5.00_mf2dd.img.lz", + "pcdos_5.00_mf2ed.img.lz","pcdos_5.00_mf2hd.img.lz","pcdos_5.00_ssdd.img.lz","pcdos_5.00_ssdd8.img.lz", + // PC-DOS 5.02 + "pcdos_5.02_dsdd.img.lz","pcdos_5.02_dsdd8.img.lz","pcdos_5.02_dshd.img.lz","pcdos_5.02_mf2dd.img.lz", + "pcdos_5.02_mf2ed.img.lz","pcdos_5.02_mf2hd.img.lz","pcdos_5.02_ssdd.img.lz","pcdos_5.02_ssdd8.img.lz", + // PC-DOS 6.10 + "pcdos_6.10_dsdd.img.lz","pcdos_6.10_dsdd8.img.lz","pcdos_6.10_dshd.img.lz","pcdos_6.10_mf2dd.img.lz", + "pcdos_6.10_mf2ed.img.lz","pcdos_6.10_mf2hd.img.lz","pcdos_6.10_ssdd.img.lz","pcdos_6.10_ssdd8.img.lz", + // PC-DOS 6.30 + "pcdos_6.30_dsdd.img.lz","pcdos_6.30_dsdd8.img.lz","pcdos_6.30_dshd.img.lz","pcdos_6.30_mf2dd.img.lz", + "pcdos_6.30_mf2ed.img.lz","pcdos_6.30_mf2hd.img.lz","pcdos_6.30_ssdd.img.lz","pcdos_6.30_ssdd8.img.lz", + // mkfs.vfat + "mkfs.vfat_dshd.img.lz","mkfs.vfat_mf2dd.img.lz","mkfs.vfat_mf2ed.img.lz","mkfs.vfat_mf2hd.img.lz", + // mkfs.vfat for Atari + "mkfs.vfat_atari_dshd.img.lz","mkfs.vfat_atari_mf2dd.img.lz","mkfs.vfat_atari_mf2ed.img.lz","mkfs.vfat_atari_mf2hd.img.lz", + // Microsoft OS/2 1.00 for Tandy + "msos2_1.00_tandy_dsdd.img.lz","msos2_1.00_tandy_dshd.img.lz","msos2_1.00_tandy_mf2dd.img.lz","msos2_1.00_tandy_mf2hd.img.lz", + // Microsoft OS/2 1.10 for AST + "msos2_1.10_ast_dsdd.img.lz","msos2_1.10_ast_dshd.img.lz","msos2_1.10_ast_mf2dd.img.lz","msos2_1.10_ast_mf2hd.img.lz", + // Microsoft OS/2 1.10 for Nokia + "msos2_1.10_nokia_dsdd.img.lz","msos2_1.10_nokia_dshd.img.lz","msos2_1.10_nokia_mf2dd.img.lz","msos2_1.10_nokia_mf2hd.img.lz", + // Microsoft OS/2 1.21 + "msos2_1.21_dsdd.img.lz","msos2_1.21_dshd.img.lz","msos2_1.21_mf2dd.img.lz","msos2_1.21_mf2hd.img.lz", + // Microsoft OS/2 1.30.1 + "msos2_1.30.1_dsdd.img.lz","msos2_1.30.1_dshd.img.lz","msos2_1.30.1_mf2dd.img.lz","msos2_1.30.1_mf2ed.img.lz","msos2_1.30.1_mf2hd.img.lz", + // OS/2 1.20 + "os2_1.20_dsdd.img.lz","os2_1.20_dshd.img.lz","os2_1.20_mf2dd.img.lz","os2_1.20_mf2hd.img.lz", + // OS/2 1.30 + "os2_1.30_dsdd.img.lz","os2_1.30_dshd.img.lz","os2_1.30_mf2dd.img.lz","os2_1.30_mf2hd.img.lz", + // OS/2 2.00 + "os2_6.307_dsdd.img.lz","os2_6.307_dshd.img.lz","os2_6.307_mf2dd.img.lz","os2_6.307_mf2ed.img.lz","os2_6.307_mf2hd.img.lz", + // OS/2 2.10 + "os2_6.514_dsdd.img.lz","os2_6.514_dshd.img.lz","os2_6.514_mf2dd.img.lz","os2_6.514_mf2ed.img.lz","os2_6.514_mf2hd.img.lz", + // OS/2 2.11 + "os2_6.617_dsdd.img.lz","os2_6.617_dshd.img.lz","os2_6.617_mf2dd.img.lz","os2_6.617_mf2ed.img.lz","os2_6.617_mf2hd.img.lz", + // OS/2 Warp 3 + "os2_8.162_dshd.img.lz","os2_8.162_mf2dd.img.lz","os2_8.162_mf2ed.img.lz","os2_8.162_mf2hd.img.lz", + // OS/2 Warp 4 + "os2_9.023_dshd.img.lz","os2_9.023_mf2dd.img.lz","os2_9.023_mf2ed.img.lz","os2_9.023_mf2hd.img.lz", + // eComStation + "ecs_dshd.img.lz","ecs_mf2dd.img.lz","ecs_mf2ed.img.lz","ecs_mf2hd.img.lz", + // Windows 95 + "win95_dsdd8.img.lz","win95_dsdd.img.lz","win95_dshd.img.lz","win95_mf2dd.img.lz", + "win95_mf2ed.img.lz","win95_mf2hd.img.lz","win95_ssdd8.img.lz","win95_ssdd.img.lz", + // Windows 95 OSR 2 + "win95osr2_dsdd8.img.lz","win95osr2_dsdd.img.lz","win95osr2_dshd.img.lz","win95osr2_mf2dd.img.lz", + "win95osr2_mf2ed.img.lz","win95osr2_mf2hd.img.lz","win95osr2_ssdd8.img.lz","win95osr2_ssdd.img.lz", + /// Windows 95 OSR 2.1 + "win95osr2.1_dsdd8.img.lz","win95osr2.1_dsdd.img.lz","win95osr2.1_dshd.img.lz","win95osr2.1_mf2dd.img.lz", + "win95osr2.1_mf2ed.img.lz","win95osr2.1_mf2hd.img.lz","win95osr2.1_ssdd8.img.lz","win95osr2.1_ssdd.img.lz", + // Windows 95 OSR 2.5 + "win95osr2.5_dsdd8.img.lz","win95osr2.5_dsdd.img.lz","win95osr2.5_dshd.img.lz","win95osr2.5_mf2dd.img.lz", + "win95osr2.5_mf2ed.img.lz","win95osr2.5_mf2hd.img.lz","win95osr2.5_ssdd8.img.lz","win95osr2.5_ssdd.img.lz", + // Windows 98 + "win98_dsdd8.img.lz","win98_dsdd.img.lz","win98_dshd.img.lz","win98_mf2dd.img.lz", + "win98_mf2ed.img.lz","win98_mf2hd.img.lz","win98_ssdd8.img.lz","win98_ssdd.img.lz", + // Windows 98 Second Edition + "win98se_dsdd8.img.lz","win98se_dsdd.img.lz","win98se_dshd.img.lz","win98se_mf2dd.img.lz", + "win98se_mf2ed.img.lz","win98se_mf2hd.img.lz","win98se_ssdd8.img.lz","win98se_ssdd.img.lz", + // Windows Me + "winme_dsdd.img.lz","winme_dshd.img.lz","winme_mf2dd.img.lz","winme_mf2ed.img.lz","winme_mf2hd.img.lz", + // Windows NT 3.10 + "winnt_3.10_dshd.img.lz","winnt_3.10_mf2dd.img.lz","winnt_3.10_mf2ed.img.lz","winnt_3.10_mf2hd.img.lz", + // Windows NT 3.50 + "winnt_3.50_dshd.img.lz","winnt_3.50_mf2dd.img.lz","winnt_3.50_mf2ed.img.lz","winnt_3.50_mf2hd.img.lz", + // Windows NT 3.51 + "winnt_3.51_dshd.img.lz","winnt_3.51_mf2dd.img.lz","winnt_3.51_mf2ed.img.lz","winnt_3.51_mf2hd.img.lz", + // Windows NT 4.00 + "winnt_4_dsdd.img.lz","winnt_4_dshd.img.lz","winnt_4_mf2dd.img.lz","winnt_4_mf2ed.img.lz", + "winnt_4_mf2hd.img.lz","winnt_4_ssdd.img.lz", + // Windows 2000 + "win2000_dsdd.img.lz","win2000_dshd.img.lz","win2000_mf2dd.img.lz","win2000_mf2ed.img.lz","win2000_mf2hd.img.lz", + // Windows Vista + "winvista_dsdd.img.lz","winvista_dshd.img.lz","winvista_mf2dd.img.lz","winvista_mf2ed.img.lz","winvista_mf2hd.img.lz", + // BeOS R4.5 + "beos_r4.5_mf2hd.img.lz", + // Hatari + "hatari_mf1dd.st.lz","hatari_mf1dd_10.st.lz","hatari_mf1dd_11.st.lz", + "hatari_mf2dd.st.lz","hatari_mf2dd_10.st.lz","hatari_mf2dd_11.st.lz", + "hatari_mf2ed.st.lz","hatari_mf2hd.st.lz", + // Atari TOS 1.04 + "tos_1.04_mf1dd.st.lz","tos_1.04_mf2dd.st.lz", + // NetBSD 1.6 + "netbsd_1.6_mf2dd.img.lz","netbsd_1.6_mf2hd.img.lz", + // NeXTStep 3.3 + "nextstep_3.3_mf2dd.img.lz","nextstep_3.3_mf2hd.img.lz", + // OpenStep for Mach 4.0 + "openstep_4.0_mf2dd.img.lz","openstep_4.0_mf2hd.img.lz", + // OpenStep for Mach 4.2 + "openstep_4.2_mf2dd.img.lz","openstep_4.2_mf2hd.img.lz", + // Solaris 2.4 + "solaris_2.4_mf2dd.img.lz","solaris_2.4_mf2hd.img.lz", + }; + + readonly MediaType[] mediatypes = { + // Concurrent DOS 6.00 + MediaType.DOS_525_HD, MediaType.DOS_35_DS_DD_9, MediaType.DOS_35_HD, + // DR-DOS 3.40 + MediaType.DOS_525_DS_DD_9, MediaType.DOS_525_DS_DD_8, MediaType.DOS_525_HD, MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_HD, MediaType.DOS_525_SS_DD_9, MediaType.DOS_525_SS_DD_8, + // DR-DOS 3.41 + MediaType.DOS_525_DS_DD_9, MediaType.DOS_525_DS_DD_8, MediaType.DOS_525_HD, MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_HD, MediaType.DOS_525_SS_DD_9, MediaType.DOS_525_SS_DD_8, + // DR-DOS 5.00 + MediaType.DOS_525_DS_DD_9, MediaType.DOS_525_DS_DD_8, MediaType.DOS_525_HD, MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_HD, MediaType.DOS_525_SS_DD_9, MediaType.DOS_525_SS_DD_8, + // DR-DOS 6.00 + MediaType.DOS_525_DS_DD_9, MediaType.DOS_525_DS_DD_8, MediaType.DOS_525_HD, MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_ED, MediaType.DOS_35_HD, MediaType.DOS_525_SS_DD_9, MediaType.DOS_525_SS_DD_8, + // DR-DOS 7.02 + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_ED,MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_9,MediaType.DOS_525_SS_DD_8, + // DR-DOS 7.03 + MediaType.DOS_525_DS_DD_9, MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_ED,MediaType.DOS_35_HD, + // DR-DOS 8.00 + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_ED,MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_9,MediaType.DOS_525_SS_DD_8, + // MS-DOS 3.30A + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_ED,MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_9,MediaType.DOS_525_SS_DD_8, + // MS-DOS 3.31 + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_ED,MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_9,MediaType.DOS_525_SS_DD_8, + // MS-DOS 4.01 + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_9,MediaType.DOS_525_SS_DD_8, + // MS-DOS 5.00 + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_ED,MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_9,MediaType.DOS_525_SS_DD_8, + // MS-DOS 6.00 + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_ED,MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_9,MediaType.DOS_525_SS_DD_8, + // MS-DOS 6.20 + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_ED,MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_9,MediaType.DOS_525_SS_DD_8, + // MS-DOS 6.20 RC1 + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_ED,MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_9,MediaType.DOS_525_SS_DD_8, + // MS-DOS 6.21 + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_ED,MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_9,MediaType.DOS_525_SS_DD_8, + // MS-DOS 6.22 + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_ED,MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_9,MediaType.DOS_525_SS_DD_8, + // MS-DOS 7.10 + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_ED,MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_9,MediaType.DOS_525_SS_DD_8, + // MS-DOS 3.20 for Amstrad + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_525_SS_DD_9,MediaType.DOS_525_SS_DD_8, + // MS-DOS 2.11 for AT&T + MediaType.DOS_525_DS_DD_9, + // MS-DOS 3.30 for DeLL + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_9,MediaType.DOS_525_SS_DD_8, + // MS-DOS 3.10 for Epson + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_HD, + // MS-DOS 3.20 for Epson + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_525_SS_DD_9,MediaType.DOS_525_SS_DD_8, + // MS-DOS 3.20 for HP + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_9,MediaType.DOS_525_SS_DD_8, + // MS-DOS 3.21 for Hyosung + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_9,MediaType.DOS_525_SS_DD_8, + // MS-DOS 3.21 for Kaypro + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_9,MediaType.DOS_525_SS_DD_8, + // MS-DOS 3.10 for Olivetti + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_HD,MediaType.DOS_525_SS_DD_9, + // MS-DOS 3.30 for Toshiba + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_9,MediaType.DOS_525_SS_DD_8, + // MS-DOS 4.01 for Toshiba + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_9,MediaType.DOS_525_SS_DD_8, + // Novell DOS 7.00 + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_ED,MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_9,MediaType.DOS_525_SS_DD_8, + // OpenDOS 7.01 + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_ED,MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_9,MediaType.DOS_525_SS_DD_8, + // PC-DOS 2.00 + MediaType.DOS_525_DS_DD_9, + // PC-DOS 2.10 + MediaType.DOS_525_DS_DD_9, + // PC-DOS 2000 + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_ED,MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_9,MediaType.DOS_525_SS_DD_8, + // PC-DOS 3.00 + MediaType.DOS_525_HD, + // PC-DOS 3.10 + MediaType.DOS_525_HD, + // PC-DOS 3.30 + MediaType.DOS_525_HD,MediaType.DOS_35_HD, + // PC-DOS 4.00 + MediaType.DOS_525_HD,MediaType.DOS_35_HD, + // PC-DOS 5.00 + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_ED,MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_9,MediaType.DOS_525_SS_DD_8, + // PC-DOS 5.02 + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_ED,MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_9,MediaType.DOS_525_SS_DD_8, + // PC-DOS 6.10 + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_ED,MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_9,MediaType.DOS_525_SS_DD_8, + // PC-DOS 6.30 + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_ED,MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_9,MediaType.DOS_525_SS_DD_8, + // mkfs.vfat + MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_ED,MediaType.DOS_35_HD, + // mkfs.vfat for Atari + MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_ED,MediaType.DOS_35_HD, + // Microsoft OS/2 1.00 for Tandy + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_HD, + // Microsoft OS/2 1.10 for AST + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_HD, + // Microsoft OS/2 1.10 for Nokia + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_HD, + // Microsoft OS/2 1.21 + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_HD, + // Microsoft OS/2 1.30.1 + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_ED,MediaType.DOS_35_HD, + // OS/2 1.20 + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_HD, + // OS/2 1.30 + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_HD, + // OS/2 2.00 + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_ED,MediaType.DOS_35_HD, + // OS/2 2.10 + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_ED,MediaType.DOS_35_HD, + // OS/2 2.11 + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_ED,MediaType.DOS_35_HD, + // OS/2 Warp 3 + MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_ED,MediaType.DOS_35_HD, + // OS/2 Warp 4 + MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_ED,MediaType.DOS_35_HD, + // eComStation + MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_ED,MediaType.DOS_35_HD, + // Windows 95 + MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_ED,MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_8,MediaType.DOS_525_SS_DD_9, + // Windows 95 OSR 2 + MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_ED,MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_8,MediaType.DOS_525_SS_DD_9, + /// Windows 95 OSR 2.1 + MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_ED,MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_8,MediaType.DOS_525_SS_DD_9, + // Windows 95 OSR 2.5 + MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_ED,MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_8,MediaType.DOS_525_SS_DD_9, + // Windows 98 + MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_ED,MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_8,MediaType.DOS_525_SS_DD_9, + // Windows 98 Second Edition + MediaType.DOS_525_DS_DD_8,MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9, + MediaType.DOS_35_ED,MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_8,MediaType.DOS_525_SS_DD_9, + // Windows Me + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_ED,MediaType.DOS_35_HD, + // Windows NT 3.10 + MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_ED,MediaType.DOS_35_HD, + // Windows NT 3.50 + MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_ED,MediaType.DOS_35_HD, + // Windows NT 3.51 + MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_ED,MediaType.DOS_35_HD, + // Windows NT 4.00 + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_ED, + MediaType.DOS_35_HD,MediaType.DOS_525_SS_DD_9, + // Windows 2000 + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_ED,MediaType.DOS_35_HD, + // Windows Vista + MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_ED,MediaType.DOS_35_HD, + // BeOS R4.5 + MediaType.DOS_35_HD, + // Hatari + // TODO: Incorrect media types + MediaType.DOS_35_SS_DD_9,MediaType.GENERIC_HDD,MediaType.GENERIC_HDD, + MediaType.DOS_35_DS_DD_9,MediaType.ATARI_35_DS_DD,MediaType.GENERIC_HDD, + MediaType.DOS_35_ED,MediaType.DOS_35_HD, + // Atari TOS 1.04 + MediaType.DOS_35_SS_DD_9,MediaType.DOS_35_DS_DD_9, + // NetBSD 1.6 + MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_HD, + // NeXTStep 3.3 + MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_HD, + // OpenStep for Mach 4.0 + MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_HD, + // OpenStep for Mach 4.2 + MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_HD, + // Solaris 2.4 + MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_HD, + }; + + readonly ulong[] sectors = { + // Concurrent DOS 6.00 + 2400, 1440, 2880, + // DR-DOS 3.40 + 720, 640, 2400, 1440, 2880, 360, 320, + // DR-DOS 3.41 + 720,640,2400,1440,2880,360,320, + // DR-DOS 5.00 + 720,640,2400,1440,2880,360,320, + // DR-DOS 6.00 + 720,640,2400,1440,5760,2880,360,320, + // DR-DOS 7.02 + 720,640,2400,1440,5760,2880,360,320, + // DR-DOS 7.03 + 720,640,2400,1440,5760,2880, + // DR-DOS 8.00 + 720,640,2400,1440,5760,2880,360,320, + // MS-DOS 3.30A + 720,640,2400,1440,5760,2880,360,320, + // MS-DOS 3.31 + 720,640,2400,1440,5760,2880,360,320, + // MS-DOS 4.01 + 720,640,2400,1440,2880,360,320, + // MS-DOS 5.00 + 720,640,2400,1440,5760,2880,360,320, + // MS-DOS 6.00 + 720,640,2400,1440,5760,2880,360,320, + // MS-DOS 6.20 + 720,640,2400,1440,5760,2880,360,320, + // MS-DOS 6.20 RC1 + 720,640,2400,1440,5760,2880,360,320, + // MS-DOS 6.21 + 720,640,2400,1440,5760,2880,360,320, + // MS-DOS 6.22 + 720,640,2400,1440,5760,2880,360,320, + // MS-DOS 7.10 + 720,640,2400,1440,5760,2880,360,320, + // MS-DOS 3.20 for Amstrad + 720,640,2400,1440,360,320, + // MS-DOS 2.11 for AT&T + 720, + // MS-DOS 3.30 for DeLL + 720,640,2400,1440,2880,360,320, + // MS-DOS 3.10 for Epson + 720,640,2400, + // MS-DOS 3.20 for Epson + 720,640,2400,1440,360,320, + // MS-DOS 3.20 for HP + 720,640,2400,1440,2880,360,320, + // MS-DOS 3.21 for Hyosung + 720,640,2400,1440,2880,360,320, + // MS-DOS 3.21 for Kaypro + 720,640,2400,1440,2880,360,320, + // MS-DOS 3.10 for Olivetti + 720,2400,360, + // MS-DOS 3.30 for Toshiba + 720,640,2400,1440,2880,360,320, + // MS-DOS 4.01 for Toshiba + 720,640,2400,1440,2880,360,320, + // Novell DOS 7.00 + 720,640,2400,1440,5760,2880,360,320, + // OpenDOS 7.01 + 720,640,2400,1440,5760,2880,360,320, + // PC-DOS 2.00 + 720, + // PC-DOS 2.10 + 720, + // PC-DOS 2000 + 720,640,2400,1440,5760,2880,360,320, + // PC-DOS 3.00 + 2400, + // PC-DOS 3.10 + 2400, + // PC-DOS 3.30 + 2400,2880, + // PC-DOS 4.00 + 2400,2880, + // PC-DOS 5.00 + 720,640,2400,1440,5760,2880,360,320, + // PC-DOS 5.02 + 720,640,2400,1440,5760,2880,360,320, + // PC-DOS 6.10 + 720,640,2400,1440,5760,2880,360,320, + // PC-DOS 6.30 + 720,640,2400,1440,5760,2880,360,320, + // mkfs.vfat + 2400,1440,5760,2880, + // mkfs.vfat for Atari + 2400,1440,5760,2880, + // Microsoft OS/2 1.00 for Tandy + 720,2400,1440,2880, + // Microsoft OS/2 1.10 for AST + 720,2400,1440,2880, + // Microsoft OS/2 1.10 for Nokia + 720,2400,1440,2880, + // Microsoft OS/2 1.21 + 720,2400,1440,2880, + // Microsoft OS/2 1.30.1 + 720,2400,1440,5760,2880, + // OS/2 1.20 + 720,2400,1440,2880, + // OS/2 1.30 + 720,2400,1440,2880, + // OS/2 2.00 + 720,2400,1440,5760,2880, + // OS/2 2.10 + 720,2400,1440,5760,2880, + // OS/2 2.11 + 720,2400,1440,5760,2880, + // OS/2 Warp 3 + 2400,1440,5760,2880, + // OS/2 Warp 4 + 2400,1440,5760,2880, + // eComStation + 2400,1440,5760,2880, + // Windows 95 + 640,720,2400,1440,5760,2880,320,360, + // Windows 95 OSR 2 + 640,720,2400,1440,5760,2880,320,360, + /// Windows 95 OSR 2.1 + 640,720,2400,1440,5760,2880,320,360, + // Windows 95 OSR 2.5 + 640,720,2400,1440,5760,2880,320,360, + // Windows 98 + 640,720,2400,1440,5760,2880,320,360, + // Windows 98 Second Edition + 640,720,2400,1440,5760,2880,320,360, + // Windows Me + 720,2400,1440,5760,2880, + // Windows NT 3.10 + 2400,1440,5760,2880, + // Windows NT 3.50 + 2400,1440,5760,2880, + // Windows NT 3.51 + 2400,1440,5760,2880, + // Windows NT 4.00 + 720,2400,1440,5760,2880,360, + // Windows 2000 + 720,2400,1440,5760,2880, + // Windows Vista + 720,2400,1440,5760,2880, + // BeOS R4.5 + 2880, + // Hatari + 720,800,880,1440,1600,1760,5760,2880, + // Atari TOS 1.04 + 720,1440, + // NetBSD 1.6 + 1440,2880, + // NeXTStep 3.3 + 1440,2880, + // OpenStep for Mach 4.0 + 1440,2880, + // OpenStep for Mach 4.2 + 1440,2880, + // Solaris 2.4 + 1440,2880, + }; + + readonly uint[] sectorsize = { + // Concurrent DOS 6.00 + 512, 512, 512, + // DR-DOS 3.40 + 512, 512, 512, 512, 512, 512, 512, + // DR-DOS 3.41 + 512,512,512,512,512,512,512, + // DR-DOS 5.00 + 512,512,512,512,512,512,512, + // DR-DOS 6.00 + 512,512,512,512,512,512,512,512, + // DR-DOS 7.02 + 512,512,512,512,512,512,512,512, + // DR-DOS 7.03 + 512,512,512,512,512,512, + // DR-DOS 8.00 + 512,512,512,512,512,512,512,512, + // MS-DOS 3.30A + 512,512,512,512,512,512,512,512, + // MS-DOS 3.31 + 512,512,512,512,512,512,512,512, + // MS-DOS 4.01 + 512,512,512,512,512,512,512, + // MS-DOS 5.00 + 512,512,512,512,512,512,512,512, + // MS-DOS 6.00 + 512,512,512,512,512,512,512,512, + // MS-DOS 6.20 + 512,512,512,512,512,512,512,512, + // MS-DOS 6.20 RC1 + 512,512,512,512,512,512,512,512, + // MS-DOS 6.21 + 512,512,512,512,512,512,512,512, + // MS-DOS 6.22 + 512,512,512,512,512,512,512,512, + // MS-DOS 7.10 + 512,512,512,512,512,512,512,512, + // MS-DOS 3.20 for Amstrad + 512,512,512,512,512,512, + // MS-DOS 2.11 for AT&T + 512, + // MS-DOS 3.30 for DeLL + 512,512,512,512,512,512,512, + // MS-DOS 3.10 for Epson + 512,512,512, + // MS-DOS 3.20 for Epson + 512,512,512,512,512,512, + // MS-DOS 3.20 for HP + 512,512,512,512,512,512,512, + // MS-DOS 3.21 for Hyosung + 512,512,512,512,512,512,512, + // MS-DOS 3.21 for Kaypro + 512,512,512,512,512,512,512, + // MS-DOS 3.10 for Olivetti + 512,512,512, + // MS-DOS 3.30 for Toshiba + 512,512,512,512,512,512,512, + // MS-DOS 4.01 for Toshiba + 512,512,512,512,512,512,512, + // Novell DOS 7.00 + 512,512,512,512,512,512,512,512, + // OpenDOS 7.01 + 512,512,512,512,512,512,512,512, + // PC-DOS 2.00 + 512, + // PC-DOS 2.10 + 512, + // PC-DOS 2000 + 512,512,512,512,512,512,512,512, + // PC-DOS 3.00 + 512, + // PC-DOS 3.10 + 512, + // PC-DOS 3.30 + 512,512, + // PC-DOS 4.00 + 512,512, + // PC-DOS 5.00 + 512,512,512,512,512,512,512,512, + // PC-DOS 5.02 + 512,512,512,512,512,512,512,512, + // PC-DOS 6.10 + 512,512,512,512,512,512,512,512, + // PC-DOS 6.30 + 512,512,512,512,512,512,512,512, + // mkfs.vfat + 512,512,512,512, + // mkfs.vfat for Atari + 512,512,512,512, + // Microsoft OS/2 1.00 for Tandy + 512,512,512,512, + // Microsoft OS/2 1.10 for AST + 512,512,512,512, + // Microsoft OS/2 1.10 for Nokia + 512,512,512,512, + // Microsoft OS/2 1.21 + 512,512,512,512, + // Microsoft OS/2 1.30.1 + 512,512,512,512,512, + // OS/2 1.20 + 512,512,512,512, + // OS/2 1.30 + 512,512,512,512, + // OS/2 2.00 + 512,512,512,512,512, + // OS/2 2.10 + 512,512,512,512,512, + // OS/2 2.11 + 512,512,512,512,512, + // OS/2 Warp 3 + 512,512,512,512, + // OS/2 Warp 4 + 512,512,512,512, + // eComStation + 512,512,512,512, + // Windows 95 + 512,512,512,512,512,512,512,512, + // Windows 95 OSR 2 + 512,512,512,512,512,512,512,512, + /// Windows 95 OSR 2.1 + 512,512,512,512,512,512,512,512, + // Windows 95 OSR 2.5 + 512,512,512,512,512,512,512,512, + // Windows 98 + 512,512,512,512,512,512,512,512, + // Windows 98 Second Edition + 512,512,512,512,512,512,512,512, + // Windows Me + 512,512,512,512,512, + // Windows NT 3.10 + 512,512,512,512, + // Windows NT 3.50 + 512,512,512,512, + // Windows NT 3.51 + 512,512,512,512, + // Windows NT 4.00 + 512,512,512,512,512,512, + // Windows 2000 + 512,512,512,512,512, + // Windows Vista + 512,512,512,512,512, + // BeOS R4.5 + 512, + // Hatari + 512,512,512,512,512,512,512,512, + // Atari TOS 1.04 + 512,512, + // NetBSD 1.6 + 512,512, + // NeXTStep 3.3 + 512,512, + // OpenStep for Mach 4.0 + 512,512, + // OpenStep for Mach 4.2 + 512,512, + // Solaris 2.4 + 512,512, + }; + + readonly long[] clusters = { + // Concurrent DOS 6.00 + 2400, 720, 2880, + // DR-DOS 3.40 + 360,320,2400,720,2880,360,320, + // DR-DOS 3.41 + 360,320,2400,720,2880,360,320, + // DR-DOS 5.00 + 360,320,2400,720,2880,360,320, + // DR-DOS 6.00 + 360,320,2400,720,2880,2880,360,320, + // DR-DOS 7.02 + 360,320,2400,720,2880,2880,360,320, + // DR-DOS 7.03 + 360,320,2400,720,2880,2880, + // DR-DOS 8.00 + 360,320,2400,720,2880,2880,360,320, + // MS-DOS 3.30A + 360,320,2400,720,5760,2880,360,320, + // MS-DOS 3.31 + 360,320,2400,720,5760,2880,360,320, + // MS-DOS 4.01 + 360,320,2400,720,2880,360,320, + // MS-DOS 5.00 + 360,320,2400,720,2880,2880,360,320, + // MS-DOS 6.00 + 360,320,2400,720,2880,2880,360,320, + // MS-DOS 6.20 + 360,320,2400,720,2880,2880,360,320, + // MS-DOS 6.20 RC1 + 360,320,2400,720,2880,2880,360,320, + // MS-DOS 6.21 + 360,320,2400,720,2880,2880,360,320, + // MS-DOS 6.22 + 360,320,2400,720,2880,2880,360,320, + // MS-DOS 7.10 + 360,320,2400,720,2880,2880,360,320, + // MS-DOS 3.20 for Amstrad + 360,320,2400,720,360,320, + // MS-DOS 2.11 for AT&T + 360, + // MS-DOS 3.30 for DeLL + 360,320,2400,720,2880,360,320, + // MS-DOS 3.10 for Epson + 360,320,2400, + // MS-DOS 3.20 for Epson + 360,320,2400,720,360,320, + // MS-DOS 3.20 for HP + 360,320,2400,720,2880,360,320, + // MS-DOS 3.21 for Hyosung + 360,320,2400,720,2880,360,320, + // MS-DOS 3.21 for Kaypro + 360,320,2400,720,2880,360,320, + // MS-DOS 3.10 for Olivetti + 360,2400,360, + // MS-DOS 3.30 for Toshiba + 360,320,2400,720,2880,360,320, + // MS-DOS 4.01 for Toshiba + 360,320,2400,720,2880,360,320, + // Novell DOS 7.00 + 360,320,2400,720,2880,2880,360,320, + // OpenDOS 7.01 + 360,320,2400,720,2880,2880,360,320, + // PC-DOS 2.00 + 360, + // PC-DOS 2.10 + 360, + // PC-DOS 2000 + 360,320,2400,720,2880,2880,360,320, + // PC-DOS 3.00 + 2400, + // PC-DOS 3.10 + 2400, + // PC-DOS 3.30 + 2400,2880, + // PC-DOS 4.00 + 2400,2880, + // PC-DOS 5.00 + 360,320,2400,720,2880,2880,360,320, + // PC-DOS 5.02 + 360,320,2400,720,2880,2880,360,320, + // PC-DOS 6.10 + 360,320,2400,720,2880,2880,360,320, + // PC-DOS 6.30 + 360,320,2400,720,2880,2880,360,320, + // mkfs.vfat + 2400,720,2880,2880, + // mkfs.vfat for Atari + 1200,720,2880,1440, + // Microsoft OS/2 1.00 for Tandy + 360,2400,720,2880, + // Microsoft OS/2 1.10 for AST + 360,2400,720,2880, + // Microsoft OS/2 1.10 for Nokia + 360,2400,720,2880, + // Microsoft OS/2 1.21 + 360,2400,720,2880, + // Microsoft OS/2 1.30.1 + 360,2400,720,2880,2880, + // OS/2 1.20 + 360,2400,720,2880, + // OS/2 1.30 + 360,2400,720,2880, + // OS/2 2.00 + 360,2400,720,2880,2880, + // OS/2 2.10 + 360,2400,720,2880,2880, + // OS/2 2.11 + 360,2400,720,2880,2880, + // OS/2 Warp 3 + 2400,720,2880,2880, + // OS/2 Warp 4 + 2400,720,2880,2880, + // eComStation + 2400,720,2880,2880, + // Windows 95 + 320,360,2400,720,2880,2880,320,360, + // Windows 95 OSR 2 + 320,360,2400,720,2880,2880,320,360, + /// Windows 95 OSR 2.1 + 320,360,2400,720,2880,2880,320,360, + // Windows 95 OSR 2.5 + 320,360,2400,720,2880,2880,320,360, + // Windows 98 + 320,360,2400,720,2880,2880,320,360, + // Windows 98 Second Edition + 320,360,2400,720,2880,2880,320,360, + // Windows Me + 360,2400,720,2880,2880, + // Windows NT 3.10 + 2400,720,2880,2880, + // Windows NT 3.50 + 2400,720,2880,2880, + // Windows NT 3.51 + 2400,720,2880,2880, + // Windows NT 4.00 + 360,2400,720,2880,2880,360, + // Windows 2000 + 360,2400,720,2880,2880, + // Windows Vista + 360,2400,720,2880,2880, + // BeOS R4.5 + 2880, + // Hatari + 360,400,440,720,800,880,2880,1440, + // Atari TOS 1.04 + 360,720, + // NetBSD 1.6 + 720,2880, + // NeXTStep 3.3 + 720,2880, + // OpenStep for Mach 4.0 + 720,2880, + // OpenStep for Mach 4.2 + 720,2880, + // Solaris 2.4 + 720,2880, + }; + + readonly int[] clustersize = { + // Concurrent DOS 6.00 + 512, 1024, 512, + // DR-DOS 3.40 + 1024,1024,512,1024,512,512,512, + // DR-DOS 3.41 + 1024,1024,512,1024,512,512,512, + // DR-DOS 5.00 + 1024,1024,512,1024,512,512,512, + // DR-DOS 6.00 + 1024,1024,512,1024,1024,512,512,512, + // DR-DOS 7.02 + 1024,1024,512,1024,1024,512,512,512, + // DR-DOS 7.03 + 1024,1024,512,1024,1024,512, + // DR-DOS 8.00 + 1024,1024,512,1024,1024,512,512,512, + // MS-DOS 3.30A + 1024,1024,512,1024,512,512,512,512, + // MS-DOS 3.31 + 1024,1024,512,1024,512,512,512,512, + // MS-DOS 4.01 + 1024,1024,512,1024,512,512,512, + // MS-DOS 5.00 + 1024,1024,512,1024,1024,512,512,512, + // MS-DOS 6.00 + 1024,1024,512,1024,1024,512,512,512, + // MS-DOS 6.20 + 1024,1024,512,1024,1024,512,512,512, + // MS-DOS 6.20 RC1 + 1024,1024,512,1024,1024,512,512,512, + // MS-DOS 6.21 + 1024,1024,512,1024,1024,512,512,512, + // MS-DOS 6.22 + 1024,1024,512,1024,1024,512,512,512, + // MS-DOS 7.10 + 1024,1024,512,1024,1024,512,512,512, + // MS-DOS 3.20 for Amstrad + 1024,1024,512,1024,512,512, + // MS-DOS 2.11 for AT&T + 1024, + // MS-DOS 3.30 for DeLL + 1024,1024,512,1024,512,512,512, + // MS-DOS 3.10 for Epson + 1024,1024,512, + // MS-DOS 3.20 for Epson + 1024,1024,512,1024,512,512, + // MS-DOS 3.20 for HP + 1024,1024,512,1024,512,512,512, + // MS-DOS 3.21 for Hyosung + 1024,1024,512,1024,512,512,512, + // MS-DOS 3.21 for Kaypro + 1024,1024,512,1024,512,512,512, + // MS-DOS 3.10 for Olivetti + 1024,512,512, + // MS-DOS 3.30 for Toshiba + 1024,1024,512,1024,512,512,512, + // MS-DOS 4.01 for Toshiba + 1024,1024,512,1024,512,512,512, + // Novell DOS 7.00 + 1024,1024,512,1024,1024,512,512,512, + // OpenDOS 7.01 + 1024,1024,512,1024,1024,512,512,512, + // PC-DOS 2.00 + 1024, + // PC-DOS 2.10 + 1024, + // PC-DOS 2000 + 1024,1024,512,1024,1024,512,512,512, + // PC-DOS 3.00 + 512, + // PC-DOS 3.10 + 512, + // PC-DOS 3.30 + 512,512, + // PC-DOS 4.00 + 512,512, + // PC-DOS 5.00 + 1024,1024,512,1024,1024,512,512,512, + // PC-DOS 5.02 + 1024,1024,512,1024,1024,512,512,512, + // PC-DOS 6.10 + 1024,1024,512,1024,1024,512,512,512, + // PC-DOS 6.30 + 1024,1024,512,1024,1024,512,512,512, + // mkfs.vfat + 512,1024,1024,512, + // mkfs.vfat for Atari + 1024,1024,1024,1024, + // Microsoft OS/2 1.00 for Tandy + 1024,512,1024,512, + // Microsoft OS/2 1.10 for AST + 1024,512,1024,512, + // Microsoft OS/2 1.10 for Nokia + 1024,512,1024,512, + // Microsoft OS/2 1.21 + 1024,512,1024,512, + // Microsoft OS/2 1.30.1 + 1024,512,1024,1024,512, + // OS/2 1.20 + 1024,512,1024,512, + // OS/2 1.30 + 1024,512,1024,512, + // OS/2 2.00 + 1024,512,1024,1024,512, + // OS/2 2.10 + 1024,512,1024,1024,512, + // OS/2 2.11 + 1024,512,1024,1024,512, + // OS/2 Warp 3 + 512,1024,1024,512, + // OS/2 Warp 4 + 512,1024,1024,512, + // eComStation + 512,1024,1024,512, + // Windows 95 + 1024,1024,512,1024,1024,512,512,512, + // Windows 95 OSR 2 + 1024,1024,512,1024,1024,512,512,512, + /// Windows 95 OSR 2.1 + 1024,1024,512,1024,1024,512,512,512, + // Windows 95 OSR 2.5 + 1024,1024,512,1024,1024,512,512,512, + // Windows 98 + 1024,1024,512,1024,1024,512,512,512, + // Windows 98 Second Edition + 1024,1024,512,1024,1024,512,512,512, + // Windows Me + 1024,512,1024,1024,512, + // Windows NT 3.10 + 512,1024,1024,512, + // Windows NT 3.50 + 512,1024,1024,512, + // Windows NT 3.51 + 512,1024,1024,512, + // Windows NT 4.00 + 1024,512,1024,512,512,512, + // Windows 2000 + 1024,512,1024,1024,512, + // Windows Vista + 1024,512,1024,1024,512, + // BeOS R4.5 + 512, + // Hatari + 1024,1024,1024,1024,1024,1024,1024,1024, + // Atari TOS 1.04 + 1024,1024, + // NetBSD 1.6 + 1024,512, + // NeXTStep 3.3 + 1024,512, + // OpenStep for Mach 4.0 + 1024,512, + // OpenStep for Mach 4.2 + 1024,512, + // Solaris 2.4 + 1024,512, + }; + + readonly string[] volumename = { + // Concurrent DOS 6.00 + null, null, null, + // DR-DOS 3.40 + null, null, null, null, null, null, null, + // DR-DOS 3.41 + null, null, null, null, null, null, null, + // DR-DOS 5.00 + null, null, null, null, null, null, null, + // DR-DOS 6.00 + null, null, null, null, null, null, null, null, + // DR-DOS 7.02 + "VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL", + // DR-DOS 7.03 + "VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL", + // DR-DOS 8.00 + "VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL", + // MS-DOS 3.30A + null, null, null, null, null, null, null,null, + // MS-DOS 3.31 + null, null, null, null, null, null, null,null, + // MS-DOS 4.01 + "VOLUMELABEL",null,"VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL",null, + // MS-DOS 5.00 + "VOLUMELABEL",null,"VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL",null, + // MS-DOS 6.00 + "VOLUMELABEL",null,"VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL",null, + // MS-DOS 6.20 + "VOLUMELABEL",null,"VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL",null, + // MS-DOS 6.20 RC1 + "VOLUMELABEL",null,"VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL",null, + // MS-DOS 6.21 + "VOLUMELABEL",null,"VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL",null, + // MS-DOS 6.22 + "VOLUMELABEL",null,"VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL",null, + // MS-DOS 7.10 + "VOLUMELABEL",null,"VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL",null, + // MS-DOS 3.20 for Amstrad + null,null,null,null,null,null, + // MS-DOS 2.11 for AT&T + null, + // MS-DOS 3.30 for DeLL + null,null,null,null,null,null,null, + // MS-DOS 3.10 for Epson + null,null,null, + // MS-DOS 3.20 for Epson + null,null,null,null,null,null, + // MS-DOS 3.20 for HP + null,null,null,null,null,null,null, + // MS-DOS 3.21 for Hyosung + null,null,null,null,null,null,null, + // MS-DOS 3.21 for Kaypro + null,null,null,null,null,null,null, + // MS-DOS 3.10 for Olivetti + null,null,null, + // MS-DOS 3.30 for Toshiba + null,null,null,null,null,null,null, + // MS-DOS 4.01 for Toshiba + "VOLUMELABEL","NO NAME ","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","NO NAME ", + // Novell DOS 7.00 + "VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL", + // OpenDOS 7.01 + "VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL", + // PC-DOS 2.00 + null, + // PC-DOS 2.10 + null, + // PC-DOS 2000 + "VOLUMELABEL",null,"VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL",null, + // PC-DOS 3.00 + null, + // PC-DOS 3.10 + null, + // PC-DOS 3.30 + null,null, + // PC-DOS 4.00 + "VOLUMELABEL","VOLUMELABEL", + // PC-DOS 5.00 + "VOLUMELABEL",null,"VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL",null, + // PC-DOS 5.02 + "VOLUMELABEL",null,"VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL",null, + // PC-DOS 6.10 + "VOLUMELABEL",null,"VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL",null, + // PC-DOS 6.30 + "VOLUMELABEL",null,"VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL",null, + // mkfs.vfat + "VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL", + // mkfs.vfat for Atari + null,null,null,null, + // Microsoft OS/2 1.00 for Tandy + null,null,null,null, + // Microsoft OS/2 1.10 for AST + null,null,null,null, + // Microsoft OS/2 1.10 for Nokia + null,null,null,null, + // Microsoft OS/2 1.21 + "NO NAME ","NO NAME ","NO NAME ","NO NAME ", + // Microsoft OS/2 1.30.1 + "NO NAME ","NO NAME ","NO NAME ","NO NAME ","NO NAME ", + // OS/2 1.20 + "NO NAME ","NO NAME ","NO NAME ","NO NAME ", + // OS/2 1.30 + "NO NAME ","NO NAME ","NO NAME ","NO NAME ", + // OS/2 2.00 + "NO NAME ","NO NAME ","NO NAME ","NO NAME ","NO NAME ", + // OS/2 2.10 + "NO NAME ","NO NAME ","NO NAME ","NO NAME ","NO NAME ", + // OS/2 2.11 + "NO NAME ","NO NAME ","NO NAME ","NO NAME ","NO NAME ", + // OS/2 Warp 3 + "NO NAME ","NO NAME ","NO NAME ","NO NAME ", + // OS/2 Warp 4 + "NO NAME ","NO NAME ","NO NAME ","NO NAME ", + // eComStation + "NO NAME ","NO NAME ","NO NAME ","NO NAME ", + // Windows 95 + null,"VOLUMELABEL","VOLUMELABEL","VOLUMELABEL", + "VOLUMELABEL","VOLUMELABEL",null,"VOLUMELABEL", + // Windows 95 OSR 2 + null,"VOLUMELABEL","VOLUMELABEL","VOLUMELABEL", + "VOLUMELABEL","VOLUMELABEL",null,"VOLUMELABEL", + /// Windows 95 OSR 2.1 + null,"VOLUMELABEL","VOLUMELABEL","VOLUMELABEL", + "VOLUMELABEL","VOLUMELABEL",null,"VOLUMELABEL", + // Windows 95 OSR 2.5 + null,"VOLUMELABEL","VOLUMELABEL","VOLUMELABEL", + "VOLUMELABEL","VOLUMELABEL",null,"VOLUMELABEL", + // Windows 98 + null,"VOLUMELABEL","VOLUMELABEL","VOLUMELABEL", + "VOLUMELABEL","VOLUMELABEL",null,"VOLUMELABEL", + // Windows 98 Second Edition + null,"VOLUMELABEL","VOLUMELABEL","VOLUMELABEL", + "VOLUMELABEL","VOLUMELABEL",null,"VOLUMELABEL", + // Windows Me + "VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL", + // Windows NT 3.10 + "NO NAME ","NO NAME ","NO NAME ","NO NAME ", + // Windows NT 3.50 + "NO NAME ","NO NAME ","NO NAME ","NO NAME ", + // Windows NT 3.51 + "NO NAME ","NO NAME ","NO NAME ","NO NAME ", + // Windows NT 4.00 + "NO NAME ","NO NAME ","NO NAME ","NO NAME ", + "NO NAME ","NO NAME ", + // Windows 2000 + "NO NAME ","NO NAME ","NO NAME ","NO NAME ","NO NAME ", + // Windows Vista + "NO NAME ","NO NAME ","NO NAME ","NO NAME ","NO NAME ", + // BeOS R4.5 + "NO NAME ", + // Hatari + null,null,null, + null,null,null, + null,null, + // Atari TOS 1.04 + null,null, + // NetBSD 1.6 + "VOLUMELABEL","VOLUMELABEL", + // NeXTStep 3.3 + null,null, + // OpenStep for Mach 4.0 + null,null, + // OpenStep for Mach 4.2 + null,null, + // Solaris 2.4 + null,null, + }; + + readonly string[] volumeserial = { + // Concurrent DOS 6.00 + null, null, null, + // DR-DOS 3.40 + null, null, null, null, null, null, null, + // DR-DOS 3.41 + null, null, null, null, null, null, null, + // DR-DOS 5.00 + null, null, null, null, null, null, null, + // DR-DOS 6.00 + null, null, null, null, null, null, null, null, + // DR-DOS 7.02 + "1BF63C69","1BF70E75","1BF7185F","1BF80C4F","1BF90F1D","1BF82777","1BF72430","1BF72F1E", + // DR-DOS 7.03 + "0C1A2013","0CE22B5B","0CEA1D3E","0CEE102F","0CEE3760","0CEF2739", + // DR-DOS 8.00 + "1BFD1977","1BFD2D3F","1BFD3531","1BFC3231","1BFA1D58","1BFC117D","1BFE0971","1BFE1423", + // MS-DOS 3.30A + null, null, null, null, null, null, null,null, + // MS-DOS 3.31 + null, null, null, null, null, null, null,null, + // MS-DOS 4.01 + "122C190A",null,"2480190A","2D471909","0F5A1908","2F3D190A",null, + // MS-DOS 5.00 + "0B6018F8",null,"1E3518F8","285A18FB","231D18FE","415118FC","316118F8",null, + // MS-DOS 6.00 + "067B18F6",null,"193418F6","1F3A18F5","165318F3","172418F4","234918F6",null, + // MS-DOS 6.20 + "265418ED",null,"0B7018EE","127418F0","137F18F2","364C18F0","185C18EE",null, + // MS-DOS 6.20 RC1 + "064B18EB",null,"192518EB","244C18EA","3C3118E7","344118E9","267E18EB",null, + // MS-DOS 6.21 + "2A41181B",null,"0641181C","3B26181C","082518E2","237118E1","123F181C",null, + // MS-DOS 6.22 + "317C1818",null,"0D3A1819","3C251817","387A1815","185E1817","18231819",null, + // MS-DOS 7.10 + "1156180A",null,"2951180A","3057180B","2B4A1811","344B180C","352D180A",null, + // MS-DOS 3.20 for Amstrad + null,null,null,null,null,null, + // MS-DOS 2.11 for AT&T + null, + // MS-DOS 3.30 for DeLL + null,null,null,null,null,null,null, + // MS-DOS 3.10 for Epson + null,null,null, + // MS-DOS 3.20 for Epson + null,null,null,null,null,null, + // MS-DOS 3.20 for HP + null,null,null,null,null,null,null, + // MS-DOS 3.21 for Hyosung + null,null,null,null,null,null,null, + // MS-DOS 3.21 for Kaypro + null,null,null,null,null,null,null, + // MS-DOS 3.10 for Olivetti + null,null,null, + // MS-DOS 3.30 for Toshiba + null,null,null,null,null,null,null, + // MS-DOS 4.01 for Toshiba + "0B2519E7","163419E7","1E3119E7","133919E9","177419EA","317E19E7","3B7319E7", + // Novell DOS 7.00 + "1BE7254C","1BE73024","1BE7397C","1BE63635","1BE51661","1BE61143","1BE80A5D","1BE8144C", + // OpenDOS 7.01 + "1BE93E2B","1BEA234D","1BEA325D","1BEB294F","1BEC2C2E","1BEC0C5D","1BEA3E60","1BEB0E26", + // PC-DOS 2.00 + null, + // PC-DOS 2.10 + null, + // PC-DOS 2000 + "2634100E",null,"3565100E","3B6B1012","3B2D1013","1D491013","4136100E",null, + // PC-DOS 3.00 + null, + // PC-DOS 3.10 + null, + // PC-DOS 3.30 + null,null, + // PC-DOS 4.00 + "3C240FE3","2E3E0FE1", + // PC-DOS 5.00 + "33260FF9",null,"11550FFA","234F0FFB","2F600FFC","0D550FFC","1D630FFA",null, + // PC-DOS 5.02 + "06231000",null,"1A3E1000","1F3B0FFF","3D750FFD","3F4F0FFE","26471000",null, + // PC-DOS 6.10 + "25551004",null,"3E5F1004","142D1006","17541007","355A1006","0D5E1005",null, + // PC-DOS 6.30 + "2B22100C",null,"3B47100C","0C55100C","1B80100A","0B59100B","0A3A100D",null, + // mkfs.vfat + "20C279B1","20FD9501","2132D70A","2118F1AA", + // mkfs.vfat for Atari + null,null,null,null, + // Microsoft OS/2 1.00 for Tandy + "9C170C15","9BFB0C15","9C13FC15","9BF99C15", + // Microsoft OS/2 1.10 for AST + "66A42C15","67696C15","66DEBC15","66DC4C15", + // Microsoft OS/2 1.10 for Nokia + "676B4C15","67768C15","9C12DC15","66A74C15", + // Microsoft OS/2 1.21 + "9C074C15","66BCFC15","66C1AC15","66C7FC15", + // Microsoft OS/2 1.30.1 + "66C47C15","66CBEC15","9C167C15","9C147C15","9C0FEC15", + // OS/2 1.20 + "5BF5E015","5BE61015","5C26F015","5C376015", + // OS/2 1.30 + "5C418015","5BE20015","5C7F1015","5B83C015", + // OS/2 2.00 + "5C3BD015","5B807015","5BE69015","5C187015","5C390015", + // OS/2 2.10 + "1BFCB414","E6C6C414","E6CCF414","E6AF6414","1C005414", + // OS/2 2.11 + "E6AEB414","1C00D414","1C03B414","E6C90414","E6B6E414", + // OS/2 Warp 3 + "E6AF7414","E6D63414","E6A65414","E6AE6414", + // OS/2 Warp 4 + "E6CD9414","1BFAD414","E6DFF414","E6D4C414", + // eComStation + "E6CA5814","E6CBC814","E6B81814","1C013814", + // Windows 95 + null,"3B360D0D","24240D0D","3C260D11", + "30050D10","275A0D11",null,"3B100D0F", + // Windows 95 OSR 2 + null,"1C5B0D19","11510D19","0F1F0D15", + "40200D17","3D610D14",null,"280B0D19", + /// Windows 95 OSR 2.1 + null,"1F3B0D1C","14470D1C","1C510DE4", + "2E250DE2","10640DE4",null,"2B3E0D1C", + // Windows 95 OSR 2.5 + null,"18190DFB","0A240DFB","1E320DE7", + "33230DE8","125B0DE7",null,"21410DFB", + // Windows 98 + null,"40090E0F","28140E0F","0E620E0A", + "14390E0D","0E081246",null,"30600E10", + // Windows 98 Second Edition + null,"1B550EEC","1B100EEB","08410EE6", + "0E0F0EE8","325D0EE4",null,"13380EEC", + // Windows Me + "2F200F02","103A0F01","2F1C0EFC","21570EFF","07040EFB", + // Windows NT 3.10 + "60EA50BC","6C857D51","4009440C","30761EDC", + // Windows NT 3.50 + "0C478404","7CBEB35B","7C1E8DCB","ECB276AF", + // Windows NT 3.51 + "482D8681","8889C95E","54DE6C39","F47D2516", + // Windows NT 4.00 + "D8CAAC1F","E0BB6D70","C08C3C60","9C44B411", + "4C7DD099","4CD82982", + // Windows 2000 + "4019989C","78F30AF8","E4217DDE","80B3B996","28043527", + // Windows Vista + "3C9F0BD2","3A8E465C","B2EFB822","3C30C632","16DAB07A", + // BeOS R4.5 + "00000000", + // Hatari + null,null,null, + null,null,null, + null,null, + // Atari TOS 1.04 + null,null, + // NetBSD 1.6 + "EEB51A0C","CCFD1A06", + // NeXTStep 3.3 + null,null, + // OpenStep for Mach 4.0 + null,null, + // OpenStep for Mach 4.2 + null,null, + // Solaris 2.4 + null,null, + }; + + readonly string[] oemid = { + // Concurrent DOS 6.00 + "DIGITAL ", "DIGITAL ", "DIGITAL ", + // DR-DOS 3.40 + "DIGITAL ", "DIGITAL ", "DIGITAL ", "DIGITAL ", "DIGITAL ", "DIGITAL ", "DIGITAL ", + // DR-DOS 3.41 + "DIGITAL ", "DIGITAL ", "DIGITAL ", "DIGITAL ", "DIGITAL ", "DIGITAL ", "DIGITAL ", + // DR-DOS 5.00 + "IBM 3.3", "IBM 3.3", "IBM 3.3", "IBM 3.3", "IBM 3.3", "IBM 3.3", "IBM 3.3", + // DR-DOS 6.00 + "IBM 3.3", "IBM 3.3", "IBM 3.3", "IBM 3.3", "IBM 3.3", "IBM 3.3", "IBM 3.3", "IBM 3.3", + // DR-DOS 7.02 + "DRDOS 7","DRDOS 7","DRDOS 7","DRDOS 7","DRDOS 7","DRDOS 7","DRDOS 7","DRDOS 7", + // DR-DOS 7.03 + "DRDOS 7","DRDOS 7","DRDOS 7","DRDOS 7","DRDOS 7","DRDOS 7", + // DR-DOS 8.00 + "DRDOS 7","DRDOS 7","DRDOS 7","DRDOS 7","DRDOS 7","DRDOS 7","DRDOS 7","DRDOS 7", + // MS-DOS 3.30A + "MSDOS3.3",null,"MSDOS3.3","MSDOS3.3","MSDOS3.3","MSDOS3.3","MSDOS3.3",null, + // MS-DOS 3.31 + "IBM 3.3",null,"IBM 3.3","IBM 3.3","IBM 3.3","IBM 3.3","IBM 3.3",null, + // MS-DOS 4.01 + "MSDOS4.0",null,"MSDOS4.0","MSDOS4.0","MSDOS4.0","MSDOS4.0",null, + // MS-DOS 5.00 + "MSDOS5.0",null,"MSDOS5.0","MSDOS5.0","MSDOS5.0","MSDOS5.0","MSDOS5.0",null, + // MS-DOS 6.00 + "MSDOS5.0",null,"MSDOS5.0","MSDOS5.0","MSDOS5.0","MSDOS5.0","MSDOS5.0",null, + // MS-DOS 6.20 + "MSDOS5.0",null,"MSDOS5.0","MSDOS5.0","MSDOS5.0","MSDOS5.0","MSDOS5.0",null, + // MS-DOS 6.20 RC1 + "MSDOS5.0",null,"MSDOS5.0","MSDOS5.0","MSDOS5.0","MSDOS5.0","MSDOS5.0",null, + // MS-DOS 6.21 + "MSDOS5.0",null,"MSDOS5.0","MSDOS5.0","MSDOS5.0","MSDOS5.0","MSDOS5.0",null, + // MS-DOS 6.22 + "MSDOS5.0",null,"MSDOS5.0","MSDOS5.0","MSDOS5.0","MSDOS5.0","MSDOS5.0",null, + // MS-DOS 7.10 + "MSWIN4.1",null,"MSWIN4.1","MSWIN4.1","MSWIN4.1","MSWIN4.1","MSWIN4.1",null, + // MS-DOS 3.20 for Amstrad + "MSDOS3.2",null,"MSDOS3.2","MSDOS3.2","MSDOS3.2",null, + // MS-DOS 2.11 for AT&T + "PSA 1.04", + // MS-DOS 3.30 for DeLL + "IBM 3.3",null,"IBM 3.3","IBM 3.3","IBM 3.3","IBM 3.3",null, + // MS-DOS 3.10 for Epson + "EPS 3.10","EPS 3.10","EPS 3.10", + // MS-DOS 3.20 for Epson + "IBM 3.2","IBM 3.2","IBM 3.2","IBM 3.2","IBM 3.2","IBM 3.2", + // MS-DOS 3.20 for HP + "MSDOS3.2",null,"MSDOS3.2","MSDOS3.2","MSDOS3.2","MSDOS3.2",null, + // MS-DOS 3.21 for Hyosung + "MSDOS3.2",null,"MSDOS3.2","MSDOS3.2","MSDOS3.2","MSDOS3.2",null, + // MS-DOS 3.21 for Kaypro + "MSDOS3.2",null,"MSDOS3.2","MSDOS3.2","MSDOS3.2","MSDOS3.2",null, + // MS-DOS 3.10 for Olivetti + "IBM 3.1","IBM 3.1","IBM 3.1", + // MS-DOS 3.30 for Toshiba + "IBM 3.3",null,"IBM 3.3","IBM 3.3","IBM 3.3","IBM 3.3",null, + // MS-DOS 4.01 for Toshiba + "T V4.00 ","T V4.00 ","T V4.00 ","T V4.00 ","T V4.00 ","T V4.00 ","T V4.00 ", + // Novell DOS 7.00 + "NWDOS7.0","NWDOS7.0","NWDOS7.0","NWDOS7.0","NWDOS7.0","NWDOS7.0","NWDOS7.0","NWDOS7.0", + // OpenDOS 7.01 + "OPENDOS7","OPENDOS7","OPENDOS7","OPENDOS7","OPENDOS7","OPENDOS7","OPENDOS7","OPENDOS7", + // PC-DOS 2.00 + "IBM 2.0", + // PC-DOS 2.10 + "IBM 2.0", + // PC-DOS 2000 + "IBM 7.0",null,"IBM 7.0","IBM 7.0","IBM 7.0","IBM 7.0","IBM 7.0",null, + // PC-DOS 3.00 + "IBM 3.0", + // PC-DOS 3.10 + "IBM 3.1", + // PC-DOS 3.30 + "IBM 3.3","IBM 3.3", + // PC-DOS 4.00 + "IBM 4.0","IBM 4.0", + // PC-DOS 5.00 + "IBM 5.0",null,"IBM 5.0","IBM 5.0","IBM 5.0","IBM 5.0","IBM 5.0",null, + // PC-DOS 5.02 + "IBM 5.0",null,"IBM 5.0","IBM 5.0","IBM 5.0","IBM 5.0","IBM 5.0",null, + // PC-DOS 6.10 + "IBM 6.0",null,"IBM 6.0","IBM 6.0","IBM 6.0","IBM 6.0","IBM 6.0",null, + // PC-DOS 6.30 + "IBM 6.0",null,"IBM 6.0","IBM 6.0","IBM 6.0","IBM 6.0","IBM 6.0",null, + // mkfs.vfat + "mkfs.fat","mkfs.fat","mkfs.fat","mkfs.fat", + // mkfs.vfat for Atari + null,null,null,null, + // Microsoft OS/2 1.00 for Tandy + "TAN 10.0","TAN 10.0","TAN 10.0","TAN 10.0", + // Microsoft OS/2 1.10 for AST + "IBM 10.1","IBM 10.1","IBM 10.1","IBM 10.1", + // Microsoft OS/2 1.10 for Nokia + "IBM 10.1","IBM 10.1","IBM 10.1","IBM 10.1", + // Microsoft OS/2 1.21 + "IBM 10.2","IBM 10.2","IBM 10.2","IBM 10.2", + // Microsoft OS/2 1.30.1 + "IBM 10.2","IBM 10.2","IBM 10.2","IBM 10.2","IBM 10.2", + // OS/2 1.20 + "IBM 10.2","IBM 10.2","IBM 10.2","IBM 10.2", + // OS/2 1.30 + "IBM 10.2","IBM 10.2","IBM 10.2","IBM 10.2", + // OS/2 2.00 + "IBM 20.0","IBM 20.0","IBM 20.0","IBM 20.0","IBM 20.0", + // OS/2 2.10 + "IBM 20.0","IBM 20.0","IBM 20.0","IBM 20.0","IBM 20.0", + // OS/2 2.11 + "IBM 20.0","IBM 20.0","IBM 20.0","IBM 20.0","IBM 20.0", + // OS/2 Warp 3 + "IBM 20.0","IBM 20.0","IBM 20.0","IBM 20.0", + // OS/2 Warp 4 + "IBM 20.0","IBM 20.0","IBM 20.0","IBM 20.0", + // eComStation + "IBM 4.50","IBM 4.50","IBM 4.50","IBM 4.50", + // Windows 95 + null,"MSWIN4.0","MSWIN4.0","MSWIN4.0", + "MSWIN4.0","MSWIN4.0",null,"MSWIN4.0", + // Windows 95 OSR 2 + null,"MSWIN4.1","MSWIN4.1","MSWIN4.1", + "MSWIN4.1","MSWIN4.1",null,"MSWIN4.1", + /// Windows 95 OSR 2.1 + null,"MSWIN4.1","MSWIN4.1","MSWIN4.1", + "MSWIN4.1","MSWIN4.1",null,"MSWIN4.1", + // Windows 95 OSR 2.5 + null,"MSWIN4.1","MSWIN4.1","MSWIN4.1", + "MSWIN4.1","MSWIN4.1",null,"MSWIN4.1", + // Windows 98 + null,"MSWIN4.1","MSWIN4.1","MSWIN4.1", + "MSWIN4.1","MSWIN4.1",null,"MSWIN4.1", + // Windows 98 Second Edition + null,"MSWIN4.1","MSWIN4.1","MSWIN4.1", + "MSWIN4.1","MSWIN4.1",null,"MSWIN4.1", + // Windows Me + "MSWIN4.1","MSWIN4.1","MSWIN4.1","MSWIN4.1","MSWIN4.1", + // Windows NT 3.10 + "MSDOS5.0","MSDOS5.0","MSDOS5.0","MSDOS5.0", + // Windows NT 3.50 + "MSDOS5.0","MSDOS5.0","MSDOS5.0","MSDOS5.0", + // Windows NT 3.51 + "MSDOS5.0","MSDOS5.0","MSDOS5.0","MSDOS5.0", + // Windows NT 4.00 + "MSDOS5.0","MSDOS5.0","MSDOS5.0","MSDOS5.0", + "MSDOS5.0","MSDOS5.0", + // Windows 2000 + "MSDOS5.0","MSDOS5.0","MSDOS5.0","MSDOS5.0","MSDOS5.0", + // Windows Vista + "MSDOS5.0","MSDOS5.0","MSDOS5.0","MSDOS5.0","MSDOS5.0", + // BeOS R4.5 + "BeOS ", + // Hatari + null,null,null, + null,null,null, + null,null, + // Atari TOS 1.04 + null,null, + // NetBSD 1.6 + "BSD 4.4","BSD 4.4", + // NeXTStep 3.3 + "NEXT ","NEXT ", + // OpenStep for Mach 4.0 + "NEXT ","NEXT ", + // OpenStep for Mach 4.2 + "NEXT ","NEXT ", + // Solaris 2.4 + "MSDOS3.3","MSDOS3.3", + }; + + [Test] + public void Test() + { + for(int i = 0; i < testfiles.Length; i++) + { + string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "fat12", testfiles[i]); + Filter filter = new LZip(); + filter.Open(location); + ImagePlugin image = new ZZZRawImage(); + Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]); + Assert.AreEqual(mediatypes[i], image.ImageInfo.mediaType, testfiles[i]); + Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]); + Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); + Filesystem fs = new FAT(); + Assert.AreEqual(true, fs.Identify(image, 0, image.ImageInfo.sectors - 1), testfiles[i]); + fs.GetInformation(image, 0, image.ImageInfo.sectors - 1, out string information); + Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]); + Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]); + Assert.AreEqual("FAT12", fs.XmlFSType.Type, testfiles[i]); + Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); + Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); + Assert.AreEqual(oemid[i], fs.XmlFSType.SystemIdentifier, testfiles[i]); + } + } + } +} diff --git a/DiscImageChef.Tests/Filesystems/HFS_APM.cs b/DiscImageChef.Tests/Filesystems/HFS_APM.cs new file mode 100644 index 000000000..e7659623a --- /dev/null +++ b/DiscImageChef.Tests/Filesystems/HFS_APM.cs @@ -0,0 +1,116 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : HFS_MBR.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program 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 General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using System.Collections.Generic; +using System.IO; +using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using DiscImageChef.Filesystems; +using DiscImageChef.Filters; +using DiscImageChef.ImagePlugins; +using DiscImageChef.PartPlugins; +using NUnit.Framework; + +namespace DiscImageChef.Tests.Filesystems +{ + [TestFixture] + public class HFS_MBR + { + readonly string[] testfiles = { + "linux.vdi.lz", + }; + + readonly ulong[] sectors = { + 262144, + }; + + readonly uint[] sectorsize = { + 512, + }; + + readonly long[] clusters = { + 65018, + }; + + readonly int[] clustersize = { + 2048, + }; + + readonly string[] volumename = { + "Volume label", + }; + + readonly string[] volumeserial = { + "0000000000000000", + }; + + [Test] + public void Test() + { + for(int i = 0; i < testfiles.Length; i++) + { + string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "hfsplus_mbr", testfiles[i]); + Filter filter = new LZip(); + filter.Open(location); + ImagePlugin image = new VDI(); + Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]); + Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]); + Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); + PartPlugin parts = new MBR(); + Assert.AreEqual(true, parts.GetInformation(image, out List partitions), testfiles[i]); + Filesystem fs = new DiscImageChef.Filesystems.AppleHFS(); + int part = -1; + for(int j = 0; j < partitions.Count; j++) + { + if(partitions[j].PartitionType == "0xAF") + { + part = j; + break; + } + } + Assert.AreNotEqual(-1, part, "Partition not found"); + Assert.AreEqual(true, fs.Identify(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1), testfiles[i]); + fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information); + Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]); + Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]); + Assert.AreEqual("HFS", fs.XmlFSType.Type, testfiles[i]); + Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); + Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); + } + } + } +} diff --git a/DiscImageChef.Tests/Filesystems/HFS_RDB.cs b/DiscImageChef.Tests/Filesystems/HFS_RDB.cs new file mode 100644 index 000000000..00f58ffb7 --- /dev/null +++ b/DiscImageChef.Tests/Filesystems/HFS_RDB.cs @@ -0,0 +1,124 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : FAT16_RDB.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program 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 General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using System; +using System.Collections.Generic; +using System.IO; +using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using DiscImageChef.Filesystems; +using DiscImageChef.Filters; +using DiscImageChef.ImagePlugins; +using DiscImageChef.PartPlugins; +using NUnit.Framework; + +namespace DiscImageChef.Tests.Filesystems +{ + [TestFixture] + public class FAT16_RDB + { + readonly string[] testfiles = { + "amigaos_3.9.vdi.lz", + }; + + readonly ulong[] sectors = { + 1024128 + }; + + readonly uint[] sectorsize = { + 512, + }; + + readonly long[] clusters = { + 1020064 + }; + + readonly int[] clustersize = { + 512, + }; + + readonly string[] volumename = { + "VOLUMELABEL" + }; + + readonly string[] volumeserial = { + "UNKNOWN ", + }; + + readonly string[] oemid = { + "CDP 5.0", + }; + + [Test] + public void Test() + { + throw new NotImplementedException("Partition schemes inside partitions are not yet implemented, and should be tested here."); + /* + for(int i = 0; i < testfiles.Length; i++) + { + string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "fat16_rdb", testfiles[i]); + Filter filter = new LZip(); + filter.Open(location); + ImagePlugin image = new VDI(); + Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]); + Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]); + Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); + PartPlugin parts = new AmigaRigidDiskBlock(); + Assert.AreEqual(true, parts.GetInformation(image, out List partitions), testfiles[i]); + Filesystem fs = new DiscImageChef.Filesystems.FAT(); + int part = -1; + for(int j = 0; j < partitions.Count; j++) + { + if(partitions[j].PartitionType == "\"RES\\86\"") + { + part = j; + break; + } + } + Assert.AreNotEqual(-1, part, "Partition not found"); + Assert.AreEqual(true, fs.Identify(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1), testfiles[i]); + fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information); + Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]); + Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]); + Assert.AreEqual("Amiga FFS", fs.XmlFSType.Type, testfiles[i]); + Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); + Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); + Assert.AreEqual(oemid[i], fs.XmlFSType.SystemIdentifier, testfiles[i]); + }*/ + } + } +} diff --git a/DiscImageChef.Tests/Filesystems/LFS_MBR.cs b/DiscImageChef.Tests/Filesystems/LFS_MBR.cs new file mode 100644 index 000000000..496f996e6 --- /dev/null +++ b/DiscImageChef.Tests/Filesystems/LFS_MBR.cs @@ -0,0 +1,119 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : HAMMER_MBR.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program 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 General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using System; +using System.Collections.Generic; +using System.IO; +using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using DiscImageChef.Filesystems; +using DiscImageChef.Filters; +using DiscImageChef.ImagePlugins; +using DiscImageChef.PartPlugins; +using NUnit.Framework; + +namespace DiscImageChef.Tests.Filesystems +{ + [TestFixture] + public class HAMMER_MBR + { + readonly string[] testfiles = { + "dflybsd_3.6.1.vdi.lz","dflybsd_4.0.5.vdi.lz", + }; + + readonly ulong[] sectors = { + 104857600, 104857600, + }; + + readonly uint[] sectorsize = { + 512, 512, + }; + + readonly long[] clusters = { + 104856192, 104856192, + }; + + readonly int[] clustersize = { + 512, 512, + }; + + readonly string[] volumename = { + "Volume label", "Volume label", + }; + + readonly string[] volumeserial = { + "UNKNOWN","UNKNOWN", + }; + + [Test] + public void Test() + { + throw new NotImplementedException("HAMMER filesystem is not yet implemented"); + /* + for(int i = 0; i < testfiles.Length; i++) + { + string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "hammer_mbr", testfiles[i]); + Filter filter = new LZip(); + filter.Open(location); + ImagePlugin image = new VDI(); + Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]); + Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]); + Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); + PartPlugin parts = new MBR(); + Assert.AreEqual(true, parts.GetInformation(image, out List partitions), testfiles[i]); + Filesystem fs = new DiscImageChef.Filesystems.HAMMER(); + int part = -1; + for(int j = 0; j < partitions.Count; j++) + { + if(partitions[j].PartitionType == "0xA5") + { + part = j; + break; + } + } + Assert.AreNotEqual(-1, part, "Partition not found"); + Assert.AreEqual(true, fs.Identify(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1), testfiles[i]); + fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information); + Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]); + Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]); + Assert.AreEqual("HAMMER", fs.XmlFSType.Type, testfiles[i]); + Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); + Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); + }*/ + } + } +} diff --git a/DiscImageChef.Tests/Filesystems/MFS.cs b/DiscImageChef.Tests/Filesystems/MFS.cs new file mode 100644 index 000000000..318b899a9 --- /dev/null +++ b/DiscImageChef.Tests/Filesystems/MFS.cs @@ -0,0 +1,114 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : HFS.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program 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 General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using System.IO; +using DiscImageChef.CommonTypes; +using DiscImageChef.Filesystems; +using DiscImageChef.Filters; +using DiscImageChef.ImagePlugins; +using NUnit.Framework; + +namespace DiscImageChef.Tests.Filesystems +{ + [TestFixture] + public class HFS + { + readonly string[] testfiles = { + "macos_1.1_mf2dd.img.lz","macos_2.0_mf2dd.img.lz","macos_6.0.7_mf2dd.img.lz","nextstep_3.3_mf2hd.img.lz", + "openstep_4.0_mf2hd.img.lz","openstep_4.2_mf2hd.img.lz","rhapsody_dr1_mf2hd.img.lz", + }; + + readonly MediaType[] mediatypes = { + MediaType.AppleSonyDS, MediaType.AppleSonyDS, MediaType.AppleSonyDS, MediaType.DOS_35_HD, + MediaType.DOS_35_HD, MediaType.DOS_35_HD, MediaType.DOS_35_HD, + }; + + readonly ulong[] sectors = { + 1600, 1600, 1600, 2880, + 2880, 2880, 2880, + }; + + readonly uint[] sectorsize = { + 512, 512, 512, 512, + 512, 512, 512, + }; + + readonly long[] clusters = { + 1594, 1594, 1594, 2874, + 2874, 2874, 2874, + }; + + readonly int[] clustersize = { + 512, 512, 512, 512, + 512, 512, 512, + }; + + readonly string[] volumename = { + "Volume label","Volume label","Volume label","Volume label", + "Volume label","Volume label","Volume label", + }; + + readonly string[] volumeserial = { + null, null, null, null, + null, null, null, + }; + + [Test] + public void Test() + { + for(int i = 0; i < testfiles.Length; i++) + { + string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "hfs", testfiles[i]); + Filter filter = new LZip(); + filter.Open(location); + ImagePlugin image = new ZZZRawImage(); + Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]); + Assert.AreEqual(mediatypes[i], image.ImageInfo.mediaType, testfiles[i]); + Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]); + Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); + Filesystem fs = new AppleHFS(); + Assert.AreEqual(true, fs.Identify(image, 0, image.ImageInfo.sectors - 1), testfiles[i]); + fs.GetInformation(image, 0, image.ImageInfo.sectors - 1, out string information); + Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]); + Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]); + Assert.AreEqual("HFS", fs.XmlFSType.Type, testfiles[i]); + Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); + Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); + } + } + } +} diff --git a/DiscImageChef.Tests/Filesystems/NTFS_GPT.cs b/DiscImageChef.Tests/Filesystems/NTFS_GPT.cs new file mode 100644 index 000000000..134a5dff2 --- /dev/null +++ b/DiscImageChef.Tests/Filesystems/NTFS_GPT.cs @@ -0,0 +1,130 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : NTFS_MBR.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program 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 General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using System.Collections.Generic; +using System.IO; +using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using DiscImageChef.Filesystems; +using DiscImageChef.Filters; +using DiscImageChef.ImagePlugins; +using DiscImageChef.PartPlugins; +using NUnit.Framework; + +namespace DiscImageChef.Tests.Filesystems +{ + [TestFixture] + public class NTFS_MBR + { + readonly string[] testfiles = { + "win10.vdi.lz", "win2000.vdi.lz", "winnt_3.10.vdi.lz", "winnt_3.50.vdi.lz", + "winnt_3.51.vdi.lz", "winnt_4.00.vdi.lz", "winvista.vdi.lz", "linux.vdi.lz", + + }; + + readonly ulong[] sectors = { + 524288, 2097152, 1024000, 524288, + 524288, 524288, 524288, 262144, + }; + + readonly uint[] sectorsize = { + 512, 512, 512, 512, + 512, 512, 512, 512, + }; + + readonly long[] clusters = { + 65263, 1046511, 1023057, 524256, + 524256, 524096, 64767, 32512, + }; + + readonly int[] clustersize = { + 4096, 1024, 512, 512, + 512, 512, 4096, 4096, + }; + + readonly string[] volumename = { + null, null, null, null, + null, null, null, null, + }; + + readonly string[] volumeserial = { + "C46C1B3C6C1B28A6","8070C8EC70C8E9CC","10CC6AC6CC6AA5A6","7A14F50014F4BFE5", + "24884447884419A6","822C288D2C287E73","E20AF54B0AF51D6B","065BB96B7C1BCFDA", + }; + + readonly string[] oemid = { + null, null, null, null, + null, null, null, null, + }; + + [Test] + public void Test() + { + for(int i = 0; i < testfiles.Length; i++) + { + string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "ntfs_mbr", testfiles[i]); + Filter filter = new LZip(); + filter.Open(location); + ImagePlugin image = new VDI(); + Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]); + Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]); + Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); + PartPlugin parts = new MBR(); + Assert.AreEqual(true, parts.GetInformation(image, out List partitions), testfiles[i]); + Filesystem fs = new DiscImageChef.Filesystems.NTFS(); + int part = -1; + for(int j = 0; j < partitions.Count; j++) + { + if(partitions[j].PartitionType == "0x07") + { + part = j; + break; + } + } + Assert.AreNotEqual(-1, part, "Partition not found"); + Assert.AreEqual(true, fs.Identify(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1), testfiles[i]); + fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information); + Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]); + Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]); + Assert.AreEqual("NTFS", fs.XmlFSType.Type, testfiles[i]); + Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); + Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); + Assert.AreEqual(oemid[i], fs.XmlFSType.SystemIdentifier, testfiles[i]); + } + } + } +} diff --git a/DiscImageChef.Tests/Filesystems/NWFS386.cs b/DiscImageChef.Tests/Filesystems/NWFS386.cs new file mode 100644 index 000000000..496f996e6 --- /dev/null +++ b/DiscImageChef.Tests/Filesystems/NWFS386.cs @@ -0,0 +1,119 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : HAMMER_MBR.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program 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 General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using System; +using System.Collections.Generic; +using System.IO; +using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using DiscImageChef.Filesystems; +using DiscImageChef.Filters; +using DiscImageChef.ImagePlugins; +using DiscImageChef.PartPlugins; +using NUnit.Framework; + +namespace DiscImageChef.Tests.Filesystems +{ + [TestFixture] + public class HAMMER_MBR + { + readonly string[] testfiles = { + "dflybsd_3.6.1.vdi.lz","dflybsd_4.0.5.vdi.lz", + }; + + readonly ulong[] sectors = { + 104857600, 104857600, + }; + + readonly uint[] sectorsize = { + 512, 512, + }; + + readonly long[] clusters = { + 104856192, 104856192, + }; + + readonly int[] clustersize = { + 512, 512, + }; + + readonly string[] volumename = { + "Volume label", "Volume label", + }; + + readonly string[] volumeserial = { + "UNKNOWN","UNKNOWN", + }; + + [Test] + public void Test() + { + throw new NotImplementedException("HAMMER filesystem is not yet implemented"); + /* + for(int i = 0; i < testfiles.Length; i++) + { + string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "hammer_mbr", testfiles[i]); + Filter filter = new LZip(); + filter.Open(location); + ImagePlugin image = new VDI(); + Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]); + Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]); + Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); + PartPlugin parts = new MBR(); + Assert.AreEqual(true, parts.GetInformation(image, out List partitions), testfiles[i]); + Filesystem fs = new DiscImageChef.Filesystems.HAMMER(); + int part = -1; + for(int j = 0; j < partitions.Count; j++) + { + if(partitions[j].PartitionType == "0xA5") + { + part = j; + break; + } + } + Assert.AreNotEqual(-1, part, "Partition not found"); + Assert.AreEqual(true, fs.Identify(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1), testfiles[i]); + fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information); + Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]); + Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]); + Assert.AreEqual("HAMMER", fs.XmlFSType.Type, testfiles[i]); + Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); + Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); + }*/ + } + } +} diff --git a/DiscImageChef.Tests/Filesystems/OCFS2.cs b/DiscImageChef.Tests/Filesystems/OCFS2.cs new file mode 100644 index 000000000..496f996e6 --- /dev/null +++ b/DiscImageChef.Tests/Filesystems/OCFS2.cs @@ -0,0 +1,119 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : HAMMER_MBR.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program 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 General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using System; +using System.Collections.Generic; +using System.IO; +using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using DiscImageChef.Filesystems; +using DiscImageChef.Filters; +using DiscImageChef.ImagePlugins; +using DiscImageChef.PartPlugins; +using NUnit.Framework; + +namespace DiscImageChef.Tests.Filesystems +{ + [TestFixture] + public class HAMMER_MBR + { + readonly string[] testfiles = { + "dflybsd_3.6.1.vdi.lz","dflybsd_4.0.5.vdi.lz", + }; + + readonly ulong[] sectors = { + 104857600, 104857600, + }; + + readonly uint[] sectorsize = { + 512, 512, + }; + + readonly long[] clusters = { + 104856192, 104856192, + }; + + readonly int[] clustersize = { + 512, 512, + }; + + readonly string[] volumename = { + "Volume label", "Volume label", + }; + + readonly string[] volumeserial = { + "UNKNOWN","UNKNOWN", + }; + + [Test] + public void Test() + { + throw new NotImplementedException("HAMMER filesystem is not yet implemented"); + /* + for(int i = 0; i < testfiles.Length; i++) + { + string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "hammer_mbr", testfiles[i]); + Filter filter = new LZip(); + filter.Open(location); + ImagePlugin image = new VDI(); + Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]); + Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]); + Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); + PartPlugin parts = new MBR(); + Assert.AreEqual(true, parts.GetInformation(image, out List partitions), testfiles[i]); + Filesystem fs = new DiscImageChef.Filesystems.HAMMER(); + int part = -1; + for(int j = 0; j < partitions.Count; j++) + { + if(partitions[j].PartitionType == "0xA5") + { + part = j; + break; + } + } + Assert.AreNotEqual(-1, part, "Partition not found"); + Assert.AreEqual(true, fs.Identify(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1), testfiles[i]); + fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information); + Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]); + Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]); + Assert.AreEqual("HAMMER", fs.XmlFSType.Type, testfiles[i]); + Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); + Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); + }*/ + } + } +} diff --git a/DiscImageChef.Tests/Filesystems/ProDOS_APM.cs b/DiscImageChef.Tests/Filesystems/ProDOS_APM.cs new file mode 100644 index 000000000..816e7b0f7 --- /dev/null +++ b/DiscImageChef.Tests/Filesystems/ProDOS_APM.cs @@ -0,0 +1,151 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : HFS_APM.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program 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 General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using System.Collections.Generic; +using System.IO; +using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using DiscImageChef.Filesystems; +using DiscImageChef.Filters; +using DiscImageChef.ImagePlugins; +using DiscImageChef.PartPlugins; +using NUnit.Framework; + +namespace DiscImageChef.Tests.Filesystems +{ + [TestFixture] + public class HFS_APM + { + readonly string[] testfiles = { + "amigaos_3.9.vdi.lz","darwin_1.3.1.vdi.lz","darwin_1.4.1.vdi.lz","darwin_6.0.2.vdi.lz", + "darwin_8.0.1.vdi.lz","macos_1.1.vdi.lz","macos_2.0.vdi.lz","macos_6.0.7.vdi.lz", + "macos_7.5.3.vdi.lz","macos_7.5.vdi.lz","macos_7.6.vdi.lz","macos_8.0.vdi.lz", + "macos_8.1.vdi.lz","macos_9.0.4.vdi.lz","macos_9.1.vdi.lz","macos_9.2.1.vdi.lz", + "macos_9.2.2.vdi.lz","macosx_10.2.vdi.lz","macosx_10.3.vdi.lz","macosx_10.4.vdi.lz", + "rhapsody_dr1.vdi.lz", + }; + + readonly ulong[] sectors = { + 1024128,409600,409600,409600, + 409600,41820,41820,81648, + 1024000,1024000,1024000,1024000, + 1024000,1024000,1024000,1024000, + 1024000,1024000,1024000,1024000, + 409600, + }; + + readonly uint[] sectorsize = { + 512,512,512,512, + 512,512,512,512, + 512,512,512,512, + 512,512,512,512, + 512,512,512,512, + 512, + }; + + readonly long[] clusters = { + 64003,51189,51189,58502, + 58502,39991,39991,39991, + 63954,63990,63954,63954, + 63954,63922,63922,63922, + 63922,63884,63883,63883, + 58506, + }; + + readonly int[] clustersize = { + 8192,4096,4096,3584, + 3584,1024,1024,1024, + 8192,8192,8192,8192, + 8192,8192,8192,8192, + 8192,8192,8192,8192, + 3584, + }; + + readonly string[] volumename = { + "Volume label","Volume label","Volume label","Volume label", + "Volume label","Volume label","Volume label","Volume label", + "Volume label","Volume label","Volume label","Volume label", + "Volume label","Volume label","Volume label","Volume label", + "Volume label","Volume label","Volume label","Volume label", + "Volume label" + }; + + readonly string[] volumeserial = { + null,null,null,null, + "AAFE1382AF5AA898",null,null,null, + null,null,null,null, + null,null,null,null, + null,"5A7C38B0CAF279C4","FB49083EBD150509","632C0B1DB46FD188", + null, + }; + + [Test] + public void Test() + { + for(int i = 0; i < testfiles.Length; i++) + { + string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "hfs_apm", testfiles[i]); + Filter filter = new LZip(); + filter.Open(location); + ImagePlugin image = new VDI(); + Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]); + Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]); + Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); + PartPlugin parts = new AppleMap(); + Assert.AreEqual(true, parts.GetInformation(image, out List partitions), testfiles[i]); + Filesystem fs = new DiscImageChef.Filesystems.AppleHFS(); + int part = -1; + for(int j = 0; j < partitions.Count; j++) + { + if(partitions[j].PartitionType == "Apple_HFS") + { + part = j; + break; + } + } + Assert.AreNotEqual(-1, part, "Partition not found"); + Assert.AreEqual(true, fs.Identify(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1), testfiles[i]); + fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information); + Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]); + Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]); + Assert.AreEqual("HFS", fs.XmlFSType.Type, testfiles[i]); + Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); + Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); + } + } + } +} diff --git a/DiscImageChef.Tests/Filesystems/SFS_MBR.cs b/DiscImageChef.Tests/Filesystems/SFS_MBR.cs new file mode 100644 index 000000000..e7e0fdf76 --- /dev/null +++ b/DiscImageChef.Tests/Filesystems/SFS_MBR.cs @@ -0,0 +1,121 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : SFS_RDB.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program 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 General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using System.Collections.Generic; +using System.IO; +using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using DiscImageChef.Filesystems; +using DiscImageChef.Filters; +using DiscImageChef.ImagePlugins; +using DiscImageChef.PartPlugins; +using NUnit.Framework; + +namespace DiscImageChef.Tests.Filesystems +{ + [TestFixture] + public class SFS_RDB + { + readonly string[] testfiles = { + "uae.vdi.lz", + }; + + readonly ulong[] sectors = { + 1024128, + }; + + readonly uint[] sectorsize = { + 512, + }; + + readonly long[] clusters = { + 127000, + }; + + readonly int[] clustersize = { + 2048, + }; + + readonly string[] volumename = { + null, + }; + + readonly string[] volumeserial = { + null, + }; + + readonly string[] oemid = { + null, + }; + + [Test] + public void Test() + { + for(int i = 0; i < testfiles.Length; i++) + { + string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "sfs_rdb", testfiles[i]); + Filter filter = new LZip(); + filter.Open(location); + ImagePlugin image = new VDI(); + Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]); + Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]); + Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); + PartPlugin parts = new AmigaRigidDiskBlock(); + Assert.AreEqual(true, parts.GetInformation(image, out List partitions), testfiles[i]); + Filesystem fs = new DiscImageChef.Filesystems.SFS(); + int part = -1; + for(int j = 0; j < partitions.Count; j++) + { + if(partitions[j].PartitionType == "\"SFS\\0\"" || partitions[j].PartitionType == "\"SFS\\2\"") + { + part = j; + break; + } + } + Assert.AreNotEqual(-1, part, "Partition not found"); + Assert.AreEqual(true, fs.Identify(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1), testfiles[i]); + fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information); + Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]); + Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]); + Assert.AreEqual("SmartFileSystem", fs.XmlFSType.Type, testfiles[i]); + Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); + Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); + Assert.AreEqual(oemid[i], fs.XmlFSType.SystemIdentifier, testfiles[i]); + } + } + } +} diff --git a/DiscImageChef.Tests/Filesystems/SFS_MBR_RDB.cs b/DiscImageChef.Tests/Filesystems/SFS_MBR_RDB.cs new file mode 100644 index 000000000..5963fc019 --- /dev/null +++ b/DiscImageChef.Tests/Filesystems/SFS_MBR_RDB.cs @@ -0,0 +1,118 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : AFFS_MBR_RDB.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program 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 General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using System.Collections.Generic; +using System.IO; +using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using DiscImageChef.Filesystems; +using DiscImageChef.Filters; +using DiscImageChef.ImagePlugins; +using DiscImageChef.PartPlugins; +using NUnit.Framework; +using System; + +namespace DiscImageChef.Tests.Filesystems +{ + [TestFixture] + public class AFFS_MBR_RDB + { + readonly string[] testfiles = { + "aros.vdi.lz","aros_intl.vdi.lz", + }; + + readonly ulong[] sectors = { + 409600,409600, + }; + + readonly uint[] sectorsize = { + 512,512, + }; + + readonly long[] clusters = { + 408240,408240, + }; + + readonly int[] clustersize = { + 512,512, + }; + + readonly string[] volumename = { + "Volume label","Volume label", + }; + + readonly string[] volumeserial = { + null,null, + }; + + [Test] + public void Test() + { + throw new NotImplementedException("Partition schemes inside partitions are not yet implemented, and should be tested here."); +/* for(int i = 0; i < testfiles.Length; i++) + { + string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "affs_mbr_rdb", testfiles[i]); + Filter filter = new LZip(); + filter.Open(location); + ImagePlugin image = new VDI(); + Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]); + Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]); + Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); + PartPlugin parts = new MBR(); + Assert.AreEqual(true, parts.GetInformation(image, out List partitions), testfiles[i]); + Filesystem fs = new DiscImageChef.Filesystems.AmigaDOSPlugin(); + int part = -1; + for(int j = 0; j < partitions.Count; j++) + { + if(partitions[j].PartitionType == "0x2D") + { + part = j; + break; + } + } + Assert.AreNotEqual(-1, part, "Partition not found"); + Assert.AreEqual(true, fs.Identify(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1), testfiles[i]); + fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information); + Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]); + Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]); + Assert.AreEqual("Amiga FFS", fs.XmlFSType.Type, testfiles[i]); + Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); + Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); + }*/ + } + } +} diff --git a/DiscImageChef.Tests/Filesystems/SysV.cs b/DiscImageChef.Tests/Filesystems/SysV.cs new file mode 100644 index 000000000..9a3288c5d --- /dev/null +++ b/DiscImageChef.Tests/Filesystems/SysV.cs @@ -0,0 +1,106 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : AFFS.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program 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 General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using System.IO; +using DiscImageChef.CommonTypes; +using DiscImageChef.Filesystems; +using DiscImageChef.Filters; +using DiscImageChef.ImagePlugins; +using NUnit.Framework; + +namespace DiscImageChef.Tests.Filesystems +{ + [TestFixture] + public class AFFS + { + readonly string[] testfiles = { + "amigaos_3.9.adf.lz", "amigaos_3.9_intl.adf.lz", + }; + + readonly MediaType[] mediatypes = { + MediaType.CBM_AMIGA_35_DD, MediaType.CBM_AMIGA_35_DD, + }; + + readonly ulong[] sectors = { + 1760, 1760, + }; + + readonly uint[] sectorsize = { + 512, 512, + }; + + readonly long[] clusters = { + 1760, 1760, + }; + + readonly int[] clustersize = { + 512, 512, + }; + + readonly string[] volumename = { + "Volume label", "Volume label", + }; + + readonly string[] volumeserial = { + null, null, + }; + + [Test] + public void Test() + { + for(int i = 0; i < testfiles.Length; i++) + { + string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "affs", testfiles[i]); + Filter filter = new LZip(); + filter.Open(location); + ImagePlugin image = new ZZZRawImage(); + Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]); + Assert.AreEqual(mediatypes[i], image.ImageInfo.mediaType, testfiles[i]); + Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]); + Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); + Filesystem fs = new AmigaDOSPlugin(); + Assert.AreEqual(true, fs.Identify(image, 0, image.ImageInfo.sectors - 1), testfiles[i]); + fs.GetInformation(image, 0, image.ImageInfo.sectors - 1, out string information); + Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]); + Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]); + Assert.AreEqual("Amiga FFS", fs.XmlFSType.Type, testfiles[i]); + Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); + Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); + } + } + } +} diff --git a/DiscImageChef.Tests/Filesystems/SysV_MBR.cs b/DiscImageChef.Tests/Filesystems/SysV_MBR.cs new file mode 100644 index 000000000..c27ca4c6b --- /dev/null +++ b/DiscImageChef.Tests/Filesystems/SysV_MBR.cs @@ -0,0 +1,120 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : SysV_MBR.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program 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 General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using System.Collections.Generic; +using System.IO; +using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using DiscImageChef.Filesystems; +using DiscImageChef.Filters; +using DiscImageChef.ImagePlugins; +using DiscImageChef.PartPlugins; +using NUnit.Framework; + +namespace DiscImageChef.Tests.Filesystems +{ + [TestFixture] + public class SysV_MBR + { + readonly string[] testfiles = { + "amix.vdi.lz", + }; + + readonly ulong[] sectors = { + 409600,409600, + }; + + readonly uint[] sectorsize = { + 512,512, + }; + + readonly long[] clusters = { + 511488, + }; + + readonly int[] clustersize = { + 1024, + }; + + readonly string[] volumename = { + "Volume label", + }; + + readonly string[] volumeserial = { + null, + }; + + readonly string[] type = { + "SVR4 fs", + }; + + [Test] + public void Test() + { + for(int i = 0; i < testfiles.Length; i++) + { + string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "s5fs_rdb", testfiles[i]); + Filter filter = new LZip(); + filter.Open(location); + ImagePlugin image = new VDI(); + Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]); + Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]); + Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); + PartPlugin parts = new AmigaRigidDiskBlock(); + Assert.AreEqual(true, parts.GetInformation(image, out List partitions), testfiles[i]); + Filesystem fs = new DiscImageChef.Filesystems.AmigaDOSPlugin(); + int part = -1; + for(int j = 0; j < partitions.Count; j++) + { + if(partitions[j].PartitionType == "\"UNI\\1\"") + { + part = j; + break; + } + } + Assert.AreNotEqual(-1, part, "Partition not found"); + Assert.AreEqual(true, fs.Identify(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1), testfiles[i]); + fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information); + Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]); + Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]); + Assert.AreEqual(type[i], fs.XmlFSType.Type, testfiles[i]); + Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); + Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); + } + } + } +} diff --git a/DiscImageChef.Tests/Filesystems/SysV_RDB.cs b/DiscImageChef.Tests/Filesystems/SysV_RDB.cs new file mode 100644 index 000000000..56a0e6d52 --- /dev/null +++ b/DiscImageChef.Tests/Filesystems/SysV_RDB.cs @@ -0,0 +1,116 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : AFFS_MBR.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program 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 General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using System.Collections.Generic; +using System.IO; +using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using DiscImageChef.Filesystems; +using DiscImageChef.Filters; +using DiscImageChef.ImagePlugins; +using DiscImageChef.PartPlugins; +using NUnit.Framework; + +namespace DiscImageChef.Tests.Filesystems +{ + [TestFixture] + public class AFFS_MBR + { + readonly string[] testfiles = { + "aros.vdi.lz","aros_intl.vdi.lz", + }; + + readonly ulong[] sectors = { + 409600,409600, + }; + + readonly uint[] sectorsize = { + 512,512, + }; + + readonly long[] clusters = { + 408240,408240, + }; + + readonly int[] clustersize = { + 512,512, + }; + + readonly string[] volumename = { + "Volume label","Volume label", + }; + + readonly string[] volumeserial = { + null,null, + }; + + [Test] + public void Test() + { + for(int i = 0; i < testfiles.Length; i++) + { + string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "affs_mbr", testfiles[i]); + Filter filter = new LZip(); + filter.Open(location); + ImagePlugin image = new VDI(); + Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]); + Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]); + Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); + PartPlugin parts = new MBR(); + Assert.AreEqual(true, parts.GetInformation(image, out List partitions), testfiles[i]); + Filesystem fs = new DiscImageChef.Filesystems.AmigaDOSPlugin(); + int part = -1; + for(int j = 0; j < partitions.Count; j++) + { + if(partitions[j].PartitionType == "0x2D") + { + part = j; + break; + } + } + Assert.AreNotEqual(-1, part, "Partition not found"); + Assert.AreEqual(true, fs.Identify(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1), testfiles[i]); + fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information); + Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]); + Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]); + Assert.AreEqual("Amiga FFS", fs.XmlFSType.Type, testfiles[i]); + Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); + Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); + } + } + } +} diff --git a/DiscImageChef.Tests/Filesystems/UFS.cs b/DiscImageChef.Tests/Filesystems/UFS.cs new file mode 100644 index 000000000..6f0e4ab78 --- /dev/null +++ b/DiscImageChef.Tests/Filesystems/UFS.cs @@ -0,0 +1,114 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : MFS.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program 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 General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using System.IO; +using DiscImageChef.CommonTypes; +using DiscImageChef.Filesystems; +using DiscImageChef.Filters; +using DiscImageChef.ImagePlugins; +using NUnit.Framework; + +namespace DiscImageChef.Tests.Filesystems +{ + [TestFixture] + public class MFS + { + readonly string[] testfiles = { + "macos_0.1_mf1dd.img.lz","macos_0.5_mf1dd.img.lz","macos_1.1_mf1dd.img.lz","macos_2.0_mf1dd.img.lz", + "macos_6.0.7_mf1dd.img.lz", + }; + + readonly MediaType[] mediatypes = { + MediaType.AppleSonySS, MediaType.AppleSonySS, MediaType.AppleSonySS, MediaType.AppleSonySS, + MediaType.AppleSonySS + }; + + readonly ulong[] sectors = { + 800, 800, 800, 800, + 800, + }; + + readonly uint[] sectorsize = { + 512, 512, 512, 512, + 512, 512, 512, + }; + + readonly long[] clusters = { + 391, 391, 391, 391, + 391, + }; + + readonly int[] clustersize = { + 1024, 1024, 1024, 1024, + 1024, + }; + + readonly string[] volumename = { + "Volume label","Volume label","Volume label","Volume label", + "Volume label", + }; + + readonly string[] volumeserial = { + null, null, null, null, + null, null, null, + }; + + [Test] + public void Test() + { + for(int i = 0; i < testfiles.Length; i++) + { + string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "mfs", testfiles[i]); + Filter filter = new LZip(); + filter.Open(location); + ImagePlugin image = new ZZZRawImage(); + Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]); + Assert.AreEqual(mediatypes[i], image.ImageInfo.mediaType, testfiles[i]); + Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]); + Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); + Filesystem fs = new DiscImageChef.Filesystems.AppleMFS.AppleMFS(); + Assert.AreEqual(true, fs.Identify(image, 0, image.ImageInfo.sectors - 1), testfiles[i]); + fs.GetInformation(image, 0, image.ImageInfo.sectors - 1, out string information); + Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]); + Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]); + Assert.AreEqual("MFS", fs.XmlFSType.Type, testfiles[i]); + Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); + Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); + } + } + } +} diff --git a/DiscImageChef.Tests/Filesystems/UFS_APM.cs b/DiscImageChef.Tests/Filesystems/UFS_APM.cs new file mode 100644 index 000000000..3ff496a2c --- /dev/null +++ b/DiscImageChef.Tests/Filesystems/UFS_APM.cs @@ -0,0 +1,116 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : UFS_MBR.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program 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 General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using System.Collections.Generic; +using System.IO; +using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using DiscImageChef.Filesystems; +using DiscImageChef.Filters; +using DiscImageChef.ImagePlugins; +using DiscImageChef.PartPlugins; +using NUnit.Framework; + +namespace DiscImageChef.Tests.Filesystems +{ + [TestFixture] + public class UFS_MBR + { + readonly string[] testfiles = { + "ufs1/linux.vdi.lz", "ufs2/linux.vdi.lz", + }; + + readonly ulong[] sectors = { + 262144, 262144, + }; + + readonly uint[] sectorsize = { + 512, 512, + }; + + readonly long[] clusters = { + 65024, 65018, + }; + + readonly int[] clustersize = { + 2048, 2048 + }; + + readonly string[] volumename = { + "Volume label", "Volume label", + }; + + readonly string[] volumeserial = { + "59588B778E9ACDEF", "UNKNOWN", + }; + + [Test] + public void Test() + { + for(int i = 0; i < testfiles.Length; i++) + { + string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "ufs_mbr", testfiles[i]); + Filter filter = new LZip(); + filter.Open(location); + ImagePlugin image = new VDI(); + Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]); + Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]); + Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); + PartPlugin parts = new MBR(); + Assert.AreEqual(true, parts.GetInformation(image, out List partitions), testfiles[i]); + Filesystem fs = new DiscImageChef.Filesystems.FFSPlugin(); + int part = -1; + for(int j = 0; j < partitions.Count; j++) + { + if(partitions[j].PartitionType == "0x83") + { + part = j; + break; + } + } + Assert.AreNotEqual(-1, part, "Partition not found"); + Assert.AreEqual(true, fs.Identify(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1), testfiles[i]); + fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information); + Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]); + Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]); + Assert.AreEqual("UFS", fs.XmlFSType.Type, testfiles[i]); + Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); + Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); + } + } + } +} diff --git a/DiscImageChef.Tests/Filesystems/UFS_NeXT.cs b/DiscImageChef.Tests/Filesystems/UFS_NeXT.cs new file mode 100644 index 000000000..4f8a978b9 --- /dev/null +++ b/DiscImageChef.Tests/Filesystems/UFS_NeXT.cs @@ -0,0 +1,176 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : UFS_MBR.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program 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 General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using System.Collections.Generic; +using System.IO; +using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using DiscImageChef.Filesystems; +using DiscImageChef.Filters; +using DiscImageChef.ImagePlugins; +using DiscImageChef.PartPlugins; +using NUnit.Framework; + +namespace DiscImageChef.Tests.Filesystems +{ + [TestFixture] + public class UFS_MBR + { + readonly string[] testfiles = { + "ufs1/linux.vdi.lz", "ufs2/linux.vdi.lz", "ffs43/darwin_1.3.1.vdi.lz", "ffs43/darwin_1.4.1.vdi.lz", + "ffs43/darwin_6.0.2.vdi.lz", "ffs43/darwin_8.0.1.vdi.lz", "ffs43/dflybsd_1.2.0.vdi.lz", "ffs43/dflybsd_3.6.1.vdi.lz", + "ffs43/dflybsd_4.0.5.vdi.lz", "ffs43/netbsd_1.6.vdi.lz", "ffs43/netbsd_7.1.vdi.lz", "ufs1/darwin_1.3.1.vdi.lz", + "ufs1/darwin_1.4.1.vdi.lz", "ufs1/darwin_6.0.2.vdi.lz", "ufs1/darwin_8.0.1.vdi.lz", "ufs1/dflybsd_1.2.0.vdi.lz", + "ufs1/dflybsd_3.6.1.vdi.lz", "ufs1/dflybsd_4.0.5.vdi.lz", "ufs1/freebsd_6.1.vdi.lz", "ufs1/freebsd_7.0.vdi.lz", + "ufs1/freebsd_8.2.vdi.lz", "ufs1/netbsd_1.6.vdi.lz", "ufs1/netbsd_7.1.vdi.lz", "ufs1/solaris_7.vdi.lz", + "ufs1/solaris_7.vdi.lz", "ufs2/freebsd_6.1.vdi.lz", "ufs2/freebsd_7.0.vdi.lz", "ufs2/freebsd_8.2.vdi.lz", + "ufs2/netbsd_7.1.vdi.lz", + }; + + readonly ulong[] sectors = { + 262144, 262144, 262144, 262144, + 262144, 262144, 262144, 262144, + 262144, 262144, 262144, 262144, + 262144, 262144, 262144, 262144, + 262144, 262144, 262144, 262144, + 262144, 262144, 262144, 262144, + 262144, 262144, 262144, 262144, + 262144, + }; + + readonly uint[] sectorsize = { + 512, 512, 512, 512, + 512, 512, 512, 512, + 512, 512, 512, 512, + 512, 512, 512, 512, + 512, 512, 512, 512, + 512, 512, 512, 512, + 512, 512, 512, 512, + 512, + }; + + readonly long[] clusters = { + 65024, 65018, 65024, 65018, + 65024, 65018, 65024, 65018, + 65024, 65018, 65024, 65018, + 65024, 65018, 65024, 65018, + 65024, 65018, 65024, 65018, + 65024, 65018, 65024, 65018, + 65024, 65018, 65024, 65018, + 65024, + }; + + readonly int[] clustersize = { + 2048, 2048, 2048, 2048, + 2048, 2048, 2048, 2048, + 2048, 2048, 2048, 2048, + 2048, 2048, 2048, 2048, + 2048, 2048, 2048, 2048, + 2048, 2048, 2048, 2048, + 2048, 2048, 2048, 2048, + 2048, + }; + + readonly string[] volumename = { + "Volume label", "Volume label", "Volume label", "Volume label", + "Volume label", "Volume label", "Volume label", "Volume label", + "Volume label", "Volume label", "Volume label", "Volume label", + "Volume label", "Volume label", "Volume label", "Volume label", + "Volume label", "Volume label", "Volume label", "Volume label", + "Volume label", "Volume label", "Volume label", "Volume label", + "Volume label", "Volume label", "Volume label", "Volume label", + "Volume label", + }; + + readonly string[] volumeserial = { + "59588B778E9ACDEF", "UNKNOWN", "UNKNOWN", "UNKNOWN", + "UNKNOWN", "UNKNOWN", "UNKNOWN", "UNKNOWN", + "UNKNOWN", "UNKNOWN", "UNKNOWN", "UNKNOWN", + "UNKNOWN", "UNKNOWN", "UNKNOWN", "UNKNOWN", + "UNKNOWN", "UNKNOWN", "UNKNOWN", "UNKNOWN", + "UNKNOWN", "UNKNOWN", "UNKNOWN", "UNKNOWN", + "UNKNOWN", "UNKNOWN", "UNKNOWN", "UNKNOWN", + "UNKNOWN", + }; + + readonly string[] type = { + "UFS", "UFS2", "UFS", "UFS", + "UFS", "UFS", "UFS", "UFS", + "UFS", "UFS", "UFS", "UFS", + "UFS", "UFS", "UFS", "UFS", + "UFS", "UFS", "UFS", "UFS", + "UFS", "UFS", "UFS", "UFS", + "UFS", "UFS2", "UFS2", "UFS2", + "UFS2", + }; + + [Test] + public void Test() + { + for(int i = 0; i < testfiles.Length; i++) + { + string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "ufs_mbr", testfiles[i]); + Filter filter = new LZip(); + filter.Open(location); + ImagePlugin image = new VDI(); + Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]); + Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]); + Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); + PartPlugin parts = new MBR(); + Assert.AreEqual(true, parts.GetInformation(image, out List partitions), testfiles[i]); + Filesystem fs = new DiscImageChef.Filesystems.FFSPlugin(); + int part = -1; + for(int j = 0; j < partitions.Count; j++) + { + if(partitions[j].PartitionType == "0x83") + { + part = j; + break; + } + } + Assert.AreNotEqual(-1, part, "Partition not found"); + Assert.AreEqual(true, fs.Identify(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1), testfiles[i]); + fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information); + Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]); + Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]); + Assert.AreEqual(type[i], fs.XmlFSType.Type, testfiles[i]); + Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); + Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); + } + } + } +} diff --git a/DiscImageChef.Tests/Filesystems/UFS_RDB.cs b/DiscImageChef.Tests/Filesystems/UFS_RDB.cs new file mode 100644 index 000000000..3f3ff26a5 --- /dev/null +++ b/DiscImageChef.Tests/Filesystems/UFS_RDB.cs @@ -0,0 +1,136 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : UFS_APM.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program 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 General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using System.Collections.Generic; +using System.IO; +using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using DiscImageChef.Filesystems; +using DiscImageChef.Filters; +using DiscImageChef.ImagePlugins; +using DiscImageChef.PartPlugins; +using NUnit.Framework; + +namespace DiscImageChef.Tests.Filesystems +{ + [TestFixture] + public class UFS_APM + { + readonly string[] testfiles = { + "ffs43/darwin_1.3.1.vdi.lz","ffs43/darwin_1.4.1.vdi.lz","ffs43/darwin_6.0.2.vdi.lz","ffs43/darwin_8.0.1.vdi.lz", + "ufs1/darwin_1.3.1.vdi.lz","ufs1/darwin_1.4.1.vdi.lz","ufs1/darwin_6.0.2.vdi.lz","ufs1/darwin_8.0.1.vdi.lz", + "ufs1/macosx_10.2.vdi.lz","ufs1/macosx_10.3.vdi.lz","ufs1/macosx_10.4.vdi.lz", + }; + + readonly ulong[] sectors = { + 262144, 262144, 262144, 262144, + 262144, 262144, 262144, 262144, + 262144, 262144, 262144, + }; + + readonly uint[] sectorsize = { + 512, 512, 512, 512, + 512, 512, 512, 512, + 512, 512, 512, + }; + + readonly long[] clusters = { + 65024, 65018, 65024, 65018, + 65024, 65018, 65024, 65018, + 65024, 65018, 65024, + }; + + readonly int[] clustersize = { + 2048, 2048, 2048, 2048, + 2048, 2048, 2048, 2048, + 2048, 2048, 2048, + }; + + readonly string[] volumename = { + "Volume label", "Volume label", "Volume label", "Volume label", + "Volume label", "Volume label", "Volume label", "Volume label", + "Volume label", "Volume label", "Volume label", + }; + + readonly string[] volumeserial = { + "UNKNOWN", "UNKNOWN", "UNKNOWN", "UNKNOWN", + "UNKNOWN", "UNKNOWN", "UNKNOWN", "UNKNOWN", + "UNKNOWN", "UNKNOWN", "UNKNOWN", + }; + + readonly string[] type = { + "UFS", "UFS", "UFS", "UFS", + "UFS", "UFS", "UFS", "UFS", + "UFS", "UFS", "UFS", + }; + + [Test] + public void Test() + { + for(int i = 0; i < testfiles.Length; i++) + { + string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "ufs_apm", testfiles[i]); + Filter filter = new LZip(); + filter.Open(location); + ImagePlugin image = new VDI(); + Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]); + Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]); + Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); + PartPlugin parts = new AppleMap(); + Assert.AreEqual(true, parts.GetInformation(image, out List partitions), testfiles[i]); + Filesystem fs = new DiscImageChef.Filesystems.FFSPlugin(); + int part = -1; + for(int j = 0; j < partitions.Count; j++) + { + if(partitions[j].PartitionType == "Apple_UFS") + { + part = j; + break; + } + } + Assert.AreNotEqual(-1, part, "Partition not found"); + Assert.AreEqual(true, fs.Identify(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1), testfiles[i]); + fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information); + Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]); + Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]); + Assert.AreEqual(type[i], fs.XmlFSType.Type, testfiles[i]); + Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); + Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); + } + } + } +} diff --git a/DiscImageChef.Tests/Filesystems/UFS_Suni86.cs b/DiscImageChef.Tests/Filesystems/UFS_Suni86.cs new file mode 100644 index 000000000..3775b34ea --- /dev/null +++ b/DiscImageChef.Tests/Filesystems/UFS_Suni86.cs @@ -0,0 +1,120 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : UFS_RDB.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program 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 General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using System.Collections.Generic; +using System.IO; +using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using DiscImageChef.Filesystems; +using DiscImageChef.Filters; +using DiscImageChef.ImagePlugins; +using DiscImageChef.PartPlugins; +using NUnit.Framework; + +namespace DiscImageChef.Tests.Filesystems +{ + [TestFixture] + public class UFS_RDB + { + readonly string[] testfiles = { + "amix.vdi.lz", + }; + + readonly ulong[] sectors = { + 262144, + }; + + readonly uint[] sectorsize = { + 512, + }; + + readonly long[] clusters = { + 65024, + }; + + readonly int[] clustersize = { + 2048, + }; + + readonly string[] volumename = { + null, + }; + + readonly string[] volumeserial = { + "UNKNOWN", + }; + + readonly string[] type = { + "UFS", + }; + + [Test] + public void Test() + { + for(int i = 0; i < testfiles.Length; i++) + { + string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "ufs_rdb", testfiles[i]); + Filter filter = new LZip(); + filter.Open(location); + ImagePlugin image = new VDI(); + Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]); + Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]); + Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); + PartPlugin parts = new AmigaRigidDiskBlock(); + Assert.AreEqual(true, parts.GetInformation(image, out List partitions), testfiles[i]); + Filesystem fs = new DiscImageChef.Filesystems.FFSPlugin(); + int part = -1; + for(int j = 0; j < partitions.Count; j++) + { + if(partitions[j].PartitionType == "\"UNI\\2\"") + { + part = j; + break; + } + } + Assert.AreNotEqual(-1, part, "Partition not found"); + Assert.AreEqual(true, fs.Identify(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1), testfiles[i]); + fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information); + Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]); + Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]); + Assert.AreEqual(type[i], fs.XmlFSType.Type, testfiles[i]); + Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); + Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); + } + } + } +} diff --git a/DiscImageChef.Tests/Filesystems/UNIXBFS_MBR.cs b/DiscImageChef.Tests/Filesystems/UNIXBFS_MBR.cs new file mode 100644 index 000000000..4e95785a3 --- /dev/null +++ b/DiscImageChef.Tests/Filesystems/UNIXBFS_MBR.cs @@ -0,0 +1,111 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : unixbfs.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program 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 General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using System.Collections.Generic; +using System.IO; +using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using DiscImageChef.Filesystems; +using DiscImageChef.Filters; +using DiscImageChef.ImagePlugins; +using DiscImageChef.PartPlugins; +using NUnit.Framework; + +namespace DiscImageChef.Tests.Filesystems +{ + [TestFixture] + public class unixbfs + { + readonly string[] testfiles = { + "linux.vdi.lz","amix.adf.lz", + }; + + readonly ulong[] sectors = { + 262144,1760, + }; + + readonly uint[] sectorsize = { + 512,512, + }; + + readonly long[] clusters = { + 260096,1760, + }; + + readonly int[] clustersize = { + 512,512, + }; + + readonly string[] volumename = { + "Label","Label", + }; + + [Test] + public void Test() + { + for(int i = 0; i < testfiles.Length; i++) + { + string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "unixbfs", testfiles[i]); + Filter filter = new LZip(); + filter.Open(location); + ImagePlugin image = new VDI(); + Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]); + Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]); + Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); + PartPlugin parts = new MBR(); + Assert.AreEqual(true, parts.GetInformation(image, out List partitions), testfiles[i]); + Filesystem fs = new DiscImageChef.Filesystems.BFS(); + int part = -1; + for(int j = 0; j < partitions.Count; j++) + { + if(partitions[j].PartitionType == "0x83") + { + part = j; + break; + } + } + Assert.AreNotEqual(-1, part, "Partition not found"); + Assert.AreEqual(true, fs.Identify(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1), testfiles[i]); + fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information); + Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]); + Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]); + Assert.AreEqual("BFS", fs.XmlFSType.Type, testfiles[i]); + Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); + } + } + } +} diff --git a/DiscImageChef.Tests/Filesystems/UNIXBFS_RDB.cs b/DiscImageChef.Tests/Filesystems/UNIXBFS_RDB.cs new file mode 100644 index 000000000..3775b34ea --- /dev/null +++ b/DiscImageChef.Tests/Filesystems/UNIXBFS_RDB.cs @@ -0,0 +1,120 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : UFS_RDB.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program 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 General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using System.Collections.Generic; +using System.IO; +using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using DiscImageChef.Filesystems; +using DiscImageChef.Filters; +using DiscImageChef.ImagePlugins; +using DiscImageChef.PartPlugins; +using NUnit.Framework; + +namespace DiscImageChef.Tests.Filesystems +{ + [TestFixture] + public class UFS_RDB + { + readonly string[] testfiles = { + "amix.vdi.lz", + }; + + readonly ulong[] sectors = { + 262144, + }; + + readonly uint[] sectorsize = { + 512, + }; + + readonly long[] clusters = { + 65024, + }; + + readonly int[] clustersize = { + 2048, + }; + + readonly string[] volumename = { + null, + }; + + readonly string[] volumeserial = { + "UNKNOWN", + }; + + readonly string[] type = { + "UFS", + }; + + [Test] + public void Test() + { + for(int i = 0; i < testfiles.Length; i++) + { + string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "ufs_rdb", testfiles[i]); + Filter filter = new LZip(); + filter.Open(location); + ImagePlugin image = new VDI(); + Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]); + Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]); + Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); + PartPlugin parts = new AmigaRigidDiskBlock(); + Assert.AreEqual(true, parts.GetInformation(image, out List partitions), testfiles[i]); + Filesystem fs = new DiscImageChef.Filesystems.FFSPlugin(); + int part = -1; + for(int j = 0; j < partitions.Count; j++) + { + if(partitions[j].PartitionType == "\"UNI\\2\"") + { + part = j; + break; + } + } + Assert.AreNotEqual(-1, part, "Partition not found"); + Assert.AreEqual(true, fs.Identify(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1), testfiles[i]); + fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information); + Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]); + Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]); + Assert.AreEqual(type[i], fs.XmlFSType.Type, testfiles[i]); + Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); + Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); + } + } + } +} diff --git a/DiscImageChef.Tests/Filesystems/ZFS.cs b/DiscImageChef.Tests/Filesystems/ZFS.cs new file mode 100644 index 000000000..6f0e4ab78 --- /dev/null +++ b/DiscImageChef.Tests/Filesystems/ZFS.cs @@ -0,0 +1,114 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : MFS.cs +// Version : 1.0 +// Author(s) : Natalia Portillo +// +// Component : Component +// +// Revision : $Revision$ +// Last change by : $Author$ +// Date : $Date$ +// +// --[ Description ] ---------------------------------------------------------- +// +// Description +// +// --[ License ] -------------------------------------------------------------- +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program 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 General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using System.IO; +using DiscImageChef.CommonTypes; +using DiscImageChef.Filesystems; +using DiscImageChef.Filters; +using DiscImageChef.ImagePlugins; +using NUnit.Framework; + +namespace DiscImageChef.Tests.Filesystems +{ + [TestFixture] + public class MFS + { + readonly string[] testfiles = { + "macos_0.1_mf1dd.img.lz","macos_0.5_mf1dd.img.lz","macos_1.1_mf1dd.img.lz","macos_2.0_mf1dd.img.lz", + "macos_6.0.7_mf1dd.img.lz", + }; + + readonly MediaType[] mediatypes = { + MediaType.AppleSonySS, MediaType.AppleSonySS, MediaType.AppleSonySS, MediaType.AppleSonySS, + MediaType.AppleSonySS + }; + + readonly ulong[] sectors = { + 800, 800, 800, 800, + 800, + }; + + readonly uint[] sectorsize = { + 512, 512, 512, 512, + 512, 512, 512, + }; + + readonly long[] clusters = { + 391, 391, 391, 391, + 391, + }; + + readonly int[] clustersize = { + 1024, 1024, 1024, 1024, + 1024, + }; + + readonly string[] volumename = { + "Volume label","Volume label","Volume label","Volume label", + "Volume label", + }; + + readonly string[] volumeserial = { + null, null, null, null, + null, null, null, + }; + + [Test] + public void Test() + { + for(int i = 0; i < testfiles.Length; i++) + { + string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "mfs", testfiles[i]); + Filter filter = new LZip(); + filter.Open(location); + ImagePlugin image = new ZZZRawImage(); + Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]); + Assert.AreEqual(mediatypes[i], image.ImageInfo.mediaType, testfiles[i]); + Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]); + Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); + Filesystem fs = new DiscImageChef.Filesystems.AppleMFS.AppleMFS(); + Assert.AreEqual(true, fs.Identify(image, 0, image.ImageInfo.sectors - 1), testfiles[i]); + fs.GetInformation(image, 0, image.ImageInfo.sectors - 1, out string information); + Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]); + Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]); + Assert.AreEqual("MFS", fs.XmlFSType.Type, testfiles[i]); + Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); + Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); + } + } + } +}