EUG PD


Disk Bites Dust!

 
Published in EUG #23

Of all the things that can happen when you're writing a program - amongst the bugs, computer crashes and myriad of other hazards - having a disk failure is perhaps the worst. Unfortunately, nobody has yet come up with a failure-proof system so you can bet your bottom dollar that when you're reading this, somebody somewhere is about to commit GBH against their computer. But when it actually happens to you, it is somewhat more than a statistic.

Therefore, when it happened to me, sometime last week, I did not know where to begin or what to do (other than risk that charge of GBH). All I knew was that I had just saved my latest game (which has since been shelved), gone off to lunch, come back and my so-called trustworthy Electron gave me a remarkably unhelpful 'Broken Directory' error. All the information my Plus 3 manual was prepared to cough up was that my disk was in an "inconsistent state". Hmmmm, so where did that leave me? Wading through 655,360 separate bytes and checking each one is consistent? Thanks for the help.

So, what did I do first? Checked I had made a backup of all the programs on the disk, of course. I hadn't. So, what about making a backup of the game Knights which I had completed a few weeks earlier? In my dreams. There was all of one copy of this game in the entire universe. Hmmmm again.

Two bottles of Vodka later (Joke!) and I had guessed what to do. Load up a sector editor (I used the one off Advanced Disk Toolkit (ADT)) and play around with the disk. I tried changing the BOOT option number, which is stored near the end of the Free Space Map, Sector One. The punishment for doing this, without updating the checksum, would've made Captain Bligh proud. I was now not even allowed access to ADT's sector editor! I was given the error message 'Bad FS Map' (FS meaning Free Space) every time I tried. It didn't make me feel much better knowing that even if I could cure this new error, I would still have a 'Broken Directory'.

Eventually, I tried using routines which would directly access the sectors I wanted. This is because I couldn't see why ADT was needing to access the FS map, when I was asking to look at something completely different. In retrospect, I presume it was going through 'official channels' for maximum compatibility. The routines I ended up using were from old issues of Electron User and written by Roland Waddilove - and they worked! The first thing I tried to use was his Sector Editor (EU 3. 6 March 1986), inferior as it was to ADT's. Not only did it work but it cured the 'Bad FS Map' error so after I had changed the BOOT options back to what they were originally, I could use ADT's editor again!

Having learned my lesson though, before I tried playing around again, I used Roland's (or should that be Mr Waddilove's?) other utilities to search for my programs using strings and such like (Electron User 3.07 April 1986). When I'd found where they were actually stored, I used another of the Big R's programs (again EU 3. 7!) to copy them to another disk. Now I could go on to checking what was actually wrong with my directory.

This part was probably the quickest of all, and was where I discovered something that really surprised me. I was just surfing up and down my root directory and I learned the painful lesson that my version of ADFS was prepared (under extenuating circumstances, of course!) to save my programs over the top of sector three onwards! Now, for the less educated amongst us (Me included!), this means that the computer started saving the program 256 bytes into the root directory! Imagine that!

What could I do? Well, fortunately, it hadn't actually written over my directory entries, and the addresses of where they exist; in other words, the last filename in my root directory ended just before my 'saved' program started. I therefore looked on another disk, to see what is stored after the directory names, and most of it is just zeros - so I poked these in. At the very end of the directory are a few numbers to do with the options etc. of the directory. These are listed in the Plus 3 User Guide. After entering these, I found my disk worked again!

I would like to say a big thank you to the people who tried to help me: Richard Dimond, Bill Bradbury and Gus Donnachaidh. Special thanks also goes out to Roland Waddilove who, all those years ago, cast in stone the utilities that have helped me to bring you Knights in this issue's Game Show.

Ross Little, EUG #23

Ross Little