Manual - Uni-Dos
Manual - Uni-Dos
Manual - Uni-Dos
UNI-DOS
From S. D. Software.
-1-
UNI-DOS MANUAL
Contents
Section page
1 Introduction 2
2 Plus D Installation 3
3 DISCiPLE Installation 5
4 System Setup 7
5 File, Disk and Program Conversions 8
6 Simple Commands 9
7 Random Access Files 12
8 Printer Commands 15
9 Advanced Commands 16
10 Functions 20
11 Create Files 21
12 Snapshot Functions 23
13 Error codes 24
14 Hook codes 25
15 Directory Structure 27
16 Dos Variables 28
-2-
UNI-DOS MANUAL
Introduction
First of all thank you for buying UNI-DOS and welcome to a new level of
power for your Spectrum.
I expect that you have already had many hours of use from your PLUS D or
DISCiPLE, and now, with UNI-DOS, you can look forward to many more.
Before going any further check that you have everything you need to run
UNI-DOS. You should have received this manual, a disc and a RPROM chip.
There are two versions of the EPROM chip. Do make sure that you have the
correct chip for your system. You can not use the wrong chip. It won’t do any
harm but it will not work.
You should also have a disk. This will be formatted for 80 tracks and can be
used on both single and double sided drives. If you have the wrong chip or a disk
that will not work in your drive please return the entire package to S D Software
clearly stating the problem. DO NOT FORGET TO INCLUDE YOUR NAME
AND ADDRESS.
Now that you are sure you have all the parts you can begin to install UNI-DOS
on your machine. If you have a PLUS D then follow the instruction in the next
section. DISCiPLE users should go to section three.
-3-
UNI-DOS MANUAL
PLUS D installation
To install UNI-DOS on your PLUS D you will need a small cross headed
screwdriver, a small flat bladed screwdriver and about 30 minutes.
With all power switched off disconnect your PLUS D completely from the
Spectrum and remove all cables connected to it.
You will find two small cross head screws an each side of the PLUS D.
Carefully remove these and keep them safe. Ease the top cover off the PLUS D
to expose the printed circuit board.
Examine the circuit board and make note of the three large chips. The ROM
is the chip nearest to the printer plug and furthest away from the snapshot button.
Note also that this chip has a small notch at the end nearest to the centre of the
circuit board.
Remove this ROM chip using the flat blade screwdriver by easing the blade
between the chip and the socket it is plugged into. Do take the greatest of care as
these chips and the circuit boards can be damaged all too easily.
Now is the time to remove the new UNI-DOS chip from its packaging.
Examine the chip to make sure that none of the pins or legs aren’t bent or
broken. Place the new chip onto the socket making quite sure that the end with
the notch is to the centre of the circuit board. IF YOU GET IT THE WRONG
WAY YOU WILL DESTROY THE CHIP WHEN YOU SWITCH ON THE
POWER. Taking care not to bend any of the legs press the new chip into the
socket.
Assuming that all is well switch off and disconnect the PLUS D from the
Spectrum. Now replace the top onto the PLUS D. Take care with the red light to
get it in its hole. Replace the screws and reconnect the cables and plug into your
Spectrum. Switch on to make sure everything is still working.
-4-
UNI-DOS MANUAL
Store your old GDOS chip in the packaging that the UNI-DOS chip came in
and take care of it. Just in case you ever want to go back to using GDOS.
-5-
UNI-DOS MANUAL
DISCiPLE installation
To install UNI-DOS on your DISCIPLE you will need a small cross headed
screwdriver, a small flat bladed screwdriver and about 45 minutes.
With all power switched off disconnect your DISCIPLE completely from the
Spectrum and remove all cables connected to it.
You will find six small screws on the underside of the DISCIPLE. Carefully
remove these and keep them safe. Remove the base cover off the DISCIPLE to
expose the printed circuit board. Turning the DISCIPLE over you will find a
screw at either side of the Spectrum edge connector. Remove these and keep
them safe. You should now be able to drop the printed circuit board out of the
top cover. Do take care not to damage the Spectrum connector which will need
to be helped through the slot in the top cover.
Examine the circuit board and make note of the three large chips. The ROM
is the chip nearest to the Spectrum connector and furthest away from the
snapshot button. Note also that this chip has a small notch at the end nearest to
the centre of the circuit board.
Remove this ROM chip using the flat blade screwdriver by easing the blade
between the chip and the socket it is plugged into. Do take the greatest of care as
these chips and the circuit boards can be damaged all too easily
Now is the time to remove the new UNI-DOS chip from its packaging.
Examine the chip to make sure that none of the pins, or legs are bent or broken.
Place the new chip onto the socket making quite sure that the end with the notch
is to the centre of the circuit board. IF YOU GET IT THE WRONG WAY YOU
WILL DESTROY THE CHIP WHEN YOU SWITCH ON THE POWER.
Taking care not to bend any of the legs press the new chip into the socket.
-6-
UNI-DOS MANUAL
Assuming that all is well switch off and disconnect the DISCIPLE from the
Spectrum. Now replace the covers onto the DISCIPLE in the reverse manner that
you removed them. Replace the screws and reconnect the cables and plug into
your Spectrum. Switch on to make sure everything is still working.
Store your old GDOS chip in the packaging that the UNI-DOS chip came in
and take care of it. Just in case you ever want to go back to using GDOS.
You will now find that Uni-Dos does not contain any networking code. This
has had to be deleted to make space for the random filing code. If there is enough
demand then networking may be introduced as a create file.
-7-
UNI-DOS MANUAL
Now that you have changed the ROM on your PLUS D or DISCIPLE you
will need to create a customized system file. The disk already has a system file
that should work with all systems but to get the most from UNI-DOS you may
need to change some of the defaults. The defaults are for two 80 track drives and
an EPSON compatible printer. Before making any changes you should have the
drive and printer manuals to hand.
With all the cables connected and the Spectrum switched on load your UNI-
DOS disk and type RUN to boot the UNI-DOS system. The first thing that you
must do whether you are going to use the setup program or not is to make a copy
of the UNI-DOS disk_ To do this type LOAD P "backup". The program will auto
run and will request that you change disks as required. Once finished the setup
program will load automatically. You can load the setup program at any time by
typing LOAD P "setup".
The program is menu driven and is simple to use. Often only a single key
press is required to answer a question. The first part will configure the number
and type of drives you have on the system. Note that the stepping rate is now
different to GDOS. The value you enter will be rounded to 2, 3, 6 or 12 ms. Only
the last step will use the full time entered. This makes disk use much smoother
and faster but keeps the reliability of slow step rates. The default step rate is 25
ms.
The second part of the program, which you may skip, is the printer setup. If
your printer is not EPSON compatible you may well have to use this section to
make your printer work, otherwise only use it to set up anything special for your
printer.
When the program has run a new configured UNI-DOS file will be saved
onto your disk and loaded into the PLUS D or DISCIPLE.
-8-
UNI-DOS MANUAL
Conversion
If wish to use any of the new UNI-DOS features on execute or snapshot files
then you will need to run the conversion program provided. The conversion only
changes the directory entry to allow random access to the files. They can be
loaded and run without conversion.
Microdrive files have changed completely and if any of your programs use
MDRV files then they will need to be converted. This conversion is one way
only and once changed the files can not be used by GDOS. It should go without
saying that you should convert copies of your files not the originals.
While it is not necessary to convert your disks you will not get the full
benefit of UNI-DOS unless you do. With UNI-DOS whenever a disk is for-
mated a magnetic mark is written onto every sector to identify different disks.
This allows UNI-DOS to tell if you have put the wrong disk into a drive during a
file copy or if a disk has changed when using opentype files.
To format a disk you now need to load the format program. This is done by
LOAD P "format". There are six options. Two to simply format disks in drive 1
or 2. These will erase all data from the disks. The reformat options will first read
the information from the disk into memory format the disk and then load the data
back so no data is lost, unless the disk can not be read in the first place.
The final options will do a complete disk copy after formatting and can be
used to make backup copies of your disks including your UNI-DOS disk.
The last conversion you may need to do is to any programs that use the
SAVE command to copy files. There are very few of these as under GDOS a file
copy ended with a system reset. The new command is MOVE and can be found
in section 6.
-9-
UNI-DOS MANUAL
Simple Commands
Anything included below in square brackets is optional and may be left out
of the command. <channel> is a number from 0 to 16, and <drive> is 1,2 or * if
you want to use the last drive accessed.
RUN
Boots the DOS from a disc in drive 1. If there is a program in memory then
that will be run. If you wish to boot UNI-DOS when there is a program in
memory use RUN 10000
-10-
UNI-DOS MANUAL
ERASE d<drive>"<filename>"[NOT]
Erases the specified file, or files. You cannot erase a file while it has a
channel open to it or if the file is protected. Wildcards are allowed and if "NOT"
is used then no error is given if the command ends without actually having
erased a file.
LOAD d<drive>"<filename>"
Loads a BASIC program.
-11-
UNI-DOS MANUAL
LOAD d<drive>"<filename>"SCREEN$
Loads a screen file.
LOAD d<drive>"<filename>"[;]X
Loads an execute file. The optional separator is to allow the form LOAD
d<drive>;a$;X to pass syntax.
LOAD d<drive>"<filename>"[;]S
LOAD d<drive>"<filename>"[;]K
Loads snapshot files. S loads a 48K snapshot and K a 128K snapshot.
LOAD p<file-number>
LOAD p"<filename>"
Loads any type of file from the current disk. The file may be specified by
either the file’s program number which is printed during a full catalogue, or by
the file’s pathname. Note that arrays will be loaded correctly using these forms.
VERIFY d<drive>"<filename>"
VERIFY d<drive>"<filename>"DATA <var>$[()]
VERIFY d<drive>"<filename>"DATA <var>()
VERIFY d<drive>"<filename>"CODE [<addr>[,<length>]]
VERIFY d<drive>"<filename>"SCREEN$
VERIFY p<file-number>
VERIFY p"<filename>"
All of the above verify commands work. If there is no error in the verify the
program continues.
MERGE d<drive>"<filename>"
MERGE p<f1le-number>
MERGE p"<filename>"
Merges a BASIC program with the one already in memory. Duplicate
program line numbers are overwritten.
CLS #
Resets the screen colours and clears the screen. You can change the default
colours using POKE @13,<colour>.
-12-
UNI-DOS MANUAL
Just like GDOS, UNI-DOS allows you to create OPENTYPE files; however
you can now access any part of an existing file directly using the random access
capabilities of UNI-DOS. You still have to OPEN# a stream to the file but there
are now three ways of opening the file. Because there are now separate bit maps
for both drives, you can safely use OPENTYPE files on both drives at once.
OPEN #<channel>;d<drive>"<filename>"OUT
Creates an openout channel. The file is actually created in the disk directory
when you close the channel and its size depends on how many bytes are printed
to the channel. Openout channels are consecutive and write only.
OPEN #<channel>;d<drive>"<filename>"IN
OPEN #<channel>;d<drive>"<filename>"RND
Creates a random access channel attached to the specified file. Up to 16
channels can be attached to the same file at once. If IN is specified then the
channel will be read only, but is still random access.
-13-
UNI-DOS MANUAL
All channels of any type must be closed or cleared before you remove the
disc from the drive and replace it with another. If you try to use a DOS command
after swapping discs with a channel open an error will be given, but NEVER use
PRINT, INPUT or INKEY$ when the wrong disc is in the drive as the results
will be unpredictable and may corrupt your disk
PRINT #<channel>;"<data>"
Outputs data to any write channel.
INPUT #<channel>;[I,INE]<varl>[$];[LINE]<var2>[$] . . .
INKEY$ #<channel>
Inputs data from random or read only channels. INPUT reads data up to and
including the next return character (CHR$ 13) in the file. Numerical values as
well as strings may be written to and read from the disc channels. Note that when
using the random channels, INPUT can actually write data to the channel as well
as reading from it if the line contains strings or comma separators
When you reach the end of a random file a null string is registered as an end
marker by INKEY$ and an extra return character by INPUT. Any further
attempts to read the end of the file will generate an error message
You can always use the POINT command on a random channel, even if the
end of the file was reached or the channel is currently in an error status, but an
error is given if you try to move outside the file
CLEAR #
Removes all channels from the channel area without creating any
outstanding, openout channels or saving the sector buffers of random channels.
-14-
UNI-DOS MANUAL
CLOSE #*[<channel>]
Closes one or all disc channels, actually creating openout files and saving
any random sector buffers that need saving_ You can also use this command to
close any channels connected to streams "S", "P" and "K" (the BASIC streams)
and so this DOS command can now completely replace the ZX CLOSE
command. No error is given if the channel being closed was not originally open.
-15-
UNI-DOS MANUAL
Printer Commands
There are now three ways of producing a screen dump to your printer. The
first two are the same as GDOS except that there is no longer any grey scale
shading. Also the "all black" problem has been fixed.
"pass" is the number of printer passes per line to allow you to produce different
degrees of blackness.
"margin" is the dump’s margin in character widths which is totally independent
of the margin used by LPRINT.
"y"/ "x" define the top left hand corner of the image you wish to print in the
same way as PRINT AT y,x;
'height" is the image’s height in character squares.
"width" is the image's width in character squares.
You will also find that you can only stop the dump by pressing the break key
at the end of each printed line. This is to stop the printer being left in a graphics
printing mode.
LPRINT and LLIST are supported and work in the 'same way as under
GDOS. You should also see section 14 as there are a number of DOS variables
that effect the way the printer functions.
-16-
UNI-DOS MANUAL
Advanced Commands
One of the main features of UNI-DOS is the use of directories. Those of you
used to the GDOS disk system will be aware of the disk directory which could
hold up to 80 files. UNI-DOS has created a new file type which is a directory.
Now when you wish to specify a file you have to provide a PATH to the file. In
the simplest case this is Just the file name. In this case the file is looked for in the
current directory.
The directory created when the disk is formatted is called the root directory.
This is the directory you are placed into when you first boot UNI-DOS.
"<filename>"
Specifies a file in the current directory. The filename can contain the
wildcards "?" and "*".
If the string starts with a "/" then the DOS first goes back to the root
directory. Therefore:
"/<filename>"
Specifies a file in the root directory. The root directory is 80 files long and
held on the first 4 tracks of the disc and is created when the disk is formatted.
The CAT, MOVE, IN and OPEN commands allow strings with the filename
part excluded. In these cases the pathname refers to the directory itself.
-17-
UNI-DOS MANUAL
POKE @<addr>,<value>
Pokes the value to the DOS variable area. It can also be used to poke values
into main memory where the address poked will be 8192 higher than the <addr>.
It may be used to poke values up to 65535.
CAT [#<channel>;][d]<drive>["<pathname>"][NOT]
CAT [#<channel>;][d]<drive>["<pathname>"]![NOT]
This command first prints the disc name if it exists followed by the actual
catalogue. If the root directory is being catalogued then the total free disc space
available is printed at the end of the listing. If the catalogue is of any other
directory, the dirname is printed at the top and the directory's capacity is printed
at the bottom. The string part of the command when included can cause the
listing of all programs with a specified name (e.g. using wildcards), or if the
string ends with a "/", a directory will be catalogued. A "!" after the string will
produce a catalogue of filenames only, and if you include "NOT" at the end then
any hidden files will also be listed. Both the forms CAT 1 and CAT d1 are valid,
and the listing can be directed to a stream by specifying a channel number.
-18-
UNI-DOS MANUAL
SAVE @<drive>,<track>,<sector>,<addr>
Saves the data at the specified address directly to a disc sector.
LOAD @<drive>,<track>,<sector>,<addr>
Loads a single sector of raw data from the disc to the specified address.
MERGE d<drive>"<pathname>"
MERGE d<drive>"<pathname>"CODE [<addr>[,<length>]]
MERGE p<file-number>
MERGE p"<pathname>"
Only BASIC programs and code blocks may be merged. Merging a code
block has the effect of disabling the auto run address.
OPEN #<channel>;d<drive>"<pathname>"IN
OPEN #<channel>;d<drive>"<pathname>"RND
Creates a random access channel attached to the specified file. Up to 16
channels can be attached to the same file at. once. If the pathname ends in a "/",
the file is expected to be a directory. Therefore for example
OPEN #<channel>;"/"RND opens a channel to the root directory. If IN is
specified then the channel will be read only, but is still random access.
OPEN #<channel>;d<drive>;IN
OPEN #<channel>;d<drive>;RND
Opens a random channel to the entire disc.
Only channels attached to directories or to the entire disc; will let you
examine and change the last two bytes of any sector since these are normally
only for internal use.
OUT #[<channel>]
Saves all outstanding sector buffers of random channels back to the disc
immediately. An error is given if the channel specified is not a random channel.
-19-
UNI-DOS MANUAL
IN d<drive>
Selects the current drive. A feature of the 128k Spectrum means that this
command is interpreted as a calculator expression if it is typed as a single
command on the edit line without a line number. The DOS command can be
accessed in this case by either preceding or following the command with a colon.
IN d<drive>"<pathname>/"
Sets the, current drive and directory to those specified. The pathname must
end with a "/".
The routine uses the last 16 bytes of the main RAM and so these should not
be overwritten when the error trapping is on. The trapping is automatically
switched off when a program finishes, on a reset, when the break key is pressed,
or by using LINE 0.
The break key can also be disabled independently of the error trapping by
using PORE @4,0 - this disables the break key at most times but not for example
during a scroll? Prompt which can be trapped using the LINE command. Break
will be re-enabled by a reset or by PORE @4, 1, but at other times be careful not
to get the BASIC stuck into an endless loop.
-20-
UNI-DOS MANUAL
FUNCTIONS
All the DOS commands must be enclosed in brackets but the functions can
still be included in expressions.
e.g. (PEEK @<addr1>)+(PEEK @<addr2>)*256 or (PEEK @(PEEK@<addr>))
(PEEK @<addr>)
This function peeks the DOS system variables.
(LEN #<channel>)
Returns the length of a random channel. An error is given if the channel is
not random access.
(POINT #<channel>)
Returns the current file pointer of a random channel or zero if the end of the
file has been reached. An error is given if the channel is not random access.
(IN #<channel>,<length>)
This function reads the specified number of bytes from any type of channel
as a string and is an extremely useful way of getting around the limitations of the
INPUT command.
(AT d<drive>"<pathname>")
Searches through the specified directory and returns either the file number of
the file found, or zero if the file was not found.
-21-
UNI-DOS MANUAL
CREATE FILES
LOAD d<drive>"<pathname>"USR
SAVE [OVER] d<drive>"<pathname>"USR <addr>,<length>
These file types and the associated DOS commands for creating and loading
them, provide an easy way of adding new commands and functions to the DOS.
These extensions are loaded and stored between the channel area and the BASIC
program and so will be lost if you type NEW but will leave the main DOS
uncorrupted.
When you load a CREATE file, any previously loaded extensions with the
same first syntax character are reclaimed so that loading a CREATE file twice
has the same effect as loading it once. Apart from this, the effects of loading
CREATE files is accumulative. Several CREATE files are already available:
FORMAT d<drive>"<discname>"
Names the disc which will then, be printed during any catalogue of this disc.
To erase the disc’s name, use a null string.
(LINE)
This function is designed to tell the BASIC programmer which disc is
currently in use. The numeric result is the sum of:
(STR$ #<channel>)
This function returns as a string result either a null string if the specified
channel is closed, or the stream letter that the channel uses. "d" is the openout
stream and "D" the random access stream.
-22-
UNI-DOS MANUAL
ERASE d<drive>"<filename>"CAT
Erases a directory. The string must be a simple filename not a pathname, and
cannot contain wildcards.
(STEP [d<drive>])
This function returns the pathname of either the last directory accessed, or
the current directory on the specified drive.
-23-
UNI-DOS MANUAL
Snapshot Functions
If an error occurs during the saving of a snapshot then the DOS does not
immediately return to the main program but instead goes back to the striped
border as if you had just pressed the snapshot button. This is to let you know that
the snapshot was unsuccessful and allow you to retry it.
The snapshot button can be pressed at any time UNI-DOS is loaded. The
result will be a striped border and the Spectrum will freeze waiting for a key to
be pressed. The following keys are allowed:
When you are taking a 128K snapshot the computer will freeze shortly after
you have pressed 5. If the main part of the screen is unchanged then press "n" to
continue. However, if the main part of the screen picture has changed then press
"y". This is to allow the snapshot routine to know which screen was currently in
use.
All the files are saved onto the current disk. It is most important that you do
not change the disk in the drive if there are any OPENTYPE files being written
to that disk as any other disk will almost certainly be corrupted by the snapshot
routines.
-24-
UNI-DOS MANUAL
Error Codes
0 Nonsense in Uni-Dos
1 O.K. Uni-Dos
2 Break requested
3 Corrupt sector
4 Sector missing
5 Check disc in drive
6 DOS file not found
7 Invalid filename
8 Invalid sector number
9 Invalid device/channel
10 Wrong stream type
11 Verification failed
12 Wrong file type
13 CODE parameter error
14 Directory not found
15 File has zero length
16 Reading a write file
17 Writing a read file
18 POINT outside file
19 Channel out of order
20 Illegal drive number
21 Disc write protected
22 Not enough disc space
23 Directory full
24 File not found
25 End of file
26 Filename already used
27 File still open
28 File in use
29 Channel already open
30 Protected file
31 Unavailable RST 8
The DOS RAM is checked whenever a NEW or a reset occurs. If there has
been any corruption then the DOS flag will be reset and a warning message will
appear on the screen. The DOS should be reloaded.
-25-
UNI-DOS MANUAL
Hook codes
The machine code interface consists of hook codes (command codes on the
PLUS D and DISCiPLE). These are accessed in the usual way of RST 8
followed by a single byte containing the number of the required hook code.
-26-
UNI-DOS MANUAL
-27-
UNI-DOS MANUAL
Directory Structure
Each file has a 256 byte header stored in the directory. The root directory is
40 sectors in length and can hold 80 file headers. This is always located on the
first four tracks of side 1 of the disk. Subdirectories are basically the same except
that they can occur anywhere on the disk. A subdirectory is always created in a
single area so even though there may appear to be enough room on a disk you
may not be able to create a directory.
Unlike all other files the last two bytes of a sector in a subdirectory do not
point to the next sector. This is not necessary as the next sector is always the next
on the disk. The last two bytes of the last sector of a subdirectory are set to #FF
to indicate the end of the directory.
In the root directory the first file header may also contain the disk name
which is held at the end of the file header. The meanings of each of the bytes in a
file header are as follows.
byte use
0 file type: 0 ERASED
1 BASIC PROGRAM
2 NUMERIC ARRAY
3 STRING ARRAY
4 CODE FILE
5 48K SNAPSHOT
6 MDRV
7 SCREEN$
8 SPECIAL
9 128K SNAPSHOT
10 OPENTYPE
11 EXECUTE
12 SUBDIRECTORY
13 CREATE
UNI-DOS Variables
-28-
UNI-DOS MANUAL
9 1 0 Left margin
number of spaces sent before first
printed character on a line.
-29-
UNI-DOS MANUAL
99 1 0 error code
-30-
UNI-DOS MANUAL
********************************************************
-31-