BIOS, CRDOS. Part 3.
ZXNet echo conference «zx.spectrum»
From Alexander Shherbakov → To All 2 April 1998
■ All, do you respect me?
OPERATING SYSTEM CR-DOS version 1.5
-+--+--+--+--+--+--+--+--+--+--+--+---
The meaning of developing a new operating system (hereinafter DOS) for 8-bit computers with processor VM80, consisted of:
- eliminating the shortcomings characteristic of DOS CP/M;
- bringing the service and capabilities closer to DOS MS-DOS;
- ease of configuration (from the point of view of the user
and programmer) of the operating system.
The name of the operating system CR-DOS is translated as
Cassette RAM-Disk Operating System.
Note that DOS CR-DOS works with a magnetic tape drive (ML), emulating a real disk. Therefore, most
disk functions and commands work with HML as a disk.
Moreover, it is possible to work comfortably with HML even in the absence
of other disks, since (in particular) the HML driver allows
not only to copy files from cassette to cassette (as with 2 drives), but also using a special software mechanism
(know-how) to freely access any block file
on the ML when writing or reading.
The author's many years of experience in using various PCs have shown
that the operation of a PC such as an IBM PC with a floppy drive is carried out -
occurs at a very low speed. For slower 8-bit PCs with a frequency of 2 MHz on a 580VM80 processor, the exchange rate with a floppy disk does not exceed 2 - 5 kilobytes per second.
Based on this, it seems more optimal to use RAM disks instead of real floppy disks.
CR-DOS is capable of supporting up to 26 electronic disks.
To work with a PC, it is proposed to use the following
types of electronic disks, indicating the optimal size (the use of the concept "electronic disk" is more legitimate than
RAM disk, but for brevity the words
RAM disk will be used):
ROM, 16 - 64Kb - is bootable, contains DOS, system
and a number of application applications programs.
RAM, 64 - 256Kb -electronic disk, organized in additional
memory, used for everyday work.
Static. RAM, 32 - 128Kb -electronic disk on static memory chips
with backup power from SC type batteries,
can be used for intermediate storage of files.
EPROM, 32 - 256Kb -electronic disk on electrically reprogrammable microcircuits. Can be used as
an archive disk (due to the low exchange speed).
In addition to the indicated quasi-disks, you can
use a 3-inch floppy drive with 720Kb or 1.44MB. A
for file exchange between quasi-disks and floppy disks, use a special service program, because CR-DOS version 1.5 cannot work effectively with real disks. Our use of a 3" drive is based on three reasons:
1. 3" drive is smaller in size, in contrast to 5", and
its placement requires less volume.
2. 3" floppy disks are more convenient to use, because they
are smaller in size and the hard plastic casing better protects
the magnetic disk from mechanical damage.
3. Storing information on a 3" drive is more reliable than on a
5".
4. Storing information on 3" floppy disks is cheaper than on 5" floppy disks, due to the larger capacity of 3" floppy disks.
Software DOS consists of 3 parts, each of which
is located in its own file, which simplifies configuring the system
and transferring it to another computer. DOS consists of the following
parts:
1. BIOS - a basic input/output system that complements the
capabilities of the built-in BIOS, file: IO.SYS.
2. BDOS - a basic disk operating system containing
file structure, file: CRDOS.SYS.
3. CCP - command processor,processing operator commands, file: COMMAND.COM.
BIOS
BIOS included in DOS communicates BDOS with
BIOS located in ROM. Since the operating system
can be installed on computers with different levels of service
built-in BIOS, in addition to connecting the BDOS with the ROM BIOS of a specific machine, the BIOS included in the DOS can perform
exchange functions with the computer hardware. For example, exchange with disk drives, magnetic tape drives, extended exchange with console, printer, i.e. those functions that are absent in
the standard ROM BIOS.
The exchange between the BIOS and BDOS includes the following functions
actually performed by the BIOS or emulated by it:
- system initialization during boot (cold start);
- system initialization during a “hot” start;
- polling the state of the keyboard, printer;
- entering a character with keyboard;
- displaying a symbol on the display, printer;
- reading and writing a tape marker onML;
- reading and writing a block of information on ML;
- reading the boot sector and issuing disk parameters;
- reading and writing a sector to the disk;
- issuing the starting address of the disk table;
- issuing the starting address of the I/O device table;
Moreover, the last two functions provide the address in RAM, on which
the specified tables (know-how) are located, with a description
of the supported ones RAM disks and input/output devices. The structure of these tables is quite simple and even a novice programmer can use them to easily connect the devices necessary for
work to the computer.
BDOS
DOS CR-DOS has the same functionality as DOS CP/M, and provides 99% compatibility of programs written for CP/M, but working in the environment CR-DOS. However, there are a number of differences related to the features of CR-DOS. In
in particular, CR-DOS can service up to 26 RAM disks, 16
external serial and parallel input/output devices. In addition, it is planned to introduce into BDOS Handle oriented functions for exchanging files and external devices,
which significantly simplifies working with DOS at the file level, rather than cumbersome FCB functions. Perhaps in the future,Handle functions
may become a standard for 8-bit PCs.
RAM disk structure.
The minimum addressable space on a RAM disk is
a physical sector:
┌──────────────────────────── ────────────┬────────────┐
│ Data area 128 bytes │control │
│ (logical sector) │amount 1 byte│
└──────────────────────────── ────────────┴────────────┘
The physical sector size is 129 bytes. The first
128 bytes of them are the data area and form a logical
sector, the contents of which are available for reading and
modification of DOS. The last (129th) byte is intended to store
the checksum (modulo 256) of the logical sector.
Work at the level of physical sectors, as well as processing
of the checksum, is carried out by the RAM disk driver. However, only 128 bytes of the data area and device status
bits are transferred to DOS
.
The RAM disk consists of the following parts:
- boot sector, (BOOT)
- data area (Data Area).
The boot sector contains information about the RAM
disk format and service information, and has a length that is a multiple of 128:
128, 256, 512 bytes, depending on the length of the loader programDOS. A standard BOOT sector has a size of 128 bytes or 1
logical sector.
The method of placing files on a RAM disk is similar to DOS
ORDOS for the Orion PC, because is the most optimal for
RAM disks. The disk data area contains information in the format:
┌───────────┬────────────┬ ───────────┬────────────┬- ─┐
│ Header │ Content │ Header │ Content │ ... │
│ file │ file │ file │ file │ │
└───────────┴────────────┴ ───────────┴────────────┴─ ─┴
The file header is 32 bytes long and contains:
1. name (8 characters) and extension (3 characters) of the file,
2. file attributes (1 byte),
3. file creation date (2 bytes),
4. file length (3 bytes),
5. starting address of loading into RAM (for executable files-
catch) (2 bytes).
Unused bytes form a reserve, part of which
is used by DOS when writing files to the ML, and as working cells
when working with a specific file. The rest of the
can be used at the discretion of the PC user.
The file content can have a length from 0 bytes to the maximum possible length determined by the size of the RAM disk, but
be no more than 65536 sectors or about 8 MB.
CCP
The command processor communicates with the user
through the command line. Based on the modularity of DOS, you can
install, instead of the standard CCP, your own command processor
endowed with additional functions.
The commands executed by CPP are as follows (the description syntax
is generally accepted - {|} means or, the [] -parameter may be absent):
MOTOR [{ ON | OFF }] -switching, turning on,
turning off the HML motor (necessary
when rewinding,
rewinding ML, etc.).
DIR [mask] - output of the disk directory.
ERA [mask] - deleting files.
REN old_file new_file - renaming the file.
FORMAT disk [parameters] -formatting the RAM disk.
- 6 -
LOAD { file_name | . }[, address] - loads a data file into
RAM.
executable_file_name [parameters] - launches the file for execution.
SAVE file_name, address1-address2 - writes a section of RAM to disk.
TYPE { file_name | . } [options] - view the contents of the file.
COPY source destination - copy information.
BUFMEM address1-address2 - reserve memory for
I/O buffer.
SYS disk - install the system disk.
PATH disk [drive [...]] - specify search paths for system files.
VER - display the version number.
{ HELP | ? } -issuing help.
Notations: Alex spent a little time with By you.
mask -[
drive -
filename -implicit: use of global symbols '?'
and '*',
explicit: standard file name
source -{ mask | device }
receiver -{ mask | device }
device - supported I/O device: PRN, CON, AUX,
NUL, etc.
address - hexadecimal number, leading zeros are omitted and the hexadecimal marker (symbol 'H') is not placed.