Reading Disk Drive Errors
It is sometimes helpful to read the disk drive error channel when the drive red light is flashing. Here is a small BASIC program
to do that. It reads the channel, displays the error message, and turns the red activity LED off.
10 OPEN 15,8,15
20 INPUT#15,EN,EM$,ET,ES
30 PRINT EN,EM$,ET,ES
40 CLOSE 15
This program and all of the possible drive error messages are listed in the back of the disk drive operators manual. (Appendix B)
-- Ray Carlsen --
APPENDIX B: SUMMARY OF CBM FLOPPY ERROR MESSAGES
Error code | Description |
0 | OK, no error exists. |
1 | Files scratched response. Not an error condition. |
2-19 | Unused error messages: should be ignored. |
20 | Block header not found on disk. |
21 | Sync character not found. |
22 | Data block not present. |
23 | Checksum error in data. |
24 | Byte decoding error in data. |
25 | Write-verify error. |
26 | Attempt to write with write protect on. |
27 | Checksum error in header. |
28 | Data extends into next block. |
29 | Disk id mismatch. |
30 | General syntax error |
32 | Invalid command. |
32 | Long line. |
33 | Invalid filename. |
34 | No file given. |
39 | Command file not found. |
50 | Record not present. |
51 | Overflow in record. |
52 | File too large. |
60 | File open for write. |
61 | File not open. |
62 | File not found. |
63 | File exists. |
64 | File type mismatch. |
65 | No block. |
66 | Illegal track or sector. |
67 | Illegal system track or sector. |
70 | No channels available. |
71 | Directory error. |
72 | Disk full or directory full. |
73 | Power up message, or write attempt with DOS Mismatch |
74 | Drive not ready. |
20 | READ ERROR (block header not found) The disk controller is unable to locate the header of the requested data block. Caused by an illegal block number, or the header has been destroyed. |
21 | READ ERROR (no sync character) The disk controller is unable to detect a sync mark on the desired track. Caused by misalignment of the read/writer bead, no diskette is present, or unformatted or improperly seated diskette. Can also indicate a hardware failure. |
22 | READ ERROR (data block not present) The disk controller has been requested to read or verify a data block that was not properly written. This error message occurs in conjunction with the BLOCK commands and indicates an illegal track and/or block request. |
23 | READ ERROR (checksum error in data block) This error message indicates that there is an error in one or more of the data bytes. The data has been read into the DOS memory, but the checksum over the data is in error. This message may also indicate grounding problems. |
24 | READ ERROR (byte decoding error) The data or header has been read into the DOS memory, but a hardware error has been created due to an invalid bit pattern in the data byte. This message may also indicate grounding problems. |
25 | WRITE ERROR (write-verify error) This message is generated if the controller detects a mismatch between the written data and the data in the DOS memory. |
26 | WRITE PROTECT ON This message is generated when the controller has been requested to write a data block while the write protect switch is depressed. Typically, this is caused by using a diskette with a write a protect tab over the notch. |
27 | READ ERROR (checksum error in header) The controller has detected an error in the header of the requested data block. The block bas not been read into the DOS memory. This message may also indicate grounding problems. |
28 | WRITE ERROR (long data block) The controller attempts to detect the sync mark of the next header after writing a data block. If the sync mark does not appear within a pre-determined time, the error message is generated. The error is caused by a bad diskette format (the data extends into the next block), or by hardware failure. |
29 | DISK ID MISMATCH This Message is generated when the controller has been requested to access a diskette which has not been initialized. The message can also occur if a diskette has a bad header. |
30 | SYNTAX ERROR {general syntax) The DOS cannot interpret the command sent to the command channel. Typically this is caused by an illegal number of filenames, or patterns are used. For example, two file names may appear on the left side of the COPY command. |
31 | SYNTAX ERROR (invalid command) The DOS does not recognize the command. The command must start in the first position. |
32 | SYNTAX ERROR (invalid command) The command sent is longer than 58 characters |
33 | SYNTAX ERROR (invalid file name) Pattern matching is invalidly used in the OPEN or SAVE command. |
34 | SYNTAX ERROR (no file given) the file name was left out of a command or the DOS does not recognize it as such. Typically, a colon (:) has been left out of the command. |
39 | SYNTAX ERROR (invalid command) This error may result if the command sent to command channel (secondary address 15) is unrecognized by the DOS. |
50 | RECORD NOT PREDSENT Result of disk reading past the last record through INPUT#, or GET# commands. This message will also occur after positioning to a record beyond end of file in a relative file. If the intent is to expand the file by adding the new record (with a PRINT# command), the error message may be ignored. INPUT or GET should not be attempted after this error is detected without first repositioning. |
51 | OVERFINL ROECWOR D PRINT# statement exceeds record boundary. Information is cut off. Since the carriage return is sent as a record terminator is counted in the record size. This message will occur if the total characters in the record (including the final carriage return) exceeds the defined size, |
52 | FILE TOO LARGE Record position within a relative file indicates that disk overflow will result. |
60 | WRITE FILE OPEN This message is generated when a write file that has not been closed is being opened for reading. |
61 | FILE NOT OPEN This message is generated when a file is being accessed that has not been opened in the DOS. Sometimes, in this case, a message is not generated; the request is simply ignored. |
62 | FILE NOT FOUND The requested file does not exist on the indicated drive. |
63 | FILE EXISTS The file name of the file being created already exists on the diskette. |
64 | FILE TYPE MISMATCH The file type does not match the file type in the directory entry for the requested file. |
65 | NO BLOCK This message occurs in conjunction with the B-A command. It indicates that the block to be allocated has been previously allocated. The parameters indicate the track and sector available with the next highest number. If the parameters are zero (0), then all blocks higher in number are in use. |
66 | ILLEGAL TRACK AND SECTOR The DOS has attempted to access a track or block which does not exist in the format being used. This may indicate a problem reading the pointer to the next block. |
67 | ILLEGAL SYSTEM T OR S This special error message indicates an illegal system track or block. |
70 | NO CHANNEL (available) The requested channel is not available, or all channels are in use. a maximum of five sequential files may be opened at one time to the DOS. Direct access channels may have six opened files. |
71 | DIRECTORY ERROR The BAM does not match the internal count. There is a problem in the BAM allocation or the BAM has been overwritten in DOS memory. To correct this problem, reinitialize the diskette to restore the BAM in memory. Some active files may be terminated by the corrective action. NOTE: BAM=Block Availability Map |
72 | DISK FULL Either the blocks on the diskette are used or the directory is at its entry limit. DISK FULL is seat when two blocks are available on the 1541 to allow the current file to be closed. |
73 | DOS MISMATCH (73, CBM DOS V2.6 1541) DOS 11 and 2 are read compatible but not write compatible. Disks may be interchangeably read with either DOS, but a disk formatted on one version cannot be written upon with the other version because the format is different. This error is displayed whenever an attempt is made to write upon a disk which has been formatted in 2 non-compatible format. (A utility routine is available to assist in converting from one format to another.) This message may also appear after power up. |
74 | DRIVE NOT READY An attempt has been made to access the 154] Single Drive Floppy Disk without any diskettes present in either drive, |
Comments