archeocomp
Experienced Member
I have a 360k floppy disk, formatted to 18x256byte physical sectors per track that has one bad sector - track 37, head 1, sector 11.
I would like to lock out that sector from use.
Here is what I tried.
A>stat dsk:
A: DRIVE CHARACTERISTICS
2880: 128 BYTE RECORD CAPACITY
360: KILOBYTE DRIVE CAPACITY
64: 32 BYTE DIRECTORY ENTRIES
64: CHECKED DIRECTORY ENTRIES
128: RECORDS/ EXTENT
16: RECORDS/ BLOCK
72: SECTORS/ TRACK
0: RESERVED TRACKS
A>mbasic dpb
BASIC-85 Rev. 5.29
[CP/M Version]
Copyright 1985-1986 ¤ by Microsoft
Created: 28-Jul-85
33592 Bytes free
DPB VALUES FOR THE CURRENT DISK --
Sectors per Track 72
Sectors are not interleaved
Block Shift (BSH) 4
Block Mask (BLM) 15
Extent Mask (EXM) 0
Total Sectors (DSM) 179
Directory Entries (DRM) 63
Allocation 0 (AL0) 80H
Allocation 1 (AL1) 0H
Cylinder Offset (OFS) 0
.
.
.
Sectors are numbered from 0 to 17 on each side.
My program FDC says this:
Reading disk (18 sectors per track, 40 tracks)
current track:37
error reading sector(head):
37 11(1)st1 CRC error
I tried to compute allocation unit number:
sector nr -> 37*18*2*2 + 1*18*2*2 + 11*2*2 + 1 -> 2781
alloc unit (2k units) -> 2781/16 -> 173 -> 0ADh
then make any small 1 alloc.unit file
MBASIC
10 print
save "BAD",a
system
A>
ddt bad.bas
d50
0050 00 3C 00 3C 00 3C 00 3C 00 3C 00 00 00 42 41 44 .<.<.<.<.<...BAD
0060 20 20 20 20 20 42 41 53 00 00 80 01 97 00 00 00 BAS........
97 above is alloc unit number
now change it to 0ADh
s6c
006C 97 ad
006D 00 .
now change file extension to CRC
-s65
0065 42 43
0066 41 52
0067 53 43
0068 00
0069 00 .
-d50
0050 00 3C 00 3C 00 3C 00 3C 00 3C 00 00 00 42 41 44 .<.<.<.<.<...BAD
0060 20 20 20 20 20 43 52 43 00 00 80 01 AD 00 00 00 CRC........
-a100
0100 mvi a,16 --make file
0102 lxi d,5c
0105 call 5
0108 mvi a,10 --close file
010A lxi d,5c
010D call 5
0110 rst 7
0111
-s6c
006C 97 ad
006D 00 .
-g100
A>
I see no BAD.CRC file. So I see now it is not that easy :-(
Can anybody help? I am also thinking about writing a program that would accept bad sector numbers and then make lock.out file, but first I want to get it done with DDT if it is possible.
I would like to lock out that sector from use.
Here is what I tried.
A>stat dsk:
A: DRIVE CHARACTERISTICS
2880: 128 BYTE RECORD CAPACITY
360: KILOBYTE DRIVE CAPACITY
64: 32 BYTE DIRECTORY ENTRIES
64: CHECKED DIRECTORY ENTRIES
128: RECORDS/ EXTENT
16: RECORDS/ BLOCK
72: SECTORS/ TRACK
0: RESERVED TRACKS
A>mbasic dpb
BASIC-85 Rev. 5.29
[CP/M Version]
Copyright 1985-1986 ¤ by Microsoft
Created: 28-Jul-85
33592 Bytes free
DPB VALUES FOR THE CURRENT DISK --
Sectors per Track 72
Sectors are not interleaved
Block Shift (BSH) 4
Block Mask (BLM) 15
Extent Mask (EXM) 0
Total Sectors (DSM) 179
Directory Entries (DRM) 63
Allocation 0 (AL0) 80H
Allocation 1 (AL1) 0H
Cylinder Offset (OFS) 0
.
.
.
Sectors are numbered from 0 to 17 on each side.
My program FDC says this:
Reading disk (18 sectors per track, 40 tracks)
current track:37
error reading sector(head):
37 11(1)st1 CRC error
I tried to compute allocation unit number:
sector nr -> 37*18*2*2 + 1*18*2*2 + 11*2*2 + 1 -> 2781
alloc unit (2k units) -> 2781/16 -> 173 -> 0ADh
then make any small 1 alloc.unit file
MBASIC
10 print
save "BAD",a
system
A>
ddt bad.bas
d50
0050 00 3C 00 3C 00 3C 00 3C 00 3C 00 00 00 42 41 44 .<.<.<.<.<...BAD
0060 20 20 20 20 20 42 41 53 00 00 80 01 97 00 00 00 BAS........
97 above is alloc unit number
now change it to 0ADh
s6c
006C 97 ad
006D 00 .
now change file extension to CRC
-s65
0065 42 43
0066 41 52
0067 53 43
0068 00
0069 00 .
-d50
0050 00 3C 00 3C 00 3C 00 3C 00 3C 00 00 00 42 41 44 .<.<.<.<.<...BAD
0060 20 20 20 20 20 43 52 43 00 00 80 01 AD 00 00 00 CRC........
-a100
0100 mvi a,16 --make file
0102 lxi d,5c
0105 call 5
0108 mvi a,10 --close file
010A lxi d,5c
010D call 5
0110 rst 7
0111
-s6c
006C 97 ad
006D 00 .
-g100
A>
I see no BAD.CRC file. So I see now it is not that easy :-(
Can anybody help? I am also thinking about writing a program that would accept bad sector numbers and then make lock.out file, but first I want to get it done with DDT if it is possible.