* DiscImageChef.Devices/Command.cs:

* DiscImageChef.Decoders/ATA/Errors.cs:
	* DiscImageChef/Commands/DeviceInfo.cs:
	* DiscImageChef.Devices/Linux/Command.cs:
	* DiscImageChef.Devices/Device/Commands.cs:
	* DiscImageChef.Devices/Device/AtaCommands.cs:
	* DiscImageChef.Devices/Device/Constructor.cs:
	* DiscImageChef.Devices/Device/AtapiCommands.cs:
	* DiscImageChef.Devices/DiscImageChef.Devices.csproj:
	* DiscImageChef.Decoders/DiscImageChef.Decoders.csproj:
	  Moved ATA register definition to a more common place.

	* DiscImageChef.Decoders/SCSI/Sense.cs:
	  Added information from SAT-4.
This commit is contained in:
2015-11-23 04:26:53 +00:00
parent a5ce129a2f
commit 57644ecb39
4 changed files with 134 additions and 2 deletions

111
ATA/Errors.cs Normal file
View File

@@ -0,0 +1,111 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : Errors.cs
// Version : 1.0
// Author(s) : Natalia Portillo
//
// Component : Component
//
// Revision : $Revision$
// Last change by : $Author$
// Date : $Date$
//
// --[ Description ] ----------------------------------------------------------
//
// Description
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright (C) 2011-2015 Claunia.com
// ****************************************************************************/
// //$Id$
using System;
namespace DiscImageChef.Decoders.ATA
{
public struct AtaRegistersCHS
{
public byte feature;
public byte sectorCount;
public byte sector;
public byte cylinderLow;
public byte cylinderHigh;
public byte deviceHead;
public byte command;
}
public struct AtaRegistersLBA28
{
public byte feature;
public byte sectorCount;
public byte lbaLow;
public byte lbaMid;
public byte lbaHigh;
public byte deviceHead;
public byte command;
}
public struct AtaRegistersLBA48
{
public ushort feature;
public ushort sectorCount;
public ushort lbaLow;
public ushort lbaMid;
public ushort lbaHigh;
public byte deviceHead;
public byte command;
}
public struct AtaErrorRegistersCHS
{
public byte status;
public byte error;
public byte sectorCount;
public byte sector;
public byte cylinderLow;
public byte cylinderHigh;
public byte deviceHead;
public byte command;
}
public struct AtaErrorRegistersLBA28
{
public byte status;
public byte error;
public byte sectorCount;
public byte lbaLow;
public byte lbaMid;
public byte lbaHigh;
public byte deviceHead;
public byte command;
}
public struct AtaErrorRegistersLBA48
{
public byte status;
public byte error;
public ushort sectorCount;
public ushort lbaLow;
public ushort lbaMid;
public ushort lbaHigh;
public byte deviceHead;
public byte command;
}
}

View File

@@ -1,3 +1,12 @@
2015-11-23 Natalia Portillo <claunia@claunia.com>
* ATA/Errors.cs:
* DiscImageChef.Decoders.csproj:
Moved ATA register definition to a more common place.
* SCSI/Sense.cs:
Added information from SAT-4.
2015-11-23 Natalia Portillo <claunia@claunia.com>
* SCSI/Sense.cs:

View File

@@ -83,6 +83,7 @@
<Compile Include="SCSI\MMC\Features.cs" />
<Compile Include="SCSI\DiscStructureCapabilities.cs" />
<Compile Include="SCSI\Sense.cs" />
<Compile Include="ATA\Errors.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup>

View File

@@ -38,6 +38,7 @@
using System;
using System.Text;
using System.Collections.Generic;
using DiscImageChef.Decoders.ATA;
namespace DiscImageChef.Decoders.SCSI
{
@@ -621,9 +622,19 @@ namespace DiscImageChef.Decoders.SCSI
throw new NotImplementedException("Check OSD");
}
public static void DecodeDescriptor09(byte[] descriptor)
public static AtaErrorRegistersLBA48 DecodeDescriptor09(byte[] descriptor)
{
throw new NotImplementedException("Check SAT-3");
AtaErrorRegistersLBA48 errorRegisters = new AtaErrorRegistersLBA48();
errorRegisters.error = descriptor[3];
errorRegisters.sectorCount = (ushort)((descriptor[4] << 8) + descriptor[5]);
errorRegisters.lbaLow = (ushort)((descriptor[6] << 8) + descriptor[7]);
errorRegisters.lbaMid = (ushort)((descriptor[8] << 8) + descriptor[9]);
errorRegisters.lbaHigh = (ushort)((descriptor[10] << 8) + descriptor[11]);
errorRegisters.deviceHead = descriptor[12];
errorRegisters.status = descriptor[13];
return errorRegisters;
}
public static void DecodeDescriptor0B(byte[] descriptor)