(C) Megus / BW
Music: BY Mr.Z / HWC
OPERATING SYSTEM
NeOS v1.0
Below is a description of the standard functions
system. For convenience, they are divided into parts (for
actions taken). So:
Function "System manager"
# 004B. System info
Function gives basic information about the system and
computer.
Log in: -
Output: A - computer code;
BC - version (vB.C);
HL - address of the ID-Thong system.
# 004E. Wait for keypress
The function expects a keystroke.
Log in: -
Output: A - key code.
Variable registers: -
# 0051. Wait for keypress + click
The function expects a pressing issue, and click after click.
Log in: -
Output: A - key code.
Variable registers: -
# 0054. Click sound
Function produces a small click on the Beeper.
Log in: -
Exit: -
Variable registers: -
# 0057. Exit from program
Function makes emergency (mostly)
Output from running program with the restoration of
stack (STACK_P), interrupts, and the subsequent transition to
an address specified variable PROGRET.
Log in: -
Exit: -
# 0066. NMI handler
Immediately upon arrival of non-masked interrupt takes you
to the address HK_NMI, which should have a team go to the
interrupt handler.
*
Function "Driver / library manager"
This set of functions responsible for working with
drivers and libraries. Number of simultaneously
established libraries and drivers is limited
only the computer's memory, as memory drivers and libraries are
located in a "chain", then there, in front of each driver /
library is a reference to the next. Drivers are divided into
two types:
- Resident, that is, working on the prairie
vaniyah;
- Non-resident, that is caused program
My purpose, rather than automatically.
Prerequisite is to find the first
drivers and libraries in low memory (# 0000 - # BFFF).
Since the ROM is necessarily present at least one
drivers and libraries, this condition is satisfied
always.
Options:
# 005A. Add driver
Function sets a new driver (any type).
Input: HL - address of the driver;
BC - his page.
Exit: -
# 005D. Remove driver
Function removes the driver.
Input: HL - pointer to name (in low memory).
Output: Z - Driver deleted successfully;
NZ - the driver is not found.
# 0060. Add library
Function sets a new library.
Input: HL - address of the library;
BC - Home of the library.
Exit: -
# 0063. Remove library
Function removes the library.
Input: HL - pointer to name (in low memory).
Output: Z - Library removed successfully;
NZ - Library not found.
# 0069. Open driver
Function searches for the driver and returns information
about it.
Input: HL - pointer to name (in low memory).
Output: HL - address of the driver (if # FFFF - Driver
not found);
BC - page driver;
DE - Driver header length;
A - flags of the driver.
# 006C. Open library
Function searches the library and returns information about
it. Input: HL - a pointer to the name of the library (at the
bottom
memory).
Output: HL - address of the library (if # FFFF - Bible
edema was not found);
BC - Home of the library;
DE - header length of the library.
*
Function "Memory manager"
This set of functions designed to manage the paging memory.
Options:
# 006F. RAM info
Function gives basic information about the top
(Paged) memory.
Log in: -
Output: HL - обший amount of upper memory (in KB);
DE - free upper memory (in KB);
BC - number of pages in upper memory.
# 0072. Change page
Function changes the page in # C000-# FFFF.
Input: A - page number.
Output: Z - OK;
NZ - no such page.
# 0075. Allocate high memory block
The function allocates a block of upper memory.
Input: C - unit volume.
Output: Z - memory allocated;
NZ - not enough contiguous memory;
HL - address of the block;
BC - Home of the block.
# 0078. Allocate low memory block
The function allocates a block of low memory.
Login: DE - volume in bytes;
Output: HL - starting address of the block in memory.
# 007B. Free high memory block
Frees the upper memory block.
Log in: BC - page number;
D - high byte address;
E - the number of released kilobytes.
Exit: -
# 007E. Free low memory block
Frees the block of low memory.
Login: DE - amount to free memory in bytes.
Output: HL - a new lower limit address of the memory.
# 0081. Get max length of high memory block
Function gives the size of the largest free upper memory
block. Log in: -
Output: A - unit volume in kilobytes.
# 0084. Reallocate memory map
Function moves the memory card.
Login: DE - a new position map;
BC - A new page map.
Exit: -
# 0087. Get page status
Function gives information about the page.
Log in: BC - page.
Yield: DE - map Employment page.
# 008A. Set page status
Function sets information about the page.
Log in: BC - page;
DE - map Employment page.
Exit: -
# 008D. Select 4MB page
In NeOS v1.0 is not implemented.
# 0090. Change page in low memory
In NeOS v1.0 is not implemented.
*
Options "Screen manager"
This set of functions designed to perform basic actions
with a screen. It can be useful for organizing the user
interface, etc.
When you specify coordinates and sizes in the register
pair, the most significant byte - the coordinate Y, Jr. -
coordinate X. All the functions that use the driver character
output (output characters, lines, messages, numbers, menus) are
working in the current text window.
Options:
# 0093. Clear screen
The function clears the screen and sets new
current attributes.
Input: C - attribute;
B - border.
Exit: -
# 0096. Clear window
The function clears the window without flooding it with
attributes. Log in: BC - the upper left corner of the window;
DE - the size of the window.
Exit: -
# 0099. Fill window with attribute
The function fills the screen without changing the attribute
images in it.
Log in: BC - the upper left corner of the window;
DE - the size of the window;
H - attribute.
Exit: -
# 009C. Call symbol-output driver
Function causes the current driver is a character
output.
Input: A - number of driver functions.
Exit: -
Variable registers: -
# 009F. Put character
Function displays a single character.
Input: C - code for the character.
Exit: -
Variable registers: -
# 00A2. Put string
The function outputs the string of characters. Marker for
the end of the line is the code # FF. The line can meet the
following control codes: db # 10, N - Set the color of ink N;
db # 11, N - Set the color of paper N;
db # 12, N - Installation bright N;
db # 13, N - install flash N;
db # 14, N - setting current attributes;
db # 16, X, Y - coordinate the installation print.
Input: HL - address of string.
Exit: -
# 00A5. Messager
Display a message from the table. Message delimiter is the
code # FF. Used to derive function Put string, so you can use
control codes.
Input: HL - address of the table;
C - line number (0 - first row).
Exit: -
# 00A8. Print byte-number
Function displays the number in the range # 00 - # FF (8
bits). The output is in the calculation, given 7 bit system
variable flags1. Input: C - number.
Exit: -
# 00AB. Print Word-Number
Function displays the number in the range # 00 - # FFFF
(16 bits).
Input: HL - number.
Exit: -
# 00AE. Print double-word-number
Function displays a number between # 0 - # FFFFFFFF
(32 bits).
Input: HL - lower 16-bit numbers;
IX - the older 16-bit numbers.
Exit: -
# 00B1. Scroll Window Up
Function moves the window up on one familiarity
together with attributes, scraping the bottom line and the gulf
of its current attributes. Log in: BC - window coordinates;
DE - the size of the window.
Exit: -
# 00B4. Scroll Window Down
Function moves the window down to one familiarity
together with attributes, clearing the top line and the gulf of
its current attributes. Log in: BC - window coordinates;
DE - the size of the window.
Exit: -
# 00B7. Scroll Text Window Up
The function shifts the current text window up
one familiarity.
Log in: -
Exit: -
Variable registers: -
# 00BA. Scroll Text Window Down
The function shifts the current text window down
one familiarity.
Log in: -
Exit: -
Variable registers: -
# 00BD. Draw Styled Box
Function draws a stylized rectangular frame without setting
attribute. Address style specified in the variable styles.
Style is a set of characters, which is drawn frame (only 8
characters). Log in: BC - the upper left corner of the frame;
DE - the size of the window;
A - identity (A = 0 - ROM).
Exit: -
# 00C0. Draw Window
Function draws a window on the screen and clean it.
Login: IX - a pointer to a window handle.
Exit: -
# 00C3. Vertical Menu
The function displays a vertical menu
(Menu text should be printed in advance!). Selection
the menu is the arrow keys,
Enter (select the item), Edit (exit from the menu). The
coordinates of the menu in the descriptor are relative to the
current text window. Login: IX - pointer to handle the menu;
E - the initial number of points.
Output: E - item number, E = # FF - if you clicked Edit.
# 00C6. Put sprite
The function displays a sprite.
Input: HL - address of the sprite;
DE - the size of a sprite;
BC - the coordinates of the sprite
7 bits of C = 0 - black and white sprite
7-bit C = 1 - color sprite.
Yield: DE - address after the withdrawal.
*
(C) Megus / BW
Music: BY Mr.Z / HWC
OPERATING SYSTEM
NeOS v1.0
Function "Disk manager"
This set of functions responsible for working with disk
devices. Functions provide access how to files, directories,
and directly to the disk sector. Virtually all functions are
performed through the corresponding driver, this unit is a
trustee and removes some of the problems with the programmer.
In NeOS v1.0 can connect up to 19 disk drives (hereinafter
will be possible to 26 disk drives).
Options:
# 00C9. Recognize disk
Function determines the membership of the current storage
device to any installed file system. If successful, the
identification is also establishes the root directory of the
current. Log in: -
Output: Z - system is defined;
NZ - the system is not defined.
# 00CC. Change disk drive
Function changes the current disk device. Determining the
membership drive system is not made. Input: A - number of the
device. Output: Z - the choice is made;
NZ - no such device.
# 00CF. Open file
Function opens a file for random access (read / write).
Before opening a file descriptor must be set the file name and
address of the read buffer. Login: IX - file descriptor.
Output: Z - the file is opened;
NZ - file could not be opened.
# 00D2. File driver caller
Function makes reference to the file system driver. Number
of driver functions specified in the register A.
# 00D5. Read bytes from file
The function reads a sequence of bytes from
File (redirected to the file system driver).
# 00D8. Write bytes to file
The function writes a sequence of bytes in
file (redirected to the file system driver).
# 00DB. Read sectors
The function reads a sequence of sectors
with the current device (forwarded to the driver
disk device).
# 00DE. Write sectors
The function writes a sequence of sectors
at current device (forwarded to the driver
disk device).
Function read / write bytes from / to file rendered in
kernal, not only for the convenience of the call. Thus, how
different devices can be active at different file systems, it
can be done in parallel work with two files on different
devices and, therefore, belonging to different systems.
Function to access the file system driver to the driver of this
device, and features read / write bytes refer to device where
you open the file.
*
Other features kernalya
# 00E1. Go lower by pixel
The function calculates the address of the next row in
screen.
Input: HL - address in the display area.
Output: HL - address of the next line.
# 00E4. Go higher by pixel
The function calculates the address of the previous row in
the screen.
Input: HL - address in the display area.
Output: HL - address of the previous line.
# 00E7. Go lower by cell
The function calculates the address of the next familiarity
on the screen. Input: HL - address in the display area.
Output: HL - address of the next familiarity.
# 00EA. Go lower at attributes
The function calculates the address of the next familiarity
in the attributes. Input: HL - address of the attributes.
Output: HL - address of the next familiarity.
# 00ED. Go higher at attributes
The function calculates the address of the previous
familiarity in the attributes. Input: HL - address of the
attributes. Output: HL - address of previous familiarity.
# 00F0. Calculate screen address
The function calculates the address in the screen
coordinates of familiarity. Log in: BC - coordinates in
familiarity. Output: HL - address in the display area.
# 00F3. Calculate attribute address
The function calculates the address of the attributes of the
coordinates of familiarity. Log in: BC - coordinates in
familiarity. Output: HL - address of the attributes.
# 00F6. Convert screen address to attribute
The function takes the address in the display area in
address in the field attributes.
Input: HL - address in the display area.
Output: HL - address of the attributes.
# 00F9. String comparision
The function compares two sequences of bytes.
Input: HL - address of a single line;
DE - the address of another line;
C - number of bytes to compare.
Output: Z - strings are identical;
NZ - lines are different.
Variable registers: B.
*
Entry point kernalya
# 004B. System info
# 004E. Wait for keypress
# 0051. Wait for keypress + click
# 0054. Click sound
# 0057. Exit from program
# 005A. Add driver
# 005D. Remove driver
# 0060. Add library
# 0063. Remove library
# 0066. NMI handler
# 0069. Open driver
# 006C. Open library
# 006F. RAM info
# 0072. Change page
# 0075. Allocate high memory block
# 0078. Allocate low memory block
# 007B. Free high memory block
# 007E. Free low memory block
# 0081. Get max length of high memory block
# 0084. Reallocate memory map
# 0087. Get page status
# 008A. Set page status
# 008D. Select 4MB page
# 0090. Change page in low memory
# 0093. Clear screen
# 0096. Clear window
# 0099. Fill window with attribute
# 009C. Call symbol-output driver
# 009F. Put character
# 00A2. Put string
# 00A5. Messager
# 00A8. Put byte-number
# 00AB. Put word-number
# 00AE. Put double-word-number
# 00B1. Scroll window up
# 00B4. Scroll window down
# 00B7. Scroll text window up
# 00BA. Scroll text window down
# 00BD. Draw styled box
# 00C0. Draw window
# 00C3. Vertical menu
# 00C6. Put sprite
# 00C9. Recognize disk
# 00CC. Change disk drive
# 00CF. Open file
# 00D2. File driver caller
# 00D5. Read bytes from file
# 00D8. Write bytes from file
# 00DB. Read sectors
# 00DE. Write sectors
# 00E1. Go lower by pixel
# 00E4. Go higher by pixel
# 00A7. Go lower by cell
# 00EA. Go lower at attributes
# 00ED. Go higher at attributes
# 00F0. Calculate screen address
# 00F3. Calculate attribute address
# 00F6. Convert screen address to attribute
# 00F9. String comparision
# 00FC. Input string
# 00FF. Command interpreter
# 0102. Read number
# 0105. Shut AY
# 0108. Change directory
*
Error handler (RST # 8)
If any serious error occurs
error handler. Depending on the type of
errors can occur:
- Return after the place of call error (R);
- Exit the program (function call Exit from
program) (Q);
- Restore the stack of ERR_SP, then the transition
by ERR_JP (E);
- Return code and dialog errors in the register
A (O).
Thus, the error can not just treat, but also to return
some information program. These are the error function at work
with disk devices.
The error handler is invoked as follows: immediately after
the command code RST # 8 should follow the error code. For
example:
RST # 8
DEFB 2; Out of text window
Possible to use not only the standard error handler, but
also any other. To do this, pereustvanovit system variable
HK_ERR. If it is not zero, then called RST # 8 is a transition
at the address specified in it, otherwise use the standard
handler. At the entrance to an external handler (as well as it
should when you log into the built-handler!) In case C there is
an error code, but in case it is the same DE, multiplied by 2.
Error Codes:
# 00. OK (R)
Is not an error, an informant about the success of any
operation.
# 01. No such library function (R)
This error can occur when accessing the
library, in the absence of its function to call.
# 02. Out of text window (E)
The error occurs when trying to establish the coordinates of
the press outside the text box.
# 03. Read error (O)
Interactive error reading from the disk device. The output
of the register A gives:
# 00 - Retry;
# 01 - Abort;
# 02 - Ignore.
# 04. Not enough memory (Q)
The error occurs when attempting to allocate memory.
# 05. Write error (O)
Interactive error writing to the disk device. The output of
the register A gives:
# 00 - Retry;
# 01 - Abort;
# 02 - Ignore.
# 06. No such driver function (E)
The error occurs when invoking non-existent
driver functions.
# 07. Fatal error (Q)
Fatal error in the program.
# 08. Unknown command (E)
Occurs when you enter a command, an unknown shell.
# 09. Syntax error (E)
Error occurs if an incorrect indication of the command
parameters.
# 0A. No such page (R)
The error occurs when you try to switch to
non-existent page.
# 0B. Unreleased function (R)
The error occurs when invoking non-existent
library functions.
# 0C. Read only (E)
The error occurs when you try to write
to a disk device that is designed only for
reading.
# 0D. No disk (E)
The error occurs when there is no disk in the device.
The remaining numbers of errors the system responds
string: Error Nmm.
# 0E. Unknown file system (E)
The error occurs when it is impossible to determine
membership drive to any filesystem.
# 0F. Can't open file (E)
Error occurs when you can not be opened
file, but not in its absence.
# 10. No such disk drive (E)
The error occurs when trying to choose a non-existent disk
device.
# 11. No such file (E)
The error occurs when you try to access a nonexistent file.
# 12. Unable to delete file (E)
The error occurs if you can not remove
file for any reason.
# 13. Unable to make directory (E)
Error occurs when you can not create directory.
*
(C) Megus / BW
Music: REMIXED BY KENOTRON
OPERATING SYSTEM
NeOS v1.0
The general concept of Brainwave BIOS v1.0
Brainwave BIOS is the core of the operating
system NeOS. BIOS provides the programmer a set of specific
functions to manage the system. All functions can be divided
into several types: - System-wide functions;
- Functions to work with drivers and libraries;
- Memory management functions;
- Functions of the disk;
- Functions to the screen;
- Other functions.
Appeal to the system functions is via kernalya, located at
a specific point of ROM. As we refine the system to grow and
kernal, but all the old functions will remain in their places.
Many of the BIOS functions do not check for
correctness of input data. This is done to improve the speed of
their work.
To control external devices the system offers the ability
to install the appropriate drivers. Each driver can have its
their own internal functions. For each type of devices
installed on a certain standard driver functions. Thus, the
replacement unit on a similar but implemented differently
enough to replace the driver.
Since the BIOS provides only the minimum necessary
functions, the programmer can be connected their own library
functions. Certain types of libraries (in accordance with their
appointment) is also set standard. Thus, when create a new
library of any type, can be a painless replacement of the old
library to the new without losing compatibility.
Restarts the system BIOS
RST # 0: Reboot system
Complete system reboot. Interception of this restart is
impossible.
RST # 8: Error manager
Error handler. Follow the instructions RST # 8
indicate an error code. If the value HK_ERR, equal to 0, is
called the standard error handler otherwise, the transition
goes to the specified address.
RST # 10 - RST # 30: Interrupt handlers
Restarts are designed to interrupt, prihodyashih from an
external interrupt controller.
RST # 38: Interrupt handler
Handler traps (IM 1).
B # 000E is the address internal error handler, and # 0016
- address internal shell.
*
Standards for drivers of different types
Devices
For resident drivers have the following
restriction: These drivers should not spoil the area TEMPFA. If
the driver uses this field, all changing cells must remember
and when a restore. If the driver they do not uses, but uses
the function calls the BIOS, it be sure to save those bytes
TEMPFA, which function uses BIOS.
Driver File Systems
These drivers are provided with work NeOS
any file system (TR-DOS, MS-DOS, iSDOS, etc.). After you
install this driver also will be polled to determine membership
disc.
Standard driver features:
# 00. Identify disk
Function determines whether the disk belongs to the current
device, the file system. Upon successful identification sets
the root directory current.
Log in: -
Output: Z - disk belongs to the system;
NZ - disk does not belong to the system.
# 01. Set system variables
The function sets the system variables for
work with the system.
Log in: -
Exit: -
# 02. Catalogue info
Function gives basic information about the current
directory.
Login: IX - a pointer to the descriptor directory.
Exit: -
# 03. Close file
The function closes the file. If the current sector
file is not recorded, it is written, if I
header file that is recorded and the title.
Login: IX - file descriptor.
Output: Z - file closed;
NZ - error closing.
# 04. Create file
The function creates a file of unit length. In the file
descriptor must be filled in the first 26 bytes. Login: IX -
file descriptor. Output: Z - file is created;
NZ - the file is not created.
# 05. Read bytes
The function reads a byte from
file.
Login: IX - the file descriptor;
BC - the length of the sequence;
HL - address of the boot.
Output: HL - address after boot;
Z - reading success;
NZ - move abroad file.
# 06. Write bytes
The function writes a sequence of bytes
file.
Login: IX - the file descriptor;
BC - the length of the sequence;
HL - address of record.
Output: HL - address after recording;
Z - the CD has been successful;
NZ - can not write.
# 07. Set file position
The function sets the file position.
Login: IX - the file descriptor;
BC - position (lower 2 bytes);
HL - position (highest 2 bytes).
Output: Z - position is set;
NZ - there is no such position.
# 08. Delete file
The function deletes the file. Do not remove the Read only
files.
Input: HL - the file name.
Output: A = 0 - file is deleted;
A = 1 - no such file;
A = 2 - Read only.
# 09. Set file attributes
The function sets the file attributes.
Input: HL - the file name;
C - attribute.
Output: A = 0 - attributes set;
A = 1 - no such file;
A = 2 - can not install.
# 0A. Create directory
The function creates a directory.
Login: IX - the name of the directory.
Output: A = 0 - directory is created;
A = 1 - there is no place for creation;
A = 2 - can not create.
# 0B. Delete directory
The function removes an empty subdirectory.
Input: HL - the name of the directory.
Output: A = 0 - all OK;
A = 1 - there is no directory;
A = 2 - impossible to remove.
# 0C. Set path
The function sets the directory up one level deeper than the
current (or return to a higher level or the root directory). If
the string is two characters point '.', Then jumps to the next
level. If the point is one, then go to root directory.
Input: HL - address of the directory name (19b.).
Output: A = 0 - the path is established;
A = 1 - there is no path;
A = 2 - can not install.
# 0D. Get file number
Function on the file name gives the number of its descriptor
in the directory. Input: HL - filename (16 +3).
Output: A = # FF - no such file;
A - number of file handles (0-253).
# 0E. Get catalogue cell
Function gives the file handle, starting at a particular
location. Input: C - number of the initial file;
B - number of items read;
HL - address of where to put opsateli.
Exit: -
# 0F. Reread FAT buffer
The function updates the buffer FAT.
Input: C - sector number FAT.
Exit: -
# 10. Disk Info
Function gives basic information on the disk.
Login: IX - pointer to handle the disk.
Exit: -
*
Drivers character output
These drivers provide a single output
characters on the screen, and other possible devices
character output.
Standard driver features:
# 00. Print character
Function displays a single character on the screen. Code
# 0D - linefeed (CR + LF)
Input: C - code for the character;
Exit: -
# 01. Set coordinates
The function sets the coordinates of the printed characters
on the screen. Positioning is the current text box.
Log in: BC - coordinates;
Exit: -
# 02. Init driver
Initialize the driver and setting the current
text box.
Input: C = 0 - initialize the driver;
C = 1 - restore the original video mode.
Yield: BC - the character size in pixels, the basic solution
Benches Spectrum (256x192). Size equal to
# FF, means that this coordinate time
measures variable (B-y, C-x).
DE - limiting the coordinates of X and Y, to
foot in a text box on the screen.
# 03. Put string
The function outputs the string of characters. Marker for
the end of the line is the code # FF. The line can meet the
following control codes: db # 10, N - Set the color of ink N;
db # 11, N - Set the color of paper N;
db # 12, N - Installation bright N;
db # 13, N - install flash N;
db # 14, N - setting current attributes;
db # 16, X, Y - coordinate the installation print.
Input: HL - address of string.
Exit: -
*
Driver-volatile memory (CMOS)
These drivers are designed to provide access to the CMOS,
get the current time, etc. CMOS settings are stored some NeOS.
Standard driver features:
# 00. Read byte from CMOS
The function reads a byte from CMOS.
Input: L - number of bytes in the CMOS.
Output: A - bytes read from the CMOS.
# 01. Write byte to CMOS
The function writes the byte in the CMOS.
Input: L - number of bytes in the CMOS;
E - value to write.
Output: Z - write was successful;
NZ - can not write byte.
# 02. Read time from CMOS
The function reads the time from the CMOS.
Log in: -
Output: L - seconds;
H - minutes;
E - watch.
# 03. Read date from CMOS
The function reads a date from the CMOS.
Log in: -
Output: L - number;
H - per month;
E - day of the week;
D - per year.
# 04. Write time to CMOS
The function writes the time in CMOS.
Input: L - seconds;
H - minutes;
E - watch.
Output: Z - has been established;
NZ - can not set the time.
# 05. Write date to CMOS
The function writes the date in CMOS.
Input: L - number;
H - per month;
E - day of the week;
D - per year.
Output: Z - date set;
NZ - can not set a date.
*
Disk device driver
These drivers are provided with work NeOS
disk devices. Driver File Systems
do not work themselves to the disk, and use functions
this type of driver.
Standard driver features:
# 00. Get info about drive
Function gives basic information about the device.
Input: C - Sector size (256/512 = 1 / 2)
DE - address where to put a table describing
equation describing the device.
Exit: -
# 01. Read sectors
The function reads a sequence of sectors
from the device.
Input: HL - address of the boot;
B - number of sectors;
DE - number of the initial block;
C - number of sectors in the block.
Output: A = 0 - the sector is read;
A = 1 - a nonexistent block;
A = 2 - invalid number of sectors;
DE - unit number after the reading;
HL - address after reading;
C - number of sectors in the block.
# 02. Write sectors
The function writes a sequence of sectors
to the device.
Input: HL - address of the boot;
B - number of sectors;
DE - number of the initial block;
C - number of sectors in the block.
Output: A = 0 - the sector is read;
A = 1 - a nonexistent block;
A = 2 - invalid number of sectors;
DE - unit number after the recording;
HL - address after recording;
C - number of sectors in the block.
lichestvo sectors;
DE - number of the initial block;
C - number of sectors in the block.
Output: A = 0 - the sector is read;
A = 1 - a nonexistent block;
A = 2 - invalid number of sectors;
DE - unit number after the recording;
HL - address after recording;
C - number of sectors in the block.
*
(C) Megus / BW
Music: COMPOSED BY ZHENYA/ZER0
OPERATING SYSTEM
NeOS v1.0
Format accommodate drivers
and libraries in memory
Drivers and libraries in memory
in the form of "chains." That is, at the beginning of each
driver / library is a link to the next unit of the chain. Thus,
to search for a specific driver / library, you must go through
the chain. C On the one hand, this structure slows
access to the drivers, but on the other hand, such
method removes the limitation to the number of installed
drivers / libraries, and their number limited only by free
memory.
Header format drivers / libraries
Offset Length Description
0 2 next page number
Driver
February 2 address of the next driver
(# FFFF - end of the chain)
April 1 a flag byte driver
May 1 Length of the driver's name
6 ... Driver Name
... ... The body of the driver
The first 4 bytes - a reference to the following driver /
library and the rest have information about this driver /
library. The length of the name of the driver / library should
not exceed 16 characters.
The layout of the flag byte (0 / 1):
bit 0: Controls whether the file system (no / yes);
bit 1: reserve;
bit 2: resident / resident driver;
bit 3: is a character output device
(No / yes);
bit 4: activity / inactivity of the driver (for resistive
incident to the driver);
bit 5: reserve (should be 0);
bit 6: same bat 5;
bit 7: same bat 5.
For a library, a flag byte assumes no
information.
To refer to a specific driver,
must do the following:
- Open the driver (a function of BIOS);
- On the received address / page to apply to Dry
faith.
Number of driver functions specified in the register A.
The system must be present
The following drivers:
- Keyboard driver (kbd.drv);
- Driver CMOS (cmos.drv);
- Print driver is a character (symXX.drv);
- Disk device driver (fdd.drv / hdd.drv / cd.drv /
ram.drv etc);
- File system driver (trdos.drv, msdos.drv,
isdos.drv etc).
Reserved a number of standard names of drivers for certain
types of devices: - Mouse.drv - mouse;
- Joystick.drv - joystick;
*
Format driver library
Library of drivers provides for joint
Storage of the same type of drivers. Drivers are stored in
movable form, ie You can download the driver
any area of memory and configure it to work
in its special function (source for
with a library of drivers attached to the kit
Delivery NeOS).
Header Format Library
Offset Length Description
0 4 Id "DLIB"
April 1 Number of drivers in the Bible.
May 3 Reserve
Total 8 bytes.
Next come the headlines drivers.
Header format driver
Offset Length Description
0 16 Name of Driver
Feb. 16 start position driver
(Relative to the
drivers, and not from the beginning
la files)
February 18 The body length driver
February 20 number of elements
matching pattern
January 22 a flag byte driver
January 23 Reserve
Total 24 bytes.
Format storage driver
First comes the body of the driver, compiled
at address 0. Then there is a matching pattern. Matching
pattern consists of a two-byte pointers to asbolyutnye address
in the body of the driver relative to its beginning. 6 and 7
bits of byte in the index - a reserve for future improvements
format. The length of the driver can not exceed 16K.
Due to the characteristics when setting arises
some restriction on the driver code: absolute
addresses within the body of the driver must
be given two consecutive bytes. For example, a call to the
table can not be done as follows as follows:
...
ld a, offset
add a, TAB256; ml. b. address table
ld l, a
adc a, TAB/256; Art. b. address table
sub l
ld h, a
...
TAB db 0,1,2,3,4,5
...
*
Description of the shell NeOS v1.0
The shell is designed NeOS
for basic control system and files. He
allows you to execute commands that can be divided
into 2 main groups:
- Team management system;
- Team work with disk devices;
When you first start NeOS tries to run the file
"neosboot.bat" with the disc set in the CMOS boot. In the
absence of this file is output in the command line editor.
In version 1.0 of the interpreter is very limited,
but this will be fixed in future versions.
Command interpreter
Team management system
1. VER
Command displays the version information
NeOS.
2. MEM
Command displays information about the available upper
memory.
3. CLS
Command clears the screen and fill it with the current
attribute.
4. CLW
Command clears the current text box and fill it with the
current attribute.
5. COLOR attr
Command sets the current attributes attr.
6. BORDER color
Command sets the border color of color.
7. RAM page
The team consists of # C000-# FFFF page number of the page.
8. CALL addr
Team invokes the address addr.
9. STACK addr
Command sets the stack pointer to addr.
10. HEX
Command sets the output of all numbers in hex.
11. DEC
Command sets the output of all the numbers in decimal form.
12. SILENCE
Command turns off the sound AY.
13. POKE addr byte
The team enters the 8-bit value byte at addr.
14. PEEK addr
Command displays the 8-bit number from a cell addr.
15. DPOKE addr word
The team enters the 16-bit number word in a cell
addr and addr +1.
16. DPEEK addr
Command displays the contents of cells addr and addr +1
as a 16-bit number.
17. TEXTWIN x y width height
Command sets the current window with the coordinates of the
upper-left corner of x and y, wide width, tall height.
Coordinates and window sizes are given a familiarity 8x8 pixels.
18. MEMMAP
Command displays a map pokilobaytnuyu Employment
memory.
19. EXIT
The command produces output in StartUp Menu.
Teams work with disk device
1. LOAD file [addr] [length]
The team loads the first length bytes of file into the
address addr. Addr and length parameters are optional.
2. SAVE file addr length
This command writes a file with the file length length
address addr.
3. RUN file [param]
Command starts to execute the code file
file. Characters that are after the file name may
perceived as the program options.
4. RUNS file
Command starts to execute the batch file
file. Batch file - a text file containing a sequence of
commands NeOS. In addition to standard commands there are
additional: "+" - The inclusion mapping of executable commands
on
screen;
"-" - Disable display of executable commands;
"" - A symbol of comment - the entire current line is assumed
remains to comment and ignored.
The last line must be terminated by a newline (# 0D or # 0D,
# 0A), otherwise it will fail.
5. CD [path]
Command sets the current path and / or device. In the
absence of the parameter, the command displays the current
path.
6. DIR
Command displays the names of the files contained in the
current directory.
7. REN file1 file2
Command renames the file file1 to the file file2.
8. DEL file
Command removes the file file. Read-Only files are removed
from pre-confirmation.
9. MKDIR name
The command creates a new directory name.
10. RMDIR name
Command deletes an empty directory name.
In NeOS set the standard for expansion
Files:
*. Cnp - executable;
*. Bat - batch file;
*. Drv - driver library;
*. Lib - library of functions;
*. Scr - screen file (6912 bytes).
The upper memory NeOS organize yourself a small area (1Kb)
for its domestic needs. Memory allocation in this area is as
follows:
256b - buffer command line;
512b - time domain for different functions;
114b - the current path.
In kernale there is a region reserved for the call of some
useful functions shell. Here is their description:
# 00FC. Input string
Function is a character editor
line. It provides the following convenience
editing:
* Ability to move the cursor on the line
keys;
* The ability to insert characters into the middle of the line;
* The ability to switch the Russian / Latin re
Giustra, and Caps Lock.
Upon completion of recruitment into the end of the string is
appended code # 0D. Input: HL - address of the edit buffer;
B - the length of the input string.
Exit: -
# 00FF. Command interpreter
The function performs the action specified in the command
line. If interp +2 and interp +3, equal to 0, use the
built-interpreter, otherwise case - outside the target of a
given variable. Log in: -
Exit: -
# 0102. Read number
The function reads from a string 16-bit number.
The number can be in hex, and
in decimal form.
Input: HL - address of string.
Output: HL - a limited number;
DE - the address in the following numbers;
C = 0 - number of considered successful;
C = 1 - error while reading.
# 0105. Shut AY
The function is similar to the SILENCE command
interpreter.
Log in: -
Exit: -
# 0108. Change directory
The function is similar to the CD shell.
Input: HL - address of string.
Exit: -
105. Shut AY
The function is similar to the SILENCE command
interpreter.
Log in: -
Exit: -
# 0108. Change directory
The function is similar to the CD shell.
Input: HL - address of string.
Exit: -
(C) Megus / BW
Music: COMPOSED BY ZHENYA/ZER0
OPERATING SYSTEM
NeOS v1.0
System variables NeOS
Unmovable block of variables
Name Address Len Description
TEMPFA # 5B00 Time 512. Region
HK_ERR # 5D00 2 Error manager
HK_INT1 # 5D02 2 User INT 1
HK_INT2 # 5D04 2 User INT 2
HK_INT3 # 5D06 2 User INT 3
HK_INT4 # 5D08 2 User INT 4
HK_INT5 # 5D0A 2 User INT 5
HK_NMI # 5D0C 3 NMI handler
STACK_P # 5D0F 2 The value of the stack
before starting
program
PROGRET # 5D11 2 Address return
from the program
ERR_SP # 5D13 2 The value of the stack
after error
ERR_JP # 5D15 2 Address return
by mistake
DRV_BEG # 5D17 4 pointer to
Home Tabley
particle driver
LIB_BEG # 5D1B 4 pointer to
Home Tabley
particle libraries
RES_BEG # 5D1F 4 pointer to
Home Tabley
particle residents
VARLEN # 5D23 1 Length of mixing
schaemogo block
variables
F_DRV # 5D24 7 Fake-driver
F_LIB # 5D2B 7 Fake-bibl.
F_RES # 5D32 7 Fake-resident
NEOSFD # 5D39 1946 FD file, TCI
rytogo NeOS
TOTRRET # 5D67 2 Call TR-DOS
TOTR # 5D69 ... Calling the TR-DOS
*
Move blocks of variables
At the beginning of this block indicates the register IY.
This region can move in an arbitrary domain (preferably at the
bottom of memory). Accessing the variables is done through the
offset (index).
The name of the Indus. Len Description
scratr +0 1 Acre. Attributes
atrf +1 a mask attribute
scrcrd +2 2 Acre. coordinates
fontadr +4 1 Address Font
(High byte)
border +5 a Border color
styles +6 2 Address Table
frame styles
textwin +8 4 Parameters
textbox
(X, Y, W, H)
limcrd +12 2 limit
coordinates in
text box
symdrv +14 2 Address Driver
serial-by-character
O
lastkey +16 1 Code last
keystroke
repwait +17 1 Pause before
autorepeat
reprate +18 1 Frequency of repetition
repcnt +19 1 inside. counter
lastki1 +20 1 inside. Vac.
pagemp +21 4 pointer to
memory card
ramtop +25 2 Top border
lower memory
curpage +27 2 Current. Home
Contents ports +29 4 ports
memory management
drive +33 1 Current disk
device
drvnum +34 1 No.
Devices
drivdsc +35 2 Address Descriptor
the current disk
Devices
drivtab +37 2 Address Table
Device Descriptor-TV
curdbl +39 2 Number of the first
unit current
directory
dskerr +41 1 Code last
reactions to discrete
kovuyu error
pnt_x +42 2 Coordinates X
pnt_y +44 2 Y coordinate
brd_l +46 2 Left border
brd_r +48 2 Right border
brd_u +50 2 Top border
brd_d +52 2 Lower bound
buttons +54 1 Comp. Buttons:
bit0: Right
bit1: Left
bit2: average
sens_x +55 1 sensitive
to X
sens_y +56 1 sensitive
on Y
flags1 +57 1 flag (see below)
flags2 +58 1 flag (see below)
neos_r +59 4 pointer to
workingmen. reg. NeOS
neostmp +63 4 Ext. variable
scrbeg +64 1 tbsp. B screen
countrs +65 2 counters mouse
interp +67 4 Address of the external
interpreter
Description of the bits of flag variables. In parentheses
indicated status bit 0 / 1.
flags1:
bit 0: Flag clicking on the button (no / yes);
bit 1: when you click on the button (yes / no);
bit 2: Output mode characters on the screen (replace / XOR);
bit 3: Reserve;
bit 4: Language input lines (LAT / RUS);
bit 5: Register set: 1-Caps Lock;
bit 6: Office-bit drivers character output;
bit 7: Notation in the derivation of the numbers (10/16).
flags2:
bit 0: delay in the promotion of the drive (no / yes);
bit 1: Use a manual file systems;
bit 2: Use the interpretation. batch files.
The remaining bits are undefined and should be equal to zero.
Immediately after the system variables can go
description of disk devices.
p
Immediately after the system variables can go
description of disk devices.
pD command loads the first length bytes of file into the
address addr. Addr and length parameters are optional.
2. SAVE file addr length
This command writes a file with the file length length
address addr.
3. RUN file [param]
Command starts to execute the code file
file. Characters that are after the file name may
perceived as the program options.
4. RUNS file
Command starts to execute the batch file
file. Batch file - a text file containing a sequence of
commands NeOS. In addition to standard commands there are
additional: "+" - The inclusion mapping of executable commands
on
screen;
"-" - Disable display of executable commands;
"" - A symbol of comment - the entire current line is assumed
remains to comment and ignored.
The last line must be terminated by a newline (# 0D or # 0D,
# 0A), otherwise it will fail.
5. CD [path]
Command sets the current path and / or device. In the
absence of the parameter, the command displays the current
path.
6. DIR
Command displays the names of the files contained in the
current directory.
7. REN file1 file2
Command renames the file file1 to the file file2.
8. DEL file
Command removes the file file. Read-Only files are removed
from pre-confirmation.
9. MKDIR name
The command creates a new directory name.
10. RMDIR name
Command deletes an empty directory name.
In NeOS set the standard for expansion
Files:
*. Cnp - executable;
*. Bat - batch file;
*. Drv - driver library;
*. Lib - library of functions;
*. Scr - screen file (6912 bytes).
The upper memory NeOS organize yourself a small area (1Kb)
for its domestic needs. Memory allocation in this area is as
follows:
256b - buffer command line;
512b - time domain for different functions;
114b - the current path.
In kernale there is a region reserved for the call of some
useful functions shell. Here is their description:
# 00FC. Input string
Function is a character editor
line. It provides the following convenience
editing:
* Ability to move the cursor on the line
keys;
* The ability to insert characters into the middle of the line;
* The ability to switch the Russian / Latin re
Giustra, and Caps Lock.
Upon completion of recruitment into the end of the string is
appended code # 0D. Input: HL - address of the edit buffer;
B - the length of the input string.
Exit: -
# 00FF. Command interpreter
The function performs the action specified in the command
line. If interp +2 and interp +3, equal to 0, use the
built-interpreter, otherwise case - outside the target of a
given variable. Log in: -
Exit: -
# 0102. Read number
The function reads from a string 16-bit number.
The number can be in hex, and
in decimal form.
Input: HL - address of string.
Output: HL - a limited number;
DE - the address in the following numbers;
C = 0 - number of considered successful;
C = 1 - error while reading.
# 0105. Shut AY
The function is similar to the SILENCE command
interpreter.
Log in: -
Exit: -
# 0108. Change directory
The function is similar to the CD shell.
Input: HL - address of string.
Exit: -
105. Shut AY
The function is similar to the SILENCE command
interpreter.
Log in: -
Exit: -
# 0108. Change directory
The function is similar to the CD shell.
Input: HL - address of string.
Exit: -
(C) Megus / BW
Music: REMIXED BY ZHENYA/ZER0
OPERATING SYSTEM
NeOS v1.0
Description of different data formats
Format Index
The first 2 bytes - number of pages, the following
bytes - the address.
Format descriptor unit
Offset Length Description
0 1 Number of sectors per track
January 1 code of length sektora8
Jan. 2 The number of sectors in the block
March 2 address the device driver
February 5 address the current driver
filesystem
July 2 Address buffer FAT
September 1 Current sector FAT
January 10 a flag byte
January 11 Page buffer FAT
January 12 Length FAT
Total 13 bytes.
Table format disk parameters
Offset Length Description
0 1 Number of sectors per track
(0 - end of table)
January 1 Number of sections of the device
February 2 Number of tracks on the disc
... ... (Continued)
Since for the same sector size allowed several different
formats, the descriptors are the parameters one by one. Table
ends with a null byte.
Disc Format Descriptor
Offset Length Description
0 16 Disc name
February 16 disk capacity in blocks
February 18 number of free blocks
February 20 Sector size in bytes
January 22 block size in sectors
Total 23 bytes.
The format of the descriptor directory
Offset Length Description
0 1 Number of Files
January 1 Number of deleted files
February 2nd volume in the blocks directory
Total of 4 bytes.
The format of the file descriptor
Offset Length Description
0 16 Filename
March 16 File Extension
January 19 File attributes
Bit 0 - Read Only
Bit 1 - Hidden File
bit 2 - System File
Bit 3 - flag disklabel
Bit 4 - title
subdirectory
Bit 5 - archive file
Bit 6 - segmented /
continuous
February 20 Address File Download
February 22 File creation time
Feb. 24 Founded file
April 26 The length of the file
February 30 initial block file
32 1 Number of device file
33 2 The initial unit of its
directory
35 1 Number of files in a directory
36 2 address the read buffer
38 2 Current Block file
40 1 Current sector in the block
41 4 position in the file
45 1 Flags file:
Bit 0 - no title
changed / unchanged
bit 1 - the sector is not
changed / unchanged
bit 2 - the current sector
do not read / read
Total 46 bytes.
The first 32 bytes of the descriptor file - the element
catalog issued by function Get catalogue cell.
The format of the information stored in the CMOS
Offset Length Description
0 1 Seconds
January 1 Second Alarm
January 2 Minutes
January 3 Minutes alarm
January 4 Hours
May 1 Alarm Clock
June 1 Day of the Week
July 1 Number
Aug. 1 Month
September 1st Year
April 10 System CMOS registers
63 1 boot disk
The first 14 bytes of CMOS may not be the same for
different circuits, the data are correct only
for GLUK'ovskoy scheme. Therefore, it is not recommended
reading time by bytes, use a special function.
The format of the descriptor window
Offset Length Description
0 1 X coordinate
7 bit = 0 - no shadows
7 bits = 1 - with shadow
January 1 Y coordinate
February 1 width of the window
March 1 window height
April 1 attribute window
May 1 attribute shadow
June 1 style of window frame
Total 7 bytes.
Format Descriptor menu
Offset Length Description
0 1 X coordinate
January 1 Y coordinate
February 1 width of the strip separation
January 3 Number of points
April 1 attribute nevydel. item
May 1 attribute apportionment. item
Total 6 bytes.
Table of types of computers
Function System info shows the output type
computer. Here is a table matching the specific
model codes and layout of ports, memory management
on system variables:
0 - Spectrum 128;
ports +0 - # 7FFD;
1 - Pentagon 512;
ports +0 - # 7FFD;
2 - Scorpion ZS 256;
ports +0 - # 7FFD;
ports +1 - # 1FFD;
3 - Scorpion + GMX
ports +0 - # 7FFD;
ports +1 - # 1FFD;
4 - KAY 256;
ports +0 - # 7FFD;
ports +1 - # 1FFD;
5 - KAY 1024;
ports +0 - # 7FFD;
ports +1 - # 1FFD;
6 - Profi;
ports +0 - # 7FFD;
ports +1 - # DFFD;
7 - Sam Coupe.
ports +0 - # FA;
ports +1 - # FB.
System variable always contains the ports +3
state of the port # EFF7.
*
CREDITS
Programming:
Megus / BW:
- BIOS, NeOS;
- Set of drivers;
- Optimization of the code.
MAV / BW:
- Low-level procedures for disc;
- Adaptation ZASM Wednesday NeOS.
Tigrr / BW:
- Driver MS-DOS'a.
Andrey Isaev:
- Finalization of the driver FDD.
Counseling, advice, criticism:
Pavel Fedin:
- Author of the idea BIOS;
- Constructive criticism.
MAV:
- Tips and advice on the very concept of
BIOS.
Denis Dmitriev:
- Advice on the implementation of the system drivers;
- Constructive criticism.
Roman Milukov:
- By the idea of an installer.
Andrey Isaev:
- Advice on the file system;
- Tips for better command Institute
terpretatora;
- Constructive criticism.
Tim Kelly:
- Advice on the implementation of the system drivers.
Beta Testing:
Megus, Virtual, Tigrr, Navigator, MAV, Andrey
Isaev, Denis Dmitriev, Alexander Kormishin.
Moral support:
Brainwave, X-Project, Andrey Isaev, Alexander
Kormishin, Tim Kelly, Roman Milukov, Yuri Voyna
lovich, all REAL.SPECCY.
e GMoralnaya support:
Brainwave, X-Project, Andrey Isaev, Alexander
Kormishin, Tim Kelly, Roman Milukov, Yuri Voyna
lovich, all REAL.SPECCY.
e small area (1Kb) for its domestic needs. Memory
allocation in this area is as follows:
256b - buffer command line;
512b - time domain for different functions;
114b - the current path.
In kernale there is a region reserved for the call of some
useful functions shell. Here is their description:
# 00FC. Input string
Function is a character editor
line. It provides the following convenience
editing:
* Ability to move the cursor on the line
keys;
* The ability to insert characters into the middle of the line;
* The ability to switch the Russian / Latin re
Giustra, and Caps Lock.
Upon completion of recruitment into the end of the string is
appended code # 0D. Input: HL - address of the edit buffer;
B - the length of the input string.
Exit: -
# 00FF. Command interpreter
The function performs the action specified in the command
line. If interp +2 and interp +3, equal to 0, use the
built-interpreter, otherwise case - outside the target of a
given variable. Log in: -
Exit: -
# 0102. Read number
The function reads from a string 16-bit number.
The number can be in hex, and
in decimal form.
Input: HL - address of string.
Output: HL - a limited number;
DE - the address in the following numbers;
C = 0 - number of considered successful;
C = 1 - error while reading.
# 0105. Shut AY
The function is similar to the SILENCE command
interpreter.
Log in: -
Exit: -
# 0108. Change directory
The function is similar to the CD shell.
Input: HL - address of string.
Exit: -
105. Shut AY
The function is similar to the SILENCE command
interpreter.
Log in: -
Exit: -
# 0108. Change directory
The function is similar to the CD shell.
Input: HL - address of string.
Exit: -