Mercurial > hg > Members > kono > nitros9-code
changeset 999:dac2d1602e51
A four lesson tutorial I found on my harddrive
author | roug |
---|---|
date | Tue, 25 Feb 2003 21:29:08 +0000 |
parents | 50e65888ce5c |
children | da4002e207e3 |
files | docs/articles/tutorial.article |
diffstat | 1 files changed, 1764 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/docs/articles/tutorial.article Tue Feb 25 21:29:08 2003 +0000 @@ -0,0 +1,1764 @@ +<?xml version="1.0" ?> +<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" + "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> +<article> +<articleinfo> +<author><firstname>Bob</firstname><surname>Montowski</surname></author> +<title>An OS9 Tutorial</title> +</articleinfo> +<section> +<title>Lesson 1</title> +<para> +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 <emphasis>not</emphasis> a programming language. +It is totally different from BASIC and +if you wish to program in Basic then 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 information it will +ask you for the DATE and TIME. This +information is <emphasis>very</emphasis> important and should +be given correctly each time you start +up OS-9. Do <emphasis>not</emphasis> just hit enter, give +a date and time. This information 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 information 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: +<literallayout> + 1 pm-1300 hours + 2 pm-1400 hours + 3 pm-1500 hours + . + . + . + 10 pm-2200 hours + 11 pm-2300 hours + midnite-0000 hours +</literallayout> + +To enter Dec 25, 1985...3:30 pm you +would type +<screen> + YY/MM/DD HH:MM:SS + 85/12/25 15:30:00 +</screen> + +After a date and time have been given +to OS-9 you may check this time anytime +you want from OS-9 by typing 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: +<screen> +OS9:load dir list del attr copy +</screen> +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 <emphasis>very</emphasis> fast 40 track +disk drive. +</para> +<para> +OS-9 always has 2 directories that it +keeps 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 <userinput>DIR</userinput>, 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: +<userinput>DIR /D0/DEFS</userinput> 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 information by +typing: +<userinput>DIR E /D0</userinput> +and OS-9 will give you a directory +of everything that is in the /D0 +directory with exact information 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: +<screen> + DSPPPERW + EWR + -------- +</screen> +That is 8 slots that can have a letter +in it. If the DIR E command shows this +on a line +<screen> + D--RW-RW +</screen> +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: +<screen> + --E--ERW +</screen> +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. +</para> +<para> +If you don't want to do a DIR E on a +whole disk than you can get the information +you need on a single entry by typing: +<screen> +ATTR /D0/startup +</screen> +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 +<screen> + ------rw +</screen> +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: +<screen> +ATTR /D0/startup -w +</screen> +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. +</para> +<para> +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: +<screen> +LIST /D0/startup +</screen> +You will see this: +<screen> +setime <term +</screen> +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 +memory, if that fails it will go to the +EXECUTION directory and see if the +command is there, if that fails 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: +<screen> +OS9:build /d0/myfile +</screen> +you will then see a (?) +at each (?) type these lines +<screen> +? dir /d0 +? dir /d0/cmds +? mfree +? free +? (enter) +</screen> +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??? +</para> +<para> +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 memory. If you +know that 4 blocks of 256 bytes makes +one K (kilobyte) then 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 630 +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 information 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 +character to an OS-9 disk and you lose 1 +sector. Write 1 character to a RS Dos disk +and you lose 9 sectors!!! +</para> +<para> +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 <emphasis>more</emphasis> 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)... +</para> +<para> +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 <command>dir</command> command. I find +this a useful tip and try to follow it +strictly when I work with OS-9. +</para> +<para> +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. +</para> +</section> +<section> +<title>Lesson 2</title> +<para> +OK, glad to see that you are back for +lesson #2. I'll cover the way the OS-9 +has multiple directories and how each +directory can have directories within +that. What is this good for and how can +you use this on your OS-9 system? Well, +first it makes it very easy to put your +files on your disks in a manner that +will make it easy for you to find those +files again in the future... +Let's take a blank disk and format it. +If you have one drive do this: +<screen> +OS9:load format dir makdir build free +</screen> +take your Master Disk out of drive 0 +and put in a blank disk. Now at the OS9 +prompt you type format /d0. You will +be asked if you really want to format +the disk in drive 0? Type Y for yes. +When the format is done you will be +asked for a name to put on the disk. +Each disk you format under OS-9 will +have a NAME on the disk. For the time +being we'll call this disk JUNK DISK. +OS-9 will check the disk to be sure all +the sectors are good and if not OS-9 +will lock out the bad sectors from the +directory. This means that you could +use a scratched disk that you were not +able to format under RS Dos... But you +should beware of doing this if you +intend to put anything realllllly +important on this disk. +Now that the format is done at +the OS-9 prompt... type: +<screen> +OS9:free /d0. +</screen> +This will check the disk you just did +the format on in drive 0 and it will +tell you the name of the disk... how many +total sectors there are on the disk and +how many of those sectors are available +for you to store data in. OS-9 is set +up for a 35 track system with 18 sectors +per track... This gives you 630 sectors +total on the disk and OS-9 will take 10 +of those sectors for its Directory +information. If you do not see 620 +sectors free for use than the disk had +some bad sectors on it and you might +not want to put anything important on +this disk. But for now we will just +experiment with the disk. +at the OS9 prompt type: +<screen> +OS9:makdir /d0/LETTERS +OS9:makdir /d0/BILLS +OS9:makdir /d0/LETTERS/FROM.JOE +OS9:makdir /d0/LETTERS/FROM.SUE +OS9:makdir /d0/LETTERS/FROM.TOM +OS9:makdir /d0/BILLS/PHONE +OS9:makdir /d0/BILLS/GAS +OS9:makdir /d0/BILLS/FOOD +OS9:chd /d0 +OS9:dir /d0 +</screen> +....You will see that the dir returns +LETTERS BILLS +as what is on the disk in drive 0 +But you made 6 directories... so where +are the other ones? Try this: +<screen> +OS9:dir /d0/BILLS +PHONE GAS FOOD +</screen> +is what you will get. See how you can +cluster important stuff in directories +so that it has a logical flow and you +can work your way down thru the levels +of the directories to get the information you +want???? +Try this: +<screen> +OS9:dir /d0/LETTERS +FROM.JOE FROM.SUE FROM.TOM +</screen> +is what you get... in a real life +situation... say the business world you +could then do this: +<screen> +OS9:dir /d0/LETTERS/FROM.TOM +</screen> +and you would see the letters you stored +from someone called TOM... A very neat, +logical way to store and retrieve data +from your disk. When you get into +owning double sided disks for storage +or even a Hard Disk drive for storage +you will see how this makes it easier +to get to your information. Imagine +having a Hard Disk under RS DOS? A Dir +of that drive might return a directory +listing some 100-500 lines long... It +would be a real pain to read all those +titles and try to find the file you +wanted to del or copy or rename... +</para> +<para> +If you have a two drive OS-9 system +then you can go thru this exercize too +by just putting the disk you wish to +format in drive /d1 and changing all +the makedir and dir statements I gave +so they say /d1 instead of /d0. +</para> +<para> +Now in the prior example I showed you +the command chd... what is this? Well +OS-9 has two commands built into it and +you can call them to tell OS-9 that you +are changing your DATA directory or your +EXECUTION directory. Now this is very +important to remember!!! If you take +the Master Disk out of drive /d0 and +put in a new Master Disk that say has +more commands in its /D0/CMDS directory +you <emphasis>must</emphasis> tell OS-9 that you did +this... you do this by: +<screen> +OS9:chx /d0/cmds +OS9:chd /d0 +</screen> +OS-9 will then check this disk so it +will know where the DATA directory is +on the disk and where the EXECUTION +directory is on the disk. It will <emphasis>not</emphasis> +always be in the same spot on each disk. +You might be used to RS DOS where the +directory was <emphasis>always</emphasis> on track 17, +but this is not true under OS-9. OS-9 +must always know where these two +directories are before it will do a +read/write for that disk. +Another benefit of the chd and chx +command are to save you some typing. +So if you are not a quick or accurate +typist these commands are a real boon +to you. Take the example above where +we had directories within directories. +If you wished to copy files or delete +files or build files in the +/d0/letters/from.joe directory you would +think you would have to type that long +line each time. You could for your own +piece of mind but there is a shortcut +to all that typing... do this: +<screen> +OS9:chd /d0/letters/from.joe +</screen> +If you do a dir now you will see that +there are <emphasis>no</emphasis> files in the directory +you are in... +You could build a file in this new +DATA directory by typing +<screen> +OS9:build /d0/letters/from.joe/june.1st +</screen> +or you could just say: +<screen> +OS9:build june.1st +</screen> +as you used the chd command earlier OS-9 +knows to add that whole string of characters +in front of june.1st to make the whole +pathlist to where you wish to build a +file. You see that there is less chance +of a typing error in this shorthand +method rather than typing out that long +string of characters each time.... +</para> +<para> +When you go to makdir or build something +on the disk you have to keep in mind +that OS-9 expects titles of directories +and files to obey certain rules. The +names of these files/directories <emphasis>must</emphasis> +begin with a letter(upper/lower case) +and may have no spaces in the title. +If you wanted to build a file called: +a letter from my buddy +You would need to type it in as: +a.letter.from.my.buddy +for OS-9 to accept it... you could have +even typed it in as: +aletterfrommybuddy +But this is a bit harder to read... +Another character you can use to separate +words for easier reading is the left +arrow sign... this can be made by typing +the clear key/minus sign together... +depending on the type screen you are +reading OS-9 on you will see a left +arrow or an underline. They are both +the same ascii character. But the character. rom +on the CoCo was setup for the left +arrow sign. This clear key/minus key +is a bit hard to remember and harder +yet to type so I use the period(.) to +separate my words in my titles and +directories. +File names and directories can be up to +29 characters long... You can have numbers +mixed into this but the first characters of +each file/directory <emphasis>must</emphasis> be a letter! +so these names are perfectly legal: +<screen> + number11111111 jan281985 + q1234567890 a2gggg8888cccc9999 +</screen> +NO SPECIAL CHARACTERS MAY BE USED IN A FILE +NAME OR A DIRECTORY NAME!!! This means +no !@#$%^&*+="'- are allowed in any +title. Some of these characters are used by +OS-9 to perform other useful functions +that will be covered in a future lesson. +</para> +<para> +OS-9 has the ability to take information +and pass it thru a pipe into a filter to +change the information in some manner before +showing it on your screen or your +printer. The command for a pipe is the +exclamation point(!). A filter can be +thought of as a program that will take +data in and do something with it before +passing some data out. The ONLY filter +that you have with your original OS-9 +is the filter called TEE. If you were +to do this: +<screen> +OS9:list startup ! tee /d0/f1 /d0/f2 +</screen> +it would list the data in the file +called startup thru the pipe (!) into +the filter TEE... this program would then +send the data out to two files that +are called /d0/f1 /d0/f2 and you would +have two perfect copies of the file +startup called f1 and f2... You could +have done this same thing by typing: +<screen> +OS9:copy /d0/startup /d0/f1 +OS9:copy /d0/startup /d0/f2 +</screen> +TEE will take any data that is piped +into it and send it to the list of +devices or files that are printed after +the tee command and separated by spaces. +so a line like this: +<screen> +OS9:dir /d0 ! TEE /d0/stuff /p /d0/s2 +</screen> +will send a directory of /d0 to your +screen, a file called /d0/stuff, to the +printer, and to a file called /d0/s2. +This is a way to get some data to a lot +of different places all at about the +same time. There are other filters you +can buy that will do the following: +<screen> +OS9:list startup ! upper +</screen> +this will take any data in a file +called startup and send it thru the +filter called upper... upper will take +ALL lower case letters and change them +to upper case before passing that information +on... +<screen> +OS9:list startup ! wc +</screen> +This command will list the file startup +thru the pipe into the filter wc which +will count the # of lines, characters, and +words in the file which <command>wc</command> will then +print out to your screen. Imagine +doing that by hand? +There are a <emphasis>lot of filters</emphasis> that you can +buy. Check the Official OS-9 Tour +Guide out for a list of the filters you +can buy and who sells them. +</para> +<para> +A piece of advice now. If you think you +are going to get into OS-9 you should +consider getting a 2nd disk drive if +you now only have 1 drive. OS-9 can be +run on a single drive CoCo but it is a +real PAIN IN THE BUTT!!! On a 2 drive +system you can keep all your commands on +drive /d0 and all your data on drive /d1 +and should speed along just fine and not +worry about space being tight on your +drives when you go to build files in +the future. +</para> +<para> +Until you become familiar with OS-9 and +the way it gives error #'s instead of +letter codes for the errors you make +then do this: +<screen> +OS9:printerr +</screen> +this will then print the error # of any +error you have and give you a short +english(???) sentence of what was wrong. +As you use OS-9 more you will find that +you will likely get 4-6 error codes that +tend to repeat a lot. Most errors on +OS-9 are caused by typing errors when +entering directory names or file names. +</para> +<para> +I hope I don't appear to be jumping +about two much with these lessons but +I am trying to tackle the problems of +OS-9 in the same manner that I ran into +them and am sure other new users are +finding them. So I give this final bit +of advice... OS-9 comes with 3 books. +a red(purple) one, a blue one and a +yellow(orange)one. Don't even look at +the blue book yet. It has machine language information in +it that you <emphasis>may never</emphasis> use unless you +get into machine language programming under OS-9. +The red book will tell you all the +commands available under OS-9 and a bit +on how they work. READ THIS BOOK OVER +AND OVER AT LEAST 4 TIMES!!! The yellow +book has information on the text editor that +comes with OS-9. This is covered in +the 1st half of the book... READ THIS +VERRRRRY CLOSELY... IT GETS COMPLICATED +but there are a lot of examples... +The 2nd half of the yellow manual also +has some machine language information in it for doing +assembly of machine language programs... If you are +not going to get into machine language ever then you +don't need to read this info. Even +though you have these 3 fine manuals, run +to the nearest RS store and buy the +Official OS-9 Tour Guide. It has more +information than these 3 manuals and it is +written in a lot friendlier manner than +these 3 manuals. It also gives better +examples on how to use the commands +available to you under OS-9 and give +a history of OS-9 and why it is such a +fine Operating System to run on your +CoCo. +</para> +<para> +Next lesson? I will tell you the +commands that you might never use and +how to delete them to make more space +on your Master Disk. +</para> +</section> +<section> +<title>Lesson 3</title> +<para> +Below is a list of the commands that you +may seldom use and therefore may delete +from your EXECUTION directory which is +/D0/CMDS... +<note><para> NONE OF THESE COMMANDS SHOULD BE +DELETED FROM YOUR ORIGINAL DISK... NEVER +DELETE FILES/DIRECTORIES/COMMANDS FROM +YOUR ORIGINAL OS-9 MASTER DISK. ALWAYS +MAKE THESE DELETIONS/CHANGES TO A BACKUP +OF YOUR MASTER DISK</para></note> +To make a backup of your OS-9 Master +disk do this: +For a single drive system you must at +the OS-9 prompt type this: +<screen> +OS9:load format free +</screen> +Take your OS-9 Master disk out of your +drive /d0... put a blank disk in drive +/d0... now at the OS-9 prompt type: +<screen> +OS9:format /d0 +</screen> +When OS-9 asks if your really want to +format the disk in drive /d0 respond +Y for yes or R for ready... When the +format is done OS-9 will ask you for a +name to put on the disk. You may give +any name up to 32 characters. The name at +this point does not matter as when we +backup the original Master disk to this +disk... it will retain the name of the +original Master disk. So you can just +call the disk NEW. +When the format is done and the verify +pass is done the OS-9 prompt will return +At this point you want to type: +<screen> +OS9:free /d0 +</screen> +If the free does not say...630 sectors +total on the disk... and 620 available +for use... <emphasis>Do not use this disk to do a +backup onto... it will <emphasis role="bold">not</emphasis> work!!!</emphasis> +Take the newly formatted disk out of +drive /d0 and put your original Master +disk back in drive /d0. At the OS-9 +prompt you will type: +<screen> +OS9:unlink format free +</screen> +This will take the two commands out of +memory and give you more memory to work +with when you go to do your backup. +At the OS-9 prompt you will type: +<screen> +OS9:load backup +</screen> +Take your original Master disk out of +drive /d0 and put your newly formatted +disk in drive /d0... +at the OS-9 prompt you type: +<screen> +OS9:backup s /d0 #32k +</screen> +OS-9 will ask you if you are ready to +backup from /d0 to /d0... You type Y for +yes. OS-9 will now say ready the +destination disk... you already have it +in the drive. Hit any key to continue +... OS-9 will list the name that was on +the disk and ask if it ok to write over +this disk... type Y for yes... OS-9 will +then say ready SOURCE disk hit a key... +Put your OS-9 Master disk back in drive +/d0 and hit any key... When OS-9 says to +ready the DESTINATION disk... Take your +Master disk out of drive /d0 and put the +newly formatted disk in drive /d0... hit +any key to continue... OS-9 will repeat +this prompting till the whole original +disk is copied exactly over to the new +disk... +<warning><para>If the disk that you did +the format on did not give you the whole +630 sectors on the disk and 620 free for +use when you did the +free /d0 on it... you may not backup to +that disk... backup is a mirror copy of +the original disk to the new disk... if +there was a bad sector on he new disk +the backup will not work... if there was +a bad sector on the original disk the +backup will not work... BOTH DISK MUST BE +FREE OF ERRORS AND HAVE THE SAME NUMBER +OF SECTORS ON THE DISK... A DISK WITH 80 +TRACKS CAN'T BE BACKED UP TO A DISK WITH +40 TRACKS... A DOUBLE SIDED DISK CAN'T BE +BACKED UP TO A SINGLE SIDED DISK... A +HARD DISK CAN'T BE BACKED UP TO A FLOPPY +DISK... OS-9 WILL CHECK TO SEE WHAT SIZE +THE DISK IS THAT YOU ARE BACKING UP FROM +AND TO... IT WILL ABORT THE BACKUP IF +THEY ARE NOT THE SAME TYPE/SIZE...</para></warning> +WHEN THE BACKUP IS DONE DO THIS: +Put your original Master disk away. You +can leave the new Master disk in drive +/d0... but you must let OS-9 know that +there is a new disk in the drive... +so at the OS-9 prompt you will type: +<screen> +OS9:chd /d0 +OS9:chx /d0/cmds +</screen> +OS-9 is now ready to continue... and we +can now delete some seldom used commands +and gain some disk space back for our +own files... +To delete these commands you will type: +<screen> +OS9:del /d0/cmds/command.name +</screen> +Where command name is the names of each +command you are deleting... +</para> +<variablelist> +<varlistentry><term>binex</term> + <term>exbin</term> +<listitem> +<para> +These two commands are +for turning a binary file into a text +file and vice/versa. I have never used +these two commands to date. While they +might be useful, I am not sure who +they are useful to? +</para> +</listitem> +</varlistentry> +<varlistentry><term>cmp</term> +<listitem> +<para> +This is for comparing two text +files together and listing where (with +an offset) the differences are. I find +it easier/quicker/more reliable to just +list the two files to my screen and look +for the differences... +</para> +</listitem> +</varlistentry> +<varlistentry><term>cobbler</term> +<listitem> +<para> +This is only used for making a +new os9boot file on your master disk. +You won't need to use this command till +later lessons to make a new boot disk. +So you can delete it from the /D0/CMDS +directory for now. +</para> +</listitem> +</varlistentry> +<varlistentry><term>dcheck</term> +<listitem> +<para> +This command does a total +search of the disk it is called to check +and will report if any files on the disk +have been destroyed in some manner. You +will only need to use this command on +a disk that is used a lot and is almost +full. If you ever try to use a command +or file and get an error, try the ATTR +command on the file/command to see if +you have permission to use the file or +command. If the ATTR says you do and +you still can't get to the file/command +then I would use the dcheck on the disk +to see if the disk was damaged in some +manner. Dcheck is very powerful but it +will usually be the case that when you +need to use it is when the sh*t has +already hit the fan and some of the +files on your disk have been damaged in +some manner. For this reason you may +want to feel safe and keep this command +in your /D0/CMDS directory. +</para> +</listitem> +</varlistentry> +<varlistentry><term>display</term> +<listitem> +<para> +If you don't have a printer +hooked up to your OS-9 system than you +probably won't need the display command. +It is meant for sending some series of +hex codes to a device... if you do this: +<screen> +OS9:display 0c +</screen> +the screen will clear... this is sending +a control-l to the screen... if you did +this: +<screen> +OS9:display 0c >/p +</screen> +it will send a control-L to your printer +which in most cases will do a form feed +on your printer. If you have a decent +printer you may use the display command +with the (>) redirect sign to send hex +codes to your printer for setting it for +double strike, emphasized, underline, +and any other special features your +printer might support. As far as being +able to send all the codes from 0 to 255 +to your screen? I haven't found much +use for this. I have only used the +display Oc to clear the screen so far. +</para> +</listitem> +</varlistentry> +<varlistentry><term>kill</term> +<listitem> +<para> +This command is only used to kill +off some multi-process command that you +may have started up to run in the +background... if you did this: +<screen> +OS9:dir e /d0/cmds >/p& +</screen> +OS-9 will do a dir e of your EXECUTION +directory and send it to the printer. +The OS-9 prompt will return and the list +will continue in the background. If you +did a procs e command at this point you +will see that there is a process 3 or 4 +or 5 running in the background and it is +called list. To stop the list from +continuing..you would have to type: +<screen> +OS9:kill 3 +</screen> +or +<screen> +OS9:kill 4 +</screen> +or whatever the process # is that you +wish to stop... You won't be doing a lot +of multi-processing while you learn +OS-9 so you should not need this command +in your /D0/CMDS right now... +</para> +</listitem> +</varlistentry> +<varlistentry><term>link</term> +<listitem> +<para> +This one is hard to explain right +now... let's just say that when you do +a load command... the computer does a +link for you... so this command should +not be really necessary for now. If you +do a mdir e and see that a commands link +count is say 3 or 4... then you would +have to unlink the command 3 or 4 times +to get it <emphasis>out</emphasis> of memory!!! +</para> +</listitem> +</varlistentry> +<varlistentry><term>login</term> +<listitem> +<para> +This is only needed if you are +going to hook up your OS-9 system so +that outside people can link into your +CoCo and use the computer at the same +time you are using it... When you delete +this command you may also delete the 2 +files in the /d0/sys directory called +/d0/sys/motd and /d0/sys/password... +</para> +</listitem> +</varlistentry> +<varlistentry><term>merge</term> +<listitem> +<para> +This is used for putting two +data files into a single data file with +a new name... this can also be done with +the list command like this: +<screen> +OS9:list data1 data2 >/data3 +</screen> +so the merge command is not needed right +now... +</para> +</listitem> +</varlistentry> +<varlistentry><term>os9gen</term> +<listitem> +<para> +This command is used for making +a new boot disk... the new boot disk +might have more/less commands that it +will load into memory when it starts up. +For the time being you won't need this +command until the next lesson where I +will try to teach you how to make a new +and better boot disk... +</para> +</listitem> +</varlistentry> +<varlistentry><term>printerr</term> +<listitem> +<para> +When you are first learning +OS-9 you will find this command most +useful... when you start to learn the +error numbers by heart you will be able +to delete this command. You can also +delete the /d0/sys/errmsg file also. +</para> +</listitem> +</varlistentry> +<varlistentry><term>procs</term> +<listitem> +<para> +You will only need this command +if you do multi-processing... it will +show you what is running in the computer +and who is running it and how much of a +priority it has... for now you will not +use this command often. +</para> +</listitem> +</varlistentry> +<varlistentry><term>setpr</term> +<listitem> +<para> +This is for resetting the +priority of a multi-process that you +have running in the background... you +won't need this command until you get +into multi-process running. +</para> +</listitem> +</varlistentry> +<varlistentry><term>sleep</term> +<listitem> +<para> +This is for making a process +stop doing what it was doing for a set +period of time... I have never used this +command... if used wrong it will seem +like you locked up your computer as it +counts down its sleep time. +</para> +</listitem> +</varlistentry> +<varlistentry><term>tsmon</term> +<listitem> +<para> +This command is used to make +OS-9 scan the built in rs232 port for +a carrier ready signal... it is used to +set the computer up for another caller +usually calling over a phone line... it +is the basics of setting your OS-9 +system up as a bbs. +</para> +</listitem> +</varlistentry> +</variablelist> +<para> +Read over the commands in your red OS-9 +book and decide for yourself how often +you might use the commands listed above. +If you think you will not need the +commands often then delete them on your +backup master disk. This will give you +more space to store your own files on +that disk, and if you are working with +as single drive system then this is +<emphasis>very</emphasis> important... +You may also delete the asm command from +your /d0/cmds directory if you <emphasis>never</emphasis> +intend to do any machine language work... If you do +delete the /d0/cmds/asm command then you +can also get rid of the data files in +the defs directory that the asm +command works with. Do this by typing: +<screen> +OS9:deldir /d0/defs +</screen> +OS-9 will than say deleting a directory +and offer you a list, delete or quit +option... if you choose to list... it will +show you what is in the directory that +you wish to delete... if you choose to +delete the directory... you will not be +prompted again unless there is another +directory found in the directory... +This command will take a bit of time to +get rid of the directory /d0/defs... +but it will clear up a LOTTTTTTT of +space for your own use.... +</para> +<para> +OK, I saved you a bit of disk space now +let me save you a bit of a headache!!! +Radio Shack now has two versions of the +OS-9 operating system. These are the +1.00.00 and the 1.01.00 versions. The +1.01.00 has some new stuff added to it +but it is basicly the same as 1.00.00 +It is not exactly the same... close but +not exact. For this reason if you see +any articles in say Rainbow mag that say +you can change your OS-9 to have 6 ms. +step rates on your drives or 40 tracks +on your disk... you should be <emphasis>very</emphasis> +careful that the instructions refer to +your version of OS-9. Some of the early +articles in Rainbow refer to making +changes to OS-9 1.00.00... The most +recent articles in Rainbow will usually +say that these patches are for 1.00.00 +or 1.01.00... With Radio Shack getting +ready to come out with OS-9 2.00.00 it +is very important you know what OS-9 +you have when you read any articles that +say how to change your OS-9 to add some +new features to it. +</para> +<para> +If you have the original OS-9 1.00.00 +then you can get the OS-9 upgrade from +Radio Shack to 1.01.00 for about $15. +The upgrade to OS-9 2.00.00 will cost +about $25. These upgrades are only +available to original owners of OS-9 +1.00.00 or 1.01.00. +</para> +<para> +Let's talk about the devices that are +available for you to use under OS-9. +</para> + +<variablelist> +<varlistentry><term>/p</term> +<listitem> +<para> +this is for your serial printer +</para> +</listitem> +</varlistentry> +<varlistentry><term>/t1</term> +<listitem> +<para> +this is for the built in RS232 port +</para> +</listitem> +</varlistentry> +<varlistentry><term>/t2</term> +<listitem> +<para> +this is for the RS232 cartridge +</para> +</listitem> +</varlistentry> +<varlistentry><term>/d0</term> +<listitem> +<para> +this is drive 0 +</para> +</listitem> +</varlistentry> +<varlistentry><term>/d1</term> +<listitem> +<para> +this is drive 1 +</para> +</listitem> +</varlistentry> +<varlistentry><term>/d2</term> +<listitem> +<para> +this is drive 2 +</para> +</listitem> +</varlistentry> +<varlistentry><term>/d3</term> +<listitem> +<para> +this is drive 3 +</para> +</listitem> +</varlistentry> +<varlistentry><term>/term</term> +<listitem> +<para> +this is for your keyboard and video screen +</para> +</listitem> +</varlistentry> +</variablelist> +<para> +On my system I have a /H0 and /R0 which +tell the OS-9 that I have a hard disk +drive and a ram disk drive. If you +are good at machine language you can write your own +code to add your own hardware onto your +OS-9 system. I understand that OS-9 +2.00.00 has a device called /ssp and it +is for the Radio Shack Speech Sound Pak +and will let you send a text file thru +it and it will speak the file out... +So you could do this... +<screen> +OS9:dir /d0 >/ssp +</screen> +and you would hear your directory. This +could be very useful for anyone with +impaired sight. +While I have been talking about how you +can add devices to your OS-9 system I +also need to say that you can delete +devices from your system also. This +will free up ram for other programs you +might wish to run. In OS-9 2.00.00 you +can usually get rid of /d2, /d3 and the +/t2 drivers. Most people don't have +the drive 2 and 3 and don't have the +Radio Shack RS232 pak so why keep these +modules in memory wasting space? +So you can delete them and save some space +that is badly need in the 64K CoCo. +How do you do this? We'll cover that +in our next lesson; Making a new boot +disk. +</para> +</section> +<section> +<title>Lesson 4</title> +<para> +Today we are going to make a new OS-9 +boot disk... we can do this several +different ways... First type this: +<screen> +OS9:mdir +</screen> +this will show you all the programs and +descriptors that are in memory... you +should see something like this: +<screen> +OS9 OS9P2 INIT +BOOT CCDISK D0 +D1 D2 D3 +CCIO TERM IOMAN +RBF SCF SYSGO +CLOCK SHELL RS232 +T1 PRINTER P +PIPEMAN PIPER PIPE +</screen> +These are all modules that are loaded +into memory from the OS9boot file and +you can change the OS9boot file so that +it will load in more or less of these +modules at boot time. For now we will +just make a new boot disk that will load +in all of the above modules exactly the +same way. We can do this one of two +ways... First lets format a new disk +and we'll put our new OS9boot on it. At +the OS-9 prompt type: +<screen> +OS9:load format free +</screen> +take your OS-9 master disk out of drive +/d0... and install a blank disk in /d0 +now at the OS-9 prompt type: +<screen> +OS9:format /d0 +</screen> +when OS-9 asks if you are ready... type +R for ready or Y for yes. When OS-9 +asks you for a name to put on the disk +give it the name NEW BOOT DISK. When +the format is done at the OS-9 prompt +type: +<screen> +OS9:free /d0 +</screen> +and you should get 630 sectors on the +disk with 620 available for use. This +lets you know that the format was good +with no bad sectors that needed to be +locked out. Take the new disk out of +drive /d0 and put your OS-9 master disk +back in. Now type: +<screen> +OS9:load cobbler makdir save os9gen build echo +</screen> +You should now have the commands format, +free, cobbler, makdir, build, os9gen, +save and echo in your memory... +Take your master disk out of drive /d0 +and put the new disk in. Now at the +OS-9 prompt type: +<screen> +OS9:cobbler /d0 +</screen> +This will put the file OS9boot on the +disk in drive /d0 and it will contain +all the modules that were loaded into +memory from the <emphasis>last</emphasis> boot. To get all +the other files/commands/directories +over onto this new boot disk you need +to be very patient because you will +have to go through a lot of typing, +copying and swapping. +Essentially what you have to do is: +Use the makdir command to make all the +directories on this new disk that were +on the old Master disk. So you will +have to do this: +<screen> +OS9:makdir /d0/sys +OS9:makdir /d0/cmds +OS9:makdir /d0/defs +</screen> +Then you will need to use the copy +command to move all the files/commands +over from the old Master disk to this +NEW Master disk. We are talking about +a <emphasis>lot</emphasis> of disk swapping here and you +just might not be up to going through +all this work. Read on... there are 2 +easier ways to do this and I will let +you decide which you like better? +</para> +<para> +While cobbler will help us to make a new +boot disk there is no flexibility to it +and you are stuck with a mirror image +of the modules from the last boot you +did. To give us total control of what +goes in the OS9boot file we will need +to use the OS9gen command. +Leave the new boot disk in drive /do and +format it again... then do the free on +it to be sure the total sectors and free +sectors works out to 630 and 620. We +will now type: +<screen> +OS9:makdir /d0/modules +OS9:save /d0/modules/ccdisk ccdisk +OS9:save /d0/modules/d0 d0 +OS9:save /d0/modules/d1 d1 +</screen> +<note><para>if you only have a 2 drive system +you can leave out the next two lines</para></note> +<screen> +OS9:save /d0/modules/d2 /d2 +OS9:save /d0/modules/d3 /d3 + +OS9:save /d0/modules/ccio ccio +OS9:save /d0/modules/term term +OS9:save /d0/modules/ioman ioman +OS9:save /d0/modules/rbf rbf +OS9:save /d0/modules/scf scf +OS9:save /d0/modules/sysgo sysgo +OS9:save /d0/modules/clock clock +OS9:save /d0/modules/shell shell +</screen> +<note><para>if you never intend to let an +outside user link with your CoCo +by an outside phone line then +leave out the next 2 lines</para></note> +<screen> +OS9:save /d0/modules/rs232 rs232 +OS9:save /d0/modules/t1 t1 +</screen> + +<note><para>if you don't have a printer you may +leave out the next two lines</para></note> +<screen> +OS9:save /d0/modules/printer printer +OS9:save /d0/modules/p p + +OS9:save /d0/modules/pipeman pipeman +OS9:save /d0/modules/piper piper +OS9:save /d0/modules/pipe pipe +</screen> + +<note><para>if you don't have the Radio Shack +RS232 pak than you can leave out the +next two lines</para></note> +<screen> +OS9:save /d0/modules/acia acia +OS9:save /d0/modules/t2 t2 +</screen> + +We have moved an image of the modules +that are in memory over to the disk in +drive /d0. If you did not have a +printer or did not have drives /d2 and +/d3 then you did not save the listed +modules over to the disk. If you did +not intend to have an outside user then +you did not save rs232, t1, acia, and +t2 over to the disk. +</para> +<para> +We are now going to build a data file +that is going to tell OS9gen what +modules it is to put into the OS9boot +file that we are going to put on this +disk. It is very important that the +spellings you used in the save command +are the same as the modules are spelled +in memory... The new OS9boot we are +going to make might not work if you +spell any of the saved modules names +wrong!!! +OK, now at the OS-9 prompt you type: +<screen> +OS9:build /d0/bootlist +</screen> +You will then see a (?) for the prompt. +at each (?) prompt type in the following +lines... <emphasis>without the (?) marks!!!</emphasis> +<screen> +? ccdisk +? d0 +? d1 +</screen> +<note><para>if you did not save d2 and d3 in the +save operation leave the next two lines +out!!!</para></note> +<screen> +? d2 +? d3 +? ccio +? term +? ioman +? rbf +? scf +? sysgo +? clock +? shell +</screen> +<note><para>if you did not save rs232 and t1 in +the save operation leave the next two +lines out!!!</para></note> +<screen> +? rs232 +? t1 +</screen> +<note><para>if you don't have a printer and left +printer and p out of the save operation +then leave the next two lines out!!!</para></note> +<screen> +? printer +? p +? pipeman +? piper +? pipe +</screen> +<note><para>if you did not save acia and t2 +in the save operation leave the next +two lines out!!!</para></note> +<screen> +? acia +? t2 +? (enter) +</screen> +We now have everything we need on the +disk in drive /d0 to make os9gen put an +os9boot file on that disk... +At the OS-9 prompt type: +<screen> +OS9:chd /d0/modules +OS9:os9gen /d0 </d0/bootlist +</screen> +You will then have a working os9boot +file on the disk in drive /d0. Now if +you left out the d2, d3, printer, p, +rs232, t1, acia and t2 modules when you +did your save and when you built your +bootlist... those modules will not be in +memory when you use this disk to do +your next boot... BUT DON'T +BOOT WITH THIS DISK YET... IT HAS NO +COMMAND DIRECTORY ON IT... You will need +to copy all the data files and commands +off your master disk to this disk by +the same method explained in the start +of this tutorial where I talk about the +cobbler command. +</para> +<para> +Now I also said earlier that there was +2 other ways to make this boot disk and +you have to decide if they suit your +taste... The first way is to make the +new OS9boot file with either cobbler +or os9gen in the same way that I have +already explained. Now that the boot +file is on that disk... Don't copy the +whole Master disk over to this new disk! +Instead only do this: +<screen> +OS9:makdir /d0/cmds +</screen> +Copy the commands setime, dir, free and echo +over to the /d0/cmds directory on this +new disk from /d0/cmds on the old disk. +Use the build command to build a new +startup file on this disk... +<screen> +OS9:build /d0/startup +</screen> +and enter these lines in the file: +<screen> +? setime </term +? echo take the disk out of drive 0 +? echo and put your working disk in +? echo drive 0... This is ONLY A BOOT +? echo DISK!!! +? (enter) +</screen> + + +So now when you wish to BOOT OS9 you can use +this disk. After OS-9 boots ok you +will take this disk out of /d0 and put +in your Master disk. Then type: +<screen> +OS9:chd /d0 +OS9:chx /d0/cmds +</screen> +and you will be up and running... This +will be your working disk and the other +disk will be used each time you wish to +BOOT OS-9... +</para> +<para> +Another way to make a new BOOT disk is +to do this... backup the old master disk +to a newly formatted disk. Leave this +new disk in /d0. Now type: +<screen> +OS9:chd /d0 +OS9:chx /d0/cmds +</screen> +This will let OS-9 know that you have +changed disks. +Use the makdir command to make a new +directory called /d0/modules... +Follow all the save commands listed +earlier in this tutorial. Use the +build command to build a file called +/d0/bootlist... type in all the lines as +listed earlier in this tutorial. +When this is all done, you will use +the del command to: + +<screen> +OS9:del /d0/os9boot +</screen> +at this point you will: + +<screen> +OS9:chd /d0/modules +OS9:os9gen /d0 </d0/bootlist +</screen> +and your new BOOT file will go on this +disk with more/less modules as you told +it to put in the BOOT file. +BOTH of these methods will give you a +new BOOT disk but they both have their +drawbacks. The first method gives you +a boot disk but with little else on it +in the way of commands. The 2nd way +will give you a boot disk that has all +your commands on it and all your +working files. But the 2nd way to make +a new BOOT disk will not work 100% of +the time. When you go to cobbler or +os9gen a new os9boot file on a new disk +it will write that file out to track 34 +of that disk. It <emphasis>MUST</emphasis> have an +unbroken number of sectors on track 34 +to put this bootfile. If you go to +cobbler or os9gen on a disk that is +pretty full the cobbler or os9gen might +fail. <emphasis>if</emphasis> you use os9gen to make a new +os9boot file and it has <emphasis>less</emphasis> modules in +it then before the 2nd method will work just +fine. <emphasis>But</emphasis> if the new os9boot file will +have <emphasis>more</emphasis> modules in it then this 2nd +method will not work 100% of the time. +</para> +<para> +It is for this reason that I +suggest you os9gen on a disk that only +had the /d0/bootlist file on it and +the /d0/modules directory on it. You +can then copy over to this new disk +the few commands you think you will +need and after you boot with this disk +take it out of /d0 and put in the disk +you intend to work with... A disk that +has <emphasis>all</emphasis> the commands you know you +will need!!! +</para> +<para> +You might also want to add some commands +to the os9boot file so that they will +be in memory at bootup time. Some very +useful commands to have in memory all the +time are dir, build, del, mfree and free. +The only disadvantage of having these +modules in the os9boot file is that once +you boot and these modules are in memory +all the unlink-ing in the world will <emphasis>NOT</emphasis> +get them out of memory. So you have to +decide if you want them in memory that +bad. It should not cause too much of a +memory problem if you have left out the +d2, d3, rs232, t1, acia, t2, printer, and +p modules. +</para> +<para> +One of the advantages to making a +tailored os9boot file is that it gets +rid of modules that you were never going +to use and cleans up some ram for you to +use also. Not a lot of ram but enough +to make all this worthwile. The most +important thing to remember though when +using the os9gen command is that you +must move the modules from memory out +to a directory where you will +put all the modules you wish in the new +os9boot file... Then you must build a +data file with the names of all the +modules you saved... change your data +directory to the directory that has all +the modules in it... then invoke the +os9gen command telling it where to put +the os9boot file and where it is to +get the list of the modules it is to +put in the os9boot file. +</para> +<para> +You may have noticed way back in the +beginning that there were some modules +in memory that were called: +<literallayout> +os9 os9p2 init boot +</literallayout> +and we did not save them out to the +/d0/modules directory and we did not put +them in our bootlist??? You don't need +to... OS-9 knows to put those 4 modules +in each new os9boot file it makes. It is +something you <emphasis>should not try to do.</emphasis> +</para> +<para> +Right about this time you may be saying +to yourself that it sure is a pain to +go about making a new boot disk? Well +on a single disk drive system it <emphasis>is</emphasis>. +There is no getting around this. If you +had two disk drives you could have +formatted the disk in drive /d1. Then +used the cobbler or os9gen command to +put os9boot on that disk. You could +have then used the dsave command to +move all the directories/files from +/d0 over to /d1 and you would have +saved a lot of time and typing. So I +now repeat that OS-9 will run on a 1 +drive system but it sure runs a lot +better on a 2 drive system!!! +</para> +<para> +You probably read this whole tutorial +and said to yourself that you are +<emphasis>never</emphasis> going to use cobbler or os9gen +to make a new boot disk. Sounds like +too much work. Well after reading this +all over I tend to agree with you. I +had OS-9 for about 1 year before I got +around to using os9gen to make a +tailored os9boot file. Why did I use +it? I saw some fine articles in +Rainbow magazine telling how to make my +disk drives run at 6ms. under OS-9 and +how to make OS-9 use the full 40 tracks +that my drives were capable of. It was +then I decided how great a command +os9gen was and learned how to use it. +</para> +</section> +</article>