mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
* DiscImageChef.Devices/Device/AtaCommands/Ata28.cs:
Correct SEEK command to not transfer anything. * DiscImageChef.Devices/Device/AtaCommands/AtaCHS.cs: Correct SEEK command to not transfer anything. Added differentiation between READ and READ WITH RETRIES for CHS mode. Changed blocksize to unsigned on READ LONG. * DiscImageChef.Devices/Device/AtaCommands/MCPT.cs: Change MCPT enable and disable commands to use CHS registers. * DiscImageChef.Devices/Linux/Command.cs: Linux kernel granularity for SG_IO is only 1ms, use .NET counters for faster times. Solves "infinity" speeds on SSDs. * DiscImageChef/Commands/DumpMedia.cs: * DiscImageChef/Commands/MediaInfo.cs: * DiscImageChef/Commands/MediaScan.cs: * DiscImageChef.Metadata/DeviceReport.cs: * DiscImageChef/Commands/DeviceReport.cs: Added support for ATA devices. * DiscImageChef/Commands/DeviceInfo.cs: Added support for Media Card Pass Through detection and information.
This commit is contained in:
@@ -164,6 +164,11 @@ namespace DiscImageChef.Devices
|
||||
|
||||
|
||||
public bool Read(out byte[] buffer, out AtaErrorRegistersCHS statusRegisters, ushort cylinder, byte head, byte sector, byte count, uint timeout, out double duration)
|
||||
{
|
||||
return Read(out buffer, out statusRegisters, true, cylinder, head, sector, count, timeout, out duration);
|
||||
}
|
||||
|
||||
public bool Read(out byte[] buffer, out AtaErrorRegistersCHS statusRegisters, bool retry, ushort cylinder, byte head, byte sector, byte count, uint timeout, out double duration)
|
||||
{
|
||||
if (count == 0)
|
||||
buffer = new byte[512 * 256];
|
||||
@@ -172,7 +177,10 @@ namespace DiscImageChef.Devices
|
||||
AtaRegistersCHS registers = new AtaRegistersCHS();
|
||||
bool sense;
|
||||
|
||||
registers.command = (byte)AtaCommands.ReadRetry;
|
||||
if(retry)
|
||||
registers.command = (byte)AtaCommands.ReadRetry;
|
||||
else
|
||||
registers.command = (byte)AtaCommands.Read;
|
||||
registers.sectorCount = count;
|
||||
registers.cylinderHigh = (byte)((cylinder & 0xFF00) / 0x100);
|
||||
registers.cylinderLow = (byte)((cylinder & 0xFF) / 0x1);
|
||||
@@ -188,12 +196,12 @@ namespace DiscImageChef.Devices
|
||||
return sense;
|
||||
}
|
||||
|
||||
public bool ReadLong(out byte[] buffer, out AtaErrorRegistersCHS statusRegisters, ushort cylinder, byte head, byte sector, int blockSize, uint timeout, out double duration)
|
||||
public bool ReadLong(out byte[] buffer, out AtaErrorRegistersCHS statusRegisters, ushort cylinder, byte head, byte sector, uint blockSize, uint timeout, out double duration)
|
||||
{
|
||||
return ReadLong(out buffer, out statusRegisters, true, cylinder, head, sector, blockSize, timeout, out duration);
|
||||
}
|
||||
|
||||
public bool ReadLong(out byte[] buffer, out AtaErrorRegistersCHS statusRegisters, bool retry, ushort cylinder, byte head, byte sector, int blockSize, uint timeout, out double duration)
|
||||
public bool ReadLong(out byte[] buffer, out AtaErrorRegistersCHS statusRegisters, bool retry, ushort cylinder, byte head, byte sector, uint blockSize, uint timeout, out double duration)
|
||||
{
|
||||
buffer = new byte[blockSize];
|
||||
AtaRegistersCHS registers = new AtaRegistersCHS();
|
||||
@@ -230,7 +238,7 @@ namespace DiscImageChef.Devices
|
||||
registers.deviceHead = (byte)(head & 0x0F);
|
||||
registers.sector = sector;
|
||||
|
||||
lastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.PioIn, AtaTransferRegister.SectorCount,
|
||||
lastError = SendAtaCommand(registers, out statusRegisters, AtaProtocol.NonData, AtaTransferRegister.NoTransfer,
|
||||
ref buffer, timeout, true, out duration, out sense);
|
||||
error = lastError != 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user