mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
[Dump] Use new speed calculation algorithm.
This commit is contained in:
@@ -195,7 +195,6 @@ public partial class Dump
|
|||||||
|
|
||||||
MhddLog mhddLog;
|
MhddLog mhddLog;
|
||||||
IbgLog ibgLog;
|
IbgLog ibgLog;
|
||||||
double duration;
|
|
||||||
|
|
||||||
var ret = true;
|
var ret = true;
|
||||||
|
|
||||||
@@ -301,6 +300,7 @@ public partial class Dump
|
|||||||
_speedStopwatch.Reset();
|
_speedStopwatch.Reset();
|
||||||
ulong sectorSpeedStart = 0;
|
ulong sectorSpeedStart = 0;
|
||||||
InitProgress?.Invoke();
|
InitProgress?.Invoke();
|
||||||
|
double elapsed = 0;
|
||||||
|
|
||||||
for(ulong i = _resume.NextBlock; i < blocks; i += blocksToRead)
|
for(ulong i = _resume.NextBlock; i < blocks; i += blocksToRead)
|
||||||
{
|
{
|
||||||
@@ -327,15 +327,16 @@ public partial class Dump
|
|||||||
(long)i,
|
(long)i,
|
||||||
(long)blocks);
|
(long)blocks);
|
||||||
|
|
||||||
_speedStopwatch.Start();
|
_speedStopwatch.Restart();
|
||||||
bool error = ataReader.ReadBlocks(out cmdBuf, i, blocksToRead, out duration, out _, out _);
|
bool error = ataReader.ReadBlocks(out cmdBuf, i, blocksToRead, out _, out _, out _);
|
||||||
_speedStopwatch.Stop();
|
_speedStopwatch.Stop();
|
||||||
|
elapsed += _speedStopwatch.Elapsed.TotalMilliseconds;
|
||||||
|
|
||||||
_writeStopwatch.Restart();
|
_writeStopwatch.Restart();
|
||||||
|
|
||||||
if(!error)
|
if(!error)
|
||||||
{
|
{
|
||||||
mhddLog.Write(i, duration, blocksToRead);
|
mhddLog.Write(i, _speedStopwatch.Elapsed.TotalMilliseconds, blocksToRead);
|
||||||
ibgLog.Write(i, currentSpeed * 1024);
|
ibgLog.Write(i, currentSpeed * 1024);
|
||||||
|
|
||||||
outputFormat.WriteSectors(cmdBuf,
|
outputFormat.WriteSectors(cmdBuf,
|
||||||
@@ -355,7 +356,11 @@ public partial class Dump
|
|||||||
|
|
||||||
for(ulong b = i; b < i + _skip; b++) _resume.BadBlocks.Add(b);
|
for(ulong b = i; b < i + _skip; b++) _resume.BadBlocks.Add(b);
|
||||||
|
|
||||||
mhddLog.Write(i, duration < 500 ? 65535 : duration, _skip);
|
mhddLog.Write(i,
|
||||||
|
_speedStopwatch.Elapsed.TotalMilliseconds < 500
|
||||||
|
? 65535
|
||||||
|
: _speedStopwatch.Elapsed.TotalMilliseconds,
|
||||||
|
_skip);
|
||||||
|
|
||||||
ibgLog.Write(i, 0);
|
ibgLog.Write(i, 0);
|
||||||
|
|
||||||
@@ -381,12 +386,12 @@ public partial class Dump
|
|||||||
sectorSpeedStart += blocksToRead;
|
sectorSpeedStart += blocksToRead;
|
||||||
_resume.NextBlock = i + blocksToRead;
|
_resume.NextBlock = i + blocksToRead;
|
||||||
|
|
||||||
double elapsed = _speedStopwatch.Elapsed.TotalSeconds;
|
if(elapsed < 100) continue;
|
||||||
|
|
||||||
if(elapsed <= 0 || sectorSpeedStart * blockSize < 524288) continue;
|
currentSpeed = sectorSpeedStart * blockSize / (1048576 * elapsed / 1000);
|
||||||
|
ibgLog.Write(i, currentSpeed * 1024);
|
||||||
currentSpeed = sectorSpeedStart * blockSize / (1048576 * elapsed);
|
|
||||||
sectorSpeedStart = 0;
|
sectorSpeedStart = 0;
|
||||||
|
elapsed = 0;
|
||||||
_speedStopwatch.Reset();
|
_speedStopwatch.Reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -397,6 +402,7 @@ public partial class Dump
|
|||||||
_dumpStopwatch.Stop();
|
_dumpStopwatch.Stop();
|
||||||
EndProgress?.Invoke();
|
EndProgress?.Invoke();
|
||||||
mhddLog.Close();
|
mhddLog.Close();
|
||||||
|
currentSpeed = sectorSpeedStart * blockSize / (1048576 * elapsed / 1000);
|
||||||
|
|
||||||
ibgLog.Close(_dev,
|
ibgLog.Close(_dev,
|
||||||
blocks,
|
blocks,
|
||||||
@@ -442,8 +448,11 @@ public partial class Dump
|
|||||||
|
|
||||||
PulseProgress?.Invoke(string.Format(Localization.Core.Trimming_sector_0, badSector));
|
PulseProgress?.Invoke(string.Format(Localization.Core.Trimming_sector_0, badSector));
|
||||||
|
|
||||||
bool error =
|
bool error = ataReader.ReadBlock(out cmdBuf,
|
||||||
ataReader.ReadBlock(out cmdBuf, badSector, out duration, out recoveredError, out _);
|
badSector,
|
||||||
|
out double duration,
|
||||||
|
out recoveredError,
|
||||||
|
out _);
|
||||||
|
|
||||||
totalDuration += duration;
|
totalDuration += duration;
|
||||||
|
|
||||||
@@ -510,8 +519,11 @@ public partial class Dump
|
|||||||
pass));
|
pass));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool error =
|
bool error = ataReader.ReadBlock(out cmdBuf,
|
||||||
ataReader.ReadBlock(out cmdBuf, badSector, out duration, out recoveredError, out _);
|
badSector,
|
||||||
|
out double duration,
|
||||||
|
out recoveredError,
|
||||||
|
out _);
|
||||||
|
|
||||||
totalDuration += duration;
|
totalDuration += duration;
|
||||||
|
|
||||||
@@ -585,6 +597,7 @@ public partial class Dump
|
|||||||
_speedStopwatch.Reset();
|
_speedStopwatch.Reset();
|
||||||
ulong sectorSpeedStart = 0;
|
ulong sectorSpeedStart = 0;
|
||||||
InitProgress?.Invoke();
|
InitProgress?.Invoke();
|
||||||
|
double elapsed = 0;
|
||||||
|
|
||||||
for(ushort cy = 0; cy < cylinders; cy++)
|
for(ushort cy = 0; cy < cylinders; cy++)
|
||||||
{
|
{
|
||||||
@@ -613,21 +626,19 @@ public partial class Dump
|
|||||||
.Per(_oneSecond)
|
.Per(_oneSecond)
|
||||||
.Humanize()));
|
.Humanize()));
|
||||||
|
|
||||||
_speedStopwatch.Start();
|
_speedStopwatch.Restart();
|
||||||
|
|
||||||
bool error =
|
bool error = ataReader.ReadChs(out cmdBuf, cy, hd, sc, out _, out recoveredError);
|
||||||
ataReader.ReadChs(out cmdBuf, cy, hd, sc, out duration, out recoveredError);
|
|
||||||
|
|
||||||
_speedStopwatch.Stop();
|
_speedStopwatch.Stop();
|
||||||
|
|
||||||
totalDuration += duration;
|
totalDuration += _speedStopwatch.Elapsed.TotalMilliseconds;
|
||||||
|
|
||||||
_writeStopwatch.Restart();
|
_writeStopwatch.Restart();
|
||||||
|
|
||||||
if(!error || recoveredError)
|
if(!error || recoveredError)
|
||||||
{
|
{
|
||||||
mhddLog.Write(currentBlock, duration);
|
mhddLog.Write(currentBlock, _speedStopwatch.Elapsed.TotalMilliseconds);
|
||||||
ibgLog.Write(currentBlock, currentSpeed * 1024);
|
|
||||||
|
|
||||||
outputFormat.WriteSector(cmdBuf,
|
outputFormat.WriteSector(cmdBuf,
|
||||||
(ulong)((cy * heads + hd) * sectors + (sc - 1)),
|
(ulong)((cy * heads + hd) * sectors + (sc - 1)),
|
||||||
@@ -641,9 +652,11 @@ public partial class Dump
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
_resume.BadBlocks.Add(currentBlock);
|
_resume.BadBlocks.Add(currentBlock);
|
||||||
mhddLog.Write(currentBlock, duration < 500 ? 65535 : duration);
|
|
||||||
|
|
||||||
ibgLog.Write(currentBlock, 0);
|
mhddLog.Write(currentBlock,
|
||||||
|
_speedStopwatch.Elapsed.TotalMilliseconds < 500
|
||||||
|
? 65535
|
||||||
|
: _speedStopwatch.Elapsed.TotalMilliseconds);
|
||||||
|
|
||||||
outputFormat.WriteSector(new byte[blockSize],
|
outputFormat.WriteSector(new byte[blockSize],
|
||||||
(ulong)((cy * heads + hd) * sectors + (sc - 1)),
|
(ulong)((cy * heads + hd) * sectors + (sc - 1)),
|
||||||
@@ -658,12 +671,12 @@ public partial class Dump
|
|||||||
sectorSpeedStart++;
|
sectorSpeedStart++;
|
||||||
currentBlock++;
|
currentBlock++;
|
||||||
|
|
||||||
double elapsed = _speedStopwatch.Elapsed.TotalSeconds;
|
if(elapsed < 100) continue;
|
||||||
|
|
||||||
if(elapsed <= 0 || sectorSpeedStart * blockSize < 524288) continue;
|
currentSpeed = sectorSpeedStart * blockSize / (1048576 * elapsed / 1000);
|
||||||
|
ibgLog.Write(currentBlock, currentSpeed * 1024);
|
||||||
currentSpeed = sectorSpeedStart * blockSize / (1048576 * elapsed);
|
|
||||||
sectorSpeedStart = 0;
|
sectorSpeedStart = 0;
|
||||||
|
elapsed = 0;
|
||||||
_speedStopwatch.Reset();
|
_speedStopwatch.Reset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -106,7 +106,6 @@ partial class Dump
|
|||||||
var sense = true; // Sense indicator
|
var sense = true; // Sense indicator
|
||||||
byte[] cmdBuf = null; // Data buffer
|
byte[] cmdBuf = null; // Data buffer
|
||||||
ReadOnlySpan<byte> senseBuf = null; // Sense buffer
|
ReadOnlySpan<byte> senseBuf = null; // Sense buffer
|
||||||
double cmdDuration = 0; // Command execution time
|
|
||||||
const uint sectorSize = 2352; // Full sector size
|
const uint sectorSize = 2352; // Full sector size
|
||||||
newTrim = false;
|
newTrim = false;
|
||||||
PlextorSubchannel supportedPlextorSubchannel;
|
PlextorSubchannel supportedPlextorSubchannel;
|
||||||
@@ -126,9 +125,12 @@ partial class Dump
|
|||||||
var crossingLeadOut = false;
|
var crossingLeadOut = false;
|
||||||
var failedCrossingLeadOut = false;
|
var failedCrossingLeadOut = false;
|
||||||
var skippingLead = false;
|
var skippingLead = false;
|
||||||
|
double elapsed = 0;
|
||||||
|
|
||||||
for(ulong i = _resume.NextBlock; (long)i <= lastSector; i += blocksToRead)
|
for(ulong i = _resume.NextBlock; (long)i <= lastSector; i += blocksToRead)
|
||||||
{
|
{
|
||||||
|
_speedStopwatch.Reset();
|
||||||
|
|
||||||
if(_aborted)
|
if(_aborted)
|
||||||
{
|
{
|
||||||
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
||||||
@@ -273,10 +275,11 @@ partial class Dump
|
|||||||
blockSize,
|
blockSize,
|
||||||
blocksToRead,
|
blocksToRead,
|
||||||
supportedPlextorSubchannel,
|
supportedPlextorSubchannel,
|
||||||
out cmdDuration);
|
out _);
|
||||||
|
|
||||||
totalDuration += cmdDuration;
|
|
||||||
_speedStopwatch.Stop();
|
_speedStopwatch.Stop();
|
||||||
|
|
||||||
|
totalDuration += _speedStopwatch.Elapsed.TotalMilliseconds;
|
||||||
}
|
}
|
||||||
else if(readcd)
|
else if(readcd)
|
||||||
{
|
{
|
||||||
@@ -299,7 +302,7 @@ partial class Dump
|
|||||||
MmcErrorField.None,
|
MmcErrorField.None,
|
||||||
supportedSubchannel,
|
supportedSubchannel,
|
||||||
_dev.Timeout,
|
_dev.Timeout,
|
||||||
out cmdDuration);
|
out _);
|
||||||
|
|
||||||
_speedStopwatch.Stop();
|
_speedStopwatch.Stop();
|
||||||
|
|
||||||
@@ -332,12 +335,10 @@ partial class Dump
|
|||||||
MmcErrorField.None,
|
MmcErrorField.None,
|
||||||
supportedSubchannel,
|
supportedSubchannel,
|
||||||
_dev.Timeout,
|
_dev.Timeout,
|
||||||
out double cmdDuration2);
|
out _);
|
||||||
|
|
||||||
_speedStopwatch.Stop();
|
_speedStopwatch.Stop();
|
||||||
|
|
||||||
cmdDuration += cmdDuration2;
|
|
||||||
|
|
||||||
if(!sense &&
|
if(!sense &&
|
||||||
cmdBuf[0] == 0x00 &&
|
cmdBuf[0] == 0x00 &&
|
||||||
cmdBuf[1] == 0xFF &&
|
cmdBuf[1] == 0xFF &&
|
||||||
@@ -391,7 +392,7 @@ partial class Dump
|
|||||||
MmcErrorField.None,
|
MmcErrorField.None,
|
||||||
supportedSubchannel,
|
supportedSubchannel,
|
||||||
_dev.Timeout,
|
_dev.Timeout,
|
||||||
out cmdDuration);
|
out _);
|
||||||
|
|
||||||
_speedStopwatch.Stop();
|
_speedStopwatch.Stop();
|
||||||
|
|
||||||
@@ -418,7 +419,7 @@ partial class Dump
|
|||||||
MmcErrorField.None,
|
MmcErrorField.None,
|
||||||
supportedSubchannel,
|
supportedSubchannel,
|
||||||
_dev.Timeout,
|
_dev.Timeout,
|
||||||
out cmdDuration);
|
out _);
|
||||||
|
|
||||||
_speedStopwatch.Stop();
|
_speedStopwatch.Stop();
|
||||||
|
|
||||||
@@ -451,7 +452,7 @@ partial class Dump
|
|||||||
MmcErrorField.None,
|
MmcErrorField.None,
|
||||||
supportedSubchannel,
|
supportedSubchannel,
|
||||||
_dev.Timeout,
|
_dev.Timeout,
|
||||||
out cmdDuration);
|
out _);
|
||||||
|
|
||||||
_speedStopwatch.Stop();
|
_speedStopwatch.Stop();
|
||||||
|
|
||||||
@@ -479,16 +480,14 @@ partial class Dump
|
|||||||
MmcErrorField.None,
|
MmcErrorField.None,
|
||||||
supportedSubchannel,
|
supportedSubchannel,
|
||||||
_dev.Timeout,
|
_dev.Timeout,
|
||||||
out double cmdDuration2);
|
out _);
|
||||||
|
|
||||||
_speedStopwatch.Stop();
|
_speedStopwatch.Stop();
|
||||||
|
|
||||||
cmdDuration += cmdDuration2;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
totalDuration += cmdDuration;
|
totalDuration += _speedStopwatch.Elapsed.TotalMilliseconds;
|
||||||
}
|
}
|
||||||
else if(read16)
|
else if(read16)
|
||||||
{
|
{
|
||||||
@@ -506,7 +505,7 @@ partial class Dump
|
|||||||
blocksToRead,
|
blocksToRead,
|
||||||
false,
|
false,
|
||||||
_dev.Timeout,
|
_dev.Timeout,
|
||||||
out cmdDuration);
|
out _);
|
||||||
|
|
||||||
_speedStopwatch.Stop();
|
_speedStopwatch.Stop();
|
||||||
}
|
}
|
||||||
@@ -527,7 +526,7 @@ partial class Dump
|
|||||||
blocksToRead,
|
blocksToRead,
|
||||||
false,
|
false,
|
||||||
_dev.Timeout,
|
_dev.Timeout,
|
||||||
out cmdDuration);
|
out _);
|
||||||
|
|
||||||
_speedStopwatch.Stop();
|
_speedStopwatch.Stop();
|
||||||
}
|
}
|
||||||
@@ -547,7 +546,7 @@ partial class Dump
|
|||||||
0,
|
0,
|
||||||
(ushort)blocksToRead,
|
(ushort)blocksToRead,
|
||||||
_dev.Timeout,
|
_dev.Timeout,
|
||||||
out cmdDuration);
|
out _);
|
||||||
|
|
||||||
_speedStopwatch.Stop();
|
_speedStopwatch.Stop();
|
||||||
}
|
}
|
||||||
@@ -561,13 +560,11 @@ partial class Dump
|
|||||||
blockSize,
|
blockSize,
|
||||||
(byte)blocksToRead,
|
(byte)blocksToRead,
|
||||||
_dev.Timeout,
|
_dev.Timeout,
|
||||||
out cmdDuration);
|
out _);
|
||||||
|
|
||||||
_speedStopwatch.Stop();
|
_speedStopwatch.Stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
double elapsed;
|
|
||||||
|
|
||||||
// Overcome the track mode change drive error
|
// Overcome the track mode change drive error
|
||||||
if(inData && !nextData && sense)
|
if(inData && !nextData && sense)
|
||||||
{
|
{
|
||||||
@@ -596,11 +593,11 @@ partial class Dump
|
|||||||
blockSize,
|
blockSize,
|
||||||
(uint)sectorsForOffset + 1,
|
(uint)sectorsForOffset + 1,
|
||||||
supportedPlextorSubchannel,
|
supportedPlextorSubchannel,
|
||||||
out cmdDuration);
|
out _);
|
||||||
|
|
||||||
_speedStopwatch.Stop();
|
_speedStopwatch.Stop();
|
||||||
|
|
||||||
totalDuration += cmdDuration;
|
totalDuration += _speedStopwatch.Elapsed.TotalMilliseconds;
|
||||||
|
|
||||||
if(!sense)
|
if(!sense)
|
||||||
{
|
{
|
||||||
@@ -677,11 +674,11 @@ partial class Dump
|
|||||||
MmcErrorField.None,
|
MmcErrorField.None,
|
||||||
supportedSubchannel,
|
supportedSubchannel,
|
||||||
_dev.Timeout,
|
_dev.Timeout,
|
||||||
out cmdDuration);
|
out _);
|
||||||
|
|
||||||
_speedStopwatch.Stop();
|
_speedStopwatch.Stop();
|
||||||
|
|
||||||
totalDuration += cmdDuration;
|
totalDuration += _speedStopwatch.Elapsed.TotalMilliseconds;
|
||||||
}
|
}
|
||||||
else if(read16)
|
else if(read16)
|
||||||
{
|
{
|
||||||
@@ -699,9 +696,11 @@ partial class Dump
|
|||||||
1,
|
1,
|
||||||
false,
|
false,
|
||||||
_dev.Timeout,
|
_dev.Timeout,
|
||||||
out cmdDuration);
|
out _);
|
||||||
|
|
||||||
_speedStopwatch.Stop();
|
_speedStopwatch.Stop();
|
||||||
|
|
||||||
|
totalDuration += _speedStopwatch.Elapsed.TotalMilliseconds;
|
||||||
}
|
}
|
||||||
else if(read12)
|
else if(read12)
|
||||||
{
|
{
|
||||||
@@ -720,9 +719,11 @@ partial class Dump
|
|||||||
1,
|
1,
|
||||||
false,
|
false,
|
||||||
_dev.Timeout,
|
_dev.Timeout,
|
||||||
out cmdDuration);
|
out _);
|
||||||
|
|
||||||
_speedStopwatch.Stop();
|
_speedStopwatch.Stop();
|
||||||
|
|
||||||
|
totalDuration += _speedStopwatch.Elapsed.TotalMilliseconds;
|
||||||
}
|
}
|
||||||
else if(read10)
|
else if(read10)
|
||||||
{
|
{
|
||||||
@@ -740,29 +741,26 @@ partial class Dump
|
|||||||
0,
|
0,
|
||||||
1,
|
1,
|
||||||
_dev.Timeout,
|
_dev.Timeout,
|
||||||
out cmdDuration);
|
out _);
|
||||||
|
|
||||||
_speedStopwatch.Stop();
|
_speedStopwatch.Stop();
|
||||||
|
|
||||||
|
totalDuration += _speedStopwatch.Elapsed.TotalMilliseconds;
|
||||||
}
|
}
|
||||||
else if(read6)
|
else if(read6)
|
||||||
{
|
{
|
||||||
_speedStopwatch.Start();
|
_speedStopwatch.Start();
|
||||||
|
|
||||||
sense = _dev.Read6(out cmdBuf,
|
sense = _dev.Read6(out cmdBuf, out senseBuf, (uint)(i + r), blockSize, 1, _dev.Timeout, out _);
|
||||||
out senseBuf,
|
|
||||||
(uint)(i + r),
|
|
||||||
blockSize,
|
|
||||||
1,
|
|
||||||
_dev.Timeout,
|
|
||||||
out cmdDuration);
|
|
||||||
|
|
||||||
_speedStopwatch.Stop();
|
_speedStopwatch.Stop();
|
||||||
|
|
||||||
|
totalDuration += _speedStopwatch.Elapsed.TotalMilliseconds;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!sense && !_dev.Error)
|
if(!sense && !_dev.Error)
|
||||||
{
|
{
|
||||||
mhddLog.Write(i + r, cmdDuration);
|
mhddLog.Write(i + r, _speedStopwatch.Elapsed.TotalMilliseconds);
|
||||||
ibgLog.Write(i + r, currentSpeed * 1024);
|
|
||||||
extents.Add(i + r, 1, true);
|
extents.Add(i + r, 1, true);
|
||||||
_writeStopwatch.Restart();
|
_writeStopwatch.Restart();
|
||||||
|
|
||||||
@@ -901,11 +899,13 @@ partial class Dump
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(supportsLongSectors)
|
if(supportsLongSectors)
|
||||||
|
{
|
||||||
outputFormat.WriteSectorsLong(new byte[blockSize],
|
outputFormat.WriteSectorsLong(new byte[blockSize],
|
||||||
i + r,
|
i + r,
|
||||||
false,
|
false,
|
||||||
1,
|
1,
|
||||||
[SectorStatus.Errored]);
|
[SectorStatus.Errored]);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if(cmdBuf.Length % sectorSize == 0)
|
if(cmdBuf.Length % sectorSize == 0)
|
||||||
@@ -929,9 +929,11 @@ partial class Dump
|
|||||||
|
|
||||||
AaruLogging.Debug(MODULE_NAME, Localization.Core.READ_error_0, Sense.PrettifySense(senseBuf));
|
AaruLogging.Debug(MODULE_NAME, Localization.Core.READ_error_0, Sense.PrettifySense(senseBuf));
|
||||||
|
|
||||||
mhddLog.Write(i + r, cmdDuration < 500 ? 65535 : cmdDuration);
|
mhddLog.Write(i + r,
|
||||||
|
_speedStopwatch.Elapsed.TotalMilliseconds < 500
|
||||||
|
? 65535
|
||||||
|
: _speedStopwatch.Elapsed.TotalMilliseconds);
|
||||||
|
|
||||||
ibgLog.Write(i + r, 0);
|
|
||||||
AaruLogging.WriteLine(Localization.Core.Skipping_0_blocks_from_errored_block_1, 1, i + r);
|
AaruLogging.WriteLine(Localization.Core.Skipping_0_blocks_from_errored_block_1, 1, i + r);
|
||||||
newTrim = true;
|
newTrim = true;
|
||||||
}
|
}
|
||||||
@@ -942,13 +944,16 @@ partial class Dump
|
|||||||
|
|
||||||
_resume.NextBlock = i + r;
|
_resume.NextBlock = i + r;
|
||||||
|
|
||||||
elapsed = _speedStopwatch.Elapsed.TotalSeconds;
|
|
||||||
|
|
||||||
if(elapsed <= 0 || sectorSpeedStart * blockSize < 524288) continue;
|
|
||||||
|
|
||||||
currentSpeed = sectorSpeedStart * blockSize / (1048576 * elapsed);
|
|
||||||
sectorSpeedStart = 0;
|
|
||||||
_speedStopwatch.Reset();
|
_speedStopwatch.Reset();
|
||||||
|
|
||||||
|
elapsed += _speedStopwatch.Elapsed.TotalMilliseconds;
|
||||||
|
|
||||||
|
if(elapsed < 100) continue;
|
||||||
|
|
||||||
|
currentSpeed = sectorSpeedStart * blockSize / (1048576 * elapsed / 1000);
|
||||||
|
ibgLog.Write(i + r, currentSpeed * 1024);
|
||||||
|
sectorSpeedStart = 0;
|
||||||
|
elapsed = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
@@ -976,7 +981,7 @@ partial class Dump
|
|||||||
failedCrossingLeadOut);
|
failedCrossingLeadOut);
|
||||||
}
|
}
|
||||||
|
|
||||||
mhddLog.Write(i, cmdDuration, blocksToRead);
|
mhddLog.Write(i, _speedStopwatch.Elapsed.TotalMilliseconds, blocksToRead);
|
||||||
ibgLog.Write(i, currentSpeed * 1024);
|
ibgLog.Write(i, currentSpeed * 1024);
|
||||||
extents.Add(i, blocksToRead, true);
|
extents.Add(i, blocksToRead, true);
|
||||||
_writeStopwatch.Restart();
|
_writeStopwatch.Restart();
|
||||||
@@ -1172,9 +1177,13 @@ partial class Dump
|
|||||||
for(ulong b = i; b < i + _skip; b++) _resume.BadBlocks.Add(b);
|
for(ulong b = i; b < i + _skip; b++) _resume.BadBlocks.Add(b);
|
||||||
|
|
||||||
AaruLogging.Debug(MODULE_NAME, Localization.Core.READ_error_0, Sense.PrettifySense(senseBuf));
|
AaruLogging.Debug(MODULE_NAME, Localization.Core.READ_error_0, Sense.PrettifySense(senseBuf));
|
||||||
mhddLog.Write(i, cmdDuration < 500 ? 65535 : cmdDuration, _skip);
|
|
||||||
|
|
||||||
ibgLog.Write(i, 0);
|
mhddLog.Write(i,
|
||||||
|
_speedStopwatch.Elapsed.TotalMilliseconds < 500
|
||||||
|
? 65535
|
||||||
|
: _speedStopwatch.Elapsed.TotalMilliseconds,
|
||||||
|
_skip);
|
||||||
|
|
||||||
AaruLogging.WriteLine(Localization.Core.Skipping_0_blocks_from_errored_block_1, _skip, i);
|
AaruLogging.WriteLine(Localization.Core.Skipping_0_blocks_from_errored_block_1, _skip, i);
|
||||||
i += _skip - blocksToRead;
|
i += _skip - blocksToRead;
|
||||||
newTrim = true;
|
newTrim = true;
|
||||||
@@ -1186,13 +1195,14 @@ partial class Dump
|
|||||||
|
|
||||||
_resume.NextBlock = i + blocksToRead;
|
_resume.NextBlock = i + blocksToRead;
|
||||||
|
|
||||||
elapsed = _speedStopwatch.Elapsed.TotalSeconds;
|
elapsed += _speedStopwatch.Elapsed.TotalMilliseconds;
|
||||||
|
|
||||||
if(elapsed <= 0 || sectorSpeedStart * blockSize < 524288) continue;
|
if(elapsed < 100) continue;
|
||||||
|
|
||||||
currentSpeed = sectorSpeedStart * blockSize / (1048576 * elapsed);
|
currentSpeed = sectorSpeedStart * blockSize / (1048576 * elapsed / 1000);
|
||||||
|
ibgLog.Write(i, currentSpeed * 1024);
|
||||||
sectorSpeedStart = 0;
|
sectorSpeedStart = 0;
|
||||||
_speedStopwatch.Reset();
|
elapsed = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
_speedStopwatch.Stop();
|
_speedStopwatch.Stop();
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ public partial class Dump
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
byte[] tmp = new byte[8];
|
var tmp = new byte[8];
|
||||||
|
|
||||||
Array.Copy(buffer, 0x36, tmp, 0, 8);
|
Array.Copy(buffer, 0x36, tmp, 0, 8);
|
||||||
|
|
||||||
@@ -90,10 +90,10 @@ public partial class Dump
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ushort fatStart = (ushort)((buffer[0x0F] << 8) + buffer[0x0E]);
|
var fatStart = (ushort)((buffer[0x0F] << 8) + buffer[0x0E]);
|
||||||
ushort sectorsPerFat = (ushort)((buffer[0x17] << 8) + buffer[0x16]);
|
var sectorsPerFat = (ushort)((buffer[0x17] << 8) + buffer[0x16]);
|
||||||
ushort rootStart = (ushort)(sectorsPerFat * 2 + fatStart);
|
var rootStart = (ushort)(sectorsPerFat * 2 + fatStart);
|
||||||
ushort rootSize = (ushort)(((buffer[0x12] << 8) + buffer[0x11]) * 32 / 512);
|
var rootSize = (ushort)(((buffer[0x12] << 8) + buffer[0x11]) * 32 / 512);
|
||||||
byte sectorsPerCluster = buffer[0x0D];
|
byte sectorsPerCluster = buffer[0x0D];
|
||||||
|
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Reading_root_directory_in_sector_0, rootStart));
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Reading_root_directory_in_sector_0, rootStart));
|
||||||
@@ -108,13 +108,13 @@ public partial class Dump
|
|||||||
}
|
}
|
||||||
|
|
||||||
int romPos;
|
int romPos;
|
||||||
bool sfcFound = false;
|
var sfcFound = false;
|
||||||
bool genesisFound = false;
|
var genesisFound = false;
|
||||||
bool smsFound = false;
|
var smsFound = false;
|
||||||
bool n64Found = false;
|
var n64Found = false;
|
||||||
bool gbFound = false;
|
var gbFound = false;
|
||||||
bool gbcFound = false;
|
var gbcFound = false;
|
||||||
bool gbaFound = false;
|
var gbaFound = false;
|
||||||
tmp = new byte[3];
|
tmp = new byte[3];
|
||||||
|
|
||||||
for(romPos = 0; romPos < buffer.Length; romPos += 0x20)
|
for(romPos = 0; romPos < buffer.Length; romPos += 0x20)
|
||||||
@@ -177,8 +177,8 @@ public partial class Dump
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ushort cluster = BitConverter.ToUInt16(buffer, romPos + 0x1A);
|
var cluster = BitConverter.ToUInt16(buffer, romPos + 0x1A);
|
||||||
uint romSize = BitConverter.ToUInt32(buffer, romPos + 0x1C);
|
var romSize = BitConverter.ToUInt32(buffer, romPos + 0x1C);
|
||||||
|
|
||||||
MediaType mediaType = gbaFound
|
MediaType mediaType = gbaFound
|
||||||
? MediaType.GameBoyAdvanceGamePak
|
? MediaType.GameBoyAdvanceGamePak
|
||||||
@@ -228,7 +228,7 @@ public partial class Dump
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint startSector = (uint)(rootStart + rootSize + (cluster - 2) * sectorsPerCluster);
|
var startSector = (uint)(rootStart + rootSize + (cluster - 2) * sectorsPerCluster);
|
||||||
uint romSectors = romSize / 512;
|
uint romSectors = romSize / 512;
|
||||||
uint romRemaining = romSize % 512;
|
uint romRemaining = romSize % 512;
|
||||||
|
|
||||||
@@ -281,7 +281,7 @@ public partial class Dump
|
|||||||
(long)i * 512,
|
(long)i * 512,
|
||||||
romSize);
|
romSize);
|
||||||
|
|
||||||
_speedStopwatch.Start();
|
_speedStopwatch.Restart();
|
||||||
|
|
||||||
sense = _dev.Read10(out readBuffer,
|
sense = _dev.Read10(out readBuffer,
|
||||||
out senseBuf,
|
out senseBuf,
|
||||||
@@ -295,10 +295,10 @@ public partial class Dump
|
|||||||
0,
|
0,
|
||||||
(ushort)blocksToRead,
|
(ushort)blocksToRead,
|
||||||
_dev.Timeout,
|
_dev.Timeout,
|
||||||
out double cmdDuration);
|
out _);
|
||||||
|
|
||||||
_speedStopwatch.Stop();
|
_speedStopwatch.Stop();
|
||||||
totalDuration += cmdDuration;
|
totalDuration += _speedStopwatch.Elapsed.TotalMilliseconds;
|
||||||
|
|
||||||
_writeStopwatch.Restart();
|
_writeStopwatch.Restart();
|
||||||
|
|
||||||
|
|||||||
@@ -331,6 +331,7 @@ partial class Dump
|
|||||||
_speedStopwatch.Reset();
|
_speedStopwatch.Reset();
|
||||||
ulong sectorSpeedStart = 0;
|
ulong sectorSpeedStart = 0;
|
||||||
InitProgress?.Invoke();
|
InitProgress?.Invoke();
|
||||||
|
double elapsed = 0;
|
||||||
|
|
||||||
for(ulong i = _resume.NextBlock; i < blocks; i += blocksToRead)
|
for(ulong i = _resume.NextBlock; i < blocks; i += blocksToRead)
|
||||||
{
|
{
|
||||||
@@ -355,24 +356,17 @@ partial class Dump
|
|||||||
(long)i,
|
(long)i,
|
||||||
(long)blocks);
|
(long)blocks);
|
||||||
|
|
||||||
_speedStopwatch.Start();
|
_speedStopwatch.Restart();
|
||||||
|
|
||||||
sense = _dev.Read6(out readBuffer,
|
sense = _dev.Read6(out readBuffer, out _, (uint)i, blockSize, (byte)blocksToRead, _dev.Timeout, out _);
|
||||||
out _,
|
|
||||||
(uint)i,
|
|
||||||
blockSize,
|
|
||||||
(byte)blocksToRead,
|
|
||||||
_dev.Timeout,
|
|
||||||
out double cmdDuration);
|
|
||||||
|
|
||||||
_speedStopwatch.Stop();
|
_speedStopwatch.Stop();
|
||||||
|
|
||||||
totalDuration += cmdDuration;
|
totalDuration += _speedStopwatch.Elapsed.TotalMilliseconds;
|
||||||
|
|
||||||
if(!sense && !_dev.Error)
|
if(!sense && !_dev.Error)
|
||||||
{
|
{
|
||||||
mhddLog.Write(i, cmdDuration, blocksToRead);
|
mhddLog.Write(i, _speedStopwatch.Elapsed.TotalMilliseconds, blocksToRead);
|
||||||
ibgLog.Write(i, currentSpeed * 1024);
|
|
||||||
_writeStopwatch.Restart();
|
_writeStopwatch.Restart();
|
||||||
|
|
||||||
outputFormat.WriteSectors(readBuffer,
|
outputFormat.WriteSectors(readBuffer,
|
||||||
@@ -405,9 +399,12 @@ partial class Dump
|
|||||||
|
|
||||||
for(ulong b = i; b < i + _skip; b++) _resume.BadBlocks.Add(b);
|
for(ulong b = i; b < i + _skip; b++) _resume.BadBlocks.Add(b);
|
||||||
|
|
||||||
mhddLog.Write(i, cmdDuration < 500 ? 65535 : cmdDuration, _skip);
|
mhddLog.Write(i,
|
||||||
|
_speedStopwatch.Elapsed.TotalMilliseconds < 500
|
||||||
|
? 65535
|
||||||
|
: _speedStopwatch.Elapsed.TotalMilliseconds,
|
||||||
|
_skip);
|
||||||
|
|
||||||
ibgLog.Write(i, 0);
|
|
||||||
AaruLogging.WriteLine(Localization.Core.Skipping_0_blocks_from_errored_block_1, _skip, i);
|
AaruLogging.WriteLine(Localization.Core.Skipping_0_blocks_from_errored_block_1, _skip, i);
|
||||||
i += _skip - blocksToRead;
|
i += _skip - blocksToRead;
|
||||||
newTrim = true;
|
newTrim = true;
|
||||||
@@ -417,12 +414,12 @@ partial class Dump
|
|||||||
sectorSpeedStart += blocksToRead;
|
sectorSpeedStart += blocksToRead;
|
||||||
_resume.NextBlock = i + blocksToRead;
|
_resume.NextBlock = i + blocksToRead;
|
||||||
|
|
||||||
double elapsed = _speedStopwatch.Elapsed.TotalSeconds;
|
if(elapsed < 100) continue;
|
||||||
|
|
||||||
if(elapsed <= 0 || sectorSpeedStart * blockSize < 524288) continue;
|
currentSpeed = sectorSpeedStart * blockSize / (1048576 * elapsed / 1000);
|
||||||
|
ibgLog.Write(i, currentSpeed * 1024);
|
||||||
currentSpeed = sectorSpeedStart * blockSize / (1048576 * elapsed);
|
|
||||||
sectorSpeedStart = 0;
|
sectorSpeedStart = 0;
|
||||||
|
elapsed = 0;
|
||||||
_speedStopwatch.Reset();
|
_speedStopwatch.Reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -432,6 +429,7 @@ partial class Dump
|
|||||||
_dumpStopwatch.Stop();
|
_dumpStopwatch.Stop();
|
||||||
EndProgress?.Invoke();
|
EndProgress?.Invoke();
|
||||||
mhddLog.Close();
|
mhddLog.Close();
|
||||||
|
currentSpeed = sectorSpeedStart * blockSize / (1048576 * elapsed / 1000);
|
||||||
|
|
||||||
ibgLog.Close(_dev,
|
ibgLog.Close(_dev,
|
||||||
blocks,
|
blocks,
|
||||||
|
|||||||
@@ -196,6 +196,7 @@ public partial class Dump
|
|||||||
_speedStopwatch.Restart();
|
_speedStopwatch.Restart();
|
||||||
ulong sectorSpeedStart = 0;
|
ulong sectorSpeedStart = 0;
|
||||||
InitProgress?.Invoke();
|
InitProgress?.Invoke();
|
||||||
|
double elapsed = 0;
|
||||||
|
|
||||||
for(ulong i = _resume.NextBlock; i < blocks; i += blocksToRead)
|
for(ulong i = _resume.NextBlock; i < blocks; i += blocksToRead)
|
||||||
{
|
{
|
||||||
@@ -220,7 +221,7 @@ public partial class Dump
|
|||||||
(long)i,
|
(long)i,
|
||||||
blocks);
|
blocks);
|
||||||
|
|
||||||
_speedStopwatch.Start();
|
_speedStopwatch.Restart();
|
||||||
|
|
||||||
sense = _dev.Read12(out readBuffer,
|
sense = _dev.Read12(out readBuffer,
|
||||||
out senseBuf,
|
out senseBuf,
|
||||||
@@ -235,16 +236,15 @@ public partial class Dump
|
|||||||
blocksToRead,
|
blocksToRead,
|
||||||
false,
|
false,
|
||||||
_dev.Timeout,
|
_dev.Timeout,
|
||||||
out double cmdDuration);
|
out _);
|
||||||
|
|
||||||
_speedStopwatch.Stop();
|
_speedStopwatch.Stop();
|
||||||
|
elapsed += _speedStopwatch.Elapsed.TotalMilliseconds;
|
||||||
totalDuration += cmdDuration;
|
totalDuration += _speedStopwatch.Elapsed.TotalMilliseconds;
|
||||||
|
|
||||||
if(!sense && !_dev.Error)
|
if(!sense && !_dev.Error)
|
||||||
{
|
{
|
||||||
mhddLog.Write(i, cmdDuration, blocksToRead);
|
mhddLog.Write(i, _speedStopwatch.Elapsed.TotalMilliseconds, blocksToRead);
|
||||||
ibgLog.Write(i, currentSpeed * 1024);
|
|
||||||
_writeStopwatch.Restart();
|
_writeStopwatch.Restart();
|
||||||
|
|
||||||
outputFormat.WriteSectors(readBuffer,
|
outputFormat.WriteSectors(readBuffer,
|
||||||
@@ -279,9 +279,12 @@ public partial class Dump
|
|||||||
|
|
||||||
for(ulong b = i; b < i + _skip; b++) _resume.BadBlocks.Add(b);
|
for(ulong b = i; b < i + _skip; b++) _resume.BadBlocks.Add(b);
|
||||||
|
|
||||||
mhddLog.Write(i, cmdDuration < 500 ? 65535 : cmdDuration, _skip);
|
mhddLog.Write(i,
|
||||||
|
_speedStopwatch.Elapsed.TotalMilliseconds < 500
|
||||||
|
? 65535
|
||||||
|
: _speedStopwatch.Elapsed.TotalMilliseconds,
|
||||||
|
_skip);
|
||||||
|
|
||||||
ibgLog.Write(i, 0);
|
|
||||||
AaruLogging.WriteLine(Localization.Core.Skipping_0_blocks_from_errored_block_1, _skip, i);
|
AaruLogging.WriteLine(Localization.Core.Skipping_0_blocks_from_errored_block_1, _skip, i);
|
||||||
i += _skip - blocksToRead;
|
i += _skip - blocksToRead;
|
||||||
newTrim = true;
|
newTrim = true;
|
||||||
@@ -291,12 +294,12 @@ public partial class Dump
|
|||||||
sectorSpeedStart += blocksToRead;
|
sectorSpeedStart += blocksToRead;
|
||||||
_resume.NextBlock = i + blocksToRead;
|
_resume.NextBlock = i + blocksToRead;
|
||||||
|
|
||||||
double elapsed = _speedStopwatch.Elapsed.TotalSeconds;
|
if(elapsed < 100) continue;
|
||||||
|
|
||||||
if(elapsed <= 0 || sectorSpeedStart * blockSize < 524288) continue;
|
currentSpeed = sectorSpeedStart * blockSize / (1048576 * elapsed / 1000);
|
||||||
|
ibgLog.Write(i, currentSpeed * 1024);
|
||||||
currentSpeed = sectorSpeedStart * blockSize / (1048576 * elapsed);
|
|
||||||
sectorSpeedStart = 0;
|
sectorSpeedStart = 0;
|
||||||
|
elapsed = 0;
|
||||||
_speedStopwatch.Reset();
|
_speedStopwatch.Reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -306,6 +309,7 @@ public partial class Dump
|
|||||||
_dumpStopwatch.Stop();
|
_dumpStopwatch.Stop();
|
||||||
EndProgress?.Invoke();
|
EndProgress?.Invoke();
|
||||||
mhddLog.Close();
|
mhddLog.Close();
|
||||||
|
currentSpeed = sectorSpeedStart * blockSize / (1048576 * elapsed / 1000);
|
||||||
|
|
||||||
ibgLog.Close(_dev,
|
ibgLog.Close(_dev,
|
||||||
blocks,
|
blocks,
|
||||||
|
|||||||
@@ -236,6 +236,7 @@ public partial class Dump
|
|||||||
_speedStopwatch.Reset();
|
_speedStopwatch.Reset();
|
||||||
ulong sectorSpeedStart = 0;
|
ulong sectorSpeedStart = 0;
|
||||||
InitProgress?.Invoke();
|
InitProgress?.Invoke();
|
||||||
|
double elapsed = 0;
|
||||||
|
|
||||||
for(ulong i = _resume.NextBlock; i < blocks; i += blocksToRead)
|
for(ulong i = _resume.NextBlock; i < blocks; i += blocksToRead)
|
||||||
{
|
{
|
||||||
@@ -260,7 +261,7 @@ public partial class Dump
|
|||||||
(long)i,
|
(long)i,
|
||||||
(long)blocks);
|
(long)blocks);
|
||||||
|
|
||||||
_speedStopwatch.Start();
|
_speedStopwatch.Restart();
|
||||||
|
|
||||||
sense = _dev.Read12(out readBuffer,
|
sense = _dev.Read12(out readBuffer,
|
||||||
out senseBuf,
|
out senseBuf,
|
||||||
@@ -275,18 +276,17 @@ public partial class Dump
|
|||||||
blocksToRead * 4,
|
blocksToRead * 4,
|
||||||
false,
|
false,
|
||||||
_dev.Timeout,
|
_dev.Timeout,
|
||||||
out double cmdDuration);
|
out _);
|
||||||
|
|
||||||
_speedStopwatch.Stop();
|
_speedStopwatch.Stop();
|
||||||
|
elapsed += _speedStopwatch.Elapsed.TotalMilliseconds;
|
||||||
totalDuration += cmdDuration;
|
totalDuration += _speedStopwatch.Elapsed.TotalMilliseconds;
|
||||||
|
|
||||||
_writeStopwatch.Restart();
|
_writeStopwatch.Restart();
|
||||||
|
|
||||||
if(!sense && !_dev.Error)
|
if(!sense && !_dev.Error)
|
||||||
{
|
{
|
||||||
mhddLog.Write(i, cmdDuration, blocksToRead);
|
mhddLog.Write(i, _speedStopwatch.Elapsed.TotalMilliseconds, blocksToRead);
|
||||||
ibgLog.Write(i, currentSpeed * 1024);
|
|
||||||
|
|
||||||
outputOptical.WriteSectors(readBuffer,
|
outputOptical.WriteSectors(readBuffer,
|
||||||
i,
|
i,
|
||||||
@@ -318,9 +318,12 @@ public partial class Dump
|
|||||||
|
|
||||||
for(ulong b = i; b < i + _skip; b++) _resume.BadBlocks.Add(b);
|
for(ulong b = i; b < i + _skip; b++) _resume.BadBlocks.Add(b);
|
||||||
|
|
||||||
mhddLog.Write(i, cmdDuration < 500 ? 65535 : cmdDuration, _skip);
|
mhddLog.Write(i,
|
||||||
|
_speedStopwatch.Elapsed.TotalMilliseconds < 500
|
||||||
|
? 65535
|
||||||
|
: _speedStopwatch.Elapsed.TotalMilliseconds,
|
||||||
|
_skip);
|
||||||
|
|
||||||
ibgLog.Write(i, 0);
|
|
||||||
AaruLogging.Information(Localization.Core.Skipping_0_blocks_from_errored_block_1, _skip, i);
|
AaruLogging.Information(Localization.Core.Skipping_0_blocks_from_errored_block_1, _skip, i);
|
||||||
i += _skip - blocksToRead;
|
i += _skip - blocksToRead;
|
||||||
newTrim = true;
|
newTrim = true;
|
||||||
@@ -330,12 +333,12 @@ public partial class Dump
|
|||||||
sectorSpeedStart += blocksToRead;
|
sectorSpeedStart += blocksToRead;
|
||||||
_resume.NextBlock = i + blocksToRead;
|
_resume.NextBlock = i + blocksToRead;
|
||||||
|
|
||||||
double elapsed = _speedStopwatch.Elapsed.TotalSeconds;
|
if(elapsed < 100) continue;
|
||||||
|
|
||||||
if(elapsed <= 0 || sectorSpeedStart * blockSize < 524288) continue;
|
currentSpeed = sectorSpeedStart * blockSize / (1048576 * elapsed / 1000);
|
||||||
|
ibgLog.Write(i, currentSpeed * 1024);
|
||||||
currentSpeed = sectorSpeedStart * blockSize / (1048576 * elapsed);
|
|
||||||
sectorSpeedStart = 0;
|
sectorSpeedStart = 0;
|
||||||
|
elapsed = 0;
|
||||||
_speedStopwatch.Reset();
|
_speedStopwatch.Reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -344,6 +347,7 @@ public partial class Dump
|
|||||||
_dumpStopwatch.Stop();
|
_dumpStopwatch.Stop();
|
||||||
EndProgress?.Invoke();
|
EndProgress?.Invoke();
|
||||||
mhddLog.Close();
|
mhddLog.Close();
|
||||||
|
currentSpeed = sectorSpeedStart * blockSize / (1048576 * elapsed / 1000);
|
||||||
|
|
||||||
ibgLog.Close(_dev,
|
ibgLog.Close(_dev,
|
||||||
blocks,
|
blocks,
|
||||||
|
|||||||
@@ -285,8 +285,9 @@ partial class Dump
|
|||||||
Modes.DecodedMode? decMode = null;
|
Modes.DecodedMode? decMode = null;
|
||||||
|
|
||||||
if(!sense && !_dev.Error)
|
if(!sense && !_dev.Error)
|
||||||
if(Modes.DecodeMode10(cmdBuf, _dev.ScsiType).HasValue)
|
{
|
||||||
decMode = Modes.DecodeMode10(cmdBuf, _dev.ScsiType);
|
if(Modes.DecodeMode10(cmdBuf, _dev.ScsiType).HasValue) decMode = Modes.DecodeMode10(cmdBuf, _dev.ScsiType);
|
||||||
|
}
|
||||||
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Requesting_MODE_SENSE_6);
|
UpdateStatus?.Invoke(Localization.Core.Requesting_MODE_SENSE_6);
|
||||||
|
|
||||||
@@ -314,8 +315,9 @@ partial class Dump
|
|||||||
if(sense || _dev.Error) sense = _dev.ModeSense(out cmdBuf, out senseBuf, 5, out duration);
|
if(sense || _dev.Error) sense = _dev.ModeSense(out cmdBuf, out senseBuf, 5, out duration);
|
||||||
|
|
||||||
if(!sense && !_dev.Error)
|
if(!sense && !_dev.Error)
|
||||||
if(Modes.DecodeMode6(cmdBuf, _dev.ScsiType).HasValue)
|
{
|
||||||
decMode = Modes.DecodeMode6(cmdBuf, _dev.ScsiType);
|
if(Modes.DecodeMode6(cmdBuf, _dev.ScsiType).HasValue) decMode = Modes.DecodeMode6(cmdBuf, _dev.ScsiType);
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: Check partitions page
|
// TODO: Check partitions page
|
||||||
if(decMode.HasValue)
|
if(decMode.HasValue)
|
||||||
@@ -871,7 +873,7 @@ partial class Dump
|
|||||||
|
|
||||||
ulong currentSpeedSize = 0;
|
ulong currentSpeedSize = 0;
|
||||||
double imageWriteDuration = 0;
|
double imageWriteDuration = 0;
|
||||||
|
double elapsed = 0;
|
||||||
InitProgress?.Invoke();
|
InitProgress?.Invoke();
|
||||||
|
|
||||||
_speedStopwatch.Reset();
|
_speedStopwatch.Reset();
|
||||||
@@ -932,19 +934,13 @@ partial class Dump
|
|||||||
currentBlock,
|
currentBlock,
|
||||||
ByteSize.FromBytes(currentSpeed).Per(_oneSecond).Humanize()));
|
ByteSize.FromBytes(currentSpeed).Per(_oneSecond).Humanize()));
|
||||||
|
|
||||||
_speedStopwatch.Start();
|
_speedStopwatch.Restart();
|
||||||
|
|
||||||
sense = _dev.Read6(out cmdBuf,
|
sense = _dev.Read6(out cmdBuf, out senseBuf, false, fixedLen, transferLen, blockSize, _dev.Timeout, out _);
|
||||||
out senseBuf,
|
|
||||||
false,
|
|
||||||
fixedLen,
|
|
||||||
transferLen,
|
|
||||||
blockSize,
|
|
||||||
_dev.Timeout,
|
|
||||||
out duration);
|
|
||||||
|
|
||||||
_speedStopwatch.Stop();
|
_speedStopwatch.Stop();
|
||||||
totalDuration += duration;
|
totalDuration += _speedStopwatch.Elapsed.TotalMilliseconds;
|
||||||
|
elapsed += _speedStopwatch.Elapsed.TotalMilliseconds;
|
||||||
|
|
||||||
if(sense && !senseBuf.IsEmpty)
|
if(sense && !senseBuf.IsEmpty)
|
||||||
{
|
{
|
||||||
@@ -1093,14 +1089,16 @@ partial class Dump
|
|||||||
outputTape.WriteSector(new byte[blockSize], currentBlock, false, SectorStatus.NotDumped);
|
outputTape.WriteSector(new byte[blockSize], currentBlock, false, SectorStatus.NotDumped);
|
||||||
imageWriteDuration += _writeStopwatch.Elapsed.TotalSeconds;
|
imageWriteDuration += _writeStopwatch.Elapsed.TotalSeconds;
|
||||||
|
|
||||||
mhddLog.Write(currentBlock, duration < 500 ? 65535 : duration);
|
mhddLog.Write(currentBlock,
|
||||||
ibgLog.Write(currentBlock, 0);
|
_speedStopwatch.Elapsed.TotalMilliseconds < 500
|
||||||
|
? 65535
|
||||||
|
: _speedStopwatch.Elapsed.TotalMilliseconds);
|
||||||
|
|
||||||
_resume.BadBlocks.Add(currentBlock);
|
_resume.BadBlocks.Add(currentBlock);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mhddLog.Write(currentBlock, duration);
|
mhddLog.Write(currentBlock, _speedStopwatch.Elapsed.TotalMilliseconds);
|
||||||
ibgLog.Write(currentBlock, currentSpeed * 1024);
|
|
||||||
_writeStopwatch.Restart();
|
_writeStopwatch.Restart();
|
||||||
outputTape.WriteSector(cmdBuf, currentBlock, false, SectorStatus.Dumped);
|
outputTape.WriteSector(cmdBuf, currentBlock, false, SectorStatus.Dumped);
|
||||||
imageWriteDuration += _writeStopwatch.Elapsed.TotalSeconds;
|
imageWriteDuration += _writeStopwatch.Elapsed.TotalSeconds;
|
||||||
@@ -1112,12 +1110,12 @@ partial class Dump
|
|||||||
_resume.NextBlock++;
|
_resume.NextBlock++;
|
||||||
currentSpeedSize += blockSize;
|
currentSpeedSize += blockSize;
|
||||||
|
|
||||||
double elapsed = _speedStopwatch.Elapsed.TotalSeconds;
|
if(elapsed < 100) continue;
|
||||||
|
|
||||||
if(elapsed <= 0 || currentSpeedSize < 524288) continue;
|
currentSpeed = currentSpeedSize / (1048576 * elapsed / 1000);
|
||||||
|
ibgLog.Write(currentBlock, currentSpeed * 1024);
|
||||||
currentSpeed = currentSpeedSize / (1048576 * elapsed);
|
|
||||||
currentSpeedSize = 0;
|
currentSpeedSize = 0;
|
||||||
|
elapsed = 0;
|
||||||
_speedStopwatch.Reset();
|
_speedStopwatch.Reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ partial class Dump
|
|||||||
|
|
||||||
InitProgress?.Invoke();
|
InitProgress?.Invoke();
|
||||||
_speedStopwatch.Reset();
|
_speedStopwatch.Reset();
|
||||||
|
double elapsed = 0;
|
||||||
|
|
||||||
for(ulong i = _resume.NextBlock; i < blocks; i += blocksToRead)
|
for(ulong i = _resume.NextBlock; i < blocks; i += blocksToRead)
|
||||||
{
|
{
|
||||||
@@ -102,9 +103,10 @@ partial class Dump
|
|||||||
(long)i,
|
(long)i,
|
||||||
(long)blocks);
|
(long)blocks);
|
||||||
|
|
||||||
_speedStopwatch.Start();
|
_speedStopwatch.Restart();
|
||||||
sense = scsiReader.ReadBlocks(out buffer, i, blocksToRead, out double cmdDuration, out _, out _);
|
sense = scsiReader.ReadBlocks(out buffer, i, blocksToRead, out _, out _, out _);
|
||||||
totalDuration += cmdDuration;
|
elapsed += _speedStopwatch.Elapsed.TotalMilliseconds;
|
||||||
|
totalDuration += _speedStopwatch.Elapsed.TotalMilliseconds;
|
||||||
_speedStopwatch.Stop();
|
_speedStopwatch.Stop();
|
||||||
|
|
||||||
if(!sense && !_dev.Error)
|
if(!sense && !_dev.Error)
|
||||||
@@ -194,8 +196,7 @@ partial class Dump
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mhddLog.Write(i, cmdDuration, blocksToRead);
|
mhddLog.Write(i, _speedStopwatch.Elapsed.TotalMilliseconds, blocksToRead);
|
||||||
ibgLog.Write(i, currentSpeed * 1024);
|
|
||||||
_writeStopwatch.Restart();
|
_writeStopwatch.Restart();
|
||||||
|
|
||||||
outputFormat.WriteSectors(buffer,
|
outputFormat.WriteSectors(buffer,
|
||||||
@@ -242,9 +243,12 @@ partial class Dump
|
|||||||
|
|
||||||
for(ulong b = i; b < i + _skip; b++) _resume.BadBlocks.Add(b);
|
for(ulong b = i; b < i + _skip; b++) _resume.BadBlocks.Add(b);
|
||||||
|
|
||||||
mhddLog.Write(i, cmdDuration < 500 ? 65535 : cmdDuration, _skip);
|
mhddLog.Write(i,
|
||||||
|
_speedStopwatch.Elapsed.TotalMilliseconds < 500
|
||||||
|
? 65535
|
||||||
|
: _speedStopwatch.Elapsed.TotalMilliseconds,
|
||||||
|
_skip);
|
||||||
|
|
||||||
ibgLog.Write(i, 0);
|
|
||||||
AaruLogging.WriteLine(Localization.Core.Skipping_0_blocks_from_errored_block_1, _skip, i);
|
AaruLogging.WriteLine(Localization.Core.Skipping_0_blocks_from_errored_block_1, _skip, i);
|
||||||
i += _skip - blocksToRead;
|
i += _skip - blocksToRead;
|
||||||
newTrim = true;
|
newTrim = true;
|
||||||
@@ -254,12 +258,12 @@ partial class Dump
|
|||||||
sectorSpeedStart += blocksToRead;
|
sectorSpeedStart += blocksToRead;
|
||||||
_resume.NextBlock = i + blocksToRead;
|
_resume.NextBlock = i + blocksToRead;
|
||||||
|
|
||||||
double elapsed = _speedStopwatch.Elapsed.TotalSeconds;
|
if(elapsed < 100) continue;
|
||||||
|
|
||||||
if(elapsed <= 0 || sectorSpeedStart * blockSize < 524288) continue;
|
currentSpeed = sectorSpeedStart * blockSize / (1048576 * elapsed / 1000);
|
||||||
|
ibgLog.Write(i, currentSpeed * 1024);
|
||||||
currentSpeed = sectorSpeedStart * blockSize / (1048576 * elapsed);
|
|
||||||
sectorSpeedStart = 0;
|
sectorSpeedStart = 0;
|
||||||
|
elapsed = 0;
|
||||||
_speedStopwatch.Reset();
|
_speedStopwatch.Reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -78,7 +78,6 @@ public partial class Dump
|
|||||||
bool sense;
|
bool sense;
|
||||||
const ushort sdProfile = 0x0001;
|
const ushort sdProfile = 0x0001;
|
||||||
const uint timeout = 5;
|
const uint timeout = 5;
|
||||||
double duration;
|
|
||||||
ushort blocksToRead = 128;
|
ushort blocksToRead = 128;
|
||||||
uint blockSize = 512;
|
uint blockSize = 512;
|
||||||
ulong blocks = 0;
|
ulong blocks = 0;
|
||||||
@@ -99,7 +98,7 @@ public partial class Dump
|
|||||||
case DeviceType.MMC:
|
case DeviceType.MMC:
|
||||||
{
|
{
|
||||||
UpdateStatus?.Invoke(Localization.Core.Reading_CSD);
|
UpdateStatus?.Invoke(Localization.Core.Reading_CSD);
|
||||||
sense = _dev.ReadCsd(out csd, out response, timeout, out duration);
|
sense = _dev.ReadCsd(out csd, out response, timeout, out _);
|
||||||
|
|
||||||
if(!sense)
|
if(!sense)
|
||||||
{
|
{
|
||||||
@@ -115,7 +114,7 @@ public partial class Dump
|
|||||||
if(csdDecoded.Size == 0xFFF)
|
if(csdDecoded.Size == 0xFFF)
|
||||||
{
|
{
|
||||||
UpdateStatus?.Invoke(Localization.Core.Reading_Extended_CSD);
|
UpdateStatus?.Invoke(Localization.Core.Reading_Extended_CSD);
|
||||||
sense = _dev.ReadExtendedCsd(out ecsd, out response, timeout, out duration);
|
sense = _dev.ReadExtendedCsd(out ecsd, out response, timeout, out _);
|
||||||
|
|
||||||
if(!sense)
|
if(!sense)
|
||||||
{
|
{
|
||||||
@@ -152,7 +151,7 @@ public partial class Dump
|
|||||||
}
|
}
|
||||||
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Reading_OCR);
|
UpdateStatus?.Invoke(Localization.Core.Reading_OCR);
|
||||||
sense = _dev.ReadOcr(out ocr, out response, timeout, out duration);
|
sense = _dev.ReadOcr(out ocr, out response, timeout, out _);
|
||||||
|
|
||||||
if(sense)
|
if(sense)
|
||||||
{
|
{
|
||||||
@@ -168,7 +167,7 @@ public partial class Dump
|
|||||||
case DeviceType.SecureDigital:
|
case DeviceType.SecureDigital:
|
||||||
{
|
{
|
||||||
UpdateStatus?.Invoke(Localization.Core.Reading_CSD);
|
UpdateStatus?.Invoke(Localization.Core.Reading_CSD);
|
||||||
sense = _dev.ReadCsd(out csd, out response, timeout, out duration);
|
sense = _dev.ReadCsd(out csd, out response, timeout, out _);
|
||||||
|
|
||||||
if(!sense)
|
if(!sense)
|
||||||
{
|
{
|
||||||
@@ -200,7 +199,7 @@ public partial class Dump
|
|||||||
}
|
}
|
||||||
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Reading_OCR);
|
UpdateStatus?.Invoke(Localization.Core.Reading_OCR);
|
||||||
sense = _dev.ReadSdocr(out ocr, out response, timeout, out duration);
|
sense = _dev.ReadSdocr(out ocr, out response, timeout, out _);
|
||||||
|
|
||||||
if(sense)
|
if(sense)
|
||||||
{
|
{
|
||||||
@@ -211,7 +210,7 @@ public partial class Dump
|
|||||||
mediaTags.Add(MediaTagType.SD_OCR, null);
|
mediaTags.Add(MediaTagType.SD_OCR, null);
|
||||||
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Reading_SCR);
|
UpdateStatus?.Invoke(Localization.Core.Reading_SCR);
|
||||||
sense = _dev.ReadScr(out scr, out response, timeout, out duration);
|
sense = _dev.ReadScr(out scr, out response, timeout, out _);
|
||||||
|
|
||||||
if(sense)
|
if(sense)
|
||||||
{
|
{
|
||||||
@@ -232,7 +231,7 @@ public partial class Dump
|
|||||||
}
|
}
|
||||||
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Reading_CID);
|
UpdateStatus?.Invoke(Localization.Core.Reading_CID);
|
||||||
sense = _dev.ReadCid(out byte[] cid, out response, timeout, out duration);
|
sense = _dev.ReadCid(out byte[] cid, out response, timeout, out _);
|
||||||
|
|
||||||
if(sense)
|
if(sense)
|
||||||
{
|
{
|
||||||
@@ -263,7 +262,7 @@ public partial class Dump
|
|||||||
|
|
||||||
if(supportsCmd23 && blocksToRead > 1)
|
if(supportsCmd23 && blocksToRead > 1)
|
||||||
{
|
{
|
||||||
sense = _dev.ReadWithBlockCount(out cmdBuf, out _, 0, blockSize, 1, byteAddressed, timeout, out duration);
|
sense = _dev.ReadWithBlockCount(out cmdBuf, out _, 0, blockSize, 1, byteAddressed, timeout, out _);
|
||||||
|
|
||||||
if(sense || _dev.Error) supportsCmd23 = false;
|
if(sense || _dev.Error) supportsCmd23 = false;
|
||||||
|
|
||||||
@@ -289,7 +288,7 @@ public partial class Dump
|
|||||||
blocksToRead,
|
blocksToRead,
|
||||||
byteAddressed,
|
byteAddressed,
|
||||||
timeout,
|
timeout,
|
||||||
out duration);
|
out _);
|
||||||
|
|
||||||
if(error) blocksToRead /= 2;
|
if(error) blocksToRead /= 2;
|
||||||
|
|
||||||
@@ -310,7 +309,7 @@ public partial class Dump
|
|||||||
{
|
{
|
||||||
while(true)
|
while(true)
|
||||||
{
|
{
|
||||||
error = _dev.BufferedOsRead(out cmdBuf, 0, blockSize * blocksToRead, out duration);
|
error = _dev.BufferedOsRead(out cmdBuf, 0, blockSize * blocksToRead, out _);
|
||||||
|
|
||||||
if(error) blocksToRead /= 2;
|
if(error) blocksToRead /= 2;
|
||||||
|
|
||||||
@@ -339,7 +338,7 @@ public partial class Dump
|
|||||||
blocksToRead,
|
blocksToRead,
|
||||||
byteAddressed,
|
byteAddressed,
|
||||||
timeout,
|
timeout,
|
||||||
out duration);
|
out _);
|
||||||
|
|
||||||
if(error) blocksToRead /= 2;
|
if(error) blocksToRead /= 2;
|
||||||
|
|
||||||
@@ -361,7 +360,7 @@ public partial class Dump
|
|||||||
|
|
||||||
if(blocksToRead == 1)
|
if(blocksToRead == 1)
|
||||||
{
|
{
|
||||||
error = _dev.ReadSingleBlock(out cmdBuf, out _, 0, blockSize, byteAddressed, timeout, out duration);
|
error = _dev.ReadSingleBlock(out cmdBuf, out _, 0, blockSize, byteAddressed, timeout, out _);
|
||||||
|
|
||||||
if(error)
|
if(error)
|
||||||
{
|
{
|
||||||
@@ -596,6 +595,7 @@ public partial class Dump
|
|||||||
double imageWriteDuration = 0;
|
double imageWriteDuration = 0;
|
||||||
var newTrim = false;
|
var newTrim = false;
|
||||||
ulong sectorSpeedStart = 0;
|
ulong sectorSpeedStart = 0;
|
||||||
|
double elapsed = 0;
|
||||||
|
|
||||||
InitProgress?.Invoke();
|
InitProgress?.Invoke();
|
||||||
|
|
||||||
@@ -622,17 +622,11 @@ public partial class Dump
|
|||||||
(long)i,
|
(long)i,
|
||||||
(long)blocks);
|
(long)blocks);
|
||||||
|
|
||||||
_speedStopwatch.Start();
|
_speedStopwatch.Restart();
|
||||||
|
|
||||||
if(blocksToRead == 1)
|
if(blocksToRead == 1)
|
||||||
{
|
{
|
||||||
error = _dev.ReadSingleBlock(out cmdBuf,
|
error = _dev.ReadSingleBlock(out cmdBuf, out _, (uint)i, blockSize, byteAddressed, timeout, out _);
|
||||||
out _,
|
|
||||||
(uint)i,
|
|
||||||
blockSize,
|
|
||||||
byteAddressed,
|
|
||||||
timeout,
|
|
||||||
out duration);
|
|
||||||
}
|
}
|
||||||
else if(supportsCmd23)
|
else if(supportsCmd23)
|
||||||
{
|
{
|
||||||
@@ -643,10 +637,10 @@ public partial class Dump
|
|||||||
blocksToRead,
|
blocksToRead,
|
||||||
byteAddressed,
|
byteAddressed,
|
||||||
timeout,
|
timeout,
|
||||||
out duration);
|
out _);
|
||||||
}
|
}
|
||||||
else if(_useBufferedReads)
|
else if(_useBufferedReads)
|
||||||
error = _dev.BufferedOsRead(out cmdBuf, (long)(i * blockSize), blockSize * blocksToRead, out duration);
|
error = _dev.BufferedOsRead(out cmdBuf, (long)(i * blockSize), blockSize * blocksToRead, out _);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
error = _dev.ReadMultipleUsingSingle(out cmdBuf,
|
error = _dev.ReadMultipleUsingSingle(out cmdBuf,
|
||||||
@@ -656,15 +650,15 @@ public partial class Dump
|
|||||||
blocksToRead,
|
blocksToRead,
|
||||||
byteAddressed,
|
byteAddressed,
|
||||||
timeout,
|
timeout,
|
||||||
out duration);
|
out _);
|
||||||
}
|
}
|
||||||
|
|
||||||
_speedStopwatch.Stop();
|
_speedStopwatch.Stop();
|
||||||
|
|
||||||
if(!error)
|
if(!error)
|
||||||
{
|
{
|
||||||
mhddLog.Write(i, duration, blocksToRead);
|
totalDuration += _speedStopwatch.Elapsed.TotalMilliseconds;
|
||||||
ibgLog.Write(i, currentSpeed * 1024);
|
mhddLog.Write(i, _speedStopwatch.Elapsed.TotalMilliseconds, blocksToRead);
|
||||||
_writeStopwatch.Restart();
|
_writeStopwatch.Restart();
|
||||||
|
|
||||||
outputFormat.WriteSectors(cmdBuf,
|
outputFormat.WriteSectors(cmdBuf,
|
||||||
@@ -685,7 +679,11 @@ public partial class Dump
|
|||||||
|
|
||||||
for(ulong b = i; b < i + _skip; b++) _resume.BadBlocks.Add(b);
|
for(ulong b = i; b < i + _skip; b++) _resume.BadBlocks.Add(b);
|
||||||
|
|
||||||
mhddLog.Write(i, duration < 500 ? 65535 : duration, _skip);
|
mhddLog.Write(i,
|
||||||
|
_speedStopwatch.Elapsed.TotalMilliseconds < 500
|
||||||
|
? 65535
|
||||||
|
: _speedStopwatch.Elapsed.TotalMilliseconds,
|
||||||
|
_skip);
|
||||||
|
|
||||||
ibgLog.Write(i, 0);
|
ibgLog.Write(i, 0);
|
||||||
_writeStopwatch.Restart();
|
_writeStopwatch.Restart();
|
||||||
@@ -706,12 +704,12 @@ public partial class Dump
|
|||||||
sectorSpeedStart += blocksToRead;
|
sectorSpeedStart += blocksToRead;
|
||||||
_resume.NextBlock = i + blocksToRead;
|
_resume.NextBlock = i + blocksToRead;
|
||||||
|
|
||||||
double elapsed = _speedStopwatch.Elapsed.TotalSeconds;
|
if(elapsed < 100) continue;
|
||||||
|
|
||||||
if(elapsed <= 0 || sectorSpeedStart * blockSize < 524288) continue;
|
currentSpeed = sectorSpeedStart * blockSize / (1048576 * elapsed / 1000);
|
||||||
|
ibgLog.Write(i, currentSpeed * 1024);
|
||||||
currentSpeed = sectorSpeedStart * blockSize / (1048576 * elapsed);
|
|
||||||
sectorSpeedStart = 0;
|
sectorSpeedStart = 0;
|
||||||
|
elapsed = 0;
|
||||||
_speedStopwatch.Reset();
|
_speedStopwatch.Reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -721,6 +719,7 @@ public partial class Dump
|
|||||||
_dumpStopwatch.Stop();
|
_dumpStopwatch.Stop();
|
||||||
EndProgress?.Invoke();
|
EndProgress?.Invoke();
|
||||||
mhddLog.Close();
|
mhddLog.Close();
|
||||||
|
currentSpeed = sectorSpeedStart * blockSize / (1048576 * elapsed / 1000);
|
||||||
|
|
||||||
ibgLog.Close(_dev,
|
ibgLog.Close(_dev,
|
||||||
blocks,
|
blocks,
|
||||||
@@ -772,7 +771,7 @@ public partial class Dump
|
|||||||
blockSize,
|
blockSize,
|
||||||
byteAddressed,
|
byteAddressed,
|
||||||
timeout,
|
timeout,
|
||||||
out duration);
|
out double duration);
|
||||||
|
|
||||||
totalDuration += duration;
|
totalDuration += duration;
|
||||||
|
|
||||||
@@ -833,7 +832,7 @@ public partial class Dump
|
|||||||
blockSize,
|
blockSize,
|
||||||
byteAddressed,
|
byteAddressed,
|
||||||
timeout,
|
timeout,
|
||||||
out duration);
|
out double duration);
|
||||||
|
|
||||||
totalDuration += duration;
|
totalDuration += duration;
|
||||||
|
|
||||||
|
|||||||
@@ -521,7 +521,6 @@ partial class Dump
|
|||||||
_dumpStopwatch.Restart();
|
_dumpStopwatch.Restart();
|
||||||
double imageWriteDuration = 0;
|
double imageWriteDuration = 0;
|
||||||
|
|
||||||
double cmdDuration = 0;
|
|
||||||
uint saveBlocksToRead = blocksToRead;
|
uint saveBlocksToRead = blocksToRead;
|
||||||
DumpHardware currentTry = null;
|
DumpHardware currentTry = null;
|
||||||
ExtentsULong extents = null;
|
ExtentsULong extents = null;
|
||||||
@@ -585,6 +584,7 @@ partial class Dump
|
|||||||
_speedStopwatch.Reset();
|
_speedStopwatch.Reset();
|
||||||
ulong sectorSpeedStart = 0;
|
ulong sectorSpeedStart = 0;
|
||||||
InitProgress?.Invoke();
|
InitProgress?.Invoke();
|
||||||
|
double elapsed = 0;
|
||||||
|
|
||||||
for(var e = 0; e <= 16; e++)
|
for(var e = 0; e <= 16; e++)
|
||||||
{
|
{
|
||||||
@@ -657,7 +657,7 @@ partial class Dump
|
|||||||
(long)i,
|
(long)i,
|
||||||
(long)totalSize);
|
(long)totalSize);
|
||||||
|
|
||||||
_speedStopwatch.Start();
|
_speedStopwatch.Restart();
|
||||||
|
|
||||||
sense = _dev.Read12(out readBuffer,
|
sense = _dev.Read12(out readBuffer,
|
||||||
out senseBuf,
|
out senseBuf,
|
||||||
@@ -672,16 +672,15 @@ partial class Dump
|
|||||||
blocksToRead,
|
blocksToRead,
|
||||||
false,
|
false,
|
||||||
_dev.Timeout,
|
_dev.Timeout,
|
||||||
out cmdDuration);
|
out _);
|
||||||
|
|
||||||
_speedStopwatch.Stop();
|
_speedStopwatch.Stop();
|
||||||
|
elapsed += _speedStopwatch.Elapsed.TotalMilliseconds;
|
||||||
totalDuration += cmdDuration;
|
totalDuration += _speedStopwatch.Elapsed.TotalMilliseconds;
|
||||||
|
|
||||||
if(!sense && !_dev.Error)
|
if(!sense && !_dev.Error)
|
||||||
{
|
{
|
||||||
mhddLog.Write(i, cmdDuration, blocksToRead);
|
mhddLog.Write(i, _speedStopwatch.Elapsed.TotalMilliseconds, blocksToRead);
|
||||||
ibgLog.Write(i, currentSpeed * 1024);
|
|
||||||
_writeStopwatch.Restart();
|
_writeStopwatch.Restart();
|
||||||
|
|
||||||
outputFormat.WriteSectors(readBuffer,
|
outputFormat.WriteSectors(readBuffer,
|
||||||
@@ -718,9 +717,11 @@ partial class Dump
|
|||||||
|
|
||||||
AaruLogging.Debug(MODULE_NAME, Localization.Core.READ_error_0, Sense.PrettifySense(senseBuf));
|
AaruLogging.Debug(MODULE_NAME, Localization.Core.READ_error_0, Sense.PrettifySense(senseBuf));
|
||||||
|
|
||||||
mhddLog.Write(i, cmdDuration < 500 ? 65535 : cmdDuration, _skip);
|
mhddLog.Write(i,
|
||||||
|
_speedStopwatch.Elapsed.TotalMilliseconds < 500
|
||||||
ibgLog.Write(i, 0);
|
? 65535
|
||||||
|
: _speedStopwatch.Elapsed.TotalMilliseconds,
|
||||||
|
_skip);
|
||||||
|
|
||||||
AaruLogging.WriteLine(Localization.Core.Skipping_0_blocks_from_errored_block_1, _skip, i);
|
AaruLogging.WriteLine(Localization.Core.Skipping_0_blocks_from_errored_block_1, _skip, i);
|
||||||
i += _skip - blocksToRead;
|
i += _skip - blocksToRead;
|
||||||
@@ -739,12 +740,12 @@ partial class Dump
|
|||||||
_resume.NextBlock = currentSector;
|
_resume.NextBlock = currentSector;
|
||||||
sectorSpeedStart += blocksToRead;
|
sectorSpeedStart += blocksToRead;
|
||||||
|
|
||||||
double elapsed = _speedStopwatch.Elapsed.TotalSeconds;
|
if(elapsed < 100) continue;
|
||||||
|
|
||||||
if(elapsed <= 0 || sectorSpeedStart * blockSize < 524288) continue;
|
currentSpeed = sectorSpeedStart * blockSize / (1048576 * elapsed / 1000);
|
||||||
|
ibgLog.Write(i, currentSpeed * 1024);
|
||||||
currentSpeed = sectorSpeedStart * blockSize / (1048576 * elapsed);
|
|
||||||
sectorSpeedStart = 0;
|
sectorSpeedStart = 0;
|
||||||
|
elapsed = 0;
|
||||||
_speedStopwatch.Reset();
|
_speedStopwatch.Reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -764,7 +765,7 @@ partial class Dump
|
|||||||
|
|
||||||
if(extentEnd - i < blocksToRead) blocksToRead = (uint)(extentEnd - i) + 1;
|
if(extentEnd - i < blocksToRead) blocksToRead = (uint)(extentEnd - i) + 1;
|
||||||
|
|
||||||
mhddLog.Write(i, cmdDuration, blocksToRead);
|
mhddLog.Write(i, _speedStopwatch.Elapsed.TotalMilliseconds, blocksToRead);
|
||||||
ibgLog.Write(i, currentSpeed * 1024);
|
ibgLog.Write(i, currentSpeed * 1024);
|
||||||
|
|
||||||
// Write empty data
|
// Write empty data
|
||||||
@@ -815,7 +816,7 @@ partial class Dump
|
|||||||
(long)(middle + currentSector),
|
(long)(middle + currentSector),
|
||||||
(long)totalSize);
|
(long)totalSize);
|
||||||
|
|
||||||
mhddLog.Write(middle + currentSector, cmdDuration, blocksToRead);
|
mhddLog.Write(middle + currentSector, _speedStopwatch.Elapsed.TotalMilliseconds, blocksToRead);
|
||||||
ibgLog.Write(middle + currentSector, currentSpeed * 1024);
|
ibgLog.Write(middle + currentSector, currentSpeed * 1024);
|
||||||
|
|
||||||
// Write empty data
|
// Write empty data
|
||||||
@@ -861,6 +862,7 @@ partial class Dump
|
|||||||
// Video Layer 1
|
// Video Layer 1
|
||||||
UpdateStatus?.Invoke(Localization.Core.Reading_Video_Layer_1);
|
UpdateStatus?.Invoke(Localization.Core.Reading_Video_Layer_1);
|
||||||
InitProgress?.Invoke();
|
InitProgress?.Invoke();
|
||||||
|
elapsed = 0;
|
||||||
|
|
||||||
for(ulong l1 = currentSector - blocks - middleZone + l0Video; l1 < l0Video + l1Video; l1 += blocksToRead)
|
for(ulong l1 = currentSector - blocks - middleZone + l0Video; l1 < l0Video + l1Video; l1 += blocksToRead)
|
||||||
{
|
{
|
||||||
@@ -885,7 +887,7 @@ partial class Dump
|
|||||||
(long)currentSector,
|
(long)currentSector,
|
||||||
(long)totalSize);
|
(long)totalSize);
|
||||||
|
|
||||||
_speedStopwatch.Start();
|
_speedStopwatch.Restart();
|
||||||
|
|
||||||
sense = _dev.Read12(out readBuffer,
|
sense = _dev.Read12(out readBuffer,
|
||||||
out senseBuf,
|
out senseBuf,
|
||||||
@@ -900,16 +902,15 @@ partial class Dump
|
|||||||
blocksToRead,
|
blocksToRead,
|
||||||
false,
|
false,
|
||||||
_dev.Timeout,
|
_dev.Timeout,
|
||||||
out cmdDuration);
|
out _);
|
||||||
|
|
||||||
_speedStopwatch.Stop();
|
_speedStopwatch.Stop();
|
||||||
|
elapsed += _speedStopwatch.Elapsed.TotalMilliseconds;
|
||||||
totalDuration += cmdDuration;
|
totalDuration += _speedStopwatch.Elapsed.TotalMilliseconds;
|
||||||
|
|
||||||
if(!sense && !_dev.Error)
|
if(!sense && !_dev.Error)
|
||||||
{
|
{
|
||||||
mhddLog.Write(currentSector, cmdDuration, blocksToRead);
|
mhddLog.Write(currentSector, _speedStopwatch.Elapsed.TotalMilliseconds, blocksToRead);
|
||||||
ibgLog.Write(currentSector, currentSpeed * 1024);
|
|
||||||
_writeStopwatch.Restart();
|
_writeStopwatch.Restart();
|
||||||
|
|
||||||
outputFormat.WriteSectors(readBuffer,
|
outputFormat.WriteSectors(readBuffer,
|
||||||
@@ -944,9 +945,13 @@ partial class Dump
|
|||||||
//errored += blocksToRead;
|
//errored += blocksToRead;
|
||||||
//resume.BadBlocks.Add(l1);
|
//resume.BadBlocks.Add(l1);
|
||||||
AaruLogging.Debug(MODULE_NAME, Localization.Core.READ_error_0, Sense.PrettifySense(senseBuf));
|
AaruLogging.Debug(MODULE_NAME, Localization.Core.READ_error_0, Sense.PrettifySense(senseBuf));
|
||||||
mhddLog.Write(l1, cmdDuration < 500 ? 65535 : cmdDuration, _skip);
|
|
||||||
|
|
||||||
ibgLog.Write(l1, 0);
|
mhddLog.Write(l1,
|
||||||
|
_speedStopwatch.Elapsed.TotalMilliseconds < 500
|
||||||
|
? 65535
|
||||||
|
: _speedStopwatch.Elapsed.TotalMilliseconds,
|
||||||
|
_skip);
|
||||||
|
|
||||||
AaruLogging.WriteLine(Localization.Core.Skipping_0_blocks_from_errored_block_1, _skip, l1);
|
AaruLogging.WriteLine(Localization.Core.Skipping_0_blocks_from_errored_block_1, _skip, l1);
|
||||||
l1 += _skip - blocksToRead;
|
l1 += _skip - blocksToRead;
|
||||||
|
|
||||||
@@ -962,12 +967,12 @@ partial class Dump
|
|||||||
_resume.NextBlock = currentSector;
|
_resume.NextBlock = currentSector;
|
||||||
sectorSpeedStart += blocksToRead;
|
sectorSpeedStart += blocksToRead;
|
||||||
|
|
||||||
double elapsed = _speedStopwatch.Elapsed.TotalSeconds;
|
if(elapsed < 100) continue;
|
||||||
|
|
||||||
if(elapsed <= 0 || sectorSpeedStart * blockSize < 524288) continue;
|
currentSpeed = sectorSpeedStart * blockSize / (1048576 * elapsed / 1000);
|
||||||
|
ibgLog.Write(currentSector, currentSpeed * 1024);
|
||||||
currentSpeed = sectorSpeedStart * blockSize / (1048576 * elapsed);
|
|
||||||
sectorSpeedStart = 0;
|
sectorSpeedStart = 0;
|
||||||
|
elapsed = 0;
|
||||||
_speedStopwatch.Reset();
|
_speedStopwatch.Reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1053,7 +1058,7 @@ partial class Dump
|
|||||||
1,
|
1,
|
||||||
false,
|
false,
|
||||||
_dev.Timeout,
|
_dev.Timeout,
|
||||||
out cmdDuration);
|
out double cmdDuration);
|
||||||
|
|
||||||
totalDuration += cmdDuration;
|
totalDuration += cmdDuration;
|
||||||
|
|
||||||
@@ -1086,9 +1091,8 @@ partial class Dump
|
|||||||
List<ulong> tmpList = [];
|
List<ulong> tmpList = [];
|
||||||
|
|
||||||
foreach(ulong ur in _resume.BadBlocks)
|
foreach(ulong ur in _resume.BadBlocks)
|
||||||
{
|
for(ulong i = ur; i < ur + blocksToRead; i++)
|
||||||
for(ulong i = ur; i < ur + blocksToRead; i++) tmpList.Add(i);
|
tmpList.Add(i);
|
||||||
}
|
|
||||||
|
|
||||||
tmpList.Sort();
|
tmpList.Sort();
|
||||||
|
|
||||||
@@ -1256,7 +1260,7 @@ partial class Dump
|
|||||||
1,
|
1,
|
||||||
false,
|
false,
|
||||||
_dev.Timeout,
|
_dev.Timeout,
|
||||||
out cmdDuration);
|
out double cmdDuration);
|
||||||
|
|
||||||
totalDuration += cmdDuration;
|
totalDuration += cmdDuration;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user