[net.micro.cpm] Intercepting BDOS errors

dont@tekig1.UUCP (06/19/84)

X
     I've been told that somebody published a note, explaining how to catch
errors, and give the user a chance to recover, before bailing out of the
program.  I'm thinking of things like drive door being open, drive being
read only, etc.  Along the same lines, I'd like to put together a disk backup
utility that would not let the user format the source disk, and then wait to
copy the blank one onto it.  If the disk has been erased with a tape eraser,
there is no directory to check for.  I'm looking for these to be truly bullet
proof, if there is ANY chance of error, the user may be better off without
them.  (All this is targeted for a Zenith Z89 with 2.2.03 CPM, if that matters)
Many Thanks in Advance
Don Taylor
tektronix!tekig1!dont

brian@sdccsu3.UUCP (06/20/84)

a

Near the front of the BDOS there are 4 consecutive jump addresses.
Normally, these have the addresses of BDOS's error handlers (which print
the dreaded BDOS ERROR ON B sort of messages).  You can replace them
with addresses of your own if you wish.  There is one each for
	disk read only
	file read only
	select error
	bad sector

You will find them after the initial jump instruction in the bdos - for
example, in a 56K cp/m, the bdos starts at CC06, and the jump addresses
are at CC09, CC0B, CC0D, CC0F.

In a BBS system I created once, these types of bdos errors should not
ever have happened, so I replaced the addresses at boot time
(dynamically) with the address of a subroutine that printed out "system
error" and aborted the current operation, then jumped to location 0 to
warmboot the system.  Seemed to handle most of the problems.

-- 
	-Brian Kantor, UC San Diego 
	
	ihnp4 \		Kantor@Nosc
	decvax \
	akgua   -----  sdcsvax  ----- brian
	dcdwest/
	ucbvax/