
This will be my first tutorial on using
OS-9 and it will be for the beginners
who bought OS-9 and are now ripping
their hair out trying to figure out how
to use it now that they have it...
OS-9 is >NOT< a programming language.
It is totally different from BASIC and
if you wish to program in Basic than I
suggest you buy Basic09 after you are a
bit familiar with OS-9...
For people who have Disk Basic 1.0 you
will need to load the OS-9 BOOT disk
and RUN"*"...This will then tell you to
put the OS-9 Master Disk in Drive 0 and
push any key to continue...
If you have Disk Basic 1.1 then all you
need to do is put the OS-9 Master Disk
in Drive 0 and type DOS...
Now that OS-9 has started up and given
you your Logo and license info it will
ask you for the DATE and TIME.  This
info is >>VERY<< important and should
be given correctly each time you start
up OS-9...DO >NOT< JUST HIT ENTER, GIVE
A DATE AND TIME.  This info is added to
each file as it is saved to disk and
will be used by the OS-9 in the future
to keep track of current files.  The
same info is also available to you to
help you keep tabs on the dates and
times of the files that you saved to
disk...
OS-9 runs on a 24 hour clock so when
giving the time you must remember that
times after 12 noon convert to the
following:
1 pm-1300 hours
2 pm-1400 hours
3 pm-1500 hours
    .
    .
    .
10 pm-2200 hours
11 pm-2300 hours
midnite-0000 hours

To enter Dec 25, 1985...3:30 pm you
would type
           YY/MM/DD HH:MM:SS
           85/12/25 15:30:00

After a date and time have been given
to OS-9 you may check this time anytime
you want from OS-9 by tying DATE T at
OS9: prompt.  If you just say DATE that
is all you will get...You must say
DATE T to get the date and the time...
OS-9 has only a few commands already in
memory.  All the rest of the commands
that you can use from OS-9 are on your
Master Disk.  Each time you give a
command at the OS9: prompt the computer
will check to see if the command is in
memory and then it will go to the disk
in drive 0 and check the /D0/CMDS 
directory to see if the command is in
there.  You must remember to type the
command in correctly (SPELLING) or it
won't be found when the computer goes
to the /D0/CMDS directory looking for it
OS-9 can be a bit slow as it has to go
to the /D0/CMDS directory each time you
type a command at the OS-9 prompt but
you can speed this up a bit by loading
some of the commands that you will use
the most in OS-9. So you could type:
OS9:load dir list del attr copy
You will now have the commands dir,
list, del, attr, copy all in memory and
they are ready for quick access. The
drawback is that they are taking up
memory that you might need later. The
only way around this right now is to
either set your drives to run at a new
faster step rate (another tutorial) or
to get a Hard Disk Drive for use with
your OS-9.  Radio Shack had OS-9 coded
to run the disk drives at 30 MS. track
to track and to format the disk as 35
tracks.  Both of these can be changed
with a little knowledge of OS-9 or by
buying some commercial software that
will make the changes in OS-9 for you.
Another way to speed up OS-9 is to add
a 256K Ram Disk to your CoCo.  With the
256K Ram board installed and the right
software added to OS-9 the extra memory
will act like a >very< fast 40 track
disk drive.
.......................................
OS-9 always has 2 directories that it
keep track of...One is the DATA and the
other is the EXECUTION directory.  When
you type a command OS-9 will check the
current EXECUTION directory which is
/D0/CMDS at startup for the command you
just typed in.  When you go to do a
list, dir, del, rename, etc...OS-9 is
going to do to the current DATA
directory and look for your file there.
The current DATA directory at startup
is /D0...
So if you just type DIR OS-9 will go
and assume you meant DIR /D0...If you
wish to get a directory of say the
DEFS directory you must give OS-9 the
whole pathlist (NAME) to the directory.
In this case you would type:
DIR /D0/DEFS and OS-9 will know which
directory you are talking about.
So how do you know what is a command?
Or what is a data file? Or what is a
directory?  You can get this info by
typing:
DIR E /D0
and OS-9 will give you a directory
of everything that is in the /D0
directory with exact info on each entry
in that directory.  You will get the
date and time the entry was put on the
disk and the user number (0 which means
you), the entry's name, the attributes
of the entry and the size of the entry
in hexadecimal.
It is the attributes of an entry that
we will want to check. They list across
like this:
     DSPPPERW
       EWR
     --------
That is 8 slots that can have a letter
in it.  If the DIR E command shows this
on a line
     D--RW-RW
It would mean that it is a directory
and that you and any timesharing users
you had on your system could read and
write to that directory...
If the entry gives this back:
     --E--ERW
It would mean that it is a command that
can be used by you and your timesharing
users and that you have the right to
say copy that file, rename that file or
delete that file.  The timesharing user
would only be able to execute the file.
......................................
If you don't want to do a DIR E on a
whole disk than you can get the info
you need on a single entry by typing:
ATTR /D0/startup
this will printout the attributes in
the same manner as the DIR E command
did, but you now have the option of
changing the attributes of a file on
the disk...
We'll use the /D0/startup file for an
example...say the ATTR /D0/startup
prints this
    ------rw
