2017-05-19 20:28:49 +01:00
|
|
|
// /***************************************************************************
|
2020-02-27 12:31:25 +00:00
|
|
|
// Aaru Data Preservation Suite
|
* DiscImageChef.CommonTypes/MediaTypeFromSCSI.cs:
* DiscImageChef.CommonTypes/DiscImageChef.CommonTypes.csproj:
Added method to calculate MediaType from SCSI parameters
(mode, density, medium type, device type, etc).
* DiscImageChef.Metadata/DeviceReport.cs:
Added command to guess drive and media parameters and output
an XML report of them.
* DiscImageChef/Commands/DeviceReport.cs:
* DiscImageChef.Metadata/DiscImageChef.Metadata.csproj:
Added command to guess drive and media parameters and output
an XML report of them.
* DiscImageChef/Commands/DumpMedia.cs:
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Core/Checksum.cs:
* DiscImageChef/Commands/CreateSidecar.cs:
Moved checksum generation to a separate class.
* CICMMetadata:
Added support for ADIP.
* DiscImageChef.CommonTypes/MediaType.cs:
Added parameters of UDO media.
Moved DataPlay outside of Iomega, as it's not from that
manufacturer.
Added missing Exatape media and corrected 160m XL one.
Added SyJet media.
Added all ECMA defined magneto-optical (sectors calculated
from specifications, unchecked).
Added PD media.
Added Imation 320Gb RDX.
Added generic USB flash drives.
* DiscImageChef.Decoders/SCSI/Enums.cs:
Make enumerations public.
* DiscImageChef.Decoders/SCSI/Inquiry.cs:
* DiscImageChef.Devices/Device/Constructor.cs:
Trim space padded strings on SCSI INQUIRY.
* DiscImageChef.Devices/Device/ScsiCommands/MMC.cs:
Added PREVENT ALLOW MEDIUM REMOVAL.
Added START STOP UNIT.
* DiscImageChef.Devices/Device/ScsiCommands/NEC.cs:
Rename NEC methods.
* DiscImageChef.Devices/Device/ScsiCommands/Pioneer.cs:
Corrected Pioneer transfer length calculation.
* DiscImageChef.Devices/Device/ScsiCommands/Plextor.cs:
Renamed Plextor methods.
* DiscImageChef.Devices/Device/ScsiCommands/SPC.cs:
Renamed SSC PREVENT ALLOW MEDIUM REMOVAL to uncollide with
MMC same name but different command.
* DiscImageChef.Devices/DiscImageChef.Devices.csproj:
Set platform target to x86 (does it really matter?).
* DiscImageChef.Devices/Linux/Command.cs:
Reduced allocation for readlink() to current kernel
MAX_PATH.
* DiscImageChef.Devices/Linux/Enums.cs:
Modified Linux ioctl to 32-bit. Works on 64-bit also. Solves
commands not working on 32-bit environments.
* DiscImageChef.DiscImages/ZZZRawImage.cs:
Changed ECMA-184 and ECMA-183 enums.
* DiscImageChef.Metadata/Dimensions.cs:
Added all ECMA defined magneto-opticals.
Added PD media.
Added 320Gb RDX.
Corrected Exatape 160m XL.
Added Exatape 22m and 28m.
* DiscImageChef.Metadata/MediaType.cs:
Added 356mm magneto-optical media.
Changed ECMA-184 and ECMA-183 enums.
Added USB generic flash drive.
* DiscImageChef/Commands/DeviceInfo.cs:
Corrected SCSI INQUIRY naming.
Corrected SCSI MODE SENSE (6) parameters.
Reduced SCSI MODE SENSE timeout, some devices just get stuck
with unsupported MODE SENSE commanda and must be left to
timeout.
Changed FUJITSU vendor string comparison.
* DiscImageChef/Commands/MediaInfo.cs:
Added method to calculate MediaType from SCSI parameters
(mode, density, medium type, device type, etc).
Changed some error WriteLine() to debug ones. Too much
verbosity.
Added DVD media type decoding from PFI.
Found a drive that dumps ADIP, enabling it again (not
decoded).
* DiscImageChef/Commands/MediaScan.cs:
Added option to generate ImgBurn compatible log to
media-scan command.
* DiscImageChef/DiscImageChef.csproj:
Moved checksum generation to a separate class.
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Main.cs:
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Options.cs:
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
Added option to generate ImgBurn compatible log to media-scan
command.
2016-01-31 08:05:56 +00:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
//
|
|
|
|
|
// Filename : DeviceReport.cs
|
2016-07-28 18:13:49 +01:00
|
|
|
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
* DiscImageChef.CommonTypes/MediaTypeFromSCSI.cs:
* DiscImageChef.CommonTypes/DiscImageChef.CommonTypes.csproj:
Added method to calculate MediaType from SCSI parameters
(mode, density, medium type, device type, etc).
* DiscImageChef.Metadata/DeviceReport.cs:
Added command to guess drive and media parameters and output
an XML report of them.
* DiscImageChef/Commands/DeviceReport.cs:
* DiscImageChef.Metadata/DiscImageChef.Metadata.csproj:
Added command to guess drive and media parameters and output
an XML report of them.
* DiscImageChef/Commands/DumpMedia.cs:
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Core/Checksum.cs:
* DiscImageChef/Commands/CreateSidecar.cs:
Moved checksum generation to a separate class.
* CICMMetadata:
Added support for ADIP.
* DiscImageChef.CommonTypes/MediaType.cs:
Added parameters of UDO media.
Moved DataPlay outside of Iomega, as it's not from that
manufacturer.
Added missing Exatape media and corrected 160m XL one.
Added SyJet media.
Added all ECMA defined magneto-optical (sectors calculated
from specifications, unchecked).
Added PD media.
Added Imation 320Gb RDX.
Added generic USB flash drives.
* DiscImageChef.Decoders/SCSI/Enums.cs:
Make enumerations public.
* DiscImageChef.Decoders/SCSI/Inquiry.cs:
* DiscImageChef.Devices/Device/Constructor.cs:
Trim space padded strings on SCSI INQUIRY.
* DiscImageChef.Devices/Device/ScsiCommands/MMC.cs:
Added PREVENT ALLOW MEDIUM REMOVAL.
Added START STOP UNIT.
* DiscImageChef.Devices/Device/ScsiCommands/NEC.cs:
Rename NEC methods.
* DiscImageChef.Devices/Device/ScsiCommands/Pioneer.cs:
Corrected Pioneer transfer length calculation.
* DiscImageChef.Devices/Device/ScsiCommands/Plextor.cs:
Renamed Plextor methods.
* DiscImageChef.Devices/Device/ScsiCommands/SPC.cs:
Renamed SSC PREVENT ALLOW MEDIUM REMOVAL to uncollide with
MMC same name but different command.
* DiscImageChef.Devices/DiscImageChef.Devices.csproj:
Set platform target to x86 (does it really matter?).
* DiscImageChef.Devices/Linux/Command.cs:
Reduced allocation for readlink() to current kernel
MAX_PATH.
* DiscImageChef.Devices/Linux/Enums.cs:
Modified Linux ioctl to 32-bit. Works on 64-bit also. Solves
commands not working on 32-bit environments.
* DiscImageChef.DiscImages/ZZZRawImage.cs:
Changed ECMA-184 and ECMA-183 enums.
* DiscImageChef.Metadata/Dimensions.cs:
Added all ECMA defined magneto-opticals.
Added PD media.
Added 320Gb RDX.
Corrected Exatape 160m XL.
Added Exatape 22m and 28m.
* DiscImageChef.Metadata/MediaType.cs:
Added 356mm magneto-optical media.
Changed ECMA-184 and ECMA-183 enums.
Added USB generic flash drive.
* DiscImageChef/Commands/DeviceInfo.cs:
Corrected SCSI INQUIRY naming.
Corrected SCSI MODE SENSE (6) parameters.
Reduced SCSI MODE SENSE timeout, some devices just get stuck
with unsupported MODE SENSE commanda and must be left to
timeout.
Changed FUJITSU vendor string comparison.
* DiscImageChef/Commands/MediaInfo.cs:
Added method to calculate MediaType from SCSI parameters
(mode, density, medium type, device type, etc).
Changed some error WriteLine() to debug ones. Too much
verbosity.
Added DVD media type decoding from PFI.
Found a drive that dumps ADIP, enabling it again (not
decoded).
* DiscImageChef/Commands/MediaScan.cs:
Added option to generate ImgBurn compatible log to
media-scan command.
* DiscImageChef/DiscImageChef.csproj:
Moved checksum generation to a separate class.
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Main.cs:
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Options.cs:
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
Added option to generate ImgBurn compatible log to media-scan
command.
2016-01-31 08:05:56 +00:00
|
|
|
//
|
2020-03-11 21:56:55 +00:00
|
|
|
// Component : Commands.
|
* DiscImageChef.CommonTypes/MediaTypeFromSCSI.cs:
* DiscImageChef.CommonTypes/DiscImageChef.CommonTypes.csproj:
Added method to calculate MediaType from SCSI parameters
(mode, density, medium type, device type, etc).
* DiscImageChef.Metadata/DeviceReport.cs:
Added command to guess drive and media parameters and output
an XML report of them.
* DiscImageChef/Commands/DeviceReport.cs:
* DiscImageChef.Metadata/DiscImageChef.Metadata.csproj:
Added command to guess drive and media parameters and output
an XML report of them.
* DiscImageChef/Commands/DumpMedia.cs:
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Core/Checksum.cs:
* DiscImageChef/Commands/CreateSidecar.cs:
Moved checksum generation to a separate class.
* CICMMetadata:
Added support for ADIP.
* DiscImageChef.CommonTypes/MediaType.cs:
Added parameters of UDO media.
Moved DataPlay outside of Iomega, as it's not from that
manufacturer.
Added missing Exatape media and corrected 160m XL one.
Added SyJet media.
Added all ECMA defined magneto-optical (sectors calculated
from specifications, unchecked).
Added PD media.
Added Imation 320Gb RDX.
Added generic USB flash drives.
* DiscImageChef.Decoders/SCSI/Enums.cs:
Make enumerations public.
* DiscImageChef.Decoders/SCSI/Inquiry.cs:
* DiscImageChef.Devices/Device/Constructor.cs:
Trim space padded strings on SCSI INQUIRY.
* DiscImageChef.Devices/Device/ScsiCommands/MMC.cs:
Added PREVENT ALLOW MEDIUM REMOVAL.
Added START STOP UNIT.
* DiscImageChef.Devices/Device/ScsiCommands/NEC.cs:
Rename NEC methods.
* DiscImageChef.Devices/Device/ScsiCommands/Pioneer.cs:
Corrected Pioneer transfer length calculation.
* DiscImageChef.Devices/Device/ScsiCommands/Plextor.cs:
Renamed Plextor methods.
* DiscImageChef.Devices/Device/ScsiCommands/SPC.cs:
Renamed SSC PREVENT ALLOW MEDIUM REMOVAL to uncollide with
MMC same name but different command.
* DiscImageChef.Devices/DiscImageChef.Devices.csproj:
Set platform target to x86 (does it really matter?).
* DiscImageChef.Devices/Linux/Command.cs:
Reduced allocation for readlink() to current kernel
MAX_PATH.
* DiscImageChef.Devices/Linux/Enums.cs:
Modified Linux ioctl to 32-bit. Works on 64-bit also. Solves
commands not working on 32-bit environments.
* DiscImageChef.DiscImages/ZZZRawImage.cs:
Changed ECMA-184 and ECMA-183 enums.
* DiscImageChef.Metadata/Dimensions.cs:
Added all ECMA defined magneto-opticals.
Added PD media.
Added 320Gb RDX.
Corrected Exatape 160m XL.
Added Exatape 22m and 28m.
* DiscImageChef.Metadata/MediaType.cs:
Added 356mm magneto-optical media.
Changed ECMA-184 and ECMA-183 enums.
Added USB generic flash drive.
* DiscImageChef/Commands/DeviceInfo.cs:
Corrected SCSI INQUIRY naming.
Corrected SCSI MODE SENSE (6) parameters.
Reduced SCSI MODE SENSE timeout, some devices just get stuck
with unsupported MODE SENSE commanda and must be left to
timeout.
Changed FUJITSU vendor string comparison.
* DiscImageChef/Commands/MediaInfo.cs:
Added method to calculate MediaType from SCSI parameters
(mode, density, medium type, device type, etc).
Changed some error WriteLine() to debug ones. Too much
verbosity.
Added DVD media type decoding from PFI.
Found a drive that dumps ADIP, enabling it again (not
decoded).
* DiscImageChef/Commands/MediaScan.cs:
Added option to generate ImgBurn compatible log to
media-scan command.
* DiscImageChef/DiscImageChef.csproj:
Moved checksum generation to a separate class.
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Main.cs:
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Options.cs:
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
Added option to generate ImgBurn compatible log to media-scan
command.
2016-01-31 08:05:56 +00:00
|
|
|
//
|
|
|
|
|
// --[ Description ] ----------------------------------------------------------
|
|
|
|
|
//
|
2020-03-11 21:56:55 +00:00
|
|
|
// Implements the 'report' command.
|
* DiscImageChef.CommonTypes/MediaTypeFromSCSI.cs:
* DiscImageChef.CommonTypes/DiscImageChef.CommonTypes.csproj:
Added method to calculate MediaType from SCSI parameters
(mode, density, medium type, device type, etc).
* DiscImageChef.Metadata/DeviceReport.cs:
Added command to guess drive and media parameters and output
an XML report of them.
* DiscImageChef/Commands/DeviceReport.cs:
* DiscImageChef.Metadata/DiscImageChef.Metadata.csproj:
Added command to guess drive and media parameters and output
an XML report of them.
* DiscImageChef/Commands/DumpMedia.cs:
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Core/Checksum.cs:
* DiscImageChef/Commands/CreateSidecar.cs:
Moved checksum generation to a separate class.
* CICMMetadata:
Added support for ADIP.
* DiscImageChef.CommonTypes/MediaType.cs:
Added parameters of UDO media.
Moved DataPlay outside of Iomega, as it's not from that
manufacturer.
Added missing Exatape media and corrected 160m XL one.
Added SyJet media.
Added all ECMA defined magneto-optical (sectors calculated
from specifications, unchecked).
Added PD media.
Added Imation 320Gb RDX.
Added generic USB flash drives.
* DiscImageChef.Decoders/SCSI/Enums.cs:
Make enumerations public.
* DiscImageChef.Decoders/SCSI/Inquiry.cs:
* DiscImageChef.Devices/Device/Constructor.cs:
Trim space padded strings on SCSI INQUIRY.
* DiscImageChef.Devices/Device/ScsiCommands/MMC.cs:
Added PREVENT ALLOW MEDIUM REMOVAL.
Added START STOP UNIT.
* DiscImageChef.Devices/Device/ScsiCommands/NEC.cs:
Rename NEC methods.
* DiscImageChef.Devices/Device/ScsiCommands/Pioneer.cs:
Corrected Pioneer transfer length calculation.
* DiscImageChef.Devices/Device/ScsiCommands/Plextor.cs:
Renamed Plextor methods.
* DiscImageChef.Devices/Device/ScsiCommands/SPC.cs:
Renamed SSC PREVENT ALLOW MEDIUM REMOVAL to uncollide with
MMC same name but different command.
* DiscImageChef.Devices/DiscImageChef.Devices.csproj:
Set platform target to x86 (does it really matter?).
* DiscImageChef.Devices/Linux/Command.cs:
Reduced allocation for readlink() to current kernel
MAX_PATH.
* DiscImageChef.Devices/Linux/Enums.cs:
Modified Linux ioctl to 32-bit. Works on 64-bit also. Solves
commands not working on 32-bit environments.
* DiscImageChef.DiscImages/ZZZRawImage.cs:
Changed ECMA-184 and ECMA-183 enums.
* DiscImageChef.Metadata/Dimensions.cs:
Added all ECMA defined magneto-opticals.
Added PD media.
Added 320Gb RDX.
Corrected Exatape 160m XL.
Added Exatape 22m and 28m.
* DiscImageChef.Metadata/MediaType.cs:
Added 356mm magneto-optical media.
Changed ECMA-184 and ECMA-183 enums.
Added USB generic flash drive.
* DiscImageChef/Commands/DeviceInfo.cs:
Corrected SCSI INQUIRY naming.
Corrected SCSI MODE SENSE (6) parameters.
Reduced SCSI MODE SENSE timeout, some devices just get stuck
with unsupported MODE SENSE commanda and must be left to
timeout.
Changed FUJITSU vendor string comparison.
* DiscImageChef/Commands/MediaInfo.cs:
Added method to calculate MediaType from SCSI parameters
(mode, density, medium type, device type, etc).
Changed some error WriteLine() to debug ones. Too much
verbosity.
Added DVD media type decoding from PFI.
Found a drive that dumps ADIP, enabling it again (not
decoded).
* DiscImageChef/Commands/MediaScan.cs:
Added option to generate ImgBurn compatible log to
media-scan command.
* DiscImageChef/DiscImageChef.csproj:
Moved checksum generation to a separate class.
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Main.cs:
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Options.cs:
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
Added option to generate ImgBurn compatible log to media-scan
command.
2016-01-31 08:05:56 +00:00
|
|
|
//
|
|
|
|
|
// --[ 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 <http://www.gnu.org/licenses/>.
|
|
|
|
|
//
|
|
|
|
|
// ----------------------------------------------------------------------------
|
2022-02-18 10:02:53 +00:00
|
|
|
// Copyright © 2011-2022 Natalia Portillo
|
* DiscImageChef.CommonTypes/MediaTypeFromSCSI.cs:
* DiscImageChef.CommonTypes/DiscImageChef.CommonTypes.csproj:
Added method to calculate MediaType from SCSI parameters
(mode, density, medium type, device type, etc).
* DiscImageChef.Metadata/DeviceReport.cs:
Added command to guess drive and media parameters and output
an XML report of them.
* DiscImageChef/Commands/DeviceReport.cs:
* DiscImageChef.Metadata/DiscImageChef.Metadata.csproj:
Added command to guess drive and media parameters and output
an XML report of them.
* DiscImageChef/Commands/DumpMedia.cs:
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Core/Checksum.cs:
* DiscImageChef/Commands/CreateSidecar.cs:
Moved checksum generation to a separate class.
* CICMMetadata:
Added support for ADIP.
* DiscImageChef.CommonTypes/MediaType.cs:
Added parameters of UDO media.
Moved DataPlay outside of Iomega, as it's not from that
manufacturer.
Added missing Exatape media and corrected 160m XL one.
Added SyJet media.
Added all ECMA defined magneto-optical (sectors calculated
from specifications, unchecked).
Added PD media.
Added Imation 320Gb RDX.
Added generic USB flash drives.
* DiscImageChef.Decoders/SCSI/Enums.cs:
Make enumerations public.
* DiscImageChef.Decoders/SCSI/Inquiry.cs:
* DiscImageChef.Devices/Device/Constructor.cs:
Trim space padded strings on SCSI INQUIRY.
* DiscImageChef.Devices/Device/ScsiCommands/MMC.cs:
Added PREVENT ALLOW MEDIUM REMOVAL.
Added START STOP UNIT.
* DiscImageChef.Devices/Device/ScsiCommands/NEC.cs:
Rename NEC methods.
* DiscImageChef.Devices/Device/ScsiCommands/Pioneer.cs:
Corrected Pioneer transfer length calculation.
* DiscImageChef.Devices/Device/ScsiCommands/Plextor.cs:
Renamed Plextor methods.
* DiscImageChef.Devices/Device/ScsiCommands/SPC.cs:
Renamed SSC PREVENT ALLOW MEDIUM REMOVAL to uncollide with
MMC same name but different command.
* DiscImageChef.Devices/DiscImageChef.Devices.csproj:
Set platform target to x86 (does it really matter?).
* DiscImageChef.Devices/Linux/Command.cs:
Reduced allocation for readlink() to current kernel
MAX_PATH.
* DiscImageChef.Devices/Linux/Enums.cs:
Modified Linux ioctl to 32-bit. Works on 64-bit also. Solves
commands not working on 32-bit environments.
* DiscImageChef.DiscImages/ZZZRawImage.cs:
Changed ECMA-184 and ECMA-183 enums.
* DiscImageChef.Metadata/Dimensions.cs:
Added all ECMA defined magneto-opticals.
Added PD media.
Added 320Gb RDX.
Corrected Exatape 160m XL.
Added Exatape 22m and 28m.
* DiscImageChef.Metadata/MediaType.cs:
Added 356mm magneto-optical media.
Changed ECMA-184 and ECMA-183 enums.
Added USB generic flash drive.
* DiscImageChef/Commands/DeviceInfo.cs:
Corrected SCSI INQUIRY naming.
Corrected SCSI MODE SENSE (6) parameters.
Reduced SCSI MODE SENSE timeout, some devices just get stuck
with unsupported MODE SENSE commanda and must be left to
timeout.
Changed FUJITSU vendor string comparison.
* DiscImageChef/Commands/MediaInfo.cs:
Added method to calculate MediaType from SCSI parameters
(mode, density, medium type, device type, etc).
Changed some error WriteLine() to debug ones. Too much
verbosity.
Added DVD media type decoding from PFI.
Found a drive that dumps ADIP, enabling it again (not
decoded).
* DiscImageChef/Commands/MediaScan.cs:
Added option to generate ImgBurn compatible log to
media-scan command.
* DiscImageChef/DiscImageChef.csproj:
Moved checksum generation to a separate class.
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Main.cs:
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Options.cs:
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
Added option to generate ImgBurn compatible log to media-scan
command.
2016-01-31 08:05:56 +00:00
|
|
|
// ****************************************************************************/
|
2016-07-28 18:13:49 +01:00
|
|
|
|
* DiscImageChef.CommonTypes/MediaTypeFromSCSI.cs:
* DiscImageChef.CommonTypes/DiscImageChef.CommonTypes.csproj:
Added method to calculate MediaType from SCSI parameters
(mode, density, medium type, device type, etc).
* DiscImageChef.Metadata/DeviceReport.cs:
Added command to guess drive and media parameters and output
an XML report of them.
* DiscImageChef/Commands/DeviceReport.cs:
* DiscImageChef.Metadata/DiscImageChef.Metadata.csproj:
Added command to guess drive and media parameters and output
an XML report of them.
* DiscImageChef/Commands/DumpMedia.cs:
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Core/Checksum.cs:
* DiscImageChef/Commands/CreateSidecar.cs:
Moved checksum generation to a separate class.
* CICMMetadata:
Added support for ADIP.
* DiscImageChef.CommonTypes/MediaType.cs:
Added parameters of UDO media.
Moved DataPlay outside of Iomega, as it's not from that
manufacturer.
Added missing Exatape media and corrected 160m XL one.
Added SyJet media.
Added all ECMA defined magneto-optical (sectors calculated
from specifications, unchecked).
Added PD media.
Added Imation 320Gb RDX.
Added generic USB flash drives.
* DiscImageChef.Decoders/SCSI/Enums.cs:
Make enumerations public.
* DiscImageChef.Decoders/SCSI/Inquiry.cs:
* DiscImageChef.Devices/Device/Constructor.cs:
Trim space padded strings on SCSI INQUIRY.
* DiscImageChef.Devices/Device/ScsiCommands/MMC.cs:
Added PREVENT ALLOW MEDIUM REMOVAL.
Added START STOP UNIT.
* DiscImageChef.Devices/Device/ScsiCommands/NEC.cs:
Rename NEC methods.
* DiscImageChef.Devices/Device/ScsiCommands/Pioneer.cs:
Corrected Pioneer transfer length calculation.
* DiscImageChef.Devices/Device/ScsiCommands/Plextor.cs:
Renamed Plextor methods.
* DiscImageChef.Devices/Device/ScsiCommands/SPC.cs:
Renamed SSC PREVENT ALLOW MEDIUM REMOVAL to uncollide with
MMC same name but different command.
* DiscImageChef.Devices/DiscImageChef.Devices.csproj:
Set platform target to x86 (does it really matter?).
* DiscImageChef.Devices/Linux/Command.cs:
Reduced allocation for readlink() to current kernel
MAX_PATH.
* DiscImageChef.Devices/Linux/Enums.cs:
Modified Linux ioctl to 32-bit. Works on 64-bit also. Solves
commands not working on 32-bit environments.
* DiscImageChef.DiscImages/ZZZRawImage.cs:
Changed ECMA-184 and ECMA-183 enums.
* DiscImageChef.Metadata/Dimensions.cs:
Added all ECMA defined magneto-opticals.
Added PD media.
Added 320Gb RDX.
Corrected Exatape 160m XL.
Added Exatape 22m and 28m.
* DiscImageChef.Metadata/MediaType.cs:
Added 356mm magneto-optical media.
Changed ECMA-184 and ECMA-183 enums.
Added USB generic flash drive.
* DiscImageChef/Commands/DeviceInfo.cs:
Corrected SCSI INQUIRY naming.
Corrected SCSI MODE SENSE (6) parameters.
Reduced SCSI MODE SENSE timeout, some devices just get stuck
with unsupported MODE SENSE commanda and must be left to
timeout.
Changed FUJITSU vendor string comparison.
* DiscImageChef/Commands/MediaInfo.cs:
Added method to calculate MediaType from SCSI parameters
(mode, density, medium type, device type, etc).
Changed some error WriteLine() to debug ones. Too much
verbosity.
Added DVD media type decoding from PFI.
Found a drive that dumps ADIP, enabling it again (not
decoded).
* DiscImageChef/Commands/MediaScan.cs:
Added option to generate ImgBurn compatible log to
media-scan command.
* DiscImageChef/DiscImageChef.csproj:
Moved checksum generation to a separate class.
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Main.cs:
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Options.cs:
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
Added option to generate ImgBurn compatible log to media-scan
command.
2016-01-31 08:05:56 +00:00
|
|
|
using System;
|
2018-11-25 19:13:21 +00:00
|
|
|
using System.Collections.Generic;
|
2020-01-02 04:09:39 +00:00
|
|
|
using System.CommandLine;
|
2022-04-10 12:54:04 +01:00
|
|
|
using System.CommandLine.NamingConventionBinder;
|
2017-05-28 21:01:17 +01:00
|
|
|
using System.IO;
|
2020-11-30 13:10:04 +00:00
|
|
|
using System.Linq;
|
2018-11-25 20:08:28 +00:00
|
|
|
using System.Threading;
|
2020-02-27 00:33:26 +00:00
|
|
|
using Aaru.CommonTypes.Enums;
|
|
|
|
|
using Aaru.CommonTypes.Interop;
|
|
|
|
|
using Aaru.CommonTypes.Metadata;
|
|
|
|
|
using Aaru.CommonTypes.Structs.Devices.ATA;
|
|
|
|
|
using Aaru.CommonTypes.Structs.Devices.SCSI;
|
|
|
|
|
using Aaru.Console;
|
|
|
|
|
using Aaru.Core;
|
|
|
|
|
using Aaru.Database;
|
|
|
|
|
using Aaru.Database.Models;
|
|
|
|
|
using Aaru.Decoders.SCSI;
|
2020-11-30 13:10:04 +00:00
|
|
|
using Aaru.Decoders.SCSI.MMC;
|
2020-07-20 15:43:52 +01:00
|
|
|
using Aaru.Helpers;
|
2022-11-18 11:18:45 +00:00
|
|
|
using Aaru.Localization;
|
2018-11-25 17:47:14 +00:00
|
|
|
using Newtonsoft.Json;
|
2021-09-13 18:08:44 +01:00
|
|
|
using Spectre.Console;
|
2020-01-02 04:09:39 +00:00
|
|
|
using Command = System.CommandLine.Command;
|
2020-02-27 00:33:26 +00:00
|
|
|
using DeviceReport = Aaru.Core.Devices.Report.DeviceReport;
|
2021-09-13 18:08:44 +01:00
|
|
|
using Profile = Aaru.Decoders.SCSI.MMC.Profile;
|
* DiscImageChef.CommonTypes/MediaTypeFromSCSI.cs:
* DiscImageChef.CommonTypes/DiscImageChef.CommonTypes.csproj:
Added method to calculate MediaType from SCSI parameters
(mode, density, medium type, device type, etc).
* DiscImageChef.Metadata/DeviceReport.cs:
Added command to guess drive and media parameters and output
an XML report of them.
* DiscImageChef/Commands/DeviceReport.cs:
* DiscImageChef.Metadata/DiscImageChef.Metadata.csproj:
Added command to guess drive and media parameters and output
an XML report of them.
* DiscImageChef/Commands/DumpMedia.cs:
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Core/Checksum.cs:
* DiscImageChef/Commands/CreateSidecar.cs:
Moved checksum generation to a separate class.
* CICMMetadata:
Added support for ADIP.
* DiscImageChef.CommonTypes/MediaType.cs:
Added parameters of UDO media.
Moved DataPlay outside of Iomega, as it's not from that
manufacturer.
Added missing Exatape media and corrected 160m XL one.
Added SyJet media.
Added all ECMA defined magneto-optical (sectors calculated
from specifications, unchecked).
Added PD media.
Added Imation 320Gb RDX.
Added generic USB flash drives.
* DiscImageChef.Decoders/SCSI/Enums.cs:
Make enumerations public.
* DiscImageChef.Decoders/SCSI/Inquiry.cs:
* DiscImageChef.Devices/Device/Constructor.cs:
Trim space padded strings on SCSI INQUIRY.
* DiscImageChef.Devices/Device/ScsiCommands/MMC.cs:
Added PREVENT ALLOW MEDIUM REMOVAL.
Added START STOP UNIT.
* DiscImageChef.Devices/Device/ScsiCommands/NEC.cs:
Rename NEC methods.
* DiscImageChef.Devices/Device/ScsiCommands/Pioneer.cs:
Corrected Pioneer transfer length calculation.
* DiscImageChef.Devices/Device/ScsiCommands/Plextor.cs:
Renamed Plextor methods.
* DiscImageChef.Devices/Device/ScsiCommands/SPC.cs:
Renamed SSC PREVENT ALLOW MEDIUM REMOVAL to uncollide with
MMC same name but different command.
* DiscImageChef.Devices/DiscImageChef.Devices.csproj:
Set platform target to x86 (does it really matter?).
* DiscImageChef.Devices/Linux/Command.cs:
Reduced allocation for readlink() to current kernel
MAX_PATH.
* DiscImageChef.Devices/Linux/Enums.cs:
Modified Linux ioctl to 32-bit. Works on 64-bit also. Solves
commands not working on 32-bit environments.
* DiscImageChef.DiscImages/ZZZRawImage.cs:
Changed ECMA-184 and ECMA-183 enums.
* DiscImageChef.Metadata/Dimensions.cs:
Added all ECMA defined magneto-opticals.
Added PD media.
Added 320Gb RDX.
Corrected Exatape 160m XL.
Added Exatape 22m and 28m.
* DiscImageChef.Metadata/MediaType.cs:
Added 356mm magneto-optical media.
Changed ECMA-184 and ECMA-183 enums.
Added USB generic flash drive.
* DiscImageChef/Commands/DeviceInfo.cs:
Corrected SCSI INQUIRY naming.
Corrected SCSI MODE SENSE (6) parameters.
Reduced SCSI MODE SENSE timeout, some devices just get stuck
with unsupported MODE SENSE commanda and must be left to
timeout.
Changed FUJITSU vendor string comparison.
* DiscImageChef/Commands/MediaInfo.cs:
Added method to calculate MediaType from SCSI parameters
(mode, density, medium type, device type, etc).
Changed some error WriteLine() to debug ones. Too much
verbosity.
Added DVD media type decoding from PFI.
Found a drive that dumps ADIP, enabling it again (not
decoded).
* DiscImageChef/Commands/MediaScan.cs:
Added option to generate ImgBurn compatible log to
media-scan command.
* DiscImageChef/DiscImageChef.csproj:
Moved checksum generation to a separate class.
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Main.cs:
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Options.cs:
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
Added option to generate ImgBurn compatible log to media-scan
command.
2016-01-31 08:05:56 +00:00
|
|
|
|
2022-11-15 15:58:43 +00:00
|
|
|
namespace Aaru.Commands.Device;
|
|
|
|
|
|
2022-03-07 07:36:44 +00:00
|
|
|
sealed class DeviceReportCommand : Command
|
* DiscImageChef.CommonTypes/MediaTypeFromSCSI.cs:
* DiscImageChef.CommonTypes/DiscImageChef.CommonTypes.csproj:
Added method to calculate MediaType from SCSI parameters
(mode, density, medium type, device type, etc).
* DiscImageChef.Metadata/DeviceReport.cs:
Added command to guess drive and media parameters and output
an XML report of them.
* DiscImageChef/Commands/DeviceReport.cs:
* DiscImageChef.Metadata/DiscImageChef.Metadata.csproj:
Added command to guess drive and media parameters and output
an XML report of them.
* DiscImageChef/Commands/DumpMedia.cs:
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Core/Checksum.cs:
* DiscImageChef/Commands/CreateSidecar.cs:
Moved checksum generation to a separate class.
* CICMMetadata:
Added support for ADIP.
* DiscImageChef.CommonTypes/MediaType.cs:
Added parameters of UDO media.
Moved DataPlay outside of Iomega, as it's not from that
manufacturer.
Added missing Exatape media and corrected 160m XL one.
Added SyJet media.
Added all ECMA defined magneto-optical (sectors calculated
from specifications, unchecked).
Added PD media.
Added Imation 320Gb RDX.
Added generic USB flash drives.
* DiscImageChef.Decoders/SCSI/Enums.cs:
Make enumerations public.
* DiscImageChef.Decoders/SCSI/Inquiry.cs:
* DiscImageChef.Devices/Device/Constructor.cs:
Trim space padded strings on SCSI INQUIRY.
* DiscImageChef.Devices/Device/ScsiCommands/MMC.cs:
Added PREVENT ALLOW MEDIUM REMOVAL.
Added START STOP UNIT.
* DiscImageChef.Devices/Device/ScsiCommands/NEC.cs:
Rename NEC methods.
* DiscImageChef.Devices/Device/ScsiCommands/Pioneer.cs:
Corrected Pioneer transfer length calculation.
* DiscImageChef.Devices/Device/ScsiCommands/Plextor.cs:
Renamed Plextor methods.
* DiscImageChef.Devices/Device/ScsiCommands/SPC.cs:
Renamed SSC PREVENT ALLOW MEDIUM REMOVAL to uncollide with
MMC same name but different command.
* DiscImageChef.Devices/DiscImageChef.Devices.csproj:
Set platform target to x86 (does it really matter?).
* DiscImageChef.Devices/Linux/Command.cs:
Reduced allocation for readlink() to current kernel
MAX_PATH.
* DiscImageChef.Devices/Linux/Enums.cs:
Modified Linux ioctl to 32-bit. Works on 64-bit also. Solves
commands not working on 32-bit environments.
* DiscImageChef.DiscImages/ZZZRawImage.cs:
Changed ECMA-184 and ECMA-183 enums.
* DiscImageChef.Metadata/Dimensions.cs:
Added all ECMA defined magneto-opticals.
Added PD media.
Added 320Gb RDX.
Corrected Exatape 160m XL.
Added Exatape 22m and 28m.
* DiscImageChef.Metadata/MediaType.cs:
Added 356mm magneto-optical media.
Changed ECMA-184 and ECMA-183 enums.
Added USB generic flash drive.
* DiscImageChef/Commands/DeviceInfo.cs:
Corrected SCSI INQUIRY naming.
Corrected SCSI MODE SENSE (6) parameters.
Reduced SCSI MODE SENSE timeout, some devices just get stuck
with unsupported MODE SENSE commanda and must be left to
timeout.
Changed FUJITSU vendor string comparison.
* DiscImageChef/Commands/MediaInfo.cs:
Added method to calculate MediaType from SCSI parameters
(mode, density, medium type, device type, etc).
Changed some error WriteLine() to debug ones. Too much
verbosity.
Added DVD media type decoding from PFI.
Found a drive that dumps ADIP, enabling it again (not
decoded).
* DiscImageChef/Commands/MediaScan.cs:
Added option to generate ImgBurn compatible log to
media-scan command.
* DiscImageChef/DiscImageChef.csproj:
Moved checksum generation to a separate class.
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Main.cs:
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Options.cs:
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
Added option to generate ImgBurn compatible log to media-scan
command.
2016-01-31 08:05:56 +00:00
|
|
|
{
|
2022-11-18 11:18:45 +00:00
|
|
|
public DeviceReportCommand() : base("report", UI.Device_Report_Command_Description)
|
* DiscImageChef.CommonTypes/MediaTypeFromSCSI.cs:
* DiscImageChef.CommonTypes/DiscImageChef.CommonTypes.csproj:
Added method to calculate MediaType from SCSI parameters
(mode, density, medium type, device type, etc).
* DiscImageChef.Metadata/DeviceReport.cs:
Added command to guess drive and media parameters and output
an XML report of them.
* DiscImageChef/Commands/DeviceReport.cs:
* DiscImageChef.Metadata/DiscImageChef.Metadata.csproj:
Added command to guess drive and media parameters and output
an XML report of them.
* DiscImageChef/Commands/DumpMedia.cs:
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Core/Checksum.cs:
* DiscImageChef/Commands/CreateSidecar.cs:
Moved checksum generation to a separate class.
* CICMMetadata:
Added support for ADIP.
* DiscImageChef.CommonTypes/MediaType.cs:
Added parameters of UDO media.
Moved DataPlay outside of Iomega, as it's not from that
manufacturer.
Added missing Exatape media and corrected 160m XL one.
Added SyJet media.
Added all ECMA defined magneto-optical (sectors calculated
from specifications, unchecked).
Added PD media.
Added Imation 320Gb RDX.
Added generic USB flash drives.
* DiscImageChef.Decoders/SCSI/Enums.cs:
Make enumerations public.
* DiscImageChef.Decoders/SCSI/Inquiry.cs:
* DiscImageChef.Devices/Device/Constructor.cs:
Trim space padded strings on SCSI INQUIRY.
* DiscImageChef.Devices/Device/ScsiCommands/MMC.cs:
Added PREVENT ALLOW MEDIUM REMOVAL.
Added START STOP UNIT.
* DiscImageChef.Devices/Device/ScsiCommands/NEC.cs:
Rename NEC methods.
* DiscImageChef.Devices/Device/ScsiCommands/Pioneer.cs:
Corrected Pioneer transfer length calculation.
* DiscImageChef.Devices/Device/ScsiCommands/Plextor.cs:
Renamed Plextor methods.
* DiscImageChef.Devices/Device/ScsiCommands/SPC.cs:
Renamed SSC PREVENT ALLOW MEDIUM REMOVAL to uncollide with
MMC same name but different command.
* DiscImageChef.Devices/DiscImageChef.Devices.csproj:
Set platform target to x86 (does it really matter?).
* DiscImageChef.Devices/Linux/Command.cs:
Reduced allocation for readlink() to current kernel
MAX_PATH.
* DiscImageChef.Devices/Linux/Enums.cs:
Modified Linux ioctl to 32-bit. Works on 64-bit also. Solves
commands not working on 32-bit environments.
* DiscImageChef.DiscImages/ZZZRawImage.cs:
Changed ECMA-184 and ECMA-183 enums.
* DiscImageChef.Metadata/Dimensions.cs:
Added all ECMA defined magneto-opticals.
Added PD media.
Added 320Gb RDX.
Corrected Exatape 160m XL.
Added Exatape 22m and 28m.
* DiscImageChef.Metadata/MediaType.cs:
Added 356mm magneto-optical media.
Changed ECMA-184 and ECMA-183 enums.
Added USB generic flash drive.
* DiscImageChef/Commands/DeviceInfo.cs:
Corrected SCSI INQUIRY naming.
Corrected SCSI MODE SENSE (6) parameters.
Reduced SCSI MODE SENSE timeout, some devices just get stuck
with unsupported MODE SENSE commanda and must be left to
timeout.
Changed FUJITSU vendor string comparison.
* DiscImageChef/Commands/MediaInfo.cs:
Added method to calculate MediaType from SCSI parameters
(mode, density, medium type, device type, etc).
Changed some error WriteLine() to debug ones. Too much
verbosity.
Added DVD media type decoding from PFI.
Found a drive that dumps ADIP, enabling it again (not
decoded).
* DiscImageChef/Commands/MediaScan.cs:
Added option to generate ImgBurn compatible log to
media-scan command.
* DiscImageChef/DiscImageChef.csproj:
Moved checksum generation to a separate class.
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Main.cs:
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Options.cs:
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
Added option to generate ImgBurn compatible log to media-scan
command.
2016-01-31 08:05:56 +00:00
|
|
|
{
|
2022-03-06 13:29:38 +00:00
|
|
|
AddArgument(new Argument<string>
|
* DiscImageChef.CommonTypes/MediaTypeFromSCSI.cs:
* DiscImageChef.CommonTypes/DiscImageChef.CommonTypes.csproj:
Added method to calculate MediaType from SCSI parameters
(mode, density, medium type, device type, etc).
* DiscImageChef.Metadata/DeviceReport.cs:
Added command to guess drive and media parameters and output
an XML report of them.
* DiscImageChef/Commands/DeviceReport.cs:
* DiscImageChef.Metadata/DiscImageChef.Metadata.csproj:
Added command to guess drive and media parameters and output
an XML report of them.
* DiscImageChef/Commands/DumpMedia.cs:
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Core/Checksum.cs:
* DiscImageChef/Commands/CreateSidecar.cs:
Moved checksum generation to a separate class.
* CICMMetadata:
Added support for ADIP.
* DiscImageChef.CommonTypes/MediaType.cs:
Added parameters of UDO media.
Moved DataPlay outside of Iomega, as it's not from that
manufacturer.
Added missing Exatape media and corrected 160m XL one.
Added SyJet media.
Added all ECMA defined magneto-optical (sectors calculated
from specifications, unchecked).
Added PD media.
Added Imation 320Gb RDX.
Added generic USB flash drives.
* DiscImageChef.Decoders/SCSI/Enums.cs:
Make enumerations public.
* DiscImageChef.Decoders/SCSI/Inquiry.cs:
* DiscImageChef.Devices/Device/Constructor.cs:
Trim space padded strings on SCSI INQUIRY.
* DiscImageChef.Devices/Device/ScsiCommands/MMC.cs:
Added PREVENT ALLOW MEDIUM REMOVAL.
Added START STOP UNIT.
* DiscImageChef.Devices/Device/ScsiCommands/NEC.cs:
Rename NEC methods.
* DiscImageChef.Devices/Device/ScsiCommands/Pioneer.cs:
Corrected Pioneer transfer length calculation.
* DiscImageChef.Devices/Device/ScsiCommands/Plextor.cs:
Renamed Plextor methods.
* DiscImageChef.Devices/Device/ScsiCommands/SPC.cs:
Renamed SSC PREVENT ALLOW MEDIUM REMOVAL to uncollide with
MMC same name but different command.
* DiscImageChef.Devices/DiscImageChef.Devices.csproj:
Set platform target to x86 (does it really matter?).
* DiscImageChef.Devices/Linux/Command.cs:
Reduced allocation for readlink() to current kernel
MAX_PATH.
* DiscImageChef.Devices/Linux/Enums.cs:
Modified Linux ioctl to 32-bit. Works on 64-bit also. Solves
commands not working on 32-bit environments.
* DiscImageChef.DiscImages/ZZZRawImage.cs:
Changed ECMA-184 and ECMA-183 enums.
* DiscImageChef.Metadata/Dimensions.cs:
Added all ECMA defined magneto-opticals.
Added PD media.
Added 320Gb RDX.
Corrected Exatape 160m XL.
Added Exatape 22m and 28m.
* DiscImageChef.Metadata/MediaType.cs:
Added 356mm magneto-optical media.
Changed ECMA-184 and ECMA-183 enums.
Added USB generic flash drive.
* DiscImageChef/Commands/DeviceInfo.cs:
Corrected SCSI INQUIRY naming.
Corrected SCSI MODE SENSE (6) parameters.
Reduced SCSI MODE SENSE timeout, some devices just get stuck
with unsupported MODE SENSE commanda and must be left to
timeout.
Changed FUJITSU vendor string comparison.
* DiscImageChef/Commands/MediaInfo.cs:
Added method to calculate MediaType from SCSI parameters
(mode, density, medium type, device type, etc).
Changed some error WriteLine() to debug ones. Too much
verbosity.
Added DVD media type decoding from PFI.
Found a drive that dumps ADIP, enabling it again (not
decoded).
* DiscImageChef/Commands/MediaScan.cs:
Added option to generate ImgBurn compatible log to
media-scan command.
* DiscImageChef/DiscImageChef.csproj:
Moved checksum generation to a separate class.
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Main.cs:
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Options.cs:
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
Added option to generate ImgBurn compatible log to media-scan
command.
2016-01-31 08:05:56 +00:00
|
|
|
{
|
2022-03-06 13:29:38 +00:00
|
|
|
Arity = ArgumentArity.ExactlyOne,
|
2022-11-18 11:18:45 +00:00
|
|
|
Description = UI.Device_path,
|
2022-03-06 13:29:38 +00:00
|
|
|
Name = "device-path"
|
|
|
|
|
});
|
|
|
|
|
|
2022-04-10 12:54:04 +01:00
|
|
|
Add(new Option<bool>(new[]
|
|
|
|
|
{
|
|
|
|
|
"--trap-disc", "-t"
|
2022-11-18 11:18:45 +00:00
|
|
|
}, () => false, UI.Device_report_using_trap_disc));
|
2019-12-07 19:54:27 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
Handler = CommandHandler.Create(GetType().GetMethod(nameof(Invoke)));
|
|
|
|
|
}
|
2020-07-12 00:20:19 +01:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
public static int Invoke(bool debug, bool verbose, string devicePath, bool trapDisc)
|
|
|
|
|
{
|
|
|
|
|
MainClass.PrintCopyright();
|
2019-01-05 16:59:23 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(debug)
|
2020-01-02 04:09:39 +00:00
|
|
|
{
|
2022-03-06 13:29:38 +00:00
|
|
|
IAnsiConsole stderrConsole = AnsiConsole.Create(new AnsiConsoleSettings
|
2021-09-13 18:08:44 +01:00
|
|
|
{
|
2022-11-15 15:58:43 +00:00
|
|
|
Out = new AnsiConsoleOutput(System.Console.Error)
|
2022-03-06 13:29:38 +00:00
|
|
|
});
|
2019-12-07 19:54:27 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
AaruConsole.DebugWriteLineEvent += (format, objects) =>
|
|
|
|
|
{
|
|
|
|
|
if(objects is null)
|
|
|
|
|
stderrConsole.MarkupLine(format);
|
|
|
|
|
else
|
|
|
|
|
stderrConsole.MarkupLine(format, objects);
|
|
|
|
|
};
|
|
|
|
|
}
|
2019-12-07 19:54:27 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(verbose)
|
|
|
|
|
AaruConsole.WriteEvent += (format, objects) =>
|
|
|
|
|
{
|
|
|
|
|
if(objects is null)
|
|
|
|
|
AnsiConsole.Markup(format);
|
|
|
|
|
else
|
|
|
|
|
AnsiConsole.Markup(format, objects);
|
|
|
|
|
};
|
2019-01-05 16:59:23 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
Statistics.AddCommand("device-report");
|
* DiscImageChef.CommonTypes/MediaTypeFromSCSI.cs:
* DiscImageChef.CommonTypes/DiscImageChef.CommonTypes.csproj:
Added method to calculate MediaType from SCSI parameters
(mode, density, medium type, device type, etc).
* DiscImageChef.Metadata/DeviceReport.cs:
Added command to guess drive and media parameters and output
an XML report of them.
* DiscImageChef/Commands/DeviceReport.cs:
* DiscImageChef.Metadata/DiscImageChef.Metadata.csproj:
Added command to guess drive and media parameters and output
an XML report of them.
* DiscImageChef/Commands/DumpMedia.cs:
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Core/Checksum.cs:
* DiscImageChef/Commands/CreateSidecar.cs:
Moved checksum generation to a separate class.
* CICMMetadata:
Added support for ADIP.
* DiscImageChef.CommonTypes/MediaType.cs:
Added parameters of UDO media.
Moved DataPlay outside of Iomega, as it's not from that
manufacturer.
Added missing Exatape media and corrected 160m XL one.
Added SyJet media.
Added all ECMA defined magneto-optical (sectors calculated
from specifications, unchecked).
Added PD media.
Added Imation 320Gb RDX.
Added generic USB flash drives.
* DiscImageChef.Decoders/SCSI/Enums.cs:
Make enumerations public.
* DiscImageChef.Decoders/SCSI/Inquiry.cs:
* DiscImageChef.Devices/Device/Constructor.cs:
Trim space padded strings on SCSI INQUIRY.
* DiscImageChef.Devices/Device/ScsiCommands/MMC.cs:
Added PREVENT ALLOW MEDIUM REMOVAL.
Added START STOP UNIT.
* DiscImageChef.Devices/Device/ScsiCommands/NEC.cs:
Rename NEC methods.
* DiscImageChef.Devices/Device/ScsiCommands/Pioneer.cs:
Corrected Pioneer transfer length calculation.
* DiscImageChef.Devices/Device/ScsiCommands/Plextor.cs:
Renamed Plextor methods.
* DiscImageChef.Devices/Device/ScsiCommands/SPC.cs:
Renamed SSC PREVENT ALLOW MEDIUM REMOVAL to uncollide with
MMC same name but different command.
* DiscImageChef.Devices/DiscImageChef.Devices.csproj:
Set platform target to x86 (does it really matter?).
* DiscImageChef.Devices/Linux/Command.cs:
Reduced allocation for readlink() to current kernel
MAX_PATH.
* DiscImageChef.Devices/Linux/Enums.cs:
Modified Linux ioctl to 32-bit. Works on 64-bit also. Solves
commands not working on 32-bit environments.
* DiscImageChef.DiscImages/ZZZRawImage.cs:
Changed ECMA-184 and ECMA-183 enums.
* DiscImageChef.Metadata/Dimensions.cs:
Added all ECMA defined magneto-opticals.
Added PD media.
Added 320Gb RDX.
Corrected Exatape 160m XL.
Added Exatape 22m and 28m.
* DiscImageChef.Metadata/MediaType.cs:
Added 356mm magneto-optical media.
Changed ECMA-184 and ECMA-183 enums.
Added USB generic flash drive.
* DiscImageChef/Commands/DeviceInfo.cs:
Corrected SCSI INQUIRY naming.
Corrected SCSI MODE SENSE (6) parameters.
Reduced SCSI MODE SENSE timeout, some devices just get stuck
with unsupported MODE SENSE commanda and must be left to
timeout.
Changed FUJITSU vendor string comparison.
* DiscImageChef/Commands/MediaInfo.cs:
Added method to calculate MediaType from SCSI parameters
(mode, density, medium type, device type, etc).
Changed some error WriteLine() to debug ones. Too much
verbosity.
Added DVD media type decoding from PFI.
Found a drive that dumps ADIP, enabling it again (not
decoded).
* DiscImageChef/Commands/MediaScan.cs:
Added option to generate ImgBurn compatible log to
media-scan command.
* DiscImageChef/DiscImageChef.csproj:
Moved checksum generation to a separate class.
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Main.cs:
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Options.cs:
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
Added option to generate ImgBurn compatible log to media-scan
command.
2016-01-31 08:05:56 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
AaruConsole.DebugWriteLine("Device-Report command", "--debug={0}", debug);
|
|
|
|
|
AaruConsole.DebugWriteLine("Device-Report command", "--device={0}", devicePath);
|
|
|
|
|
AaruConsole.DebugWriteLine("Device-Report command", "--verbose={0}", verbose);
|
* DiscImageChef.CommonTypes/MediaTypeFromSCSI.cs:
* DiscImageChef.CommonTypes/DiscImageChef.CommonTypes.csproj:
Added method to calculate MediaType from SCSI parameters
(mode, density, medium type, device type, etc).
* DiscImageChef.Metadata/DeviceReport.cs:
Added command to guess drive and media parameters and output
an XML report of them.
* DiscImageChef/Commands/DeviceReport.cs:
* DiscImageChef.Metadata/DiscImageChef.Metadata.csproj:
Added command to guess drive and media parameters and output
an XML report of them.
* DiscImageChef/Commands/DumpMedia.cs:
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Core/Checksum.cs:
* DiscImageChef/Commands/CreateSidecar.cs:
Moved checksum generation to a separate class.
* CICMMetadata:
Added support for ADIP.
* DiscImageChef.CommonTypes/MediaType.cs:
Added parameters of UDO media.
Moved DataPlay outside of Iomega, as it's not from that
manufacturer.
Added missing Exatape media and corrected 160m XL one.
Added SyJet media.
Added all ECMA defined magneto-optical (sectors calculated
from specifications, unchecked).
Added PD media.
Added Imation 320Gb RDX.
Added generic USB flash drives.
* DiscImageChef.Decoders/SCSI/Enums.cs:
Make enumerations public.
* DiscImageChef.Decoders/SCSI/Inquiry.cs:
* DiscImageChef.Devices/Device/Constructor.cs:
Trim space padded strings on SCSI INQUIRY.
* DiscImageChef.Devices/Device/ScsiCommands/MMC.cs:
Added PREVENT ALLOW MEDIUM REMOVAL.
Added START STOP UNIT.
* DiscImageChef.Devices/Device/ScsiCommands/NEC.cs:
Rename NEC methods.
* DiscImageChef.Devices/Device/ScsiCommands/Pioneer.cs:
Corrected Pioneer transfer length calculation.
* DiscImageChef.Devices/Device/ScsiCommands/Plextor.cs:
Renamed Plextor methods.
* DiscImageChef.Devices/Device/ScsiCommands/SPC.cs:
Renamed SSC PREVENT ALLOW MEDIUM REMOVAL to uncollide with
MMC same name but different command.
* DiscImageChef.Devices/DiscImageChef.Devices.csproj:
Set platform target to x86 (does it really matter?).
* DiscImageChef.Devices/Linux/Command.cs:
Reduced allocation for readlink() to current kernel
MAX_PATH.
* DiscImageChef.Devices/Linux/Enums.cs:
Modified Linux ioctl to 32-bit. Works on 64-bit also. Solves
commands not working on 32-bit environments.
* DiscImageChef.DiscImages/ZZZRawImage.cs:
Changed ECMA-184 and ECMA-183 enums.
* DiscImageChef.Metadata/Dimensions.cs:
Added all ECMA defined magneto-opticals.
Added PD media.
Added 320Gb RDX.
Corrected Exatape 160m XL.
Added Exatape 22m and 28m.
* DiscImageChef.Metadata/MediaType.cs:
Added 356mm magneto-optical media.
Changed ECMA-184 and ECMA-183 enums.
Added USB generic flash drive.
* DiscImageChef/Commands/DeviceInfo.cs:
Corrected SCSI INQUIRY naming.
Corrected SCSI MODE SENSE (6) parameters.
Reduced SCSI MODE SENSE timeout, some devices just get stuck
with unsupported MODE SENSE commanda and must be left to
timeout.
Changed FUJITSU vendor string comparison.
* DiscImageChef/Commands/MediaInfo.cs:
Added method to calculate MediaType from SCSI parameters
(mode, density, medium type, device type, etc).
Changed some error WriteLine() to debug ones. Too much
verbosity.
Added DVD media type decoding from PFI.
Found a drive that dumps ADIP, enabling it again (not
decoded).
* DiscImageChef/Commands/MediaScan.cs:
Added option to generate ImgBurn compatible log to
media-scan command.
* DiscImageChef/DiscImageChef.csproj:
Moved checksum generation to a separate class.
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Main.cs:
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Options.cs:
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
Added option to generate ImgBurn compatible log to media-scan
command.
2016-01-31 08:05:56 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(devicePath.Length == 2 &&
|
|
|
|
|
devicePath[1] == ':' &&
|
|
|
|
|
devicePath[0] != '/' &&
|
|
|
|
|
char.IsLetter(devicePath[0]))
|
|
|
|
|
devicePath = "\\\\.\\" + char.ToUpper(devicePath[0]) + ':';
|
2019-12-07 19:54:27 +00:00
|
|
|
|
2022-11-15 15:58:43 +00:00
|
|
|
var dev = Devices.Device.Create(devicePath, out ErrorNumber devErrno);
|
* DiscImageChef.CommonTypes/MediaTypeFromSCSI.cs:
* DiscImageChef.CommonTypes/DiscImageChef.CommonTypes.csproj:
Added method to calculate MediaType from SCSI parameters
(mode, density, medium type, device type, etc).
* DiscImageChef.Metadata/DeviceReport.cs:
Added command to guess drive and media parameters and output
an XML report of them.
* DiscImageChef/Commands/DeviceReport.cs:
* DiscImageChef.Metadata/DiscImageChef.Metadata.csproj:
Added command to guess drive and media parameters and output
an XML report of them.
* DiscImageChef/Commands/DumpMedia.cs:
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Core/Checksum.cs:
* DiscImageChef/Commands/CreateSidecar.cs:
Moved checksum generation to a separate class.
* CICMMetadata:
Added support for ADIP.
* DiscImageChef.CommonTypes/MediaType.cs:
Added parameters of UDO media.
Moved DataPlay outside of Iomega, as it's not from that
manufacturer.
Added missing Exatape media and corrected 160m XL one.
Added SyJet media.
Added all ECMA defined magneto-optical (sectors calculated
from specifications, unchecked).
Added PD media.
Added Imation 320Gb RDX.
Added generic USB flash drives.
* DiscImageChef.Decoders/SCSI/Enums.cs:
Make enumerations public.
* DiscImageChef.Decoders/SCSI/Inquiry.cs:
* DiscImageChef.Devices/Device/Constructor.cs:
Trim space padded strings on SCSI INQUIRY.
* DiscImageChef.Devices/Device/ScsiCommands/MMC.cs:
Added PREVENT ALLOW MEDIUM REMOVAL.
Added START STOP UNIT.
* DiscImageChef.Devices/Device/ScsiCommands/NEC.cs:
Rename NEC methods.
* DiscImageChef.Devices/Device/ScsiCommands/Pioneer.cs:
Corrected Pioneer transfer length calculation.
* DiscImageChef.Devices/Device/ScsiCommands/Plextor.cs:
Renamed Plextor methods.
* DiscImageChef.Devices/Device/ScsiCommands/SPC.cs:
Renamed SSC PREVENT ALLOW MEDIUM REMOVAL to uncollide with
MMC same name but different command.
* DiscImageChef.Devices/DiscImageChef.Devices.csproj:
Set platform target to x86 (does it really matter?).
* DiscImageChef.Devices/Linux/Command.cs:
Reduced allocation for readlink() to current kernel
MAX_PATH.
* DiscImageChef.Devices/Linux/Enums.cs:
Modified Linux ioctl to 32-bit. Works on 64-bit also. Solves
commands not working on 32-bit environments.
* DiscImageChef.DiscImages/ZZZRawImage.cs:
Changed ECMA-184 and ECMA-183 enums.
* DiscImageChef.Metadata/Dimensions.cs:
Added all ECMA defined magneto-opticals.
Added PD media.
Added 320Gb RDX.
Corrected Exatape 160m XL.
Added Exatape 22m and 28m.
* DiscImageChef.Metadata/MediaType.cs:
Added 356mm magneto-optical media.
Changed ECMA-184 and ECMA-183 enums.
Added USB generic flash drive.
* DiscImageChef/Commands/DeviceInfo.cs:
Corrected SCSI INQUIRY naming.
Corrected SCSI MODE SENSE (6) parameters.
Reduced SCSI MODE SENSE timeout, some devices just get stuck
with unsupported MODE SENSE commanda and must be left to
timeout.
Changed FUJITSU vendor string comparison.
* DiscImageChef/Commands/MediaInfo.cs:
Added method to calculate MediaType from SCSI parameters
(mode, density, medium type, device type, etc).
Changed some error WriteLine() to debug ones. Too much
verbosity.
Added DVD media type decoding from PFI.
Found a drive that dumps ADIP, enabling it again (not
decoded).
* DiscImageChef/Commands/MediaScan.cs:
Added option to generate ImgBurn compatible log to
media-scan command.
* DiscImageChef/DiscImageChef.csproj:
Moved checksum generation to a separate class.
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Main.cs:
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Options.cs:
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
Added option to generate ImgBurn compatible log to media-scan
command.
2016-01-31 08:05:56 +00:00
|
|
|
|
2022-03-26 20:18:01 +00:00
|
|
|
switch(dev)
|
2022-03-06 13:29:38 +00:00
|
|
|
{
|
2022-03-26 20:18:01 +00:00
|
|
|
case null:
|
2022-11-18 11:18:45 +00:00
|
|
|
AaruConsole.ErrorWriteLine(string.Format(UI.Could_not_open_device_error_0, devErrno));
|
2019-12-07 19:54:27 +00:00
|
|
|
|
2022-03-26 20:18:01 +00:00
|
|
|
return (int)devErrno;
|
|
|
|
|
case Devices.Remote.Device remoteDev:
|
2022-03-26 19:35:13 +00:00
|
|
|
Statistics.AddRemote(remoteDev.RemoteApplication, remoteDev.RemoteVersion,
|
|
|
|
|
remoteDev.RemoteOperatingSystem, remoteDev.RemoteOperatingSystemVersion,
|
|
|
|
|
remoteDev.RemoteArchitecture);
|
2019-12-07 19:54:27 +00:00
|
|
|
|
2022-03-26 20:18:01 +00:00
|
|
|
break;
|
2022-03-06 13:29:38 +00:00
|
|
|
}
|
2022-03-26 20:18:01 +00:00
|
|
|
|
|
|
|
|
if(dev.Error)
|
2022-03-06 13:29:38 +00:00
|
|
|
{
|
2022-03-26 20:18:01 +00:00
|
|
|
AaruConsole.ErrorWriteLine(Error.Print(dev.LastError));
|
* DiscImageChef.CommonTypes/MediaTypeFromSCSI.cs:
* DiscImageChef.CommonTypes/DiscImageChef.CommonTypes.csproj:
Added method to calculate MediaType from SCSI parameters
(mode, density, medium type, device type, etc).
* DiscImageChef.Metadata/DeviceReport.cs:
Added command to guess drive and media parameters and output
an XML report of them.
* DiscImageChef/Commands/DeviceReport.cs:
* DiscImageChef.Metadata/DiscImageChef.Metadata.csproj:
Added command to guess drive and media parameters and output
an XML report of them.
* DiscImageChef/Commands/DumpMedia.cs:
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Core/Checksum.cs:
* DiscImageChef/Commands/CreateSidecar.cs:
Moved checksum generation to a separate class.
* CICMMetadata:
Added support for ADIP.
* DiscImageChef.CommonTypes/MediaType.cs:
Added parameters of UDO media.
Moved DataPlay outside of Iomega, as it's not from that
manufacturer.
Added missing Exatape media and corrected 160m XL one.
Added SyJet media.
Added all ECMA defined magneto-optical (sectors calculated
from specifications, unchecked).
Added PD media.
Added Imation 320Gb RDX.
Added generic USB flash drives.
* DiscImageChef.Decoders/SCSI/Enums.cs:
Make enumerations public.
* DiscImageChef.Decoders/SCSI/Inquiry.cs:
* DiscImageChef.Devices/Device/Constructor.cs:
Trim space padded strings on SCSI INQUIRY.
* DiscImageChef.Devices/Device/ScsiCommands/MMC.cs:
Added PREVENT ALLOW MEDIUM REMOVAL.
Added START STOP UNIT.
* DiscImageChef.Devices/Device/ScsiCommands/NEC.cs:
Rename NEC methods.
* DiscImageChef.Devices/Device/ScsiCommands/Pioneer.cs:
Corrected Pioneer transfer length calculation.
* DiscImageChef.Devices/Device/ScsiCommands/Plextor.cs:
Renamed Plextor methods.
* DiscImageChef.Devices/Device/ScsiCommands/SPC.cs:
Renamed SSC PREVENT ALLOW MEDIUM REMOVAL to uncollide with
MMC same name but different command.
* DiscImageChef.Devices/DiscImageChef.Devices.csproj:
Set platform target to x86 (does it really matter?).
* DiscImageChef.Devices/Linux/Command.cs:
Reduced allocation for readlink() to current kernel
MAX_PATH.
* DiscImageChef.Devices/Linux/Enums.cs:
Modified Linux ioctl to 32-bit. Works on 64-bit also. Solves
commands not working on 32-bit environments.
* DiscImageChef.DiscImages/ZZZRawImage.cs:
Changed ECMA-184 and ECMA-183 enums.
* DiscImageChef.Metadata/Dimensions.cs:
Added all ECMA defined magneto-opticals.
Added PD media.
Added 320Gb RDX.
Corrected Exatape 160m XL.
Added Exatape 22m and 28m.
* DiscImageChef.Metadata/MediaType.cs:
Added 356mm magneto-optical media.
Changed ECMA-184 and ECMA-183 enums.
Added USB generic flash drive.
* DiscImageChef/Commands/DeviceInfo.cs:
Corrected SCSI INQUIRY naming.
Corrected SCSI MODE SENSE (6) parameters.
Reduced SCSI MODE SENSE timeout, some devices just get stuck
with unsupported MODE SENSE commanda and must be left to
timeout.
Changed FUJITSU vendor string comparison.
* DiscImageChef/Commands/MediaInfo.cs:
Added method to calculate MediaType from SCSI parameters
(mode, density, medium type, device type, etc).
Changed some error WriteLine() to debug ones. Too much
verbosity.
Added DVD media type decoding from PFI.
Found a drive that dumps ADIP, enabling it again (not
decoded).
* DiscImageChef/Commands/MediaScan.cs:
Added option to generate ImgBurn compatible log to
media-scan command.
* DiscImageChef/DiscImageChef.csproj:
Moved checksum generation to a separate class.
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Main.cs:
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Options.cs:
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
Added option to generate ImgBurn compatible log to media-scan
command.
2016-01-31 08:05:56 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
return (int)ErrorNumber.CannotOpenDevice;
|
|
|
|
|
}
|
2019-10-26 17:39:50 +01:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
Statistics.AddDevice(dev);
|
2019-10-26 17:39:50 +01:00
|
|
|
|
2022-03-26 19:35:13 +00:00
|
|
|
bool isAdmin = dev is Devices.Remote.Device remoteDev2 ? remoteDev2.IsAdmin : DetectOS.IsAdmin;
|
2019-12-07 19:54:27 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(!isAdmin)
|
|
|
|
|
{
|
2022-11-18 11:18:45 +00:00
|
|
|
AaruConsole.ErrorWriteLine(UI.Device_report_must_be_run_as_admin);
|
2018-11-25 17:47:14 +00:00
|
|
|
|
2022-11-18 11:18:45 +00:00
|
|
|
AaruConsole.ErrorWriteLine(UI.Not_continuing);
|
2017-05-28 21:01:17 +01:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
return (int)ErrorNumber.NotPermitted;
|
|
|
|
|
}
|
2017-06-03 01:22:59 +01:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
var report = new DeviceReportV2
|
|
|
|
|
{
|
|
|
|
|
Manufacturer = dev.Manufacturer,
|
|
|
|
|
Model = dev.Model,
|
|
|
|
|
Revision = dev.FirmwareRevision,
|
|
|
|
|
Type = dev.Type
|
|
|
|
|
};
|
|
|
|
|
|
2022-11-15 15:58:43 +00:00
|
|
|
bool removable = false;
|
2022-03-06 13:29:38 +00:00
|
|
|
string jsonFile;
|
|
|
|
|
|
2022-11-13 19:38:03 +00:00
|
|
|
switch(string.IsNullOrWhiteSpace(dev.Manufacturer))
|
|
|
|
|
{
|
|
|
|
|
case false when !string.IsNullOrWhiteSpace(dev.FirmwareRevision):
|
|
|
|
|
jsonFile = dev.Manufacturer + "_" + dev.Model + "_" + dev.FirmwareRevision + ".json";
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
case false:
|
|
|
|
|
jsonFile = dev.Manufacturer + "_" + dev.Model + ".json";
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
{
|
|
|
|
|
if(!string.IsNullOrWhiteSpace(dev.FirmwareRevision))
|
|
|
|
|
jsonFile = dev.Model + "_" + dev.FirmwareRevision + ".json";
|
|
|
|
|
else
|
|
|
|
|
jsonFile = dev.Model + ".json";
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-03-06 13:29:38 +00:00
|
|
|
|
|
|
|
|
jsonFile = jsonFile.Replace('\\', '_').Replace('/', '_').Replace('?', '_');
|
|
|
|
|
|
|
|
|
|
if(trapDisc && dev.ScsiType != PeripheralDeviceTypes.MultiMediaDevice)
|
|
|
|
|
{
|
2022-11-18 11:18:45 +00:00
|
|
|
AaruConsole.ErrorWriteLine(UI.Device_does_not_report_with_trap_discs);
|
2020-07-12 00:20:19 +01:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
return (int)ErrorNumber.InvalidArgument;
|
|
|
|
|
}
|
2020-07-12 00:20:19 +01:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
var reporter = new DeviceReport(dev);
|
2018-11-25 18:28:57 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(dev.IsUsb)
|
2022-11-18 11:18:45 +00:00
|
|
|
if(AnsiConsole.Confirm($"[italic]{UI.Is_the_device_natively_USB}[/]"))
|
2018-11-25 18:28:57 +00:00
|
|
|
{
|
2022-11-15 15:58:43 +00:00
|
|
|
Core.Spectre.ProgressSingleSpinner(ctx =>
|
2018-11-25 18:28:57 +00:00
|
|
|
{
|
2022-11-18 11:18:45 +00:00
|
|
|
ctx.AddTask(Localization.Core.Querying_USB_information).IsIndeterminate();
|
2022-03-06 13:29:38 +00:00
|
|
|
report.USB = reporter.UsbReport();
|
|
|
|
|
});
|
2018-11-25 18:28:57 +00:00
|
|
|
|
2022-11-18 11:18:45 +00:00
|
|
|
report.USB.RemovableMedia = AnsiConsole.Confirm($"[italic]{UI.Is_the_media_removable}[/]");
|
2021-09-13 18:08:44 +01:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
removable = report.USB.RemovableMedia;
|
2018-11-25 18:28:57 +00:00
|
|
|
}
|
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(dev.IsFireWire)
|
2022-11-18 11:18:45 +00:00
|
|
|
if(AnsiConsole.Confirm($"[italic]{UI.Is_the_device_natively_FireWire}[/]"))
|
2018-11-25 18:35:39 +00:00
|
|
|
{
|
2022-11-15 15:58:43 +00:00
|
|
|
Core.Spectre.ProgressSingleSpinner(ctx =>
|
2018-11-25 18:35:39 +00:00
|
|
|
{
|
2022-03-06 13:29:38 +00:00
|
|
|
ctx.AddTask("Querying FireWire information...").IsIndeterminate();
|
|
|
|
|
report.FireWire = reporter.FireWireReport();
|
|
|
|
|
});
|
2021-09-13 18:08:44 +01:00
|
|
|
|
2022-11-18 11:18:45 +00:00
|
|
|
report.FireWire.RemovableMedia = AnsiConsole.Confirm($"[italic]{UI.Is_the_media_removable}[/]");
|
2018-11-25 18:35:39 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
removable = report.FireWire.RemovableMedia;
|
2018-11-25 18:35:39 +00:00
|
|
|
}
|
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(dev.IsPcmcia)
|
2022-11-15 15:58:43 +00:00
|
|
|
Core.Spectre.ProgressSingleSpinner(ctx =>
|
2022-03-06 13:29:38 +00:00
|
|
|
{
|
2022-11-18 11:18:45 +00:00
|
|
|
ctx.AddTask(Localization.Core.Querying_PCMCIA_information).IsIndeterminate();
|
2022-03-06 13:29:38 +00:00
|
|
|
report.PCMCIA = reporter.PcmciaReport();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
byte[] buffer = Array.Empty<byte>();
|
|
|
|
|
string mediumTypeName;
|
|
|
|
|
string mediumModel;
|
|
|
|
|
|
|
|
|
|
switch(dev.Type)
|
|
|
|
|
{
|
|
|
|
|
case DeviceType.ATA:
|
|
|
|
|
{
|
2022-11-15 15:58:43 +00:00
|
|
|
Core.Spectre.ProgressSingleSpinner(ctx =>
|
2021-09-13 18:08:44 +01:00
|
|
|
{
|
2022-11-18 11:18:45 +00:00
|
|
|
ctx.AddTask(Localization.Core.Querying_ATA_IDENTIFY).IsIndeterminate();
|
2022-03-06 13:29:38 +00:00
|
|
|
dev.AtaIdentify(out buffer, out _, dev.Timeout, out _);
|
2021-09-13 18:08:44 +01:00
|
|
|
});
|
2018-11-25 18:40:16 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(!Identify.Decode(buffer).HasValue)
|
|
|
|
|
break;
|
2018-11-25 19:17:21 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
report.ATA = new Ata
|
|
|
|
|
{
|
|
|
|
|
Identify = DeviceReport.ClearIdentify(buffer)
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
if(report.ATA.IdentifyDevice == null)
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
if((ushort)report.ATA.IdentifyDevice?.GeneralConfiguration == 0x848A)
|
|
|
|
|
{
|
|
|
|
|
report.CompactFlash = true;
|
|
|
|
|
removable = false;
|
|
|
|
|
}
|
|
|
|
|
else if(!removable &&
|
|
|
|
|
report.ATA.IdentifyDevice?.GeneralConfiguration.HasFlag(Identify.GeneralConfigurationBit.
|
|
|
|
|
Removable) == true)
|
2022-11-18 11:18:45 +00:00
|
|
|
removable = AnsiConsole.Confirm($"[italic]{UI.Is_the_media_removable}[/]");
|
2022-03-06 13:29:38 +00:00
|
|
|
|
|
|
|
|
if(removable)
|
2018-11-25 19:13:21 +00:00
|
|
|
{
|
2022-11-18 11:18:45 +00:00
|
|
|
AaruConsole.WriteLine(UI.Please_remove_any_media);
|
2022-03-06 13:29:38 +00:00
|
|
|
|
2022-11-15 15:58:43 +00:00
|
|
|
System.Console.ReadKey(true);
|
2022-03-06 13:29:38 +00:00
|
|
|
|
2022-11-15 15:58:43 +00:00
|
|
|
Core.Spectre.ProgressSingleSpinner(ctx =>
|
2021-09-13 18:08:44 +01:00
|
|
|
{
|
2022-11-18 11:18:45 +00:00
|
|
|
ctx.AddTask(Localization.Core.Querying_ATA_IDENTIFY).IsIndeterminate();
|
2021-09-13 18:08:44 +01:00
|
|
|
dev.AtaIdentify(out buffer, out _, dev.Timeout, out _);
|
|
|
|
|
});
|
2018-11-25 19:13:21 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
report.ATA.Identify = DeviceReport.ClearIdentify(buffer);
|
|
|
|
|
List<TestedMedia> mediaTests = new();
|
2018-11-25 19:13:21 +00:00
|
|
|
|
2022-11-18 11:18:45 +00:00
|
|
|
while(AnsiConsole.Confirm($"[italic]{UI.Do_you_have_media_you_can_insert}[/]"))
|
2019-12-07 19:54:27 +00:00
|
|
|
{
|
2022-11-18 11:18:45 +00:00
|
|
|
AaruConsole.WriteLine(UI.Please_insert_it_in_the_drive);
|
2022-11-15 15:58:43 +00:00
|
|
|
System.Console.ReadKey(true);
|
2018-11-25 19:13:21 +00:00
|
|
|
|
2022-11-18 11:18:45 +00:00
|
|
|
mediumTypeName = AnsiConsole.Ask<string>(UI.Please_write_description_of_media_type);
|
2018-11-25 19:13:21 +00:00
|
|
|
|
2022-11-18 11:18:45 +00:00
|
|
|
mediumModel = AnsiConsole.Ask<string>(UI.Please_write_media_model);
|
2019-12-07 19:54:27 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
TestedMedia mediaTest = reporter.ReportAtaMedia();
|
|
|
|
|
mediaTest.MediumTypeName = mediumTypeName;
|
|
|
|
|
mediaTest.Model = mediumModel;
|
2018-11-25 19:13:21 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
mediaTests.Add(mediaTest);
|
|
|
|
|
}
|
2019-12-07 19:54:27 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
report.ATA.RemovableMedias = mediaTests;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
report.ATA.ReadCapabilities = reporter.ReportAta(report.ATA.IdentifyDevice.Value);
|
2018-11-25 19:13:21 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
break;
|
|
|
|
|
}
|
2018-11-25 19:13:21 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
case DeviceType.MMC:
|
|
|
|
|
report.MultiMediaCard = reporter.MmcSdReport();
|
2021-09-13 18:08:44 +01:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
break;
|
|
|
|
|
case DeviceType.SecureDigital:
|
|
|
|
|
report.SecureDigital = reporter.MmcSdReport();
|
2018-11-25 19:13:21 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
break;
|
2022-11-18 11:18:45 +00:00
|
|
|
case DeviceType.NVMe: throw new NotImplementedException(Localization.Core.NVMe_devices_not_yet_supported);
|
2022-03-06 13:29:38 +00:00
|
|
|
case DeviceType.ATAPI:
|
2022-11-15 15:58:43 +00:00
|
|
|
Core.Spectre.ProgressSingleSpinner(ctx =>
|
2022-03-06 13:29:38 +00:00
|
|
|
{
|
2022-11-18 11:18:45 +00:00
|
|
|
ctx.AddTask(Localization.Core.Querying_ATAPI_IDENTIFY).IsIndeterminate();
|
2022-03-06 13:29:38 +00:00
|
|
|
dev.AtapiIdentify(out buffer, out _, dev.Timeout, out _);
|
|
|
|
|
});
|
2018-11-25 19:13:21 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(Identify.Decode(buffer).HasValue)
|
|
|
|
|
report.ATAPI = new Ata
|
|
|
|
|
{
|
|
|
|
|
Identify = DeviceReport.ClearIdentify(buffer)
|
|
|
|
|
};
|
2018-11-25 19:13:21 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
goto case DeviceType.SCSI;
|
|
|
|
|
case DeviceType.SCSI:
|
|
|
|
|
switch(dev.ScsiType)
|
|
|
|
|
{
|
|
|
|
|
case PeripheralDeviceTypes.DirectAccess:
|
|
|
|
|
case PeripheralDeviceTypes.SequentialAccess:
|
|
|
|
|
case PeripheralDeviceTypes.WriteOnceDevice:
|
|
|
|
|
case PeripheralDeviceTypes.MultiMediaDevice:
|
|
|
|
|
case PeripheralDeviceTypes.OpticalDevice:
|
|
|
|
|
case PeripheralDeviceTypes.BridgingExpander
|
|
|
|
|
when dev.Model.StartsWith("MDM", StringComparison.Ordinal) ||
|
|
|
|
|
dev.Model.StartsWith("MDH", StringComparison.Ordinal):
|
|
|
|
|
case PeripheralDeviceTypes.SCSIZonedBlockDevice: break;
|
|
|
|
|
default:
|
2019-09-19 16:39:32 +01:00
|
|
|
{
|
2022-11-18 11:18:45 +00:00
|
|
|
AaruConsole.ErrorWriteLine(UI.Unsupported_device_type_for_report);
|
2018-11-25 19:13:21 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
throw new IOException();
|
|
|
|
|
}
|
2018-11-25 19:13:21 +00:00
|
|
|
}
|
2019-04-30 19:55:52 +01:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(!dev.IsUsb &&
|
|
|
|
|
!dev.IsFireWire &&
|
|
|
|
|
dev.IsRemovable)
|
2022-11-18 11:18:45 +00:00
|
|
|
removable = AnsiConsole.Confirm($"[italic]{UI.Is_the_media_removable_flash_is_not}[/]");
|
2018-11-25 19:17:21 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(removable)
|
|
|
|
|
{
|
2020-05-14 03:41:49 +01:00
|
|
|
switch(dev.ScsiType)
|
|
|
|
|
{
|
|
|
|
|
case PeripheralDeviceTypes.MultiMediaDevice:
|
|
|
|
|
case PeripheralDeviceTypes.BridgingExpander
|
|
|
|
|
when dev.Model.StartsWith("MDM", StringComparison.Ordinal) ||
|
|
|
|
|
dev.Model.StartsWith("MDH", StringComparison.Ordinal):
|
2022-03-06 13:29:38 +00:00
|
|
|
dev.AllowMediumRemoval(out buffer, dev.Timeout, out _);
|
|
|
|
|
dev.EjectTray(out buffer, dev.Timeout, out _);
|
2019-12-07 19:54:27 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
break;
|
|
|
|
|
case PeripheralDeviceTypes.SequentialAccess:
|
|
|
|
|
dev.SpcAllowMediumRemoval(out buffer, dev.Timeout, out _);
|
2021-09-13 18:08:44 +01:00
|
|
|
|
2022-11-15 15:58:43 +00:00
|
|
|
Core.Spectre.ProgressSingleSpinner(ctx =>
|
2022-03-06 13:29:38 +00:00
|
|
|
{
|
2022-11-18 11:18:45 +00:00
|
|
|
ctx.AddTask(UI.Asking_drive_to_unload_tape).IsIndeterminate();
|
2021-09-13 18:08:44 +01:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
dev.Unload(out buffer, dev.Timeout, out _);
|
|
|
|
|
});
|
2019-12-07 19:54:27 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
break;
|
|
|
|
|
}
|
2018-11-25 20:08:28 +00:00
|
|
|
|
2022-11-18 11:18:45 +00:00
|
|
|
AaruConsole.WriteLine(UI.Please_remove_any_media);
|
2019-12-07 19:54:27 +00:00
|
|
|
|
2022-11-15 15:58:43 +00:00
|
|
|
System.Console.ReadKey(true);
|
2022-03-06 13:29:38 +00:00
|
|
|
}
|
2018-11-25 20:08:28 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
report.SCSI = reporter.ReportScsiInquiry();
|
2019-12-07 19:54:27 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(report.SCSI == null)
|
|
|
|
|
break;
|
2018-11-25 20:08:28 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
report.SCSI.EVPDPages =
|
|
|
|
|
reporter.ReportEvpdPages(StringHandlers.CToString(report.SCSI.Inquiry?.VendorIdentification)?.
|
|
|
|
|
Trim().ToLowerInvariant());
|
2018-11-25 20:08:28 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
reporter.ReportScsiModes(ref report, out byte[] cdromMode, out MediumTypes mediumType);
|
2018-11-25 20:08:28 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
string mediumManufacturer;
|
|
|
|
|
byte[] senseBuffer = Array.Empty<byte>();
|
2022-11-15 15:58:43 +00:00
|
|
|
bool sense = true;
|
2018-11-25 20:08:28 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
switch(dev.ScsiType)
|
|
|
|
|
{
|
|
|
|
|
case PeripheralDeviceTypes.MultiMediaDevice:
|
2018-11-25 20:08:28 +00:00
|
|
|
{
|
2022-03-06 13:29:38 +00:00
|
|
|
if(dev.IsUsb &&
|
2022-03-16 11:47:00 +00:00
|
|
|
mediumType is MediumTypes.UnknownBlockDevice or MediumTypes.ReadOnlyBlockDevice
|
2022-11-15 15:58:43 +00:00
|
|
|
or MediumTypes.ReadWriteBlockDevice)
|
2022-03-06 13:29:38 +00:00
|
|
|
goto default;
|
2020-12-03 17:45:11 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
bool iomegaRev = dev.Manufacturer.ToLowerInvariant() == "iomega" && dev.Model.
|
2022-03-07 07:36:44 +00:00
|
|
|
ToLowerInvariant().StartsWith("rrd", StringComparison.OrdinalIgnoreCase);
|
2019-07-13 13:55:24 +01:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(trapDisc)
|
|
|
|
|
{
|
|
|
|
|
if(iomegaRev)
|
2018-11-25 22:15:38 +00:00
|
|
|
{
|
2022-11-18 11:18:45 +00:00
|
|
|
AaruConsole.ErrorWriteLine(UI.Device_does_not_report_with_trap_discs);
|
2019-12-07 19:54:27 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
return (int)ErrorNumber.InvalidArgument;
|
|
|
|
|
}
|
2020-07-12 00:20:19 +01:00
|
|
|
|
2022-11-18 11:18:45 +00:00
|
|
|
if(!AnsiConsole.Confirm($"[italic]{UI.Sure_report_trap_disc}[/]"))
|
2022-03-06 13:29:38 +00:00
|
|
|
return (int)ErrorNumber.NoError;
|
2020-07-12 00:20:19 +01:00
|
|
|
|
2022-11-18 11:18:45 +00:00
|
|
|
if(!AnsiConsole.Confirm($"[italic]{UI.Do_you_have_audio_trap_disc}[/]"))
|
2022-03-06 13:29:38 +00:00
|
|
|
{
|
2022-11-18 11:18:45 +00:00
|
|
|
AaruConsole.ErrorWriteLine(UI.Please_burn_audio_trap_disc);
|
2019-12-07 19:54:27 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
return (int)ErrorNumber.NoError;
|
2020-07-12 00:20:19 +01:00
|
|
|
}
|
2022-03-06 13:29:38 +00:00
|
|
|
|
2022-11-18 11:18:45 +00:00
|
|
|
if(AnsiConsole.Confirm($"[italic]{UI.Do_you_have_GD_ROM_disc}[/]"))
|
2022-03-06 13:29:38 +00:00
|
|
|
reporter.ReportGdRomSwapTrick(ref report);
|
2020-07-12 00:20:19 +01:00
|
|
|
else
|
2022-03-06 13:29:38 +00:00
|
|
|
return (int)ErrorNumber.NoError;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
List<string> mediaTypes = new();
|
|
|
|
|
|
|
|
|
|
report.SCSI.MultiMediaDevice = new Mmc
|
2020-07-12 00:20:19 +01:00
|
|
|
{
|
2022-03-06 13:29:38 +00:00
|
|
|
ModeSense2AData = cdromMode,
|
|
|
|
|
Features = reporter.ReportMmcFeatures()
|
|
|
|
|
};
|
2019-12-07 19:54:27 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(report.SCSI.MultiMediaDevice.Features?.BinaryData != null)
|
|
|
|
|
{
|
|
|
|
|
Features.SeparatedFeatures ftr =
|
|
|
|
|
Features.Separate(report.SCSI.MultiMediaDevice.Features.BinaryData);
|
2019-12-07 19:54:27 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(ftr.Descriptors != null)
|
2022-11-15 01:35:06 +00:00
|
|
|
foreach(Profile prof in from desc in ftr.Descriptors where desc.Code == 0x0000
|
|
|
|
|
select Features.Decode_0000(desc.Data) into ftr0000
|
|
|
|
|
where ftr0000 != null from prof in ftr0000.Value.Profiles
|
|
|
|
|
select prof)
|
|
|
|
|
switch(prof.Number)
|
|
|
|
|
{
|
|
|
|
|
case ProfileNumber.CDROM:
|
|
|
|
|
case ProfileNumber.CDR:
|
|
|
|
|
case ProfileNumber.CDRW:
|
|
|
|
|
mediaTypes.Add("CD-ROM");
|
|
|
|
|
mediaTypes.Add("Audio CD");
|
|
|
|
|
mediaTypes.Add("Enhanced CD (aka E-CD, CD-Plus or CD+)");
|
|
|
|
|
mediaTypes.Add("CD-R");
|
|
|
|
|
mediaTypes.Add("CD-RW Ultra Speed (marked 16x or higher)");
|
|
|
|
|
mediaTypes.Add("CD-RW High Speed (marked between 8x and 12x)");
|
|
|
|
|
mediaTypes.Add("CD-RW (marked 4x or lower)");
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
case ProfileNumber.DVDRWRes:
|
|
|
|
|
case ProfileNumber.DVDRWSeq:
|
|
|
|
|
case ProfileNumber.DVDRDLSeq:
|
|
|
|
|
case ProfileNumber.DVDRDLJump:
|
|
|
|
|
case ProfileNumber.DVDRWDL:
|
|
|
|
|
case ProfileNumber.DVDDownload:
|
|
|
|
|
case ProfileNumber.DVDRWPlus:
|
|
|
|
|
case ProfileNumber.DVDRPlus:
|
|
|
|
|
case ProfileNumber.DVDRSeq:
|
|
|
|
|
case ProfileNumber.DVDRWDLPlus:
|
|
|
|
|
case ProfileNumber.DVDRDLPlus:
|
|
|
|
|
|
|
|
|
|
case ProfileNumber.DVDROM:
|
|
|
|
|
mediaTypes.Add("DVD-ROM");
|
|
|
|
|
mediaTypes.Add("DVD-R");
|
|
|
|
|
mediaTypes.Add("DVD-RW");
|
|
|
|
|
mediaTypes.Add("DVD+R");
|
|
|
|
|
mediaTypes.Add("DVD+RW");
|
|
|
|
|
mediaTypes.Add("DVD-R DL");
|
|
|
|
|
mediaTypes.Add("DVD+R DL");
|
|
|
|
|
mediaTypes.Add("Nintendo GameCube game");
|
|
|
|
|
mediaTypes.Add("Nintendo Wii game");
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
case ProfileNumber.DVDRAM:
|
|
|
|
|
mediaTypes.Add("DVD-RAM (1st gen, marked 2.6Gb or 5.2Gb)");
|
|
|
|
|
mediaTypes.Add("DVD-RAM (2nd gen, marked 4.7Gb or 9.4Gb)");
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
case ProfileNumber.DDCDROM:
|
|
|
|
|
case ProfileNumber.DDCDR:
|
|
|
|
|
case ProfileNumber.DDCDRW:
|
|
|
|
|
mediaTypes.Add("DDCD-ROM");
|
|
|
|
|
mediaTypes.Add("DDCD-R");
|
|
|
|
|
mediaTypes.Add("DDCD-RW");
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
case ProfileNumber.BDROM:
|
|
|
|
|
case ProfileNumber.BDRSeq:
|
|
|
|
|
case ProfileNumber.BDRRdm:
|
|
|
|
|
case ProfileNumber.BDRE:
|
|
|
|
|
mediaTypes.Add("BD-ROM");
|
|
|
|
|
mediaTypes.Add("BD-R HTL (not LTH)");
|
|
|
|
|
mediaTypes.Add("BD-RE");
|
|
|
|
|
mediaTypes.Add("BD-R LTH");
|
|
|
|
|
mediaTypes.Add("BD-R Triple Layer (100Gb)");
|
|
|
|
|
mediaTypes.Add("BD-R Quad Layer (128Gb)");
|
|
|
|
|
mediaTypes.Add("Ultra HD Blu-ray movie");
|
|
|
|
|
mediaTypes.Add("PlayStation 3 game");
|
|
|
|
|
mediaTypes.Add("PlayStation 4 game");
|
|
|
|
|
mediaTypes.Add("PlayStation 5 game");
|
|
|
|
|
mediaTypes.Add("Xbox One game");
|
|
|
|
|
mediaTypes.Add("Nintendo Wii U game");
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
case ProfileNumber.HDDVDROM:
|
|
|
|
|
case ProfileNumber.HDDVDR:
|
|
|
|
|
case ProfileNumber.HDDVDRW:
|
|
|
|
|
case ProfileNumber.HDDVDRDL:
|
|
|
|
|
case ProfileNumber.HDDVDRWDL:
|
|
|
|
|
mediaTypes.Add("HD DVD-ROM");
|
|
|
|
|
mediaTypes.Add("HD DVD-R");
|
|
|
|
|
mediaTypes.Add("HD DVD-RW");
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
case ProfileNumber.HDDVDRAM:
|
|
|
|
|
mediaTypes.Add("HD DVD-RAM");
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
}
|
2022-03-06 13:29:38 +00:00
|
|
|
}
|
2020-11-30 13:10:04 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(cdromMode != null &&
|
|
|
|
|
!iomegaRev)
|
|
|
|
|
{
|
|
|
|
|
mediaTypes.Add("CD-ROM");
|
|
|
|
|
mediaTypes.Add("Audio CD");
|
|
|
|
|
mediaTypes.Add("Enhanced CD (aka E-CD, CD-Plus or CD+)");
|
2019-12-07 19:54:27 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(report.SCSI.MultiMediaDevice.ModeSense2A.ReadCDR)
|
|
|
|
|
mediaTypes.Add("CD-R");
|
2018-11-25 22:15:38 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(report.SCSI.MultiMediaDevice.ModeSense2A.ReadCDRW)
|
2018-11-25 22:15:38 +00:00
|
|
|
{
|
2022-03-06 13:29:38 +00:00
|
|
|
mediaTypes.Add("CD-RW Ultra Speed (marked 16x or higher)");
|
|
|
|
|
mediaTypes.Add("CD-RW High Speed (marked between 8x and 12x)");
|
|
|
|
|
mediaTypes.Add("CD-RW (marked 4x or lower)");
|
|
|
|
|
}
|
2019-12-07 19:54:27 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(report.SCSI.MultiMediaDevice.ModeSense2A.ReadDVDROM)
|
|
|
|
|
mediaTypes.Add("DVD-ROM");
|
2018-11-25 22:15:38 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(report.SCSI.MultiMediaDevice.ModeSense2A.ReadDVDRAM)
|
|
|
|
|
{
|
|
|
|
|
mediaTypes.Add("DVD-RAM (1st gen, marked 2.6Gb or 5.2Gb)");
|
|
|
|
|
mediaTypes.Add("DVD-RAM (2nd gen, marked 4.7Gb or 9.4Gb)");
|
2020-07-12 00:20:19 +01:00
|
|
|
}
|
2018-11-25 22:15:38 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(report.SCSI.MultiMediaDevice.ModeSense2A.ReadDVDR)
|
|
|
|
|
mediaTypes.Add("DVD-R");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(report.SCSI.MultiMediaDevice.Features != null &&
|
|
|
|
|
!iomegaRev)
|
|
|
|
|
{
|
|
|
|
|
if(report.SCSI.MultiMediaDevice.Features.CanReadBD ||
|
|
|
|
|
report.SCSI.MultiMediaDevice.Features.CanReadBDR ||
|
|
|
|
|
report.SCSI.MultiMediaDevice.Features.CanReadBDRE1 ||
|
|
|
|
|
report.SCSI.MultiMediaDevice.Features.CanReadBDRE2 ||
|
|
|
|
|
report.SCSI.MultiMediaDevice.Features.CanReadBDROM ||
|
|
|
|
|
report.SCSI.MultiMediaDevice.Features.CanReadOldBDR ||
|
|
|
|
|
report.SCSI.MultiMediaDevice.Features.CanReadOldBDRE ||
|
|
|
|
|
report.SCSI.MultiMediaDevice.Features.CanReadOldBDROM)
|
2018-11-25 22:15:38 +00:00
|
|
|
{
|
2022-03-06 13:29:38 +00:00
|
|
|
mediaTypes.Add("BD-ROM");
|
|
|
|
|
mediaTypes.Add("BD-R HTL (not LTH)");
|
|
|
|
|
mediaTypes.Add("BD-RE");
|
|
|
|
|
mediaTypes.Add("BD-R LTH");
|
|
|
|
|
mediaTypes.Add("BD-R Triple Layer (100Gb)");
|
|
|
|
|
mediaTypes.Add("BD-R Quad Layer (128Gb)");
|
|
|
|
|
mediaTypes.Add("Ultra HD Blu-ray movie");
|
|
|
|
|
mediaTypes.Add("PlayStation 3 game");
|
|
|
|
|
mediaTypes.Add("PlayStation 4 game");
|
|
|
|
|
mediaTypes.Add("PlayStation 5 game");
|
|
|
|
|
mediaTypes.Add("Xbox One game");
|
|
|
|
|
mediaTypes.Add("Nintendo Wii U game");
|
2020-07-12 00:20:19 +01:00
|
|
|
}
|
2019-12-07 19:54:27 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(report.SCSI.MultiMediaDevice.Features.CanReadCD ||
|
|
|
|
|
report.SCSI.MultiMediaDevice.Features.MultiRead)
|
2020-07-12 00:20:19 +01:00
|
|
|
{
|
2020-11-30 13:10:04 +00:00
|
|
|
mediaTypes.Add("CD-ROM");
|
|
|
|
|
mediaTypes.Add("Audio CD");
|
2022-03-06 13:29:38 +00:00
|
|
|
mediaTypes.Add("Enhanced CD (aka E-CD, CD-Plus or CD+)");
|
2020-11-30 13:10:04 +00:00
|
|
|
mediaTypes.Add("CD-R");
|
|
|
|
|
mediaTypes.Add("CD-RW Ultra Speed (marked 16x or higher)");
|
|
|
|
|
mediaTypes.Add("CD-RW High Speed (marked between 8x and 12x)");
|
|
|
|
|
mediaTypes.Add("CD-RW (marked 4x or lower)");
|
2018-11-25 22:15:38 +00:00
|
|
|
}
|
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(report.SCSI.MultiMediaDevice.Features.CanReadCDMRW)
|
|
|
|
|
mediaTypes.Add("CD-MRW");
|
2020-07-12 00:20:19 +01:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(report.SCSI.MultiMediaDevice.Features.CanReadDDCD)
|
2018-11-25 22:15:38 +00:00
|
|
|
{
|
2022-03-06 13:29:38 +00:00
|
|
|
mediaTypes.Add("DDCD-ROM");
|
|
|
|
|
mediaTypes.Add("DDCD-R");
|
|
|
|
|
mediaTypes.Add("DDCD-RW");
|
2018-11-25 22:15:38 +00:00
|
|
|
}
|
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(report.SCSI.MultiMediaDevice.Features.CanReadDVD ||
|
|
|
|
|
report.SCSI.MultiMediaDevice.Features.DVDMultiRead ||
|
|
|
|
|
report.SCSI.MultiMediaDevice.Features.CanReadDVDPlusR ||
|
|
|
|
|
report.SCSI.MultiMediaDevice.Features.CanReadDVDPlusRDL ||
|
|
|
|
|
report.SCSI.MultiMediaDevice.Features.CanReadDVDPlusRW ||
|
|
|
|
|
report.SCSI.MultiMediaDevice.Features.CanReadDVDPlusRWDL)
|
|
|
|
|
{
|
|
|
|
|
mediaTypes.Add("DVD-ROM");
|
|
|
|
|
mediaTypes.Add("DVD-R");
|
|
|
|
|
mediaTypes.Add("DVD-RW");
|
|
|
|
|
mediaTypes.Add("DVD+R");
|
|
|
|
|
mediaTypes.Add("DVD+RW");
|
|
|
|
|
mediaTypes.Add("DVD-R DL");
|
|
|
|
|
mediaTypes.Add("DVD+R DL");
|
|
|
|
|
mediaTypes.Add("Nintendo GameCube game");
|
|
|
|
|
mediaTypes.Add("Nintendo Wii game");
|
|
|
|
|
mediaTypes.Add("DVD-RAM (1st gen, marked 2.6Gb or 5.2Gb)");
|
|
|
|
|
mediaTypes.Add("DVD-RAM (2nd gen, marked 4.7Gb or 9.4Gb)");
|
|
|
|
|
}
|
2020-07-12 00:20:19 +01:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(report.SCSI.MultiMediaDevice.Features.CanReadDVDPlusMRW)
|
|
|
|
|
mediaTypes.Add("DVD+MRW");
|
2020-07-12 00:20:19 +01:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(report.SCSI.MultiMediaDevice.Features.CanReadHDDVD ||
|
|
|
|
|
report.SCSI.MultiMediaDevice.Features.CanReadHDDVDR)
|
2018-11-25 22:15:38 +00:00
|
|
|
{
|
2022-03-06 13:29:38 +00:00
|
|
|
mediaTypes.Add("HD DVD-ROM");
|
|
|
|
|
mediaTypes.Add("HD DVD-R");
|
|
|
|
|
mediaTypes.Add("HD DVD-RW");
|
|
|
|
|
}
|
2020-07-11 20:25:41 +01:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(report.SCSI.MultiMediaDevice.Features.CanReadHDDVDRAM)
|
|
|
|
|
mediaTypes.Add("HD DVD-RAM");
|
|
|
|
|
}
|
2020-07-11 20:25:41 +01:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(iomegaRev)
|
|
|
|
|
{
|
|
|
|
|
mediaTypes.Add("REV 35Gb");
|
|
|
|
|
mediaTypes.Add("REV 70Gb");
|
|
|
|
|
mediaTypes.Add("REV 120Gb");
|
|
|
|
|
}
|
2020-07-11 20:25:41 +01:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
// Very old CD drives do not contain mode page 2Ah neither GET CONFIGURATION, so just try all CDs on them
|
|
|
|
|
// Also don't get confident, some drives didn't know CD-RW but are able to read them
|
|
|
|
|
if(mediaTypes.Count == 0 ||
|
|
|
|
|
mediaTypes.Contains("CD-ROM"))
|
|
|
|
|
{
|
|
|
|
|
mediaTypes.Add("CD-ROM");
|
|
|
|
|
mediaTypes.Add("Audio CD");
|
|
|
|
|
mediaTypes.Add("CD-R");
|
|
|
|
|
mediaTypes.Add("CD-RW Ultra Speed (marked 16x or higher)");
|
|
|
|
|
mediaTypes.Add("CD-RW High Speed (marked between 8x and 12x)");
|
|
|
|
|
mediaTypes.Add("CD-RW (marked 4x or lower)");
|
|
|
|
|
mediaTypes.Add("Enhanced CD (aka E-CD, CD-Plus or CD+)");
|
|
|
|
|
}
|
2019-12-07 19:54:27 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
mediaTypes = mediaTypes.Distinct().ToList();
|
|
|
|
|
mediaTypes.Sort();
|
2021-09-13 18:08:44 +01:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
bool tryPlextor = false, tryHldtst = false, tryPioneer = false, tryNec = false,
|
|
|
|
|
tryMediaTekF106 = false;
|
2021-09-13 18:08:44 +01:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
tryPlextor |= dev.Manufacturer.ToLowerInvariant() == "plextor";
|
|
|
|
|
tryHldtst |= dev.Manufacturer.ToLowerInvariant() == "hl-dt-st";
|
|
|
|
|
tryPioneer |= dev.Manufacturer.ToLowerInvariant() == "pioneer";
|
|
|
|
|
tryNec |= dev.Manufacturer.ToLowerInvariant() == "nec";
|
2019-12-07 19:54:27 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(!iomegaRev)
|
|
|
|
|
{
|
|
|
|
|
if(!tryPlextor)
|
|
|
|
|
tryPlextor |=
|
|
|
|
|
AnsiConsole.
|
2022-11-18 11:18:45 +00:00
|
|
|
Confirm($"[italic]{UI.Do_you_want_to_try_Plextor_commands} [red]{UI.This_is_dangerous}[/][/]",
|
2022-03-06 13:29:38 +00:00
|
|
|
false);
|
2019-12-07 19:54:27 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(!tryNec)
|
|
|
|
|
tryNec |=
|
|
|
|
|
AnsiConsole.
|
2022-11-18 11:18:45 +00:00
|
|
|
Confirm($"[italic]{UI.Do_you_want_to_try_NEC_commands} [red]{UI.This_is_dangerous}[/][/]",
|
2022-03-06 13:29:38 +00:00
|
|
|
false);
|
2018-11-25 22:15:38 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(!tryPioneer)
|
|
|
|
|
tryPioneer |=
|
|
|
|
|
AnsiConsole.
|
2022-11-18 11:18:45 +00:00
|
|
|
Confirm($"[italic]{UI.Do_you_want_to_try_Pioneer_commands} [red]{UI.This_is_dangerous}[/][/]",
|
2022-03-06 13:29:38 +00:00
|
|
|
false);
|
2018-11-25 22:15:38 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(!tryHldtst)
|
|
|
|
|
tryHldtst |=
|
|
|
|
|
AnsiConsole.
|
2022-11-18 11:18:45 +00:00
|
|
|
Confirm($"[italic]{UI.Do_you_want_to_try_HLDTST_commands} [red]{UI.This_is_dangerous}[/][/]",
|
2022-03-06 13:29:38 +00:00
|
|
|
false);
|
2018-11-25 22:15:38 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
tryMediaTekF106 =
|
|
|
|
|
AnsiConsole.
|
2022-11-18 11:18:45 +00:00
|
|
|
Confirm($"[italic]{UI.Do_you_want_to_try_MediaTek_commands} [red]{UI.This_is_dangerous}[/][/]",
|
2022-03-06 13:29:38 +00:00
|
|
|
false);
|
|
|
|
|
}
|
2019-12-07 19:54:27 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(dev.Model.StartsWith("PD-", StringComparison.Ordinal))
|
|
|
|
|
mediaTypes.Add("PD-650");
|
2019-12-07 19:54:27 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
List<TestedMedia> mediaTests = new();
|
2019-12-07 19:54:27 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
foreach(string mediaType in mediaTypes)
|
|
|
|
|
{
|
2022-11-18 11:18:45 +00:00
|
|
|
if(!AnsiConsole.Confirm($"[italic]{string.Format(UI.Do_you_have_a_0_disc, mediaType)
|
|
|
|
|
}[/]"))
|
2022-03-06 13:29:38 +00:00
|
|
|
continue;
|
2019-12-07 19:54:27 +00:00
|
|
|
|
2022-11-18 11:18:45 +00:00
|
|
|
AaruConsole.WriteLine(UI.Please_insert_it_in_the_drive);
|
2018-11-25 22:15:38 +00:00
|
|
|
|
2022-11-15 15:58:43 +00:00
|
|
|
System.Console.ReadKey(true);
|
2018-11-25 22:15:38 +00:00
|
|
|
|
2022-11-15 15:58:43 +00:00
|
|
|
bool mediaIsRecognized = true;
|
2018-11-25 22:15:38 +00:00
|
|
|
|
2022-11-15 15:58:43 +00:00
|
|
|
Core.Spectre.ProgressSingleSpinner(ctx =>
|
2022-03-06 13:29:38 +00:00
|
|
|
{
|
2022-11-18 11:18:45 +00:00
|
|
|
ctx.AddTask(Localization.Core.Waiting_for_drive_to_become_ready).IsIndeterminate();
|
2022-03-06 13:29:38 +00:00
|
|
|
sense = dev.ScsiTestUnitReady(out senseBuffer, dev.Timeout, out _);
|
2018-11-25 22:15:38 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(!sense)
|
|
|
|
|
return;
|
2020-04-03 02:49:24 +01:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
DecodedSense? decSense = Sense.Decode(senseBuffer);
|
2021-03-26 00:37:54 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(decSense.HasValue)
|
|
|
|
|
switch(decSense.Value.ASC)
|
|
|
|
|
{
|
|
|
|
|
case 0x3A:
|
|
|
|
|
{
|
2022-11-15 15:58:43 +00:00
|
|
|
int leftRetries = 50;
|
2021-03-26 00:37:54 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
while(leftRetries > 0)
|
|
|
|
|
{
|
|
|
|
|
Thread.Sleep(2000);
|
|
|
|
|
|
2022-03-07 07:36:44 +00:00
|
|
|
sense = dev.ScsiTestUnitReady(out senseBuffer, dev.Timeout, out _);
|
2022-03-06 13:29:38 +00:00
|
|
|
|
|
|
|
|
if(!sense)
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
leftRetries--;
|
2020-07-12 00:20:19 +01:00
|
|
|
}
|
2022-03-06 13:29:38 +00:00
|
|
|
|
|
|
|
|
AaruConsole.WriteLine();
|
|
|
|
|
|
|
|
|
|
mediaIsRecognized &= !sense;
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// These should be trapped by the OS but seems in some cases they're not
|
|
|
|
|
case 0x04 when decSense.Value.ASCQ == 0x01:
|
|
|
|
|
{
|
2022-11-15 15:58:43 +00:00
|
|
|
int leftRetries = 50;
|
2022-03-06 13:29:38 +00:00
|
|
|
|
|
|
|
|
while(leftRetries > 0)
|
2021-03-26 00:37:54 +00:00
|
|
|
{
|
2022-03-06 13:29:38 +00:00
|
|
|
Thread.Sleep(2000);
|
2019-12-07 19:54:27 +00:00
|
|
|
|
2022-03-07 07:36:44 +00:00
|
|
|
sense = dev.ScsiTestUnitReady(out senseBuffer, dev.Timeout, out _);
|
2019-12-07 19:54:27 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(!sense)
|
|
|
|
|
break;
|
2018-11-25 22:15:38 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
leftRetries--;
|
|
|
|
|
}
|
2021-03-26 00:37:54 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
AaruConsole.WriteLine();
|
2021-03-26 00:37:54 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
mediaIsRecognized &= !sense;
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case 0x28:
|
|
|
|
|
{
|
2022-11-15 15:58:43 +00:00
|
|
|
int leftRetries = 50;
|
2022-03-06 13:29:38 +00:00
|
|
|
|
|
|
|
|
while(leftRetries > 0)
|
|
|
|
|
{
|
|
|
|
|
Thread.Sleep(2000);
|
2021-03-26 00:37:54 +00:00
|
|
|
|
2022-03-07 07:36:44 +00:00
|
|
|
sense = dev.ScsiTestUnitReady(out senseBuffer, dev.Timeout, out _);
|
2021-03-26 00:37:54 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(!sense)
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
leftRetries--;
|
2021-03-26 00:37:54 +00:00
|
|
|
}
|
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
AaruConsole.WriteLine();
|
2021-03-26 00:37:54 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
mediaIsRecognized &= !sense;
|
|
|
|
|
|
|
|
|
|
break;
|
2018-11-25 22:15:38 +00:00
|
|
|
}
|
2022-03-06 13:29:38 +00:00
|
|
|
default:
|
|
|
|
|
AaruConsole.DebugWriteLine("Device-Report command",
|
2022-11-18 11:18:45 +00:00
|
|
|
Localization.Core.Device_not_ready_Sense,
|
2022-03-07 07:36:44 +00:00
|
|
|
decSense.Value.SenseKey, decSense.Value.ASC,
|
|
|
|
|
decSense.Value.ASCQ);
|
2022-03-06 13:29:38 +00:00
|
|
|
|
|
|
|
|
mediaIsRecognized = false;
|
|
|
|
|
|
|
|
|
|
break;
|
2018-11-25 22:15:38 +00:00
|
|
|
}
|
2022-03-06 13:29:38 +00:00
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
AaruConsole.DebugWriteLine("Device-Report command",
|
2022-11-18 11:18:45 +00:00
|
|
|
Localization.Core.
|
|
|
|
|
Got_sense_status_but_no_sense_buffer);
|
2022-03-06 13:29:38 +00:00
|
|
|
|
|
|
|
|
mediaIsRecognized = false;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var mediaTest = new TestedMedia();
|
|
|
|
|
|
|
|
|
|
if(mediaIsRecognized)
|
|
|
|
|
{
|
|
|
|
|
mediaTest = reporter.ReportMmcMedia(mediaType, tryPlextor, tryPioneer, tryNec,
|
|
|
|
|
tryHldtst, tryMediaTekF106);
|
|
|
|
|
|
|
|
|
|
if(mediaTest is null)
|
|
|
|
|
continue;
|
|
|
|
|
|
2022-03-07 07:36:44 +00:00
|
|
|
if((mediaTest.SupportsReadLong == true || mediaTest.SupportsReadLong16 == true) &&
|
|
|
|
|
mediaTest.LongBlockSize == mediaTest.BlockSize &&
|
2022-11-18 11:18:45 +00:00
|
|
|
AnsiConsole.Confirm($"[italic]{Localization.Core.Try_to_find_SCSI_READ_LONG_size
|
|
|
|
|
}[/]"))
|
2022-03-06 13:29:38 +00:00
|
|
|
AnsiConsole.Progress().AutoClear(true).HideCompleted(true).
|
|
|
|
|
Columns(new TaskDescriptionColumn(), new ProgressBarColumn(),
|
|
|
|
|
new PercentageColumn()).Start(ctx =>
|
|
|
|
|
{
|
2022-11-18 11:18:45 +00:00
|
|
|
ProgressTask task =
|
|
|
|
|
ctx.AddTask(Localization.Core.Trying_to_READ_LONG);
|
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
task.MaxValue = ushort.MaxValue;
|
|
|
|
|
|
2022-11-15 15:58:43 +00:00
|
|
|
for(ushort i = (ushort)mediaTest.BlockSize;; i++)
|
2022-03-06 13:29:38 +00:00
|
|
|
{
|
2022-11-18 11:18:45 +00:00
|
|
|
task.Description =
|
|
|
|
|
string.
|
|
|
|
|
Format(Localization.Core.Trying_READ_LONG_with_size_0,
|
|
|
|
|
i);
|
2022-03-06 13:29:38 +00:00
|
|
|
|
|
|
|
|
task.Value = i;
|
|
|
|
|
|
|
|
|
|
sense = mediaTest.SupportsReadLong16 == true
|
2022-03-07 07:36:44 +00:00
|
|
|
? dev.ReadLong16(out buffer, out senseBuffer,
|
|
|
|
|
false, 0, i, dev.Timeout, out _)
|
|
|
|
|
: dev.ReadLong10(out buffer, out senseBuffer,
|
|
|
|
|
false, false, 0, i, dev.Timeout,
|
|
|
|
|
out _);
|
2022-03-06 13:29:38 +00:00
|
|
|
|
|
|
|
|
if(!sense)
|
|
|
|
|
{
|
|
|
|
|
mediaTest.LongBlockSize = i;
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(i == ushort.MaxValue)
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if(mediaTest.SupportsReadLong == true &&
|
|
|
|
|
mediaTest.LongBlockSize != mediaTest.BlockSize)
|
|
|
|
|
{
|
2022-11-15 15:58:43 +00:00
|
|
|
Core.Spectre.ProgressSingleSpinner(ctx =>
|
2019-04-30 19:55:52 +01:00
|
|
|
{
|
2022-11-18 11:18:45 +00:00
|
|
|
ctx.AddTask(Localization.Core.Trying_SCSI_READ_LONG_10).IsIndeterminate();
|
2019-12-07 19:54:27 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
sense = dev.ReadLong10(out buffer, out senseBuffer, false, false, 0,
|
2022-03-07 07:36:44 +00:00
|
|
|
(ushort)mediaTest.LongBlockSize, dev.Timeout, out _);
|
2022-03-06 13:29:38 +00:00
|
|
|
});
|
2019-12-07 19:54:27 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(!sense)
|
|
|
|
|
mediaTest.ReadLong10Data = buffer;
|
|
|
|
|
}
|
2018-11-25 22:15:38 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(mediaTest.SupportsReadLong16 == true &&
|
|
|
|
|
mediaTest.LongBlockSize != mediaTest.BlockSize)
|
2018-11-25 22:15:38 +00:00
|
|
|
{
|
2022-11-15 15:58:43 +00:00
|
|
|
Core.Spectre.ProgressSingleSpinner(ctx =>
|
2022-03-06 13:29:38 +00:00
|
|
|
{
|
2022-11-18 11:18:45 +00:00
|
|
|
ctx.AddTask(Localization.Core.Trying_SCSI_READ_LONG_16).IsIndeterminate();
|
2019-12-07 19:54:27 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
sense = dev.ReadLong16(out buffer, out senseBuffer, false, 0,
|
2022-03-07 07:36:44 +00:00
|
|
|
mediaTest.LongBlockSize.Value, dev.Timeout, out _);
|
2022-03-06 13:29:38 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
|
|
if(!sense)
|
|
|
|
|
mediaTest.ReadLong16Data = buffer;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
mediaTest.MediumTypeName = mediaType;
|
|
|
|
|
mediaTest.MediaIsRecognized = mediaIsRecognized;
|
|
|
|
|
mediaTests.Add(mediaTest);
|
|
|
|
|
|
|
|
|
|
dev.AllowMediumRemoval(out buffer, dev.Timeout, out _);
|
|
|
|
|
dev.EjectTray(out buffer, dev.Timeout, out _);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
report.SCSI.MultiMediaDevice.TestedMedia = mediaTests;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
case PeripheralDeviceTypes.SequentialAccess:
|
|
|
|
|
{
|
|
|
|
|
report.SCSI.SequentialDevice = reporter.ReportScsiSsc();
|
|
|
|
|
|
|
|
|
|
List<TestedSequentialMedia> seqTests = new();
|
|
|
|
|
|
2022-11-18 11:18:45 +00:00
|
|
|
while(AnsiConsole.Confirm($"[italic]{UI.Do_you_have_media_you_can_insert}[/]"))
|
2022-03-06 13:29:38 +00:00
|
|
|
{
|
2022-11-18 11:18:45 +00:00
|
|
|
AaruConsole.WriteLine(UI.Please_insert_it_in_the_drive);
|
2018-11-25 22:15:38 +00:00
|
|
|
|
2022-11-15 15:58:43 +00:00
|
|
|
System.Console.ReadKey(true);
|
2022-03-06 13:29:38 +00:00
|
|
|
|
2022-11-18 11:18:45 +00:00
|
|
|
mediumTypeName = AnsiConsole.Ask<string>(UI.Please_write_description_of_media_type);
|
2022-03-06 13:29:38 +00:00
|
|
|
|
|
|
|
|
mediumManufacturer =
|
2022-11-18 11:18:45 +00:00
|
|
|
AnsiConsole.Ask<string>(Localization.Core.Please_write_media_manufacturer);
|
2022-03-06 13:29:38 +00:00
|
|
|
|
2022-11-18 11:18:45 +00:00
|
|
|
mediumModel = AnsiConsole.Ask<string>(UI.Please_write_media_model);
|
2022-03-06 13:29:38 +00:00
|
|
|
|
2022-11-15 15:58:43 +00:00
|
|
|
bool mediaIsRecognized = true;
|
2022-03-06 13:29:38 +00:00
|
|
|
|
2022-11-15 15:58:43 +00:00
|
|
|
Core.Spectre.ProgressSingleSpinner(ctx =>
|
2022-03-06 13:29:38 +00:00
|
|
|
{
|
2022-11-18 11:18:45 +00:00
|
|
|
ctx.AddTask(Localization.Core.Waiting_for_drive_to_become_ready).IsIndeterminate();
|
2022-03-06 13:29:38 +00:00
|
|
|
|
|
|
|
|
sense = dev.ScsiTestUnitReady(out senseBuffer, dev.Timeout, out _);
|
|
|
|
|
AaruConsole.DebugWriteLine("Device reporting", "sense = {0}", sense);
|
|
|
|
|
|
|
|
|
|
if(!sense)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
DecodedSense? decSense = Sense.Decode(senseBuffer);
|
|
|
|
|
|
|
|
|
|
if(decSense.HasValue)
|
|
|
|
|
switch(decSense.Value.ASC)
|
|
|
|
|
{
|
|
|
|
|
case 0x3A:
|
2018-11-25 22:15:38 +00:00
|
|
|
{
|
2022-11-15 15:58:43 +00:00
|
|
|
int leftRetries = 50;
|
2021-09-13 18:08:44 +01:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
while(leftRetries > 0)
|
|
|
|
|
{
|
|
|
|
|
Thread.Sleep(2000);
|
2021-09-13 18:08:44 +01:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
sense = dev.ScsiTestUnitReady(out senseBuffer, dev.Timeout, out _);
|
2021-09-13 18:08:44 +01:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(!sense)
|
|
|
|
|
break;
|
2021-09-13 18:08:44 +01:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
leftRetries--;
|
|
|
|
|
}
|
2021-09-13 18:08:44 +01:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
AaruConsole.WriteLine();
|
2021-09-13 18:08:44 +01:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
mediaIsRecognized &= !sense;
|
|
|
|
|
|
|
|
|
|
break;
|
2018-11-25 22:15:38 +00:00
|
|
|
}
|
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
// These should be trapped by the OS but seems in some cases they're not
|
|
|
|
|
case 0x04 when decSense.Value.ASCQ == 0x01:
|
2020-07-12 00:20:19 +01:00
|
|
|
{
|
2022-11-15 15:58:43 +00:00
|
|
|
int leftRetries = 50;
|
2022-03-06 13:29:38 +00:00
|
|
|
|
|
|
|
|
while(leftRetries > 0)
|
2021-09-13 18:08:44 +01:00
|
|
|
{
|
2022-03-06 13:29:38 +00:00
|
|
|
Thread.Sleep(2000);
|
2021-09-13 18:08:44 +01:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
sense = dev.ScsiTestUnitReady(out senseBuffer, dev.Timeout, out _);
|
2020-07-12 00:20:19 +01:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(!sense)
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
leftRetries--;
|
|
|
|
|
}
|
2019-12-07 19:54:27 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
AaruConsole.WriteLine();
|
|
|
|
|
|
|
|
|
|
mediaIsRecognized &= !sense;
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case 0x28:
|
2021-03-26 05:38:40 +00:00
|
|
|
{
|
2022-11-15 15:58:43 +00:00
|
|
|
int leftRetries = 50;
|
2022-03-06 13:29:38 +00:00
|
|
|
|
|
|
|
|
while(leftRetries > 0)
|
2021-09-13 18:08:44 +01:00
|
|
|
{
|
2022-03-06 13:29:38 +00:00
|
|
|
Thread.Sleep(2000);
|
|
|
|
|
|
|
|
|
|
sense = dev.ScsiTestUnitReady(out senseBuffer, dev.Timeout, out _);
|
|
|
|
|
|
|
|
|
|
if(!sense)
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
leftRetries--;
|
|
|
|
|
}
|
2021-09-13 18:08:44 +01:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
AaruConsole.WriteLine();
|
2021-03-26 05:38:40 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
mediaIsRecognized &= !sense;
|
|
|
|
|
|
|
|
|
|
break;
|
2021-03-26 05:38:40 +00:00
|
|
|
}
|
2022-03-06 13:29:38 +00:00
|
|
|
default:
|
|
|
|
|
AaruConsole.DebugWriteLine("Device-Report command",
|
2022-11-18 11:18:45 +00:00
|
|
|
Localization.Core.Device_not_ready_Sense,
|
2022-03-06 13:29:38 +00:00
|
|
|
decSense.Value.SenseKey, decSense.Value.ASC,
|
|
|
|
|
decSense.Value.ASCQ);
|
2018-12-26 01:15:30 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
mediaIsRecognized = false;
|
2018-11-25 22:15:38 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
AaruConsole.DebugWriteLine("Device-Report command",
|
2022-11-18 11:18:45 +00:00
|
|
|
Localization.Core.Got_sense_status_but_no_sense_buffer);
|
2019-04-30 19:07:53 +01:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
mediaIsRecognized = false;
|
|
|
|
|
}
|
|
|
|
|
});
|
2019-12-07 19:54:27 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
var seqTest = new TestedSequentialMedia();
|
|
|
|
|
|
|
|
|
|
if(mediaIsRecognized)
|
|
|
|
|
seqTest = reporter.ReportSscMedia();
|
|
|
|
|
|
|
|
|
|
seqTest.MediumTypeName = mediumTypeName;
|
|
|
|
|
seqTest.Manufacturer = mediumManufacturer;
|
|
|
|
|
seqTest.Model = mediumModel;
|
|
|
|
|
seqTest.MediaIsRecognized = mediaIsRecognized;
|
2018-11-25 20:27:38 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
seqTests.Add(seqTest);
|
2018-11-25 20:27:38 +00:00
|
|
|
|
2022-11-15 15:58:43 +00:00
|
|
|
Core.Spectre.ProgressSingleSpinner(ctx =>
|
2018-11-25 20:27:38 +00:00
|
|
|
{
|
2022-11-18 11:18:45 +00:00
|
|
|
ctx.AddTask(UI.Asking_drive_to_unload_tape).IsIndeterminate();
|
2018-11-25 20:27:38 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
dev.SpcAllowMediumRemoval(out buffer, dev.Timeout, out _);
|
|
|
|
|
dev.Unload(out buffer, dev.Timeout, out _);
|
|
|
|
|
});
|
|
|
|
|
}
|
2018-11-25 20:27:38 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
report.SCSI.SequentialDevice.TestedMedia = seqTests;
|
|
|
|
|
}
|
2018-11-25 20:27:38 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
break;
|
|
|
|
|
case PeripheralDeviceTypes.BridgingExpander
|
|
|
|
|
when dev.Model.StartsWith("MDM", StringComparison.Ordinal) ||
|
|
|
|
|
dev.Model.StartsWith("MDH", StringComparison.Ordinal):
|
|
|
|
|
{
|
|
|
|
|
List<string> mediaTypes = new()
|
|
|
|
|
{
|
2022-11-18 11:18:45 +00:00
|
|
|
Localization.Core.Media_Type_Name_MMD_140A,
|
|
|
|
|
Localization.Core.Media_Type_Name_MDW_60,
|
|
|
|
|
Localization.Core.Media_Type_Name_MDW_74,
|
|
|
|
|
Localization.Core.Media_Type_Name_MDW_80,
|
|
|
|
|
Localization.Core.Media_Type_Name_MiniDisc
|
2022-03-06 13:29:38 +00:00
|
|
|
};
|
2021-09-13 18:08:44 +01:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
mediaTypes.Sort();
|
2018-11-25 20:27:38 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
List<TestedMedia> mediaTests = new();
|
2019-12-07 19:54:27 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
foreach(string mediaType in mediaTypes)
|
|
|
|
|
{
|
2022-11-18 11:18:45 +00:00
|
|
|
if(!AnsiConsole.Confirm($"[italic]{string.Format(UI.Do_you_have_a_0_disc, mediaType)}[/]"))
|
2022-03-06 13:29:38 +00:00
|
|
|
continue;
|
2021-09-13 18:08:44 +01:00
|
|
|
|
2022-11-18 11:18:45 +00:00
|
|
|
AaruConsole.WriteLine(UI.Please_insert_it_in_the_drive);
|
2021-09-13 18:08:44 +01:00
|
|
|
|
2022-11-15 15:58:43 +00:00
|
|
|
System.Console.ReadKey(true);
|
2021-09-13 18:08:44 +01:00
|
|
|
|
2022-11-15 15:58:43 +00:00
|
|
|
bool mediaIsRecognized = true;
|
2019-12-07 19:54:27 +00:00
|
|
|
|
2022-11-15 15:58:43 +00:00
|
|
|
Core.Spectre.ProgressSingleSpinner(ctx =>
|
2022-03-06 13:29:38 +00:00
|
|
|
{
|
2022-11-18 11:18:45 +00:00
|
|
|
ctx.AddTask(Localization.Core.Waiting_for_drive_to_become_ready).IsIndeterminate();
|
2022-03-06 13:29:38 +00:00
|
|
|
|
|
|
|
|
sense = dev.ScsiTestUnitReady(out senseBuffer, dev.Timeout, out _);
|
|
|
|
|
|
|
|
|
|
if(!sense)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
DecodedSense? decSense = Sense.Decode(senseBuffer);
|
|
|
|
|
|
|
|
|
|
if(decSense.HasValue)
|
|
|
|
|
switch(decSense.Value.ASC)
|
2019-09-19 16:39:32 +01:00
|
|
|
{
|
2022-03-06 13:29:38 +00:00
|
|
|
case 0x3A:
|
2018-11-25 20:27:38 +00:00
|
|
|
{
|
2022-11-15 15:58:43 +00:00
|
|
|
int leftRetries = 50;
|
2022-03-06 13:29:38 +00:00
|
|
|
|
|
|
|
|
while(leftRetries > 0)
|
2018-11-25 20:27:38 +00:00
|
|
|
{
|
2022-03-06 13:29:38 +00:00
|
|
|
Thread.Sleep(2000);
|
2019-12-07 19:54:27 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
sense = dev.ScsiTestUnitReady(out senseBuffer, dev.Timeout, out _);
|
2021-09-13 18:08:44 +01:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(!sense)
|
|
|
|
|
break;
|
2018-11-25 20:27:38 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
leftRetries--;
|
|
|
|
|
}
|
2018-11-25 20:27:38 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
mediaIsRecognized &= !sense;
|
2020-04-03 02:49:24 +01:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
break;
|
|
|
|
|
}
|
2021-03-26 00:37:54 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
// These should be trapped by the OS but seems in some cases they're not
|
|
|
|
|
case 0x04 when decSense.Value.ASCQ == 0x01:
|
|
|
|
|
{
|
2022-11-15 15:58:43 +00:00
|
|
|
int leftRetries = 50;
|
2019-12-07 19:54:27 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
while(leftRetries > 0)
|
|
|
|
|
{
|
|
|
|
|
Thread.Sleep(2000);
|
|
|
|
|
|
|
|
|
|
sense = dev.ScsiTestUnitReady(out senseBuffer, dev.Timeout, out _);
|
|
|
|
|
|
|
|
|
|
if(!sense)
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
leftRetries--;
|
2021-03-26 00:37:54 +00:00
|
|
|
}
|
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
mediaIsRecognized &= !sense;
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case 0x28:
|
|
|
|
|
{
|
2022-11-15 15:58:43 +00:00
|
|
|
int leftRetries = 50;
|
2022-03-06 13:29:38 +00:00
|
|
|
|
|
|
|
|
while(leftRetries > 0)
|
2018-11-25 20:27:38 +00:00
|
|
|
{
|
2022-03-06 13:29:38 +00:00
|
|
|
Thread.Sleep(2000);
|
2019-12-07 19:54:27 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
sense = dev.ScsiTestUnitReady(out senseBuffer, dev.Timeout, out _);
|
2021-09-13 18:08:44 +01:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(!sense)
|
|
|
|
|
break;
|
2018-11-25 20:27:38 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
leftRetries--;
|
|
|
|
|
}
|
2018-11-25 20:27:38 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
mediaIsRecognized &= !sense;
|
2020-04-03 02:49:24 +01:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
default:
|
|
|
|
|
AaruConsole.DebugWriteLine("Device-Report command",
|
2022-11-18 11:18:45 +00:00
|
|
|
Localization.Core.Device_not_ready_Sense,
|
2022-03-06 13:29:38 +00:00
|
|
|
decSense.Value.SenseKey, decSense.Value.ASC,
|
|
|
|
|
decSense.Value.ASCQ);
|
2019-12-07 19:54:27 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
mediaIsRecognized = false;
|
2019-12-07 19:54:27 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
AaruConsole.DebugWriteLine("Device-Report command",
|
2022-11-18 11:18:45 +00:00
|
|
|
Localization.Core.Got_sense_status_but_no_sense_buffer);
|
2019-12-07 19:54:27 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
mediaIsRecognized = false;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var mediaTest = new TestedMedia();
|
|
|
|
|
|
|
|
|
|
if(mediaIsRecognized)
|
|
|
|
|
{
|
|
|
|
|
mediaTest = reporter.ReportScsiMedia();
|
|
|
|
|
|
|
|
|
|
if(mediaTest is null)
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
if((mediaTest.SupportsReadLong == true || mediaTest.SupportsReadLong16 == true) &&
|
|
|
|
|
mediaTest.LongBlockSize == mediaTest.BlockSize &&
|
2022-11-18 11:18:45 +00:00
|
|
|
AnsiConsole.Confirm($"[italic]{Localization.Core.Try_to_find_SCSI_READ_LONG_size
|
|
|
|
|
}[/]"))
|
2022-03-06 13:29:38 +00:00
|
|
|
AnsiConsole.Progress().AutoClear(true).HideCompleted(true).
|
|
|
|
|
Columns(new TaskDescriptionColumn(), new ProgressBarColumn(),
|
|
|
|
|
new PercentageColumn()).Start(ctx =>
|
2021-03-26 00:37:54 +00:00
|
|
|
{
|
2022-11-18 11:18:45 +00:00
|
|
|
ProgressTask task =
|
|
|
|
|
ctx.AddTask(Localization.Core.Trying_to_READ_LONG);
|
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
task.MaxValue = ushort.MaxValue;
|
2021-09-13 18:08:44 +01:00
|
|
|
|
2022-11-15 15:58:43 +00:00
|
|
|
for(ushort i = (ushort)mediaTest.BlockSize;; i++)
|
2022-03-06 13:29:38 +00:00
|
|
|
{
|
|
|
|
|
task.Value = i;
|
2019-04-30 20:07:10 +01:00
|
|
|
|
2022-11-18 11:18:45 +00:00
|
|
|
task.Description =
|
|
|
|
|
string.
|
|
|
|
|
Format(Localization.Core.Trying_READ_LONG_with_size_0,
|
|
|
|
|
i);
|
2019-04-30 20:07:10 +01:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
sense = mediaTest.SupportsReadLong16 == true
|
2022-03-07 07:36:44 +00:00
|
|
|
? dev.ReadLong16(out buffer, out senseBuffer, false,
|
|
|
|
|
0, i, dev.Timeout, out _)
|
|
|
|
|
: dev.ReadLong10(out buffer, out senseBuffer, false,
|
|
|
|
|
false, 0, i, dev.Timeout, out _);
|
2020-04-03 02:49:24 +01:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(!sense)
|
|
|
|
|
{
|
|
|
|
|
mediaTest.LongBlockSize = i;
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(i == ushort.MaxValue)
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
AaruConsole.WriteLine();
|
|
|
|
|
});
|
2019-12-07 19:54:27 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(mediaTest.SupportsReadLong == true &&
|
|
|
|
|
mediaTest.LongBlockSize != mediaTest.BlockSize)
|
|
|
|
|
{
|
2022-11-15 15:58:43 +00:00
|
|
|
Core.Spectre.ProgressSingleSpinner(ctx =>
|
2022-03-06 13:29:38 +00:00
|
|
|
{
|
2022-11-18 11:18:45 +00:00
|
|
|
ctx.AddTask(Localization.Core.Trying_SCSI_READ_LONG_10).IsIndeterminate();
|
2021-03-26 00:37:54 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
sense = dev.ReadLong10(out buffer, out senseBuffer, false, false, 0,
|
|
|
|
|
(ushort)mediaTest.LongBlockSize, dev.Timeout, out _);
|
|
|
|
|
});
|
2021-03-26 00:37:54 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(!sense)
|
|
|
|
|
mediaTest.ReadLong10Data = buffer;
|
|
|
|
|
}
|
2021-03-26 00:37:54 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(mediaTest.SupportsReadLong16 == true &&
|
|
|
|
|
mediaTest.LongBlockSize != mediaTest.BlockSize)
|
|
|
|
|
{
|
2022-11-15 15:58:43 +00:00
|
|
|
Core.Spectre.ProgressSingleSpinner(ctx =>
|
2019-04-30 19:55:52 +01:00
|
|
|
{
|
2022-11-18 11:18:45 +00:00
|
|
|
ctx.AddTask(Localization.Core.Trying_SCSI_READ_LONG_16).IsIndeterminate();
|
2019-12-07 19:54:27 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
sense = dev.ReadLong16(out buffer, out senseBuffer, false, 0,
|
|
|
|
|
(ushort)mediaTest.LongBlockSize, dev.Timeout, out _);
|
|
|
|
|
});
|
2018-11-25 20:27:38 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(!sense)
|
|
|
|
|
mediaTest.ReadLong16Data = buffer;
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-11-25 20:27:38 +00:00
|
|
|
|
2022-11-18 11:18:45 +00:00
|
|
|
if(mediaType == Localization.Core.Media_Type_Name_MMD_140A)
|
|
|
|
|
mediaTest.MediumTypeName = "MMD-140A";
|
|
|
|
|
else if(mediaType == Localization.Core.Media_Type_Name_MDW_60)
|
|
|
|
|
mediaTest.MediumTypeName = "MDW-60";
|
|
|
|
|
else if(mediaType == Localization.Core.Media_Type_Name_MDW_74)
|
|
|
|
|
mediaTest.MediumTypeName = "MDW-74";
|
|
|
|
|
else if(mediaType == Localization.Core.Media_Type_Name_MDW_80)
|
|
|
|
|
mediaTest.MediumTypeName = "MDW-80";
|
|
|
|
|
else if(mediaType == Localization.Core.Media_Type_Name_MiniDisc)
|
|
|
|
|
mediaTest.MediumTypeName = "MiniDisc";
|
2018-11-25 20:27:38 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
mediaTest.Manufacturer = "SONY";
|
|
|
|
|
mediaTest.MediaIsRecognized = mediaIsRecognized;
|
|
|
|
|
mediaTests.Add(mediaTest);
|
2018-11-25 22:15:38 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
dev.AllowMediumRemoval(out buffer, dev.Timeout, out _);
|
|
|
|
|
dev.EjectTray(out buffer, dev.Timeout, out _);
|
|
|
|
|
}
|
2020-05-14 03:41:49 +01:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
report.SCSI.RemovableMedias = mediaTests;
|
|
|
|
|
}
|
2020-05-14 03:41:49 +01:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
{
|
|
|
|
|
if(removable)
|
|
|
|
|
{
|
2021-09-13 18:08:44 +01:00
|
|
|
List<TestedMedia> mediaTests = new();
|
2020-05-14 03:41:49 +01:00
|
|
|
|
2022-11-18 11:18:45 +00:00
|
|
|
while(AnsiConsole.Confirm($"[italic]{UI.Do_you_have_media_you_can_insert}[/]"))
|
2020-05-14 03:41:49 +01:00
|
|
|
{
|
2022-11-18 11:18:45 +00:00
|
|
|
AaruConsole.WriteLine(UI.Please_insert_it_in_the_drive);
|
2020-05-14 03:41:49 +01:00
|
|
|
|
2022-11-15 15:58:43 +00:00
|
|
|
System.Console.ReadKey(true);
|
2020-05-14 03:41:49 +01:00
|
|
|
|
2022-11-18 11:18:45 +00:00
|
|
|
mediumTypeName = AnsiConsole.Ask<string>(UI.Please_write_description_of_media_type);
|
2022-03-06 13:29:38 +00:00
|
|
|
|
|
|
|
|
mediumManufacturer =
|
2022-11-18 11:18:45 +00:00
|
|
|
AnsiConsole.Ask<string>(Localization.Core.Please_write_media_manufacturer);
|
2022-03-06 13:29:38 +00:00
|
|
|
|
2022-11-18 11:18:45 +00:00
|
|
|
mediumModel = AnsiConsole.Ask<string>(UI.Please_write_media_model);
|
2022-03-06 13:29:38 +00:00
|
|
|
|
2022-11-15 15:58:43 +00:00
|
|
|
bool mediaIsRecognized = true;
|
2020-05-14 03:41:49 +01:00
|
|
|
|
2022-11-15 15:58:43 +00:00
|
|
|
Core.Spectre.ProgressSingleSpinner(ctx =>
|
2020-05-14 03:41:49 +01:00
|
|
|
{
|
2022-11-18 11:18:45 +00:00
|
|
|
ctx.AddTask(Localization.Core.Waiting_for_drive_to_become_ready).IsIndeterminate();
|
2021-09-13 18:08:44 +01:00
|
|
|
sense = dev.ScsiTestUnitReady(out senseBuffer, dev.Timeout, out _);
|
|
|
|
|
|
|
|
|
|
if(!sense)
|
|
|
|
|
return;
|
|
|
|
|
|
2021-03-26 00:37:54 +00:00
|
|
|
DecodedSense? decSense = Sense.Decode(senseBuffer);
|
2020-05-14 03:41:49 +01:00
|
|
|
|
|
|
|
|
if(decSense.HasValue)
|
2021-03-26 00:37:54 +00:00
|
|
|
switch(decSense.Value.ASC)
|
2020-05-14 03:41:49 +01:00
|
|
|
{
|
2021-03-26 00:37:54 +00:00
|
|
|
case 0x3A:
|
2020-05-14 03:41:49 +01:00
|
|
|
{
|
2022-11-15 15:58:43 +00:00
|
|
|
int leftRetries = 20;
|
2020-05-14 03:41:49 +01:00
|
|
|
|
2021-03-26 00:37:54 +00:00
|
|
|
while(leftRetries > 0)
|
|
|
|
|
{
|
|
|
|
|
Thread.Sleep(2000);
|
2021-09-13 18:08:44 +01:00
|
|
|
|
2022-03-07 07:36:44 +00:00
|
|
|
sense = dev.ScsiTestUnitReady(out senseBuffer, dev.Timeout, out _);
|
2020-05-14 03:41:49 +01:00
|
|
|
|
2021-03-26 00:37:54 +00:00
|
|
|
if(!sense)
|
|
|
|
|
break;
|
2020-05-14 03:41:49 +01:00
|
|
|
|
2021-03-26 00:37:54 +00:00
|
|
|
leftRetries--;
|
|
|
|
|
}
|
2020-05-14 03:41:49 +01:00
|
|
|
|
2021-03-26 00:37:54 +00:00
|
|
|
mediaIsRecognized &= !sense;
|
2020-05-14 03:41:49 +01:00
|
|
|
|
2021-03-26 00:37:54 +00:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
case 0x04 when decSense.Value.ASCQ == 0x01:
|
2020-05-14 03:41:49 +01:00
|
|
|
{
|
2022-11-15 15:58:43 +00:00
|
|
|
int leftRetries = 20;
|
2020-05-14 03:41:49 +01:00
|
|
|
|
2021-03-26 00:37:54 +00:00
|
|
|
while(leftRetries > 0)
|
|
|
|
|
{
|
|
|
|
|
Thread.Sleep(2000);
|
2021-09-13 18:08:44 +01:00
|
|
|
|
2022-03-07 07:36:44 +00:00
|
|
|
sense = dev.ScsiTestUnitReady(out senseBuffer, dev.Timeout, out _);
|
2020-05-14 03:41:49 +01:00
|
|
|
|
2021-03-26 00:37:54 +00:00
|
|
|
if(!sense)
|
|
|
|
|
break;
|
2020-05-14 03:41:49 +01:00
|
|
|
|
2021-03-26 00:37:54 +00:00
|
|
|
leftRetries--;
|
|
|
|
|
}
|
2020-05-14 03:41:49 +01:00
|
|
|
|
2021-03-26 00:37:54 +00:00
|
|
|
mediaIsRecognized &= !sense;
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
default:
|
|
|
|
|
mediaIsRecognized = false;
|
|
|
|
|
|
|
|
|
|
break;
|
2020-05-14 03:41:49 +01:00
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
mediaIsRecognized = false;
|
2021-09-13 18:08:44 +01:00
|
|
|
});
|
2020-05-14 03:41:49 +01:00
|
|
|
|
|
|
|
|
var mediaTest = new TestedMedia();
|
|
|
|
|
|
|
|
|
|
if(mediaIsRecognized)
|
|
|
|
|
{
|
|
|
|
|
mediaTest = reporter.ReportScsiMedia();
|
|
|
|
|
|
2022-03-07 07:36:44 +00:00
|
|
|
if((mediaTest.SupportsReadLong == true || mediaTest.SupportsReadLong16 == true) &&
|
|
|
|
|
mediaTest.LongBlockSize == mediaTest.BlockSize &&
|
2022-11-18 11:18:45 +00:00
|
|
|
AnsiConsole.Confirm($"[italic]{Localization.Core.Try_to_find_SCSI_READ_LONG_size
|
|
|
|
|
}[/]"))
|
2021-09-13 18:08:44 +01:00
|
|
|
AnsiConsole.Progress().AutoClear(true).HideCompleted(true).
|
|
|
|
|
Columns(new TaskDescriptionColumn(), new ProgressBarColumn(),
|
|
|
|
|
new PercentageColumn()).Start(ctx =>
|
|
|
|
|
{
|
2022-11-18 11:18:45 +00:00
|
|
|
ProgressTask task =
|
|
|
|
|
ctx.AddTask(Localization.Core.Trying_to_READ_LONG);
|
|
|
|
|
|
2021-09-13 18:08:44 +01:00
|
|
|
task.MaxValue = ushort.MaxValue;
|
2020-05-14 03:41:49 +01:00
|
|
|
|
2022-11-15 15:58:43 +00:00
|
|
|
for(ushort i = (ushort)mediaTest.BlockSize;; i++)
|
2021-09-13 18:08:44 +01:00
|
|
|
{
|
|
|
|
|
task.Value = i;
|
2020-05-14 03:41:49 +01:00
|
|
|
|
2022-11-18 11:18:45 +00:00
|
|
|
task.Description =
|
|
|
|
|
string.
|
|
|
|
|
Format(Localization.Core.Trying_READ_LONG_with_size_0,
|
|
|
|
|
i);
|
2020-05-14 03:41:49 +01:00
|
|
|
|
2021-09-13 18:08:44 +01:00
|
|
|
sense = mediaTest.SupportsReadLong16 == true
|
2022-03-07 07:36:44 +00:00
|
|
|
? dev.ReadLong16(out buffer, out senseBuffer,
|
|
|
|
|
false, 0, i, dev.Timeout, out _)
|
|
|
|
|
: dev.ReadLong10(out buffer, out senseBuffer,
|
|
|
|
|
false, false, 0, i, dev.Timeout,
|
|
|
|
|
out _);
|
2020-05-14 03:41:49 +01:00
|
|
|
|
2021-09-13 18:08:44 +01:00
|
|
|
if(!sense)
|
|
|
|
|
{
|
|
|
|
|
mediaTest.LongBlockSize = i;
|
2020-05-14 03:41:49 +01:00
|
|
|
|
2021-09-13 18:08:44 +01:00
|
|
|
break;
|
|
|
|
|
}
|
2020-05-14 03:41:49 +01:00
|
|
|
|
2021-09-13 18:08:44 +01:00
|
|
|
if(i == ushort.MaxValue)
|
|
|
|
|
break;
|
|
|
|
|
}
|
2020-05-14 03:41:49 +01:00
|
|
|
|
2021-09-13 18:08:44 +01:00
|
|
|
AaruConsole.WriteLine();
|
|
|
|
|
});
|
2020-05-14 03:41:49 +01:00
|
|
|
|
|
|
|
|
if(mediaTest.SupportsReadLong == true &&
|
|
|
|
|
mediaTest.LongBlockSize != mediaTest.BlockSize)
|
|
|
|
|
{
|
2022-11-15 15:58:43 +00:00
|
|
|
Core.Spectre.ProgressSingleSpinner(ctx =>
|
2021-09-13 18:08:44 +01:00
|
|
|
{
|
2022-11-18 11:18:45 +00:00
|
|
|
ctx.AddTask(Localization.Core.Trying_SCSI_READ_LONG_10).IsIndeterminate();
|
2021-09-13 18:08:44 +01:00
|
|
|
|
|
|
|
|
sense = dev.ReadLong10(out buffer, out senseBuffer, false, false, 0,
|
2022-03-07 07:36:44 +00:00
|
|
|
(ushort)mediaTest.LongBlockSize, dev.Timeout, out _);
|
2021-09-13 18:08:44 +01:00
|
|
|
});
|
2020-05-14 03:41:49 +01:00
|
|
|
|
|
|
|
|
if(!sense)
|
|
|
|
|
mediaTest.ReadLong10Data = buffer;
|
|
|
|
|
}
|
2021-03-26 05:38:40 +00:00
|
|
|
|
|
|
|
|
if(mediaTest.SupportsReadLong16 == true &&
|
|
|
|
|
mediaTest.LongBlockSize != mediaTest.BlockSize)
|
|
|
|
|
{
|
2022-11-15 15:58:43 +00:00
|
|
|
Core.Spectre.ProgressSingleSpinner(ctx =>
|
2021-09-13 18:08:44 +01:00
|
|
|
{
|
2022-11-18 11:18:45 +00:00
|
|
|
ctx.AddTask(Localization.Core.Trying_SCSI_READ_LONG_16).IsIndeterminate();
|
2021-09-13 18:08:44 +01:00
|
|
|
|
|
|
|
|
sense = dev.ReadLong16(out buffer, out senseBuffer, false, 0,
|
2022-03-07 07:36:44 +00:00
|
|
|
(ushort)mediaTest.LongBlockSize, dev.Timeout, out _);
|
2021-09-13 18:08:44 +01:00
|
|
|
});
|
2021-03-26 05:38:40 +00:00
|
|
|
|
|
|
|
|
if(!sense)
|
|
|
|
|
mediaTest.ReadLong16Data = buffer;
|
|
|
|
|
}
|
2020-05-14 03:41:49 +01:00
|
|
|
}
|
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
mediaTest.MediumTypeName = mediumTypeName;
|
|
|
|
|
mediaTest.Manufacturer = mediumManufacturer;
|
|
|
|
|
mediaTest.Model = mediumModel;
|
2020-05-14 03:41:49 +01:00
|
|
|
mediaTest.MediaIsRecognized = mediaIsRecognized;
|
2022-03-06 13:29:38 +00:00
|
|
|
|
2020-05-14 03:41:49 +01:00
|
|
|
mediaTests.Add(mediaTest);
|
|
|
|
|
|
|
|
|
|
dev.AllowMediumRemoval(out buffer, dev.Timeout, out _);
|
|
|
|
|
dev.EjectTray(out buffer, dev.Timeout, out _);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
report.SCSI.RemovableMedias = mediaTests;
|
|
|
|
|
}
|
2022-03-06 13:29:38 +00:00
|
|
|
else
|
2018-11-25 20:08:28 +00:00
|
|
|
{
|
2022-03-06 13:29:38 +00:00
|
|
|
report.SCSI.ReadCapabilities = reporter.ReportScsi();
|
2018-11-25 20:08:28 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if((report.SCSI.ReadCapabilities.SupportsReadLong == true ||
|
|
|
|
|
report.SCSI.ReadCapabilities.SupportsReadLong16 == true) &&
|
|
|
|
|
report.SCSI.ReadCapabilities.LongBlockSize == report.SCSI.ReadCapabilities.BlockSize)
|
2022-11-18 11:18:45 +00:00
|
|
|
if(AnsiConsole.Confirm($"[italic]{Localization.Core.Try_to_find_SCSI_READ_LONG_size
|
|
|
|
|
}[/]"))
|
2022-03-06 13:29:38 +00:00
|
|
|
AnsiConsole.Progress().AutoClear(true).HideCompleted(true).
|
|
|
|
|
Columns(new TaskDescriptionColumn(), new ProgressBarColumn(),
|
|
|
|
|
new PercentageColumn()).Start(ctx =>
|
2018-11-25 20:08:28 +00:00
|
|
|
{
|
2022-11-18 11:18:45 +00:00
|
|
|
ProgressTask task =
|
|
|
|
|
ctx.AddTask(Localization.Core.Trying_to_READ_LONG);
|
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
task.MaxValue = ushort.MaxValue;
|
2019-12-07 19:54:27 +00:00
|
|
|
|
2022-11-15 15:58:43 +00:00
|
|
|
for(ushort i = (ushort)report.SCSI.ReadCapabilities.BlockSize;; i++)
|
2021-03-26 00:37:54 +00:00
|
|
|
{
|
2022-03-06 13:29:38 +00:00
|
|
|
task.Value = i;
|
2018-11-25 20:08:28 +00:00
|
|
|
|
2022-11-18 11:18:45 +00:00
|
|
|
task.Description =
|
|
|
|
|
string.
|
|
|
|
|
Format(Localization.Core.Trying_READ_LONG_with_size_0,
|
|
|
|
|
i);
|
2020-04-03 02:49:24 +01:00
|
|
|
|
2022-03-07 07:36:44 +00:00
|
|
|
sense = report.SCSI.ReadCapabilities.SupportsReadLong16 == true
|
|
|
|
|
? dev.ReadLong16(out buffer, out senseBuffer, false,
|
|
|
|
|
0, i, dev.Timeout, out _)
|
|
|
|
|
: dev.ReadLong10(out buffer, out senseBuffer, false,
|
|
|
|
|
false, 0, i, dev.Timeout, out _);
|
2021-03-26 00:37:54 +00:00
|
|
|
|
|
|
|
|
if(!sense)
|
2021-09-13 18:08:44 +01:00
|
|
|
{
|
2022-03-06 13:29:38 +00:00
|
|
|
report.SCSI.ReadCapabilities.LongBlockSize = i;
|
2021-09-13 18:08:44 +01:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
break;
|
|
|
|
|
}
|
2018-11-25 20:08:28 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(i == ushort.MaxValue)
|
|
|
|
|
break;
|
|
|
|
|
}
|
2019-11-01 01:10:48 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
AaruConsole.WriteLine();
|
|
|
|
|
});
|
2019-12-07 19:54:27 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(report.SCSI.ReadCapabilities.SupportsReadLong == true &&
|
|
|
|
|
report.SCSI.ReadCapabilities.LongBlockSize != report.SCSI.ReadCapabilities.BlockSize)
|
|
|
|
|
{
|
2022-11-15 15:58:43 +00:00
|
|
|
Core.Spectre.ProgressSingleSpinner(ctx =>
|
2018-11-25 20:08:28 +00:00
|
|
|
{
|
2022-11-18 11:18:45 +00:00
|
|
|
ctx.AddTask(Localization.Core.Trying_SCSI_READ_LONG_10).IsIndeterminate();
|
2021-09-13 18:08:44 +01:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
sense = dev.ReadLong10(out buffer, out senseBuffer, false, false, 0,
|
|
|
|
|
(ushort)report.SCSI.ReadCapabilities.LongBlockSize,
|
|
|
|
|
dev.Timeout, out _);
|
|
|
|
|
});
|
2019-12-07 19:54:27 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(!sense)
|
|
|
|
|
report.SCSI.ReadCapabilities.ReadLong10Data = buffer;
|
|
|
|
|
}
|
2021-03-26 05:38:40 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(report.SCSI.ReadCapabilities.SupportsReadLong16 == true &&
|
|
|
|
|
report.SCSI.ReadCapabilities.LongBlockSize != report.SCSI.ReadCapabilities.BlockSize)
|
|
|
|
|
{
|
2022-11-15 15:58:43 +00:00
|
|
|
Core.Spectre.ProgressSingleSpinner(ctx =>
|
2021-03-26 05:38:40 +00:00
|
|
|
{
|
2022-11-18 11:18:45 +00:00
|
|
|
ctx.AddTask(Localization.Core.Trying_SCSI_READ_LONG_16).IsIndeterminate();
|
2021-09-13 18:08:44 +01:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
sense = dev.ReadLong16(out buffer, out senseBuffer, false, 0,
|
|
|
|
|
report.SCSI.ReadCapabilities.LongBlockSize.Value,
|
|
|
|
|
dev.Timeout, out _);
|
|
|
|
|
});
|
2021-03-26 05:38:40 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(!sense)
|
|
|
|
|
report.SCSI.ReadCapabilities.ReadLong16Data = buffer;
|
2018-11-25 20:08:28 +00:00
|
|
|
}
|
|
|
|
|
}
|
2022-03-06 13:29:38 +00:00
|
|
|
|
|
|
|
|
break;
|
2018-11-25 20:08:28 +00:00
|
|
|
}
|
2022-03-06 13:29:38 +00:00
|
|
|
}
|
2018-11-25 20:08:28 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
break;
|
2022-11-18 11:18:45 +00:00
|
|
|
default: throw new NotSupportedException(Localization.Core.Unknown_device_type);
|
2022-03-06 13:29:38 +00:00
|
|
|
}
|
* commandline:
* DiscImageChef.Settings/Settings.cs:
* DiscImageChef.Settings/docs/README.txt:
* DiscImageChef.Settings/packages.config:
* DiscImageChef.Settings/docs/LICENSE.txt:
* DiscImageChef.Settings/docs/ChangeLog.txt:
* DiscImageChef.Settings/docs/mono/index.xml:
* DiscImageChef.Settings/docs/html/index.html:
* DiscImageChef.Settings/Properties/AssemblyInfo.cs:
* DiscImageChef.Settings/DiscImageChef.Settings.csproj:
* DiscImageChef.Settings/docs/mono/ns-Claunia.PropertyList.xml:
* DiscImageChef.Settings/docs/mono/Claunia.PropertyList/UID.xml:
* DiscImageChef.Settings/docs/html/Claunia.PropertyList/UID.html:
* DiscImageChef.Settings/docs/mono/Claunia.PropertyList/NSSet.xml:
* DiscImageChef.Settings/docs/html/Claunia.PropertyList/index.html:
* DiscImageChef.Settings/docs/html/Claunia.PropertyList/NSSet.html:
* DiscImageChef.Settings/docs/mono/Claunia.PropertyList/NSDate.xml:
* DiscImageChef.Settings/docs/mono/Claunia.PropertyList/NSData.xml:
* DiscImageChef.Settings/docs/html/Claunia.PropertyList/NSDate.html:
* DiscImageChef.Settings/docs/html/Claunia.PropertyList/NSData.html:
* DiscImageChef.Settings/docs/mono/Claunia.PropertyList/NSArray.xml:
* DiscImageChef.Settings/docs/mono/Claunia.PropertyList/NSNumber.xml:
* DiscImageChef.Settings/docs/mono/Claunia.PropertyList/NSString.xml:
* DiscImageChef.Settings/docs/mono/Claunia.PropertyList/NSObject.xml:
* DiscImageChef.Settings/docs/html/Claunia.PropertyList/NSArray.html:
* DiscImageChef.Settings/docs/html/Claunia.PropertyList/NSNumber.html:
* DiscImageChef.Settings/docs/html/Claunia.PropertyList/NSString.html:
* DiscImageChef.Settings/docs/html/Claunia.PropertyList/NSObject.html:
* DiscImageChef.Settings/docs/mono/Claunia.PropertyList/NSDictionary.xml:
* DiscImageChef.Settings/docs/html/Claunia.PropertyList/NSDictionary.html:
* DiscImageChef.Settings/docs/mono/Claunia.PropertyList/PropertyListParser.xml:
* DiscImageChef.Settings/docs/html/Claunia.PropertyList/PropertyListParser.html:
* DiscImageChef.Settings/docs/mono/Claunia.PropertyList/XmlPropertyListParser.xml:
* DiscImageChef.Settings/docs/html/Claunia.PropertyList/XmlPropertyListParser.html:
* DiscImageChef.Settings/docs/mono/Claunia.PropertyList/ASCIIPropertyListParser.xml:
* DiscImageChef.Settings/docs/html/Claunia.PropertyList/ASCIIPropertyListParser.html:
* DiscImageChef.Settings/docs/mono/Claunia.PropertyList/BinaryPropertyListParser.xml:
* DiscImageChef.Settings/docs/mono/Claunia.PropertyList/BinaryPropertyListWriter.xml:
* DiscImageChef.Settings/docs/html/Claunia.PropertyList/BinaryPropertyListWriter.html:
* DiscImageChef.Settings/docs/html/Claunia.PropertyList/BinaryPropertyListParser.html:
* DiscImageChef.Settings/docs/mono/Claunia.PropertyList/PropertyListFormatException.xml:
* DiscImageChef.Settings/docs/html/Claunia.PropertyList/PropertyListFormatException.html:
Added supports for settings
* DiscImageChef/Commands/Configure.cs:
Added support for settings.
* DiscImageChef/Core/Statistics.cs:
* DiscImageChef/Commands/Verify.cs:
* DiscImageChef/Commands/Entropy.cs:
* DiscImageChef/Commands/Formats.cs:
* DiscImageChef/Commands/PrintHex.cs:
* DiscImageChef/Commands/MediaInfo.cs:
* DiscImageChef/Commands/Statistics.cs:
Added statistics.
* DiscImageChef.Decoders/SCSI/Inquiry.cs:
Corrected bug on inquiry decoding.
* DiscImageChef.Decoders/SCSI/Modes.cs:
Corrected bug on decoding mode page 2Ah without write
performance descriptors.
Corrected bug when there is a vendor page 0 in mode sense
decoding.
* DiscImageChef.Devices/Device/Constructor.cs:
Corrected detecting USB or FireWire attached CD/DVD/BD and
tape drives.
Try ATA identify on USB or FireWire that don't have SCSI
INQUIRY.
* DiscImageChef.DiscImages/CDRWin.cs:
Corrected CD-ROM XA vs CD-ROM detection.
* DiscImageChef.Partitions/AppleMap.cs:
Corrected big endian working.
Added debug output.
* DiscImageChef.sln:
Added supports for settings.
* DiscImageChef/Commands/Decode.cs:
* DiscImageChef/Commands/Analyze.cs:
* DiscImageChef/Commands/Compare.cs:
* DiscImageChef/Commands/Checksum.cs:
* DiscImageChef/Commands/Benchmark.cs:
* DiscImageChef/Commands/DeviceInfo.cs:
* DiscImageChef/Commands/CreateSidecar.cs:
Added statistics.
* DiscImageChef/Commands/DeviceReport.cs:
Added statistics.
Correct handling empty inquiry string fields.
Suppose it is not removable, til proved wrong.
Corrected MODE SENSE (6/10) detection and calling order.
If device is MMC type but reports neither mode page 2Ah
neither GET CONFIGURATION, try all CDs (old drives work like
that).
Try reading Lead-In and Lead-Out in Audio CD using Audio READ
CD commands.
Corrected READ LONG information handling, some drives return
2s-complement in 32 bit. Upper 16 bits are ignored.
Added support for DVD raw block (37856 bytes).
Check READ LONG up to 36 times the cooked block size. That
should be enough to detect huge blocked media (like DVD and
BD) without taking ages.
If READ LONG size had to be bruteforced, and debug is
activated, save the result.
* DiscImageChef/Commands/DumpMedia.cs:
Added statistics.
Corrected READ LONG information handling, some drives return
2s-complement in 32 bit. Upper 16 bits are ignored.
Start trying with 64 blocks at a time. Some drives report to
be able to read 255 at a time, but they really don't, they
take a lot longer to read.
* DiscImageChef/Commands/MediaScan.cs:
Added statistics.
Start trying with 64 blocks at a time. Some drives report to
be able to read 255 at a time, but they really don't, they
take a lot longer to read.
* DiscImageChef/DiscImageChef.csproj:
Added support for settings.
Added statistics.
* DiscImageChef/Main.cs:
* DiscImageChef/Options.cs:
Added support for settings.
Added statistics.
2016-02-03 18:58:11 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
var jsonFs = new FileStream(jsonFile, FileMode.Create);
|
|
|
|
|
var jsonSw = new StreamWriter(jsonFs);
|
2019-12-07 19:54:27 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
jsonSw.Write(JsonConvert.SerializeObject(report, Formatting.Indented, new JsonSerializerSettings
|
|
|
|
|
{
|
|
|
|
|
NullValueHandling = NullValueHandling.Ignore
|
|
|
|
|
}));
|
2019-12-07 19:54:27 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
jsonSw.Close();
|
|
|
|
|
jsonFs.Close();
|
* DiscImageChef.CommonTypes/MediaTypeFromSCSI.cs:
* DiscImageChef.CommonTypes/DiscImageChef.CommonTypes.csproj:
Added method to calculate MediaType from SCSI parameters
(mode, density, medium type, device type, etc).
* DiscImageChef.Metadata/DeviceReport.cs:
Added command to guess drive and media parameters and output
an XML report of them.
* DiscImageChef/Commands/DeviceReport.cs:
* DiscImageChef.Metadata/DiscImageChef.Metadata.csproj:
Added command to guess drive and media parameters and output
an XML report of them.
* DiscImageChef/Commands/DumpMedia.cs:
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Core/Checksum.cs:
* DiscImageChef/Commands/CreateSidecar.cs:
Moved checksum generation to a separate class.
* CICMMetadata:
Added support for ADIP.
* DiscImageChef.CommonTypes/MediaType.cs:
Added parameters of UDO media.
Moved DataPlay outside of Iomega, as it's not from that
manufacturer.
Added missing Exatape media and corrected 160m XL one.
Added SyJet media.
Added all ECMA defined magneto-optical (sectors calculated
from specifications, unchecked).
Added PD media.
Added Imation 320Gb RDX.
Added generic USB flash drives.
* DiscImageChef.Decoders/SCSI/Enums.cs:
Make enumerations public.
* DiscImageChef.Decoders/SCSI/Inquiry.cs:
* DiscImageChef.Devices/Device/Constructor.cs:
Trim space padded strings on SCSI INQUIRY.
* DiscImageChef.Devices/Device/ScsiCommands/MMC.cs:
Added PREVENT ALLOW MEDIUM REMOVAL.
Added START STOP UNIT.
* DiscImageChef.Devices/Device/ScsiCommands/NEC.cs:
Rename NEC methods.
* DiscImageChef.Devices/Device/ScsiCommands/Pioneer.cs:
Corrected Pioneer transfer length calculation.
* DiscImageChef.Devices/Device/ScsiCommands/Plextor.cs:
Renamed Plextor methods.
* DiscImageChef.Devices/Device/ScsiCommands/SPC.cs:
Renamed SSC PREVENT ALLOW MEDIUM REMOVAL to uncollide with
MMC same name but different command.
* DiscImageChef.Devices/DiscImageChef.Devices.csproj:
Set platform target to x86 (does it really matter?).
* DiscImageChef.Devices/Linux/Command.cs:
Reduced allocation for readlink() to current kernel
MAX_PATH.
* DiscImageChef.Devices/Linux/Enums.cs:
Modified Linux ioctl to 32-bit. Works on 64-bit also. Solves
commands not working on 32-bit environments.
* DiscImageChef.DiscImages/ZZZRawImage.cs:
Changed ECMA-184 and ECMA-183 enums.
* DiscImageChef.Metadata/Dimensions.cs:
Added all ECMA defined magneto-opticals.
Added PD media.
Added 320Gb RDX.
Corrected Exatape 160m XL.
Added Exatape 22m and 28m.
* DiscImageChef.Metadata/MediaType.cs:
Added 356mm magneto-optical media.
Changed ECMA-184 and ECMA-183 enums.
Added USB generic flash drive.
* DiscImageChef/Commands/DeviceInfo.cs:
Corrected SCSI INQUIRY naming.
Corrected SCSI MODE SENSE (6) parameters.
Reduced SCSI MODE SENSE timeout, some devices just get stuck
with unsupported MODE SENSE commanda and must be left to
timeout.
Changed FUJITSU vendor string comparison.
* DiscImageChef/Commands/MediaInfo.cs:
Added method to calculate MediaType from SCSI parameters
(mode, density, medium type, device type, etc).
Changed some error WriteLine() to debug ones. Too much
verbosity.
Added DVD media type decoding from PFI.
Found a drive that dumps ADIP, enabling it again (not
decoded).
* DiscImageChef/Commands/MediaScan.cs:
Added option to generate ImgBurn compatible log to
media-scan command.
* DiscImageChef/DiscImageChef.csproj:
Moved checksum generation to a separate class.
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Main.cs:
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Options.cs:
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
Added option to generate ImgBurn compatible log to media-scan
command.
2016-01-31 08:05:56 +00:00
|
|
|
|
2022-11-15 15:58:43 +00:00
|
|
|
using(var ctx = AaruContext.Create(Settings.Settings.LocalDbPath))
|
2022-03-06 13:29:38 +00:00
|
|
|
{
|
|
|
|
|
ctx.Reports.Add(new Report(report));
|
|
|
|
|
ctx.SaveChanges();
|
|
|
|
|
}
|
2018-11-27 01:42:38 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
// TODO:
|
2022-11-15 15:58:43 +00:00
|
|
|
if(Settings.Settings.Current.ShareReports)
|
2022-03-06 13:29:38 +00:00
|
|
|
Remote.SubmitReport(report);
|
2019-12-07 19:54:27 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
return (int)ErrorNumber.NoError;
|
* DiscImageChef.CommonTypes/MediaTypeFromSCSI.cs:
* DiscImageChef.CommonTypes/DiscImageChef.CommonTypes.csproj:
Added method to calculate MediaType from SCSI parameters
(mode, density, medium type, device type, etc).
* DiscImageChef.Metadata/DeviceReport.cs:
Added command to guess drive and media parameters and output
an XML report of them.
* DiscImageChef/Commands/DeviceReport.cs:
* DiscImageChef.Metadata/DiscImageChef.Metadata.csproj:
Added command to guess drive and media parameters and output
an XML report of them.
* DiscImageChef/Commands/DumpMedia.cs:
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Core/Checksum.cs:
* DiscImageChef/Commands/CreateSidecar.cs:
Moved checksum generation to a separate class.
* CICMMetadata:
Added support for ADIP.
* DiscImageChef.CommonTypes/MediaType.cs:
Added parameters of UDO media.
Moved DataPlay outside of Iomega, as it's not from that
manufacturer.
Added missing Exatape media and corrected 160m XL one.
Added SyJet media.
Added all ECMA defined magneto-optical (sectors calculated
from specifications, unchecked).
Added PD media.
Added Imation 320Gb RDX.
Added generic USB flash drives.
* DiscImageChef.Decoders/SCSI/Enums.cs:
Make enumerations public.
* DiscImageChef.Decoders/SCSI/Inquiry.cs:
* DiscImageChef.Devices/Device/Constructor.cs:
Trim space padded strings on SCSI INQUIRY.
* DiscImageChef.Devices/Device/ScsiCommands/MMC.cs:
Added PREVENT ALLOW MEDIUM REMOVAL.
Added START STOP UNIT.
* DiscImageChef.Devices/Device/ScsiCommands/NEC.cs:
Rename NEC methods.
* DiscImageChef.Devices/Device/ScsiCommands/Pioneer.cs:
Corrected Pioneer transfer length calculation.
* DiscImageChef.Devices/Device/ScsiCommands/Plextor.cs:
Renamed Plextor methods.
* DiscImageChef.Devices/Device/ScsiCommands/SPC.cs:
Renamed SSC PREVENT ALLOW MEDIUM REMOVAL to uncollide with
MMC same name but different command.
* DiscImageChef.Devices/DiscImageChef.Devices.csproj:
Set platform target to x86 (does it really matter?).
* DiscImageChef.Devices/Linux/Command.cs:
Reduced allocation for readlink() to current kernel
MAX_PATH.
* DiscImageChef.Devices/Linux/Enums.cs:
Modified Linux ioctl to 32-bit. Works on 64-bit also. Solves
commands not working on 32-bit environments.
* DiscImageChef.DiscImages/ZZZRawImage.cs:
Changed ECMA-184 and ECMA-183 enums.
* DiscImageChef.Metadata/Dimensions.cs:
Added all ECMA defined magneto-opticals.
Added PD media.
Added 320Gb RDX.
Corrected Exatape 160m XL.
Added Exatape 22m and 28m.
* DiscImageChef.Metadata/MediaType.cs:
Added 356mm magneto-optical media.
Changed ECMA-184 and ECMA-183 enums.
Added USB generic flash drive.
* DiscImageChef/Commands/DeviceInfo.cs:
Corrected SCSI INQUIRY naming.
Corrected SCSI MODE SENSE (6) parameters.
Reduced SCSI MODE SENSE timeout, some devices just get stuck
with unsupported MODE SENSE commanda and must be left to
timeout.
Changed FUJITSU vendor string comparison.
* DiscImageChef/Commands/MediaInfo.cs:
Added method to calculate MediaType from SCSI parameters
(mode, density, medium type, device type, etc).
Changed some error WriteLine() to debug ones. Too much
verbosity.
Added DVD media type decoding from PFI.
Found a drive that dumps ADIP, enabling it again (not
decoded).
* DiscImageChef/Commands/MediaScan.cs:
Added option to generate ImgBurn compatible log to
media-scan command.
* DiscImageChef/DiscImageChef.csproj:
Moved checksum generation to a separate class.
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Main.cs:
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Options.cs:
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
Added option to generate ImgBurn compatible log to media-scan
command.
2016-01-31 08:05:56 +00:00
|
|
|
}
|
2020-07-20 04:34:16 +01:00
|
|
|
}
|