Verify the
the dataread for
correctness
(using a embedded code)
Retry if
verification fails
Implementation:
Every sector
of the disk contains
a check sum
on the stored data in the
sector:
Data of 1 sector:
+---------------------------------------------+--------+
| data stored in 1 sector | chksum |
+---------------------------------------------+--------+
Read:
success = false;
NTries = 0;
/* ===============================================
Try reading a sector for upto N times
=============================================== */
while ( not success && NTries < N ) // Try up to N times !!!
{
read sector;
compute checksum of the data;
if ( computed checksum == recorded checksum )
success = true;
else
NTries++;
}
Write:
1. compute checksum on data;
2. Write data + check sum Optional:
Read the data back and verify....
(The
optional part
is usuallynot done because
to
heavy price
on performance !!!)