Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!linus!decvax!harpo!seismo!hao!hplabs!sri-unix!rconn@brl
From: rconn@brl@sri-unix.UUCP
Newsgroups: net.micro.cpm
Subject: Re:  BDOS secrets
Message-ID: <3629@sri-arpa.UUCP>
Date: Fri, 29-Jul-83 15:56:47 EDT
Article-I.D.: sri-arpa.3629
Posted: Fri Jul 29 15:56:47 1983
Date-Received: Mon, 1-Aug-83 09:26:04 EDT
Lines: 39

From:      Rick Conn 

Hi --

1.  The first six bytes of the BDOS (before the entry point) contain the
serial number.  In CP/M systems, the serial number is contained within
the CCP and the BDOS.

2.  The four byte-pairs after the entry point are addresses of subroutines
to be executed when certain BDOS errors occur.  Specifically, these four
byte pairs have the following meanings:

	1st Pair:  Address of Permanent Disk Error routine; this
			routine is executed when bad block is encountered
	2nd Pair:  Address of Select Error routine; this routine
			is executed when a select to an invalid disk
			(such as E when the BIOS allows for up to D)
			is made
	3rd Pair:  Address of Disk R/O Error routine; this routine
			is executed when a write to a R/O disk is attempted
	4th Pair:  Address of File R/O Error routine; this routine
			is executed when a write to a R/O file is attempted

As a rule, these routines usually print an error message and then do a
warm boot.  Utilities may use these to trap out errors they cause and
perform other functions besides warm boot.

To summarize, the picture looks like this:

Base of BDOS:	DS	6	;Serial Number
		JMP	BDOSE	;Enter the BDOS at the command processor
		DW	PERSUB	;Permanent Disk Error
		DW	SELSUB	;Select Disk Error
		DW	ROSUB	;R/O Disk Error
		DW	RONSUB	;R/O File Error
BDOSE:		...		;BDOS command processing


	Rick