BIOS, CRDOS. Part 1.
ZXNet echo conference «zx.spectrum»
From Alexander Shherbakov → To All 30 March 1998
■ Greetings All!
ROM-BIOS
--------
ROM BIOS is a software package located in the system ROM. It includes the following programs:
- Initialization and testing (IT);
- The Basic Input/Output System (BIOS);
- Loader with HCML.
IT and BIOS are located in the same ROM, which is necessary for their
normal operation, and Loader can be installed
in both the same and in another ROM. Moreover, the latter is preferable, since it allows, by replacing ROM #2, to install any other program instead of
Loader, for example 'Monitor', testing programs, alternative BASIC, etc., without touching IT and
BIOS.
The Initial initialization and testing program consists
of 3 parts:
1. Initial initialization of the equipment (“hardware”).
2. Equipment testing.
3. Polling and setting parameters in CMOS.
A simplified IT operation algorithm is shown in Fig. 1. Since ROM BIOS is designed for use with any equipment, a mechanism has been introduced into it that allows the user to add his own functions for initialization and
testing of this equipment to the ROM BIOS ROM. At the same timethe user does not
need to disassemble and study the ROM BIOS code to introduce his own routines into the
ROM. Moreover, the first addition of ROM
BIOS can be done on the same chip (of course in
a hand-held programmer or on another computer).
Based on this, in Fig. 1. the initialization and testing functions installed by the user are depicted with a dashed line.
BLOCK DIAGRAM OF OPERATION OF ROM BIOS
-+--+--+--+--+--+--+--+--+--+--+-
Getting started IT
╔═══════════════╗ ╔═══════════════╗
║ initial. BIOS ║<-+--+--->║ additional init.BIOS ║
╚═══════І═══════ў ╚═══════════════ў
│
V
╔═══════╧═══════╗
║ Label ║
╚═══════І═══════ў
│
V
╔═══════╧═══════╗ ╔═══════════════╗
║ testing ║<-+--+--->║ additional testing. ║
╚═══════І═══════ў ╚═══════І═══════ў
│ error │error
V ┌────────┐ V
no╔═══════╧════╧══╗ │ ╔═══════╧═════════╗
┌────Є cold start? ║└───>║ Error handling. ║
│ ╚═══════І═══════ў ║ Retry / Ignore ║
│ │yes ╚═══════І═════════ў
│ V ^
│ ╔═══════════════╗ error │
│ ║ tested. RAM ╟──────────────────┘
│ ╚═══════І═══════ў
└───────────>│
V
╔═══════╧═══════╗ ╔═══════╗
║ installed by CMOS ║<-+--+--->║ Setup ║
╚═══════І═══════ў ╚═══════ў
V
╔═══════╧═══════╗ ╔═══════════════╗
║ installation config. ║<-+--+--->║ additional setup conf. ║
╚═══════І═══════ў ╚═══════════════ў
V
╔═══════╧═══════╗ yes ╔═══════════════╗
║ loading possible?║-+--+--->║ DOS bootloader ║
╚═══════І═══════ў ╚═══════════════ў
Vnet
╔═══════╧═══════╗
║ Loader ║
╚═══════════════ў
Fig. 1.
Brief description of the operation of IT.
After receiving control of the ROM BIOS, IT begins to be executed.
First, the BIOS is initialized, i.e.setting
the required values in the BIOS work area, spinning up the sign
generator, initializing the interrupt controller (if it
exists). The initialization time should not exceed 1 second.
Additional BIOS initialization is installed directly by the user, and its execution time should not
exceed 1.5 seconds.
After the BIOS is initialized and the screen is cleared, the Label is displayed
, i.e. a message about the version and size of the BIOS ROM,
its date of creation, author.
Next, hardware testing begins.
It is advisable not to include a processor self-testing procedure
in IT, since in the event of a malfunction it is impossible to obtain a reliable result about the processor's performance.
In addition, the processor self-test code a priori occupies
most of the ROM.
Therefore, hardware testing begins with checking
the ROM checksum modulo 256. It should be noted that
if a failure in the microcircuit occurred during the ROM testing function,
then the result in this case will not be true. However, the possible indicator of failure of a certain section of the ROM is much lower
than the probability of a processor malfunction.
This is a fairly simple way to test the ROM(by
module 256) was chosen by us for two reasons.
1. Failure of ROM cells will occur over time
gradually, bit by bit, and already when the first failure
occurs, an error will be reliably detected.
2. The user can add additional
functions to the ROM, but so that the checksum of the entire ROM does not
change after this, it is necessary to install correction bytes. For modulo 256 testing, one correction byte is required, which is easier to calculate and enter than with other methods of calculating the checksum.
If an error is detected when testing the ROM, a subroutine for processing it is executed. In this case, the type
of the error is reported (in this case, the calculated checksum
does not match the specified one), then the user is prompted to
retest the object that caused the error or ignore the error.
The additional testing program is installed
directly by the user, and its testing time
should not exceed 3 seconds.
Next, the type of computer reboot is determined ("cold-
or "hot"). In the latter case, the RAM test is skipped. During a cold boot, thenon-destructive
testing of RAM by writing to mask memory cells. Self
testing reveals only immutable or "flickering" bits in RAM. If additional RAM is available, it
is also tested. Moreover, pressing the "ESC" key while testing the main or additional RAM interrupts the RAM test. The duration of the RAM test should not exceed ten
seconds with additional RAM installed.
At the end of the RAM test, the connection of the CMOS memory is determined (about it in the brief description of CMOS Setup) and the activation
of the "DEL" key, when pressed, you exit to the
Setup menu. Here you can adjust or set the necessary
parameters, for example, the type of connected drive, etc.
etc. If within 2 - 4 seconds the DEL key has not been pressed
then initialization of the equipment begins in accordance with
the values specified in CMOS. If the CMOS is not found or its
checksum does not match the calculated one, then only the main (base) hardware is
initialized.
Additional initialization (set by the user) can use the CMOS data. The additional
initialization time should not exceed 3 seconds.
ByAt the end of additional initialization, the connection of the system disk is checked
and, if present, its boot sector (the first 128 bytes) is analyzed. If the disk turns out to be a system disk, then the boot sector is read into RAM, to which control is then transferred. Otherwise, an error message is displayed on
the display and the installation of
Loader is determined. If it is connected, then control is transferred to it.
Brief description of the operation of the Loader.
Loader or loader with HKML is designed to work in
conditions where there are no disks or an operating system. Since
this operating mode is not the main one, Loader performs only the main functions:
- Viewing the cassette directory;
- Loading a file from the ML into RAM;
- Writing a section of RAM to the RAM.
These functions are quite sufficient for working in the absence
of DOS. If the Loader is located in a separate ROM, then
instead of it you can install other programs, for example,
`Monitor` (similar to PC "Radio", "Orion", etc.), BASIC, as well as
various testing programs.
Description of the functions of Loader
1. View the cassette directory. This command allows
to display a listfiles with their attributes (length,
checksum, etc.) located on the cassette. The command execution time is about 30, 45 minutes for a fully used side of the cassette.
2. Loading a file from ML into RAM. Before loading, the file name and the starting address in RAM from which the file will be located are indicated. If the file name is not specified, the first
file found is loaded. If there is no download address, its
value is taken from the attributes of the downloaded file. Upon completion of loading the executable file (if the loading address is not specified), control is transferred to the loaded program.
3. Writing a section of RAM to a file. This command is intended for saving the results of work on the ML. Before the start
of recording, the file name, addresses of the RAM section (start and
end) and, if the program is being written, then the start address
of the launch are indicated.
Note that while any of these commands is running, pressing the
key combination Ctrl+C interrupts the command and returns to the initial Loader mode.
NEXT
Come to us at light.