This means that the file can be read
and written to.  But say you don't want
to accidently delete or rename the file
in the future?  You can type:
ATTR /D0/startup -w
and the write ability to that file will
be taken away.  If you tried to delete
that file now you would get an error
message.  You can use this ATTR command
to change the attributes on all your
important files so that they will not
be deleted by accident in the future.
This is kind of like having a write
protect tab on your disk like in Disk
Basic.  But you can protect single files
on the disk.  Or even lock out a DATA
directory from having files written or
deleted from it.
......................................
When I told you that OS-9 will check
to see if a command is in memory and
then check for it in the EXECUTION
directory I left out a final thing that
it does.  It will go to the DATA 
directory and check to see if there is
a DATA file there with the same name as
what you typed in at the OS-9 prompt.
You can check this out yourself. LIST
the file startup like this:
LIST /D0/startup
You will see this:
setime <term
it looks like a command right?  Well it
is what OS-9 calls a procedure file.
OS-9 will take the command you type in
and first check to see if it is in 
memroy, if that fails it will go to the
EXECUTION directory and see if the
command is there, if that fials it will
go to the DATA directory and see if
there is a procedure file there with
the name you typed in.  If there is it
will read one line at a time from that
file and treat it like you were typing
in the lines from the keyboard.  If
you want to try this...Just type startup
at any OS-9 prompt and the system will
ask you again for the DATE and TIME to
use on the system.
You can build a procedure file of your
own that does a little more than the
startup file does...DO THIS at the OS-9
prompt:
OS9:build /d0/myfile
you will then see a (?)
at each (?) type these lines
? dir /d0
? dir /d0/cmds
? mfree
? free
? (enter)
You will now have a data file on /D0
called myfile.  If you were to type
myfile at an OS-9 prompt you will then
see a DIR of /D0 and then a DIR of
/D0/CMDS and then you will get a mfree
(memory free), and finally you will get
a free (free disk space) all listed to
your screen one at a time.  OS-9 did
all the commands in the data file as if
you just typed them in at the keyboard.
Not bad huh???
......................................
Now the next important thing to worry
about with OS-9 is how does it keep
tabs on free space in memory and on the
disks???  Memroy in the computer is
split up in blocks of 256 bytes.  If 
you do a mfree you will get back about
159 to 162 blocks of memroy.  If you
know that 4 blocks of 256 bytes makes
one K (kilobyte) than you know you have
about 40K free in memory for your
programs and commands.  This same idea
is carried over to the disk drive.  All
writes to the disk are done in blocks
of 256 bytes or 1 sector.  A newly
formatted disk will have about 640
sectors on it.  But 10 of these sectors
are taken away for use as directory
pointers.  As OS-9 only writes out to 
the disk in blocks of 256 bytes you will
be able to get more info on an OS-9
disk than a Radio Shack Dos disk which
stores data to the disk in blocks of
9 sectors (9*256=2304 bytes).  Write 1
chr. to an OS-9 disk and you lose 1
sector.  Write 1 chr. to a RS Dos disk
and you lose 9 sectors!!!
......................................
Now do a DIR /D0/CMDS and you will see
quite a long list of commands that are
available to you.  Don't worry about all
those titles because as you learn OS-9
you will become familiar with all of
them and probably not use all of them.
The nice thing about OS-9 that was so
different from RS Disk Basic was that
it is so easy to add >MORE< commands to
OS-9 than it was to add commands to the
RS DOS.  If you know 6809 machine
language you might even write some
commands that you will find useful and
might want to sell or trade with other
OS-9 users.  If you aren't all that
familiar with machine language then you
can buy some new commands fo OS-9 from
companies like Frank Hogg or from
Computerware or D.P. Johnson.  These
are commands that are so easy to
install on your OS-9 disk!!!  All you
need to do is copy them to your
EXECUTION directory which is usually
the /D0/CMDS directory.  They are then
available for your use.  No worry on
your part as to will they work with
your OS-9!!!  Some of these programs
are actual commands that you call from
OS-9 and other programs are what are
called FILTERS that you pipe data thru
under OS-9 (more on this in future
tutorial)...
.......................................
And now one final thing to cover on
OS-9 before I end this lesson.  Is
there a difference btw. upper and lower
case when you type in commands???  The
answer is no...no...no...
If you type in DIR /D0 or dir /d0 they
will both act correctly...if you type
LIST /D0/STARTUP or list /d0/startup
they will both work correctly.  OS-9
doesn't care about the case of the
commands you type in.  But here is a
standard that you might wish to keep to
so that what is on your disk are a bit
easier to understand.  It is felt that
if you keep all directory names in
capital letters and all data/comand
files in lower case you will have a
better idea of what is on your disk
when ;you use the dir command.  I find
this a useful tip and try to follow it
strictly when I work with OS-9.
....................................
The next lesson in the tutorial series
will be on nested directories and on
pipe and filters and how they are most
useful under OS-9.
Bob Montowski  215-277-6951

 