IECHost: creating disk protection errors

In February I did some development to manipulate the job queue on a Commodore 1541 drive, through IECHost. The requirement I had at the time was about creating certain DOS errors so that I would be able to test the IECHost client. Although it turned out that I didn’t need this sort of development for the testing I intended to do, this evening I decided to actually implement the option to create one DOS error, Error 21 on a single sector, as discussed in “Inside Commodore DOS”, page 126.

The IECHost firmware now accepts the ominous command “q1”, which I documented as per below:

q1 <drive number> <track> <sector> - Create error 21 on a single sector

Right. After executing this command on t/s 17/0, I tried to actually read sector 17/0 using the “dr” command (which, in turn, uses the Commodore DOS “U1” command): the drive went fetching the sector, timed out, bumped the read head, tried to fetch again, and finally gave up!

> q1 8 17 0
> dr 8 17 0

Querying the error channel from the drive in use gave me:

> ds 8
21,READ ERROR,17,00

Bingo! I was indeed able to intentionally “mess up” a specific sector to the extent that the drive could not find it any more (that is, until the disk is formatted again).

Why would anybody do that? Well, in my case there are two reasons:

  • for testing purposes, and
  • for reproducing old disk protection schemes that did expect certain DOS errors to occur on specific sectors.

Such errors would be difficult to copy from an original disk or re-create on a clone without quite some experience using the drive’s Interface Processor (IP).

As well as writing code to create additional errors on tracks and/or sectors, I will add the ability to copy an error from one disk (protected original) to another (backup clone).
In short, I plan to replicate the functionality of most programs that are part of Chapter 7 of “Inside Commodore DOS”.

Stay tuned!

About Luigi Di Fraia

I am a Senior DevOps Engineer so I get to work with the latest technologies and open-source software. However, in my private time I enjoy retro-computing.
This entry was posted in Retrocomputing, Technical and tagged , , , , , , , , . Bookmark the permalink.

1 Response to IECHost: creating disk protection errors

  1. Pingback: IECHost: more Commodore DOS errors | Luigi Di Fraia's e-Footsteps

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s