cj7hawk
Veteran Member
Thanks to Chris Radek, FSCK has now been tested on vintage hardware and not just my one-of-a-kind lockdown project. This is an Imsai, a Z80 S100 machine running CP/M 2.2 with an 8" single sided single density (standard IBM 3740 format) floppy. There were some issues, but these have been fixed with the help of the owner and we now have FSCK 1.2. See: https://github.com/rundel-tech/ZARC/tree/main/software/cpm/cpm_dev/fsck for details.
Nice project - I'll pull it down and have a play with it later. From the source comments; (which provides an idea of what it does.)
signon_msg byte "*** CP/M File System Checker V1.2 ***", 0x0d, 0x0a, 0x0d, 0x0a, "$"
no_z80_msg byte "Z80 CPU required", 0x0d, 0x0a, "$"
op_err_msg byte "Operand error. Expected format: fsck <drive>[:] [/s]", 0x0d, 0x0a, "$"
exit_msg byte "Returning to CP/M.", 0x0d, 0x0a, "$"
memory_msg byte "Insufficient memory", 0x0d, 0x0a, "$"
sel_err_msg byte "Can't select drive.", 0x0d, 0x0a, "$"
disk_err_msg byte "Disk I/O error.", 0x0d, 0x0a, "$"
dir_done_msg byte "Directory checks complete", 0x0d, 0x0a, "$"
files_msg byte "Files found: $"
unused_msg byte "Unused directory entries: $"
blocks_used_msg byte "Blocks used: $"
block_map_msg byte 0x0d, 0x0a, "Block map ('D': directory, 'F': file and '-': unused).", 0x0d, 0x0a, "$"
errors_msg byte "Errors and warnings: $"
no_ss_msg byte "Surface scan skipped", 0x0d, 0x0a, "$"
surf_scan_msg byte 0x0d, 0x0a, "Checking all blocks are readable (surface scan)", 0x0d, 0x0a, "$"
track_msg byte 0x0d, "Track: $"
sector_msg byte ", sector: $"
scan_done_msg byte 0x0d, 0x0a, "Scan complete", 0x0d, 0x0a, "$"
; Directory entry error messages
bad_user_msg byte " - bad user number$"
bad_name_msg byte " - bad file name$"
bad_ex_cnt_msg byte " - bad extent count$"
bad_s1_msg byte " - bad S1$"
ext_dup_msg byte " - duplicated physical extent$"
dble_blk_msg byte " - block not unique$"
sparse_msg byte " - is sparse (holed) [warning]$"
blk_too_big_msg byte " - block number out of range$"
no_alloc_msg byte " - no allocations in physical extent [warning]$"
bad_rc_msg byte " - RC not 0x80 in intermediate extent$"
empty_msg byte " - has no data [warning]$"
I wrote some consistency checks into my PC based DSK editor I wrote last year to move files to and from Spectrum CP/M disks ( Spectum +3 reads Amstrad disks ) - and perhaps the best use of the cross-linked files check was to tell me if I had the disk structure correct.
But different applications seem to use the OS access to disk differently. I noted Wordstar creates extent 3F for temp files so that they don't typically show on a "Directory" listing but are still valid and cannot be overwritten until deleted, and they show on STAT - so the lack of rules around CP/M directory structure probably leads to issues with a FSCK program in some cases - so reporting stuff is nice, and not trying to fix it is nicer -
I intentionally cross-link files in my new OS too, as it's completely valid for that architecture to cross-link CP/M files if the disk is memory - as it just means that multiple programs are using that same page - so the flexibility of CP/M and the lack of rules is actually a really powerful tool and capability. It also means that when I switch back to real CP/M it doesn't cause errors or issues as anything CP/M accepts seems valid by design.
Thanks for sharing - Looking forward to checking out the binary later.
David.