BIOS int 13h: WRITE test vs WRITE + READ test
Posted: 2015.08.01. 08:51
I've been trying to understand WRITE test vs WRITE + READ test. On the surface these two tests are kind of similar.
"WRITE test - Overwrites the disk surface with configurable pattern. Forces the analysis of any weak sectors and verifies any hidden problems and fixes them by reallocation of bad sectors (this is drive regeneration)."
"WRITE + read test (Pro version only) - Overwrites the disk surface with configurable pattern and then reads back sector contents, to verify if they are accessible and consistent. Forces the analysis of any weak sectors and verifies any hidden problems and fixes them by reallocation of bad sectors (this is drive regeneration)."
I guess eventually BIOS int 13h is called to run these tests. To better understand these two tests, I translated the above descriptions into the following pseudo code.
Would you please confirm whether the translation is correct?
Thank you very much.
"WRITE test - Overwrites the disk surface with configurable pattern. Forces the analysis of any weak sectors and verifies any hidden problems and fixes them by reallocation of bad sectors (this is drive regeneration)."
"WRITE + read test (Pro version only) - Overwrites the disk surface with configurable pattern and then reads back sector contents, to verify if they are accessible and consistent. Forces the analysis of any weak sectors and verifies any hidden problems and fixes them by reallocation of bad sectors (this is drive regeneration)."
I guess eventually BIOS int 13h is called to run these tests. To better understand these two tests, I translated the above descriptions into the following pseudo code.
Code: Select all
WRITE test:
// Forces the analysis of any weak sectors and verifies any hidden problems and fixes them by reallocation of bad sectors (this is drive regeneration).
do {
do {
call int 13h, ah=3h; // like DOS copy without /V
} until (errorCode==0);
call int 13h, ah=4h;
} until (errorCode==0);
WRITE + READ test:
// Forces the analysis of any weak sectors and verifies any hidden problems and fixes them by reallocation of bad sectors (this is drive regeneration).
do {
do {
call int 13h, ah=3h; // like DOS copy without /V
} until (errorCode==0);
call int 13h, ah=4h;
} until (errorCode==0);
// reads back sector contents, to verify if they are accessible and consistent
call int 13h, ah=2h;
if (errorCode==0) then {
cmp read with written;
}
Thank you very much.