home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Oakland CPM Archive
/
oakcpm.iso
/
cpmug
/
cpmug082.ark
/
NSBIOS.DOC
< prev
next >
Wrap
Text File
|
1984-04-29
|
16KB
|
250 lines
*** North Star BIOS and Support Programs ***
***
*** These routines copyright (c) 1980, 1981, 1982 by Steve Bogolub,
*** 2338 S. Scoville Ave., Berwyn, IL 60402. Jade Double D (tm)
*** disk handlers contributed to the public domain for use on Jade
*** equipment by special permission of Jade Computer Products.
*** This software may be used freely for non-commercial purposes
*** only, and may not be sold.
***
In response to the lack of source routines available in the public domain for
driving the North Star floppy disk controllers, a full set of routines for
supporting these controllers under CP/M 2.2 (tm) was developed. The original
intent was to allow convenient modification of the driver software when
non-standard drives or additional controllers were desired under the control
of a single CP/M 2.2 system. The resulting routines fulfill these goals, and
at the same time provide format compatibility with the industry-standard
Lifeboat Associates double density and single density single-sided North Star
CP/M versions 1.4 and 2.2.
The author's system includes a North Star MDS-A double density controller
with two Shugart Associates SA-400 double density, single-sided disk drives,
packaged in a standard North Star Horizon (tm) computer. Additional hardware
includes a Jade Double D (tm) double density disk controller with two Shugart
Associates SA-800R double density, single-sided disk drives. The primary
serial I/O devices are provided by a QT IO+ (tm) board, with two serial Intel
8251-type devices and programmable baud rates, among other features. The
primary list device is a Teletype (tm) Model 40 printer, driven through the
Horizon right serial port with the Model 40 simplified EIA interface (minimal
handshake lines). A total of 64K of static RAM memory is in the machine, of
which 56K is utilized directly by CP/M 2.2, 4K is overlapped (and thus
unavailable) by the two controllers and the boot PROM, and 4K is reserved in
the address space above the controllers for special-purpose programs. Every
effort has been made to maintain compatibility with a standard Horizon
configuration. Therefore, while the author's system is fully supported, a
system disk generated by these routines will boot up unmodified on a standard
Horizon with a minimum of 56K of memory, double density controller, and at
least one SA-400 disk drive or equivalent.
The routines required to support CP/M 2.2 on a North Star controller include
a BIOS module for CP/M 2.2, a system generation utility for writing out the
system to the system tracks of a North Star diskette, and a format utility for
initializing a diskette in the CP/M format. Each of these routines is included
in a separate module in the author's system. All three modules are coded using
the Intel 8080 assembler mnemonics and source format compatible with the
assembler program ASM, which is provided as a standard utility with all copies
of Digital Research CP/M 2.2. With one exception, all 8080-compatible code is
used. The Z-80 (tm) "LD A,I" instruction is used on entry to the disk driver
routines in BIOS to determine the state of the Z-80 CPU interrupt enable
flip-flop for the purpose of saving and restoring it. All other code in the
North Star routines is 8080-compatible, and even the single Z-80 instruction
should execute harmlessly on an 8080.
The three primary source modules of the author's system are listed below:
(1) NBIOSxx.ASM This is the BIOS module. It supports both the North
Star and the Jade controllers, with the North Star
drives being A: and B:, and the Jade drives being C: and D:. The Jade Double D
is a soft-loaded buffered controller containing its own resident Z-80. The 1K
of control code is stored on the North Star system tracks, and loaded out into
the Jade Double D memory on a cold boot. This BIOS provides the ability to
read and write Lifeboat-compatible single and double density, single-sided
5 1/4" diskettes, as well as industry-standard IBM 3740-compatible single
density, single-sided 8" diskettes, Altos double density Mode 2 8" format,
Morrow Designs Disk Jockey (tm) 2D 1024 bytes/sector double density,
single-sided 8" diskettes, and all standard Jade Double D formats for
single-sided or double-sided 8" drives. Due to the large amount of code
required to drive the North Star double density controller, NBIOSxx requires
an additional 2K of space beyond the 1.5K allocated in a standard Digital
Research CP/M 2.2 single density 8" system. This compares favorably with
the memory requirements of the Lifeboat CP/M 2.2, which requires only 256
bytes less space. Furthur documentation is provided within the source module.
Due to the excellent design of the North Star double density controller,
NBIOSxx is booted directly into its normal position in memory by the controller
boot routine, using a small cold boot section in NBIOSxx itself to read the
balance of the code into memory. This scheme avoids the need for the separate
"track zero" boot module required by most other controllers, including the
North Star single density controller.
(2) NSGEN.ASM This is the system generation utility. It is used to
read or write the system area of a 5 1/4" diskette in a
format compatible with NBIOSxx, and transfers from or to the TPA the CP/M CCP
and BDOS modules, along with NBIOSxx and the Jade Double D control code. The
format of the system tracks is described furthur in this source module, and is
intimately connected with corresponding code in NBIOSxx. Only standard CP/M
2.2 BDOS and BIOS calls are used, allowing bootstrap operation under the
normal Lifeboat CP/M 2.2 operating system.
(3) NSCOPY.ASM This utility provides the format function. It will
standardly format 35-track single-sided drives in
single or double density formats that are Lifeboat-compatible. In addition,
NSCOPY will standardly validate all formats by reading each track, format
80-track double-sided drives in double density, copy all tracks, the system
tracks only, or the data tracks only from one 35-track drive to another, warm
boot the CP/M 2.2 system, or cold boot the North Star controller. In addition,
NSCOPY can be modified with a one-byte configuration patch to support 40-track
drives instead of 35-track, and provide all the same features. NSCOPY contains
its own dedicated North Star controller driver routines, and will utilize all
contiguous memory up to the base of CP/M 2.2 BIOS, resulting in highly
efficient and speedy operation noticeably faster than other North Star copy
utilities. Normal CP/M 2.2 BIOS calls are used for console I/O, allowing this
program to run under the normal Lifeboat CP/M 2.2 operating system if desired.
The above modules provide everything needed along with a standard Digital
Research or Lifeboat CP/M 2.2 to run. Bootstrapping is obviously easier if a
Lifeboat CP/M 2.2 is available, although the author was able to bootstrap the
system using the standard North Star DOS, and Cromemco CDOS, along with a
standard 8" release disk purchased directly from Digital Research. This method
of bootstrapping was not exceedingly difficult, but was certainly much harder
than bootstrapping from an existing North Star CP/M 2.2 system. Needless to
say, in any case, an extensive knowledge of CP/M 2.2 is required, along with
reasonable 8080 assembly language programming proficiency.
Two additional configurations evolved from the routines described above. The
first differs only in the BIOS module. This new BIOS, designated MBIOSxx to
distinguish it from the author's normal BIOS, supports two Wangco 82 40-track
double density, single-sided drives as A: and B:, and supports two MPI 92
80-track double density, double-sided drives as C: and D: (or the equivalent
Tandon double-sided drive if the step rate is adjusted). The rest of the
target configuration included the normal Horizon left serial port as the
console device, and the Horizon right serial port with an Epson MX-80
printer attached as the list device. In addition, a single-byte change
to the system image allows this BIOS to fully support a PMMI 600 baud
MM-103 modem. If the contents of location MODEM in the BIOS are set to
zero when the BIOS is cold-booted, then instead of the normal local
device handlers, the console, list, reader, and punch are attached to
the PMMI modem, just like the public domain program BYE. In this
configuration, the BIOS waits for the phone to ring. When it does, the
phone is answered, and carriage returns must be struck for the BIOS to
determine the baud rate (110,300,450,600, or 710). When the baud rate
has been determined, a password is solicited. If the password is correct,
a normal warm boot is done, and operation of CP/M will proceed as if
the operator was local, except that console input will be accepted from
either the PMMI or the Horizon left serial port, and console output will
be sent to both the PMMI and the Horizon left serial port. This operation
will stay in effect until either the phone is hung up, or a jump is made
to the BIOS cold boot vector. A special trivial MBYE program is provided
to do the latter for convenience.
To accommodate the different step rates of the drives, a special step
rate table is employed that provides timing loop counts for the step
routine. The timings included in the BIOS are for a 4 MHz Z80 with no
wait states.
MBIOSxx supports all the North Star formats that NBIOSxx does, with the
exception of Lifeboat 2.0, which used the now-obsolete 2k group size. This
format was left out because it was retrofitted to NBIOSxx, and the author
thought it was sufficiently rare that it was not worth the effort or drive
table space to include it in MBIOSxx. It could certainly be added, using
the drive select routine of NBIOSxx as a guide, but the memory space in
MBIOSxx is very tight due to the PMMI support, and something would probably
have to be removed to make the new drive table fit.
Given the above slight limitation, and the fact that there is no support
for a second disk controller in this BIOS, it is still certainly the best
choice for a user with only a North Star controller, since it can be easily
modified for 35- or 40-track drive usage, supports a standard Horizon with
a fairly-standard printer (Epson MX-80), and can easily be modified for a
variety of different 5 1/4" drives, both double and single sided, such as the
standard North Star quad-type disks. However, such modifications require an
intimate knowledge of how to configure CP/M 2.2 disk parameter blocks and
skewing tables, and a knowledge of the stepping requirements of the target disk
drive. The normal NSCOPY and NSGEN utilities are used to support MBIOSxx,
with the 1K space normally occupied by the Jade control code reserved in the
TPA and on the disk by NSGEN but not normally used by MBIOSxx. Note that
because of the PMMI support, MBIOSxx uses about 3.5k of memory, just like
NBIOSxx. There is no significant advantage in attempting to remove the
PMMI drivers to shrink the BIOS, since an entire 1k would have to be
removed, and these drivers only account for about .5k of code.
The other additional configuration was created to support the author's North
Star single density disk system. That system consists of a North Star single
density disk controller with up to two SA-400 drives, a 16x64 SSM VB1
memory-mapped video display as the console output device, a parallel keyboard
as the console input device, a Teletype Model 43 (or other compatible) serial
printer as the list device, and a skimpy 21K of static RAM main memory. I/O
devices on this system are memory-mapped. As pointed out above, a separate
boot module is required by this hardware. This configuration is incomplete,
in that no format utility corresponding to NSCOPY is provided that will run
with the single density controller. The author's main Horizon system running
NSCOPY is used to format or copy diskettes for the single density system. On
another user's system, the standard North Star DOS disk-copy and initialize
functions should suffice for those functions, and a disk utility such as Ward
Christensen's excellent DU can be used for clearing the disk directory before
use with CP/M.
On the author's system, only 20K of main memory is contiguous. Taking a page
out of Lifeboat's book, the 1K of non-contiguous memory lends itself well to a
user I/O area scheme. Therefore, this system is implemented with the BIOS
functions separated into two parts, roughly corresponding to the disk I/O
functions in SDNBIOS, and the console and list functions in SDNUSER, resulting
in the four modules described below:
(1) SDNBOOT.ASM This routine resides on track zero, in North Star
physical sector 4. It is read from there by the boot
routine on the single density controller into memory at the fixed location
2000H. When control is passed to SDNBOOT, it reads the various sections of
SDNBIOS and SDNUSER into memory from the system tracks of the diskette. Three
such tracks are required for CP/M 2.2 on a single density disk.
(2) SDNBIOS.ASM All disk I/O routines reside here. Lifeboat-compatible
single density format is supported, but with a CP/M 2.2
parameter block, rather than the Lifeboat single density pseudo-8" disk method.
Disks can be read and written interchangeably by SDNBIOS, NBIOSxx, MBIOSxx,
Lifeboat single density CP/M 1.4, and Lifeboat double density CP/M 2.2. To
overcome the severe speed loss due to lack of sector skewing, full track
buffering is supported standardly, allowing quite respectable operation, with a
penalty of a loss of 2.5K of system memory.
(3) SDNUSER.ASM All console and list I/O routines reside here. The VB1
is used as a glass teletype for console output, with
the single concession of a backspace function on the current line. Due to the
extremely tight space considerations on this minimal machine, some functions
actually reside in SDNBIOS, to utilize all possible space.
(4) SDNSGEN.ASM This is the specialized system generation utility
required for generating the single density system,
corresponding to NSGEN for the double density system. Standard CP/M 2.2 BDOS
and BIOS calls are used, allowing this program to be run on any
Lifeboat-compatible system, single or double density. Normally, the single
density operation of NBIOSxx or MBIOSxx is very slow, due to the lack of
skewing or track buffering under those BIOS'es. To overcome this, SDNSGEN
accesses alternate physical sectors, allowing respectable transfer speeds on
the double density systems, with no penalty on the track-buffered single
density system.
These modules were developed using the pertinant North Star controller
documentation, along with a bit of fiddling around with some of the timing
where the documention was not explicit enough to point out the problem areas
(especially on the single density controller!). They are placed in the public
domain by the author, and may be freely distributed, but may not be sold.
Sections of NBIOSxx pertaining to the Jade Double D were developed from
routines made available to Jade Double D owners by Jade Computer Products, and
appear now in the public domain for use with Jade Double D controllers by
special permission from Jade Computer Products.
Author: Steve Bogolub
Date: May 14, 1982