diff options
author | Robert de Bath <rdebath@poboxes.com> | 1998-07-01 01:00:00 +0200 |
---|---|---|
committer | Lubomir Rintel <lkundrak@v3.sk> | 2013-10-23 23:40:31 +0200 |
commit | ec5f28e3f1400b5dacb88eda2d9db472a20b4349 (patch) | |
tree | b3215b2306709d0412fd7845c78ca63ccaa2e29b /bootblocks/trk_buf.c | |
parent | 2f828530e36a02c5b4c534e42ab812370c2bf7d9 (diff) | |
download | dev86-ec5f28e3f1400b5dacb88eda2d9db472a20b4349.tar.gz |
Import Dev86src-0.14.3.tar.gzv0.14.3
Diffstat (limited to 'bootblocks/trk_buf.c')
-rw-r--r-- | bootblocks/trk_buf.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/bootblocks/trk_buf.c b/bootblocks/trk_buf.c index 3039169..7fbb4c9 100644 --- a/bootblocks/trk_buf.c +++ b/bootblocks/trk_buf.c @@ -27,6 +27,7 @@ void reset_disk() if( data_buf2 ) free(data_buf2); data_buf1 = data_buf2 = 0; last_drive = disk_drive; + bad_track = -1; if( !(disk_drive & 0x80 ) ) { @@ -71,7 +72,7 @@ long sectno; int phy_h = 0; int phy_c = 0; - if( disk_drive != last_drive ) reset_disk(); + if( disk_drive != last_drive || sectno == 0 ) reset_disk(); if( disk_spt < 0 || disk_spt > 63 || disk_heads < 1 ) { @@ -115,10 +116,10 @@ long sectno; { rv = phy_read(disk_drive, phy_c, phy_h, phy_s+1, 1, data_buf1); tries--; - if( rv ) printf("Error in phy_read(%d,%d,%d,%d,%d,%d);\n", - disk_drive, phy_c, phy_h, phy_s+1, 1, data_buf1); } while(rv && tries > 0); + if( rv ) printf("Disk error 0x%02x %d:%d:%d:%d[%2d] -> 0x%04x[]\n", + rv, disk_drive, phy_c, phy_h, phy_s+1, 1, data_buf1); if(rv) return 0; else return data_buf1; } @@ -132,7 +133,7 @@ int phy_c, phy_h, phy_s; int rv, nlen; /* Big tracks get us short of memory so limit it. */ - nlen = (disk_spt-1)/22; + nlen = (disk_spt-1)/24; nlen = (disk_spt+nlen)/(nlen+1); trk_no = (long)phy_c*disk_heads*4+phy_h*4+phy_s/nlen+1; @@ -176,7 +177,6 @@ int phy_c, phy_h, phy_s; data_buf1 = data_buf2; data_buf2 = 0; data_trk2 = -1; } - bad_track = -1; data_trk1 = -1; /* Not enough memory for track read. */ @@ -187,10 +187,10 @@ int phy_c, phy_h, phy_s; rv = phy_read(disk_drive, phy_c, phy_h, phy_s/data_len+1, data_len, data_buf1); tries--; - if( rv ) printf("Error in phy_read(%d,%d,%d,%d,%d,%d);\n", - disk_drive, phy_c, phy_h, phy_s/data_len+1, data_len, data_buf1); } while(rv && tries > 0); + if( rv ) printf("Disk error 0x%02x %d:%d:%d:%d[%2d] -> 0x%04x[]\n", + rv, disk_drive, phy_c, phy_h, phy_s/data_len+1, data_len, data_buf1); /* Disk error, it'll try one at a time, _very_ slowly! */ if(rv) |