APPENDIXG
DISK OPERATING SYSTEMS: Commodore and
CP/M
The Disk Operating System (DOS)
is
the software that provides
an
interface between
the host computer and the drive's internal mass storage devices and diskettes. The DOS
keeps track
of
the
file
management details necessary to create, modify, and delete files.
It
also monitors the amount
of
free space
on
a diskette, keeps track
of
the
file
names in a
directory, and remembers where each
is
so that the
files
won't overlap.
Commodore DOS
The
1571
is
an 'intelligent' device. That means
it
contains its own CPU and ROM,
which allow it to function,
in
part, without the aid
of
the host CPU. Despite that, the
1571
is
considered a 'slave' device, existing primarily
to
perform tasks requested
by
a host
computer.
An example
of
the host/drive relationship
is
when
the
host requests a directory
of
all
files on a diskette. The host sends the directory command to the drive, then simply waits
for the drive
to
send back the information. The drive,
on
the other hand, must first check
to see if the diskette
is
inserted, start
it
spinning, wait until it
is
spinning at the proper
speed, move the read/write head
to
the track where the appropriate information
is
stored,
read it, sort it out, format the information properly, and send it down the serial bus to the
host.
The ROM software in the
1571
can
be
broken down into two major
components-
the DOS and the Controller.
As
mentioned above,
the
DOS takes care of the
file
management details. The information for those
files
is
arranged
on
the diskette in
uniformly-sized chunks called sectors. The DOS only understands information
in
the form
of
sectors. It
is
the job
of
the Controller
to
actually
go
out and read sectors from the
diskette and hand them
to
the DOS.
The C64 computer or the C
128
computer in C64 mode contain
no
DOS
of
their own.
All
of
the DOS software
is
in
the drive itself. That's also the case with the CI28 in CI28
mode, the difference being that the relationship between the
1571
and the C128
is
friendlier when the computer
is
in C128 mode.
As
a result, some
of
the more common
commands such
as
SAVE/DSAVE, LOAD/DLOAD, and NEW /HEADER are easier to
execute.
For instance, to format a disk with a C64 or with a C128 in C64 mode, you must send
the following command (after opening channel 1 to the drive's command channel
15):
PRINT# 1, "NEW0:name,id" or HEADER
"name",
lid, D0.
With the C128 in C128 mode, the command
is
this: HEADER
"name,id"
,D0
The latter method
is
easier because the
Cl28
automatically opens the channel and
sends the correctly formatted command string
to
the drive.
It
then requests status
information and reports any errors. To check the error in C64 mode, you would have
to
type several more lines.
CPiMDOS
In
CP/M mode, the DOS resides inside the host computer, and only the Controller
portion
of
the
1571
is used. The DOS code is loaded into the host's RAM when the CP/M
system is booted, and is executed by the host's CPU. All
file
handling functions are
performed within the host. Commands sent to the drive in CP/M mode request individual
sectors
of
data from the diskette. These sectors are located and read by the Controller in
the 1571, and handed
to
the CP/M DOS over the serial bus
to
the C128.
118