Path: utzoo!utgpu!water!watmath!clyde!rutgers!sri-spam!ames!amdahl!nsc!voder!wlbr!pete From: pete@wlbr.EATON.COM (Pete Lyall) Newsgroups: comp.sys.m6809 Subject: Re: Suggestion for an OS9 utility Keywords: Bad Disk Sectors Message-ID: <1169@wlbr.EATON.COM> Date: 22 Jan 88 00:08:42 GMT References: <2265@ihwpt.ATT.COM> Reply-To: pete@wlbr.UUCP (0000-Pete Lyall) Organization: Eaton IMS, Westlake Village, CA Lines: 45 In article <2265@ihwpt.ATT.COM> knudsen@ihwpt.ATT.COM (mike knudsen) writes: >I'd like to find, or get help to write, a simple (?) >utility that would read thru an entire diskette and >find all the bad (as in unreadable) sectors and mark >them as in-use on the sector allocation bitmap so that >they would never be assigned to any future files. Mike - I wrote a little nasty tool several years back in B09 to do something similar. It reads all the sectors on the media (number is determined from LSN0), and barks at errors (optionally to a disk_error_log). In the event of a CRC error, it'll attempt to rewrite the sector to itself.. usually a recovery. It did not deallocate a sector from the free map, although bitmap operations aren't as tough as they look, and could semi-easily be retrofitted with 'syscall'. This is especially simplified by the fact that most everyone uses a clustersize of 1 bit = 1 sector. The code really needs to be cleaned up and rewritten, best probably if in C. I keep meaning to, but you know the drill... If you're volunteering to do just that, I'll be happy to mail you the code. Some other tips are that you get a *lot* better throughput if you read a track at a time: (i.e. read(diskpath, trakbuff, tracksize_in_bytes)) If you get an error, *then* identify which sector of the track was offensive. BTW - what inroads are you making into OS9, Midi, and music? We (os9 forum) have a group of active MIDI junkies (self included) that are about to christen a MIDI driver, and some other stuff. Also, be advised that Lester Hands (Musica, Lyra, etc.) has been seduced by Level II (with a little gentle prodding *8^}), and is working on a windowfied version of OS9 Lyra. -- Pete Lyall (OS9 Users Group V.P.) Eaton Corporation (818)-706-5693 Compuserve: 76703,4230 (OS9 Sysop) OS9 (home): (805)-985-0632 (24hr./1200 baud) Internet: pete@wlbr.eaton.com UUCP: {ihnp4,scgvax,jplgodo,voder}!wlbr!pete