I was assigned to port the Bad Block Detector (BADBLK? I don't remember exactly) to the 64 bit architecture. The 'port' turned out to be change the build files to use the correct compiler and flags. I don't remember if the tool was written in PL/1, Bliss or VAX assembler, but we had compilers (yes, even for VAX 32 bit assembler) for all of them. The interesting part was the testing.
A Bad Block Detector is a piece of software that watches for disk blocks going bad, and remaps them to spare capacity (your spinning rust disk is lying about its size - don't know if this is true for SSDs). It might even try to copy data from the failing blocks to the remapped space if there's time. More modern h/w does this in the firmware on the drive. It's transparent to the OS. Testing this behaviour is... challenging.
Recipe: Test the Bad Block Detector
Serves: millions
Time: A couple of hour elapsed
Ingredients:
- a VAXstation - i.e. a biggish desktop machine that can run Alpha emulation well enough for our purposes. All of its disks are connected on a SCSI bus.
- a 3.5inch floppy drive with a SCSI connection (yes, you read that right)
- a box of 3.5 inch disks
- a paperclip
Method:
Boot emulated environment. Set cross compiled Bad Block Detector running. It watches for 'interesting' disk related events.
Insert floppy disk. Note the Bad Block Detector does nothing (because disk has no bad blocks.)
Take paperclip in right hand.
Take fresh disk in left hand. With pinky finger, push back the sliding cover that protects the delicate rusty surface.
Using paperclip, gouge a few hundred kilobytes of damage into rusty surface.
Replace good disk with scratched disk.
Watch console for proof that Bad Block Detector woke up, spotted the badness, and remapped its little heart out.
Serve to delighted and amazed customers.
Loose billions of dollars, arrange purchase by Compaq, rinse, repeat.