Micronix_Operating_System_1.61_Jun83 Micronix Operating System 1.61 Jun83
Micronix_Operating_System_1.61_Jun83 Micronix_Operating_System_1.61_Jun83
User Manual: Micronix_Operating_System_1.61_Jun83
Open the PDF directly: View PDF .
Page Count: 607
Download | |
Open PDF In Browser | View PDF |
Micronix Operating System Versio'ri 1.61 MORROW IMPORTANT WARRANTY IBFORMATION LIMITED WARRANTY Morrow, Inc. warrants its products to be free from defects in workmanship and materials for the periods indicated below. This warranty is ~imited to the repair and replacement 'of parts only. This warranty is void if, in the sole opinion of MOrrow Inc., the product has been subject to abuse or misuse, or has been interconnected to other maqufactut:er:s equipmen~for which compatiQility has not. beenes~ablis.hed'-:~n ·wr-itt.ng~:' :\. Circuit boards' - Parts,including the printed circuit board, purchased as factory assemblies, are warranted for a period of ninety (90) days from the original invoice/purchase date. Electro-mechanical peripherals ~ Peripheral equipment such as floppy or hard disk drives, etc., not manufactured by Morrow t Inc., are included in the limited warranty period of 90 days from the original invo\ce date when sold as. part of a Morrow system. Exception printwh~els - Expendable items such as printer ribbons, are not covered by any walranty. software media~ and Software/Firmware - Morrpw, Inc. makes no representatioris or warranties what-soever with respec~ to software or firmware associated with its products and specific:-ally disclaims any implied or expressed warranty' of 'fi tness for any particular purpose or compatibility with any hardware, operating system, or software/firmware. Morrow, Inc. reserves the right to alter or updaQe any publication or manual without obligation to notify any person of program, such changes. LIMITATION OF LIABILITY: THE FOREGOING WARRANTY IS IN LIEU OF ALL OTHER WARRANTIES, EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT WILL MO~OW, INC. BE LIABLE FOR CONSEQUENTIAL DAMAGES EVEN IF MORROW, INC. HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Should a buyer experience a defect. in either workmanship or materials during the warranty period, any Morrow Authorized Service'Center will replace or repair the product at its expense only if the product is promptly returned to the dealer or Service Cente~ with dated proof of purchase. Should factory repair be necessary, ,the Service Center shall contact Morrow Customer Service for a Return Materials Authorization (RMA) number. Copyright (C) 1983 by Morrow,Designs, Inc. All rights reserved. No part of this publication may be reproduced, transmitted, transcribed, stored in a retrieval system, or translated into any language or computet language, in form or by any means, electronic, mechanical, magnetic, optical, chemical, manual or otherwise, without prior wrItten permission of Morrow, Inc. any DISCLAIMER No representations or warranties, express ,or implied, are made with respect to the contents hereof, including, 'but not limited to, the implied warranty of merchantabili~y or fitness for a particular purpose. Further, Morrow, Inc. 'reserves the- right to ~~yise this publication and to make changes from time to time in the content hereof without obligation to notify any person of such revision. Morrow 600 McCormick St. San Leandro, CA 94577 . --~--------------------------- TlADEMARXS -----..;;...;;;;..;..;.-,;;....USED IIf THIS BINDEl. UNIX is' a product of Bell Telephone LaboJ:'atories.-, Micronix, Decision t MicroDecisiort, and Cor'rect-It are products' of Morrow Inc. CP/M 2.2 and CP/M 86 are products of Digital Research, Inc. IBM and PC-DOS are trademarks of International Business Machines , Inc. WordStar is a product of MicroPro Corporatipn. LogiCalc is, a prod\lct ,of Software Products, ~ ~nternational. - BASIC-SO, (MBASIC) is' a product of Microsoft, Inc,. BaZic is a product of Micro-Mike's, Inc. Personal Pearl is a product of Relational Systems, Inc. XEROX 820 is a product of Xerox Corporation. Osbourne is a trademark of Osbourne Computers, Inc. POIEWORD TO THE HICIORIX MARUALS If you hate technical manuals ·as a matter of prineiple-~ we can't blame you.: This one, at first -glance, looks very- thick, it only has a handfuI:of pictures, and it's not even typeset. Well, think of it as a beat up old Buick. pretty, but it's comfortable and reliable. It may not be Writing a set of manuals that covers an operating system is a difficult task. When the operating system is one that emulates Bell Lab's UNIX, the task becomes almost overwhelming. The standard Bell Lab's documentation is a 6" thick stack of technicalese, daunting to even the most hardy of individuals. Their documentation was written over a period often years, by many different people, in a variety of styles. Our documentation has to be somewhat different. Instead of tens of programmers contributing, Gary Fitts wrote the Micronix operating system and Len Edmondson wrote most of the programs. They wrote many of the entries in the Reference Manual, and provided the technical editing necessary for accuracy in the User's Guide. The User's Guide to Micronix was written in an atmosphere of friendly chaos by John VanderWood and myself. Part of the chaos revolved around a change of attitude that made it possible to rewrite the old manual in a much more amiable style. That made us happy. But, naturally, this project was scheduled to be finished before i't even began. Add to this the simultaneous improvements to the existing software by Gary and Len, and the feeling we had was one of running a race in shifting sand. The goal, a complete and easy to understand User's Guide, was like a mirage shimmering in the distance. Result: the majority of with the possible exception of time even to look at yet. The work; at least it's as accurate the User's Guide is pretty good, Tutorials, which we haven't had Reference Manual still needs some as human imperfection allows. Most of this manual was written in the stimulating and We distracting environment of Morrow's engineering department. received a lot of support from Bob Groppo, the S-100 project engineer, and further assistance and distraction from John Zalabak, Dave Block, Don Mowry, Howard Fullmer and Ken Toland. Customer service got into the act, mainly in the person of Norm Tilbury, who read and corrected drafts. Dana Tilbury and Lawrence Curtis, who toge'ther ha:ve installed (at the "factory"), more Micronix systems than anybody in the world, also read and commented on drafts of the User's Guide. We hope 'that this edition:of the Micr,<>nix Manuals enlightens more than frustrates. There should be ,8 great big "Under Construction, Bard Beads Required" sign at the beginning of this manual. We've tried all of the examples provided, and can only pray that the distribution sof.tware that you're using is the same as what we work with. ~f you find parts tha,t confuse you, discover better examples, . or can't fj.nd sQmething, you, need t9 knoW· about, write us a nO.te, ca~e of Docum~ntation, ,at Horrow. Take care, and much good fortune, Rik Farrow, June 30, 1983 Micronix Operating System user's manual MORROW. o R lEN TAT ION TAB L E o F CONTENTS 1. USING THE MANUALS ••••••••••••••••••••••••••••••• ~ •••••••• 1.1. Confusion Relief •••••••••••••••••••••••••••••••••••• 1.2. The User's Guide •••••••••••••••••••••••• -•••••••••••• 1.2.1. Orientation •• ; ••••••••••••••••••••••••••••••• 1.2.2. Installation and Operation ••••••••••••••••••• 1.2.3. Maintenance and Administration ••••••••••••••• 1.2.4. Tutorials •••••••••••••••••••••••••••••••••••• 1.3. The Reference Manual •••••••••••••••••••••••••••••••• 1.3.1. Programs ••••••••••••••••••••••••••••••••••••• 1.3.2. System Calls ••••••••••••••••••••••••••••••••• 1.3.3. Subroutines •••••••••••••••••••••••••••••••••• 1.3.4. Devices •••••••••••••••••••••••••••••••••••••• 1.3.5. Files •••••••••••••••••••••••••••••••••••••••• 3 3 2. THINGS YOU ABSOLUTELY MUST KNOW •••••••••••••••••••••••••• 4 3. SYSTEM OVERVIEW •••••••••••••••••••••••••••••••••••••••••• 3.1. Micronix Software Features •••••••••••••••••••••••••• 3.1.1. Memory Management •••••••••••••••••••••••••••• 3. 1 • 2. I.anguage s •••••••••••••••••••••••••••••••••••• 3.2. The Micronix Shell •••••••••••••••••••••••••••••••••• 3.3. The File System ••••••••••••••••••••••••••••••••••••• 3.4. Directory Terminology ••••••••••••••••••••••••••••••• 3.5. Where Files Come From ••••••••••••••••••••••••••••••• 5 6 7 7 7 8 13 14 4. WHERE TO GO FROM HERE •••••••••••••••••••••••••••••••••••• 14 1 1 2 2 2 2 2 2 3 3 3 1. USING THE MANUALS You rece~ved quite a mass of paper system. Let's see if we can sort it out a what's unnecessary at this point. with your Micronix little, eliminating All of Micronix documentation can be divided into three parts: The User Manual The Micronix Reference Manual The Technical Reference Manuals 1.1. Confusion Relief Before launching into a discussion of what information can be found where, we should clear up a couple of potential sources of confusion. ' Confusion Fac~or 1: The User Manual and Micronix Reference Manual are in the same binder, with .no obvious· separatiQn between them. This is pretty easy to get used to. The first set of tabs, orientatiQn, installation, maintenance & administration, and tuto~ials, comprise the User's Guide. Everything else, from Programs on back, is the Micronix Reference Manual. Confusion Factor 2: There are all these other reference manuals in addition to the Micronix Reference Manual. Well, these all refer to the individual hardware components that make up the Decision computer. And unless you're one of that strange breed of computer freak who can't keep his mitts out of the cirGuitry, you can just put these Technical Reference Manuals away. From now on, when we say "Refer~nce Manual", we mean the Micronix Reference Manual. Confusion Factor 3: Finally, you have the manuals for the software that is included with Micronix (a word processor, for example). Since this isn't really part of Micronix as such, we'll overlook it here. The same is true of the C and Pascal manuals, if you purchased those separately-priced compilers. Now then. The next sections give an overview of the contents behind each of the tabs in the User's Guide and Reference Manual. 1 1.2. The U~er's Guide This is the manual that you will use the most while you are getting to know your way around Micronix.It tells you how to install the hardware and software, how to run it, and how to keep it: running. 1.2.1. Orientation The section you are now reading covers the documentation a~d attempts to convey the concepts underlying the Micronix file system. 1.2.2. Installation and Operation This section runs you through hooking up all-of the cables, setting up you~ terminals and printer, checking out the preinstalled software, and reinstalling it if it doesn't check out properly. It also-has instructions for an introductory session with Micronix, including how to turn the system on and off properly. This section ends with a discussion on installing CP/M software. 1.2.3. Maintenance and Administration Here you will learn about all of the exciting and wonderful tasks that await you as system manager. We'll tell you how to check the file systems,~maintain free disk space, customize the environment, copy diskettes, provide system security, back up files, add new'user accounts, and respond to error messages. ' 1.2~4. Tutorials The last section 6f the User's Guide provides elementary training in-common'Micronix operations that are not unique to the system manager. These include changing passwords, modifying the "search path", mounting disks, using the CP/M emulator upm, and taking advantage of some of the trickier features of Micronix. 1.3. The Reference Manual This manual makes up most of the bulk of the Micronix binder. Once you get used to Mi~roni.x, you will probably find the Reference sections to be the most frequently accessed, when All of this information is you have mental lapses and the like. also available online, by way of the "help" command. Just pick the name of a program, file, system call, device, or subroutine, enter the command help so-and-so, and 10 and behold! there is the information you wanted, right there on your screen. For example, to learn how to use the concatenation program, enter help cat. (No, this won't tell you how to get your kitty out of a tree.) 2 These sections of the Reference Manual are arranged by topic, in alphabetical order. Leaf through them to get an idea of what's' in there and how to find it. Go ahead, do that right now. • 1.3.1. Programs This will probably soon becom~ the mo.st dog-eared section of the manual, since you will refer to it constantly to check on the usage and syntax of Micronix commands. It also contains valuable tips on practical applications of the programs. While many of the commands ,are' discussed in the context of installation or administration of Micronix, this section is the only central depository of Micronix's capabilities., So it's a good idea to just browse around in, it while you're waiting for a disk to copy or a file to print. You'll probably spot 'something that you've been wanting but didn't know was in there. 1.3.2. System Calls We're gett'ing into some fa'irly advanced stuff here, aimed mostly at programmers. System calls and subroutines are the building blocks upon which Micronix is constructed. This section is intended for those of you who wis:h to make (Version 6 UNIX) system calls to Mic,ronix from C or" asse~bly language programs. 1.3.3. Subroutines These are frequently-used mini-programs that programmers can embed into their own creations with a simple C invocation. 1.3.4. Devices This section gives terse descriptions of the interface between Micronix and the hardware components of the Decision computer. Some of it is very technical, but other parts are quite accessible to the average user and helpful when modifying the hardware configuration (see especially cables, printers, and ports). Those wishing to access memory or I/O mapped devices of their own will be interested in the mem and io devices. 1.3.5. Files These are tools for cutting and, forming the objects (just making sure you're still with us). surfaces of Again, this is a pretty technical discussion of file formats used internally by Micronix. Non-programmers will still want to be familiar with the layout of the banner, motd, passwd, rc, signon, and ttys files. 3 2. THINGS YOU ABSOLUTELY MUST KNOW I. Whenever you are instructed to enter some command in- the pages that follow, always follow it with a carriage return: II. When you see a screenful of data reproduced in this manual, the part that is printed in boldface is the part you type. The rest is sent Qut by the computer. III. If you get. s~uck in some procedure and you can't figure out, what to·do to escape, the delete key, (sometimes labeled RUB instead) is your best bet. Sometimes it might take a moment for Micronix to respond to the delete, so if you're in 'a panic, go· ahead and press delete a' couple more dozen -times while you wait. Delet'e also 'interrupts the out-put' of Micronix programs· 1ik-e', type when you decide that you've seen enough. When you're working inside some application program' that is not part of Micronix as such (e.g. Personal Pearl), there will be a different keystroke that 'performs the abort. Look for that in the relevant documentation (Good luck). UNDER NO CIRCUMSTANCES should you abort a program by turning off . the power or by resetting the system. Check out the section called "Desperate Measures" in the Maintenance and Administration division for additional procedures. IV. When you tell Micronix to list something out on your screen wi th the type, form, cat, Is, 'far, and other commands, and the info is whizzing up the screen faster than even Evelyn Wood could handle it, press the ES~pe key or control and s keys simultaneously to freeze the listing. When you're ready to resume, press any other key. You can use escape or "control-s" over and over in the same' operation to stop-start output. 4 3. SYSTEM OVERVIEW What is Micronix, anyway? Every computer manual has its obligatory, patronizing, futile attempt to explain just what an operating system Let's hope we do a li t tle be t'ter • and is. Think of the computer hardware as the North American continent, sans the blessings of civilization. Now think of your marvelous computer program (like WordStar) as-a sleek, gleaming Mercedes waiting to launch you from equestrian barbarism into the rolling pushbutton thunder of the latter twentieth century. -Now there's something missing here, r"ight? Your gullwing isn't going to get too fat without paved roads and bridges. So you can think of an operating system as that system of highways and byways that brings the vistas of automation within your reach. As for Micronix, well, it's the Interstate of microcomputer operating systems. Jus t as. a road mus t follow the contours of the 'terrain (within limits), an operating system must-conform itself to the ideosyncrasies' of the hardware- on which it is running. On the other hand, you wouldexpe'c t your car to perform equally well on a variety of topographies without having to modify it. Thus operating systems enable an application program to run on a range of hardware without having to monkey around with the code. As'- you travel down that highway, you stop and exchange information, drop off reports, make phone calls and connect with other programs. - This is known as input/ou'tput, or i/o. The operating system provides the facilities. Now that we've belabored this tenuous metaphor sufficiently, we can sum up by saying that the operating system creates a network of functions that give the computer its personality. Without any operating system, a computer makes a fine bookend. With one o.s. versus another, a computer will be able to handle a different set of chores, at different levels of proficiency and efficienty. Micronix is your o.s. It is rather elegant, as microcomputer operating systems go. The following sections describe some of the features of Micronix, but as you will see, reading this is no substitute for getting in there and putting it through its paces. 5 3.1. Micronix Software Features Mi-cro-nix \mi'-cro-nix\ n. an interactive timesharing operating system designed to run on Morrow's Decision c,omputer.· It 1.s compatible with Bell lab'~ UNIX version 6, containing many of the same features, including: ' * a hierarchical file system - Unlike' the "flat" file systems'(such as ,the 'one used by CP/M), a hierarchical file arrange~ent allows you to organize files in a logical and convenient ~anner. * multi-tasking (background processes)' for each user - This feature makes i ~ possible for you. to start some time-" consuming program and at the same terminal, go on to something else while the first "process" runs merrily along. * compatible file, device and interprocess I/O - Whoa! Jargon. city! This means that you can send the output of a program to a term,inal, to a printer, to a disk file, or to the 'input of another program without having to refor,mat it. Likewise, you can get the input for a program from a ter~inal) a disk file) or from the output of another program. * mountable disks - You can extend the reaches of your file system. to other hard disks or to floppy disks with a simple mount command. Without this feature, you would have to copy the files on these devices over into the file system in order to access them for reading or writing. That would be a clunky, stagnant, and altogether distasteful state of affairs. * a choice of shells (command line interpreters) - You can run Micronix in several "modes", that is, if you are in the Micronix shell, the computer will recognize Micronix commands; if you switch to the upm shell, it will recognize CP/M commands. Finally, you can configure a user so that he runs only one application program, say) Logicalc. This. user then can be said to .possess a Logicalc shell, since the shell will recognize only Logicalc commands. * nearly 100 software tools for program development, document preparation, file handling and inter-system communication (including an emulator that runs CP/M object code unchanged) * all UNIX 6 system calls (except "ptrace U ) and a cOJllplete standard I/O library. Existing UNIX programs can be compiled generally unchanged under Micronix. 6 3.1.1. Memory Management The Micronix "kernel" (t~e part that stays in memory instead of being called in now and then) takes up 64K ,bytes. Each "process" can occupy from 16 ,to 68K. A process. in normal terms. is a program that you are running from your terminal. More strictly. a process can exist in background mode and even exist independent of any terminal.~ It is a block of memory occupied by a program and its data. When the total demand for memory exceeds the amount available t Micronix swa'ps selected processes out to disk storage in order to make room. 3.1.2. Languages Most of the code in Micronix is written in the C language. This language is 'both highly structured and "fairly unrestrictive t making it efficient and easy to use. Progranmers will find that C language is good for a wide variety of programs. Other languages supp,orted by Micronix include Pascal, RATFOR, BASIC and Intel assembly language. More specific details concerning software with Micronix are not contained in this manual, since t.hey' are separately packag,ed products. 3.2. The Micronix Shell The shell or "command line interpreter" is your channel of communication with Micronix. It displays a prompt (# or %) telling you to give it something to'do. Then it reads what you type, and checks to make sure you typed it JUST RIGHT. Of course, it only checks for correct syntax.. If you accidentally tell it to erase the book you spent the last six months penning, it will do so ,without asking you if it's okay. (We'll preach your ears off about the importance of backup files later.) The shell has some fancier functions'too. It has a set of built-in commands, for moving around in the file system and displaying its contents. You can use "wildcards" in filenames to make life easier for yourself. The shell handles interpreting wildcard symbols, as well as setting up background processes, piped da'ta flow, and i/o redirection. All of these handy features are discussed in more detail in the Tutorials division of the User's Guide. 7 3.3. The File System One ,of the most 'beneficial features of Micronix is it,S file system. If you are new 'to hierarchical file structures, you may have to acquire a. taste for it. Once you do,though, those flat directories will never he good enough again. We'-r;e going to make a heroic effort, he-re to explain how the Micronix file sys,tem works, but for r'eally gettlng the hang of it you should take a tour of the file syst-em as described- under "First Time Use of Micronix" in the Installation division of ,the User's Guide. Okay, here we go. Traditionally, a file system like the one used in Micronix is compared to an inverted tree. There is a root d'irectory at the top, with other files and directories de'scending, ramifying, multiplying.. amoeba-like into the infinite depths below. Alternatively, you could envision it as a starfish, or a wagon wheel, a snowflake (~o two file systems are exac~ly the same), or perhaps a mine shaft. Here are p few things that the file system is NOT like: a doughnut a tricycle a jazz band an armadillo We're going to try a different paradigm. But first, we need to be clear on what's a file and what's a directory. Let's assume you know enough to, have at least -a foggy idea of what a file is: it could be some text you generated, some numbers in a data base, a- program's coding;_ it doesn't matter. The point is that it's NOT a directory. A directory is a list of files and where to find them. Now we get to the hierarchical part - a directory can also contain other directories, cannily referred to as subdirectories. Imagine you have awakened in a spacious circular room, chrome-and-glass motif, ferns atop filing cabinets, earth tone sculptured carpet - the office of the. future. Woven into the carpet is the cryptic symbol" I tI. Surrounding you is a panorama of doors and filing Where is the coffee machine, you wonder. This is the the future, remembe'r, and all of the coffee bushes in have been laid waste in the Great Java Blight. Don't anything? Here, drink this Petro-delite and listen. cabinets. office of the world you know You are in the root directory, a clean and wholesome place. The doors, you see before you are entrances to other directories, like bin and usr. The filing cabinets are the files themselves, 8 like micronix and finstall. The files are the important things. Directories are just pathways that you go through to ge't to the rest of the filing cabinets. Egad! You have just been transported deep into the file system. Another room, but with over a hundred filing cabinets and only one door, mysteriously labelled " •• ". Emblazoned on the carpet is the ominous, message II lusr/man/manl II Kirk: Kirk to Enterprise! Mister Scott! Kirk to Enterprise! Come in, Scotty: (brogue-ish) Scott here, Cap 'n. Kirk: What in the blazes is going on, ~cotty?, Are you fiddling with, the transporter's' controls·or what? Scotty: Beg pardon; sir. I was just testin' the transporter's new opera tin" sys tem with this "cd lusr Iman /man l" command. Kirk: (aside) Explanation, Mister Spock? Spock: It would seem that the expression /usr/man/manl somehow represents this loca t'ion, when one considers the unlikely coincidence of us materializing here (thanks to Mister Scott's tinkering) and the fact that those ve~y characters appear there on the floor. Perhaps "cd" is some sort of directive, meaning "coordinate definition" or "consign to destination". McCoy: Or "capture and detain", or "chafe and decapitate"! (Menacing theme music crescendos, cut to commercial) While the commercials are on, we will put you at ease by assuring you that ,the good doctor's anxieties are amiss. "cd" stands for change directory, which means pass through a door, or a series of doors, depending on the "argument" that follows cd. Therefore, the Enterprise brass have in effect passed from the root directory, through the usr door, on through the man door, and finally into the manl room. The complete path of this journey is "/usr/man/manl", which is the argument. By the way, this room contains the online'documentation for section I of the Reference Manual, hence "manl". But the show's back on. Spock: Captain, there is a door to your left with two dots on it. Kirk: So I see. No doubt a secret message of some sort. Now, if I can remember back to my days in the signal corps, two dots is Morse code for "I". Hmmm. But "I" is English for the Latin "ego" which sounds like "y-go" which is sort of French for "Go there"! 9 ". Spock: (muttering) Which I was about to suggest. Kirk: ScottYt give us a "cd •• ". Sco~ty: But sir t why doon't ya just walk o'er there? Kirk: Do what I tell you, Mister Scott, or I'll have you keelhauled! Besides, it'~ such a MOVING experience. (winks at McCoy). (whirring and whining of transporter - protagonists appear on the other side of the ...... door. No filing cabinets this time,; instead t there are seven doors labeled "manO", "manl", and so on Thi:s floor's up to "manS", plus another strange ".... door. carpet is decorated with the insignia "/usr/man".) Spo,ck: Fascinating. Our previous location was Iu,sr/man/manl. After passing ,thrqugh the double-dot 'door, our present location is lusr/man. Over there is a door,mar~ed "manl". I posit that these are one and the same door, viewed from opposite sides. Furthermore, this second double-dot door should lead us into a chamber known . as i. lusr" t wherein will be a "man" door, leading back into this very place. It is quite conceivable that in th~ /us,r room we woul~ discover yet another dot-dot door, being an entrance to the "I" room, whe.re we began. ' McCoy: Why you. contemptible conglomeration of collagen and chloroplasts! What the devil are you talking about? (Spock raises eyebrow, exchanges knowing look with smiling Kirk up on happy music, freeze ,. superimpose credits) More than likely you're in a similar state of befuddlement at this point. The foregoing episode serves mainly to give you a feel for the labyrinthine nature of the file system, a glimpse from the inside as opposed to the external view, which we will present next. 10 I o 0 0 0 o 0 0 0\ o 0 0 0 0\ o ---\/ /etc , , _ _....:/0\ o 0 / / bin I0 ~----~ \ / I / 0 0 0 0 0 0 usr /man/manO, 0 0 0 0 0 0 0 0 /0 0 0 0 0 0 0 0 \ /0 0 0 0 0 0 0 0 6 /0 0 0 0 \ /0 0 0 0 0 \/ I I I \0 0/ /usr I , The Root Directory /0\ 0 / \0 0 \//usr/man / \ 6 0 0 \ / 0 0\ o 0/ -----\ / \ \/ / 0 \ \ 0 0 0 0 0 0 0 0 0/ \ 0 0 0 0 0 0 0 0/- I I/usr/man/manl \ 10 I , /0\ / 0 /0 0\ / 0 \ 0 0 0 0 0 0 0 0 0 \ 0 0 0 0 000 0 I /a/annl /a 0 0 0 0 0 0 01/usr/man/man2 0 0 0 0 0 0 0 0 , '0 0 0 0 0 0 0 -I I0 0 0 0 0 0 0 0 /0\ /0 0 0 0 0-0 0 0 \ /0 0 0 0 0 0 0 0 0 o 0 0 0\ /0 0 0 0 0 0 0 0 0 \ /0 0 0 0 0 0 0 0 0 o 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 boo 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 -_... This is a partial overhead view of the file system. The thing to notice is the way that each directory cell has a "pathname" that is determined by its position relative to the root directory. The farther down into the file system you gOt the longer the pathname becomes. Whenever you are using Micronix, you will be "in" some directory. You will have access to the files in that directory (unless they are restricted) by simply typing the file's name after so~e command; for example, if you are in /usr/man/martl, you could look at file cptree.l t which is in that directory, by entering type cptree.l. If you were in some other directorYt thought you would have to include the whole pathname, as in type /usr/man/manl/cpttee.l A major potential confusion factor -. is that when you look at the contents of a directory using the dir command, you'll get a list of filenames and subdirectory names with no apparent distinction between the two types. Once you know your way around t this isn't a problem. But early on you'll be making the harmless mistake of trying to change directory (cd) to a path ending at a file, which won't work, and attempting file manipulations on some directory, which won't work either. There are two ways to get your bearings within the file system: to directory. pathname, for 1. Use the command pwd, meaning pathway Micronix will respond with your current example, la/ann/letters. 2. The dir command displays the files and subdirectories that are in your current directory. Hopefully something will look familiar enough to clue you in as to where you are. 11 Now for a little mental exercise to help assimilate what's ,before. • • gone You are in the .root directory. You get there either by logging in as the user named "root" or by typing cd I. You want to get to the home directory of user "bob", ·which means the directory that Bob automatically lands in when he logs in. (The setting up of "home directories" is discussed in Maintenance and Administration.) The pathname of Bob's home directory i~ la/fu11time/bob. There. are four ways of getting there, but .on1y one does it in a single step. See if you can come upwitb the right one. Don't peek. Cover the answers, below with your hand. (Hint: the answer is painfully obvious.) Answer #1: cd a cd fulltime cd. bob Answer #2: cd a/fulltime cd bob Answer #3: cd a cd fulltime/bob Answer #4: cd a/fulltime/bob If you produced any of the first three answers, you're catching on, but your sense of efficiency is a little suspect. You may be wondering why Answer #4 doesn't have a slash in front of the "a" in the pathname, since the pathname was given as /a/fu11time/bob. This is because you were already in the root directory (symbolized by I, giving slash a double meaning). That means subdirectory a was in your current directory, so anything that comes before it in the pathname is superfluous. Now suppose you are in directory /a/fu11time/oglethorpe, and One way to you want to get over to Bob's home directory. accomplish this is by entering cd la/fulltime/bob. The slash has to be up front there since you weren't in the root directory at the time. The alternative route demonstrates backing out of directories a step at a time, symbolized by the dot-dot doors in our earlier fable: cd cd bob to back up from la/fu11time/og1ethorpe to la/ful1time to advance from la/fu11time to /a/fu11time/bob And finally, these two commands may be condensed to cd •• /bob. 12 We're about finished with this file system discussion. It's doubtful that you feel inspired and enlightened, because as we said earlier, reading about it is no substitute for tapping on that keyboard. 3.4. Directory Terminology Just to make sure you're clear on some of the you'll ,be running into elsewhere in the manual - terminology "Root Directory" is the center of the file system, if you like the starfish analogy; if you prefer the inverted tree, it is the top. For the office-building scenario, consider it the lobby. All pathname$ to files in the system begin at the root directory. The root directory contains a few files (unless you put more in it) but mostly it contains subdirectories. The r,oot directory.is symbolized by a sla.sh, so the. command cd / will put you there. .. "Home Directory" is the position in, the file system where a user is placed when he logs. in. This choice is under the control of the. system.' manager. The 'home directory of the user "root" (usually the login name for the system manager) is the root directory. Other users would typically have home directories like la/henry. No matter where a user happens to be in the flie system, he can always return to his home directory with the command cd, with no argument following it. "Current Directory" is whatever directory you happen to be in at present. It could be the root directory, your home directory, or some other subdirectory. The pathname of your current directory can be subtracted from the pathname of some file farther down in the file system if you want to do something with that file. For example, if you are presently at la/sylvia and you want to print the file /a/sylvia/letters/mom, you could enter lpr letters/mom. You can find out the pathname of your current directory by typing pwd. To see the contents of your current directory, enter dire The " •• "symbol means "one step back in the file system". You can use more than one of them in a string. For example, to move from /f/john/micronix/chapter1 back to If, you could enter cd •• / •• /.. Starting at the same place, if you wanted to get to /f/john/cpm/intro, you can mix •• 's with a normal path in cd •• / •• /cpm/intro. Remember that cd commands have to end up at a directory name, not a file name; therefore "intro" and "chapter1" above are directories. 13 3.5. Where Files Come From . Your Micronix system comes with a basic fil·e system made up of the Micronix programs and the online documentation. You will be adding new directories with the mkdir (make directory) command, and adding files by copying things into the system (such as when you install your word and data processing software), and by running that software (it creates files for its own use). Other ways of generating new files are by using the edit command on a file that doesh't yet exist, by sending the output of som·e operation to a file that isn't there yet, and by duplicating existing files with the cp and cptree programs. No matter how extensive or intricate your file system eventually becomes, it will still always lead back to the original root direct6ry. A couple of tips on setting up your own tile space: 1. As a regular user (instead of system manager), you will probably have a home directory of /a/yourname. This is created by the accounts program. It will be an empty directory at that point. When you use mkdir directoryname to make a subdirectory, capitalize the name or at least its first letter to distinguish it asa directory instead of.a file. 2. Micronix has certain restrictions on the file names that you can come up with. File (and directory) names can be any combination of printing characters up to 14 characters long, with one exception. The slash character, /, has a special meaning for Micronix (it separates directory names), so it can't appear in file or directory names. A different set of restrictions on when using CP/M. Micronix files lower case letters or numbers, with characters, possibly followed by a characters. 4. file names is imposed for CP/M must be all a maximum length of 8 period and three more WHERE TO GO FROM HERE Well, if you haven't installed your system yet, by golly, you can't do too much else until you get that overwith. The INSTALLATION division covers this ·subject pretty well. Then you should take the tour of the file system as described toward the end of the INSTALLATION division. Next, refer to MAINTENANCE AND ADMINISTRATION for instructions on setting up user accbunts. Flip back to PROGRAMS and try running a few of them, just to see what happens. Remember that the DELete or RUBout key will normally get you out of confusing situations. CTRL and D simultaneously can be helpful too, since it logs you out. Now dig in, and enjoy yourself. 14 Micronix Operating System user's manual MORROW. ------_.-------------------------INS TAL LIN G M I C RON I X TABLE 1. 2. 2.1 2.1.1 2.2 2.3 2.4 2.5 2.5.1 2.6 2.7 2.7.1 2.7.2 2.8 2.8.1 2.8.2 3. 3.1 3.2 3.3 3.4 3.5 4. 4.1 4.2 4.3 4.3.1 4.3.2 4.3.3 4.3.4 4.3.5 4.4 4.5 4.6 O.F CONTENTS ................ STEP BY STEP INSTALLATION PROCEDURE •• · . . . . . · . STEP 1: UNPACK AND INSPECT •• • • • • • • · . INSTALLATION OVERVIEW Checking for Hidden Damage ~ • • • • • • • STEP 2: SELECT A LOCATION • • • • • • • • • STEP 3: PLUG IN THE POWER CORDS • • • STEP 4: TURN THE POWER ON, .FIRST TIME STEP 5: SETTING UP THE FIRST TERMINAL • • • • • Terminal Settings ••- • • • • • • • • • STEP 6: CONNECTING THE RS-232 TERMINAL CABLE. STEP 7: BOOTING UP CP/M • • • • • • • • • • • • TUTORIAL: Care and Feeding of Floppy Disks. Getting Ready to Boot. • • • • • ••• STEP 8: CHECKING THE HARD DISK. • ••• Booting Micronix • • • • • • • If CHECK FAILS.... • • • • • _. ·. INSTALLING MICRONIX ON THE HARD DISK • • • • FORMATTING THE HARD DISK • • • • • • • • • • USING STANDALONE MICRONIX. • • • • • BUILDING A SKELETAL MICRONIX • • • • BOOTING A SKELETAL HARD DISK MICRONIX. • • • ADDING THE SOFTWARE • • • .....· ....... FIRST TIME USE OF MICRONIX • CHECKING THE FILE SYSTEM • • .. SETTING THE DATE • • • • • • • • MOVING AROUND THE FILE SYSTEM. The BIN Directory. • •• The DEVICE Directory ••••• The ETC Directory. • • •• • • • • • • The USR Directory. • • • ••••••••• A Map Of The File System • • • • • ADDING A PASSWORD FOR ROOT • • GOING MULTIUSER. • • • • • • • • • • • • TURNING YOUR MICRONIX SYSTEM ON AND OFF • • • • • • • .. · . .. .. .. .. ·. .... 1 2 2 3 5 5 7 8 8 9 10 11 14 17 18 18 21 21 23 26 28 29 31 31 33 34 36 37 38 38 39 40 41 42 5. CONNECTING THE PRINTER • • • • • • • • • • • • • • • • 5.1 PLUGGING 'IN YOUR PRINTER • • • • • •. • • • • 5.2 TESTING YOUR PRINTER • • • • • • • • • • • • • • • • 5.3 ADJUSTING MICRONIX FOR ,YOUR PRINTER. • • •• 5.4 USING LPR, THE PRINTER COMMAND ••••• • • 5.5 USING YOUR, PRINTER WITH CP/M • • • • • • • • • • • • 5.5.1 Using LPR With CP/M. • • • • • • • • • • • • • • • 5.6 ADDITIONAL PRINTERS. • • '. • • • • • • • • • • • • • 6. INSTALLING YOUR CP/M SOFTWARE. • • • .-. • • • • • • • 6.1 Copying CP/M ~iskettes to the Hard Disk. • • • • • • 6.2 Customizing Software • • • • • • • •.• • • • • • Terminal Emulation and upm • .• • • • • • • • • • • • 6.3 6.3.1 Turning Terminal Emulation On and Off. • • 6.3.2 Terminals .File • • • • • • '. • •.• • • • • .• • • • 6.3.3 Upm's Notepad: The upmttyX File • • • • • • • • EXAMPLE: Installing NewWord • • • • • • • • • • • • 6.3.4 6.3'.5 ANOTHER EXAMPLE: Customizing Personal Pearl • • • • 44 45 46 47 49 50 50 51 53 54 55 57 57 58 58 59 60 Appendices A. Installing WordStar • • • • ......... ..... 62 INSTALLING YOUR MICRONIX SYSTEM Congratulations on getting your new system. This section of the Micronix manual explains how to connect your terminal(s) and printer(s) and how to get the software running. Rather than trying to do everything at once, then trying to figure what went wrong, we will proceed a single step at a time. This may seem a little slo~ if you are anxious, but it is merely honoring Murphy's law: If anything can go wrong, it will. Your Mlcronixsystem was connected with a terminal and tested for 12 hours before it was packed at Morrow. Twelve hours may not seem like much, but most problems from faulty hardware show up within the first half hour of use. Because of the test, we know that your Micronix system worked great for us; it should also work for you. Just follow the instructions, please. We will use checkpoints at every step so that you can be sure that you have succeeded in understanding and follo.wing instructions. We'll also do our best to explain briefly and simply what you are doing to your system as you install the software. This should provide you with a better understanding of how Micronix works. 1. INSTALLATION OVERVIEW Before we get started, this section provides a brief description of the procedures involved in installing Micronix on a Decision. This section may be all that you need if you have previously installed a Micronix system. For those of you firsttimers, the installation steps are explained in greater detail in the sections that follow. Here goes ••• 1. Unpack and check for external damage; remove the inserts from the floppy drives; 2. Choose a suitable peripherals; 3. Plug the Decision into a grounded socket; terminal into a power socket on the Decision another grounded socket; 4. Turn on the power: on? 5. Set the terminal to 9600 baud, 2 stop bits and no parity; 6. Connect this terminal to the RS-232 connector located in the lower right-hand corner of the back of the Decision; there are (at least) three of these connectors: use the one nearest the right side (when viewed from the back.) location for the computer are the 1 and its plug a or into fan and switch panel light 7. Insert the CP/M floppy disk, and boot up CP/M by pressing the RESET switch (or flick~ng the key to RESET) 8. Run the CP/M CHECK program to check the contents of hard disk. the The CHECK program is an important milestone in this process, since its outcome determines whether you will have to repeat a time-consuming (though easy) procedure that was already done when your system was tested. If it is successful, you are ready to boot and play aro~nd with Micronix and can install whatever software packag~s you may hay'e purchased. We will traverse these bridges upon ~rrival. 2. ~ 2. 1. BY STEP INSTALLATION PROCEDURE STEP 1 : UNPACK AND INSPECT The instructions for unpacking your system are essentially the same as for unpacking a piece of stereo equipment: carefully remove the cabinet from the box and save all packing materials in case you ever want to ship the system again. Besides the cabinet containing the Decision, you should have also found: o two binders, one with these instructions, o a packet of diskettes, o warranty cards, and o a power cord. The packet of diskettes contains a CP/M diskette for testing and "booting" your system, copies of the Micronix software that has already been placed onto the ~ disk, and a set of application diskettes for word and data processing. The warranty cards should be read, filled in, and mailed. THIS IS IMPORTANT: There are cardboard inserts in your floppy drives to protect them during shipping. You must remove them before applying power to the system. Lift the door latch and slide them out. Leave the doors open. Easy enough? The power cord is the only external part that is packed with the Decision. Since you are going to connect at least one terminal to the system, you also need an RS-232 cable with two male ends for each terminal you are connecting. Hopefully, your dealer was saVvy enough to realize this and sold you one with each terminal. Or, if you are daring, and competent technically, 2 you can build your own cable with parts purchased at Radio Shack or an electronics store. The section on installing printers has more details on RS-232 cables. If you bought a Morrow terminal, a RS-232 cable will be in the box with the terminal. Keep your carton and packing materials! the kids for playing camp-out. Don't give them to If you do see blatant physical damage to ify the carrier immediately for filling out a contact Morrow's Customer Service Department ask for' a' Return Authorization Number. They turned equipment without that number and it the original carton. the Decision, notdamage- claim. Then (408-430-1970) and will not accept. remust be shipped in Those of you with Decisions that have the keyswitches o~ the front can ignore the next subsection and proceed to STEP 2. 2.1.1. Checking for Hidden Damage This section can be skipped by owners of Decisions that have an ON/OFF keyswitch on the front panel; this should include just about all of you. However, if you do run into some intractable problem later in the installation, the ftillowing procedures may prove helpful, regardless of which' cabinet your 'Decision uses. By the time you have removed the Decision cabinet from the packing mater:Lals, you should have discovered any gross damage suffered during shipping. What we want you to do now'is check for hidden damage. The hidden damage will probably involve loose, rather than broken, parts that you can ,reattach yourself. And by "hidden", we mean inside the Decision cabinet. Opening the cabinet is simple and not dangerous, so don't be afraid. If you have already plugged in your Decision, please unplug it. There are two types of Decision cabinets: a molded plastic one and a metal one. To look inside the plastic cabinet, remove two screws in back, and slide the top of the Decision toward the back and lift it off. The cover to the metal cabinet is attached by four screws which you need to remove before you can slide off the cover. The cover slides off toward the front. Just under the cover, on the left hand side, there is a piece of foam rubber. Please remove the foam. This foam was put into your Decision after testing to protect the pc boards during shipping and it will interfere with air cooling if you leave it in. (Non-keyswitc-h models only.) When you have removed the foam, you will have revealed the printed circuit boards. Each board looks like a green or blue rectangle, about 5 by 10 inches in size, covered with black integrated circuits on one side. The boards should be neatly standing in a row, with white plastic guides holding the boards upright, and a black plastic connector fastening them, along their lower edge. 3 By looking down between the, pc boards (there is room for several more boards right in the middle) you will see another, much larger, green printed circuit board that extends from the front to the rear of the cabinet. This board is called the WUNDERBUS I/O, and holds 14 black 'connectors, each about 7 inches long. These connectors work identically to. one' another, that is, they provide the same data and signals to each printed circuit board that is plugged into them. To work properly, the lower edges of the smaller pc boards must be firmly attached to the black connectors. This connection, between the s~aller printed circuit boards and the WUNDERBUS I/O, is often a 'problem when shipping computers. Checkpoint: We are going to check ~,o,}:' two things: that the boards .are' held between the white plastic guides, and that all the boards are firmly connected. 1. To see whether each ·pc board is still held between the two white plastic guIdes, look along the left and right ,ends. of the boards. The white guides begin 3/4" (2 cm.) below the top o.f, the boards, and its easy to see whether each board is resting in the guides, unless you keep your computer under the table or in a dark room. 2. It's pretty hard to see the connection between the boards and the WUNDERBUS, but you can do two things. You can see that the top edge of each board is about 3/8" (.8 cm.) above the metal ~ides, and that the tops of all the boards .appear to be about the same height. And you can press down on the tops of the boards to reseat them. To reseat boards, press gently with your thumbs on both ends of the top of a board. You can use up to about 10 lbs. (4 kilos) of force pressing down, and can alternate the force from your left thumb to your right to gently rock the board into place. Even if all the boards look seated, try this with at least one board. If you find a board that is co~pletely unseated, well, reseat it. It doesn'~ matter which slot on the WUNDERBUS you fit it into, and it will only go in one way. If you find a loose cable, it should be readily apparent where it connects. Chapter 11 of the D120 manual (the hardware manual for the Decision that is in the other binder) shows the proper connection for most cables. If you can't figure out where to connect a cable, get on the horn to Morrow Customer Service. These situations are very unlikely, but we want you to be as self-reliant as possible in case they occur. 4 2.2 STEP 2: SELECT A LOCATION The choice of the location for your Decision is up to you. However, there are three requirements that'must be followed. Your Decision should be installed where it will remain level, stable and dry. The level and stable requirements refer mainly to the hard and floppy disk drives. These both contain moving parts ,that are designed to be operate,d on a level surface for maximum life expectancy. And, if you drop or jar a hard disk, the head alignment inside the sealed unit may change, making everything on the disk unreadable. Even worse, dropping an operating hard disk will probably force the heads into contact with the spinning disk, destroying many sectors. Treat your hard disk like a priceless Ming vase: keep it wher~e it won't be dropped. The definition of "dry" for electronic equipment is that the environment must be non-condensing. That is, the humidity should never be so high that water condenses on the metal parts of your computer. Obviously, rain, or spilled coffee, is too wet. And, if it, is,really"dry in your environment, you may have a problem with static. The static-charge that you ~an build up in your body walking across a rug might amount to thousands of volts, but very little current,. What this means is tha~ what feels like a little .hock to you is li~e elctro-convulsive therapy ,f,Or your computer. Computer-brain damage wiJ.I be the likely result. Problems with static can be vanquished by purchasing a rug that has copper wires woven into it. Strange though it may seem, rugs with metal content are not too uncommon, and you may be able to buy a small one from a rug store. Or, you can get an anti-static rug from an office supply or computer retailer. One final suggestion about location. Like a stereo s~stem, all of the connections f.or your system are located on the back of the cabinet. If you can arrange the system so that you can stand behind it, at least while installing it, everything will be a lot easier. Once the physical installation is completed, you can move the system so that "the back faces a wall. Remember to leave at least 4" (10 em.) at the back and over the top of the cabinet for ventilation. 2 .3 STEP 3: PLUG IN THE POWER CORDS ••• but don't just jump right in and do that. Read this section first, and be sure that the power switches to the Decision and its peripherals are off. Some Decisions have large red or white rocker switches on the front or rear panels for controlling power. To confuse matters further, they can be mounted vertically or horizontally. Off is always DOWN for vertical switches and LEFT for horizontal ones (when facing the switch). Whew. If your Decision has a keyswitch on the front panel, ignore the above and turn it fully COUNTERCLOCKWISE. 5 Your Decision comes configured from the factory for either 110 or 220 volt operation, as specified by the dea~er who ordered it. Just to be absolutely 'sure that your available current matches what the computer needs, check the sticker on the rear of the Decision. The sticker covers the power socket and tells which voltage level the computer expects. Your Decision can be plugged into any grounded Grounded outlets for 110 volts look something like this: / \ \ / outlet. I II II I I II 'I I 101 - They will receive the three-pronged plug that comes with the Decision. (If you have a 220 volt system, you will also have a three pronged socket, but in a different shape.) If grounded receptacles are not available', use an adapter to plug the power cord into the wall, and plug accessories, such as your terminal and printer, ' 'into the outlets on the back of the Decision. When using a three pronged atlapter, be sure to fasten the metal tab or green wire'from the adapter to the screw that secures the socket cover to the wall. And don't just break the ground lead off of the power plug. This is a computer, please,'not a sabre saw. To make matters worse, not all three pronged sockets are actually grounded. In older houses and buildings, all the wiring was done with two wires - no ground wire! Later, three pronged sockets were added by someone and "grounded" to the metal box they were installed in. If you want to check your ground (the third hole, which is round, or the screw that you attach the adapter to), use a 'volt-ohmmeter and check the resistance between your alleged ground and a cold water pipe. The resistance should hover near zero. If you need more outlets, get a power strip and plug everything into the power strip. Computer systems with their accessories are like stereos in that they work best if they are all using the same ground. If you are going to have terminals that are located a distance away from the Decision, use the full RS-232 specification cables which include a protective ground on pin 1. Besides a shared ground, the Decision and its peripherals, (terminals, printers, etc.) require a steady power supply. The volts, and minimum suggested voltage for the Decision is 105 the maximum is 125 volts. For 220 volt systems, the tested voltage range is 208 to 265 volts. In the United States and most of Europe, the power companies are pretty reliable at delivering electricity in this range, so most of you won't 6 have trouble with this. One problem that you need to try to avoid is voltage variations due to the startup of large electrical appliances like air conditioners, space heaters, and freezers. If an electric lamp connected to the outlet you want to use dims visibly when one of these appliances turns ori, ' you will probably be plagued with erratic performance from your computer. The only solutions are running a dedicated power line from your main service panel to either the computer or the appliance, or getting an uninterruptable power Supply. 2.4. STEP 4: TURN THE POWER ON, FIRST TIME Now" ready for the big step? Look on the back of the Decision cabinet. The socke t for power will be covered by "the sticker with the voltage level ort it. Remove the sticker. The socket is a hole with three' prongs in it. Plug the female end of the power cord into this socket. The socket is designed so that there is only one way the plug will fit in, so don't worry about doing it wrong. Plug the other end of the power cord into the outlet you have selected. Now, apply power by either reversing the position of the rocker switch or by turning the keyswitch one click clockwise. The power is now ON to the Decision. Checkpoint 1: A pilot lamp should now be glowing to notify that power has been applied. In the keyswitch~odels, the panel next to the keyswitch illuminates; in other models the Reset button lights up. The fan inside of the the back of cabinet should also be on. If you have a 5 and 1/4 inch hard disk, known as a mini-wini or mini-winchester drive, the red indicator light on the drive will also be on. The two grounded power outlets on the rear of the Decision now have power applied as well. If everything checks out here, go on to the next section on connecting the first terminal. Troubleshooting 1: If neither the pilot light nor the fan came on, check: 1. The connection of the power cord to the back of the Decision. This socket is about 3/4 (2 cm.) deep, ,and the female end of the power cord must be fully inserted for a good connection. 2. The grounded outlet. Plug a desk lamp into the outlet to make sure that you have power. 3. The circuit breaker on the back of the Decision -(keyswitch models only). It is of the pushbutton type seen on stereo receivers and speakers. Push it all the way in and release with a snap. 7 4. The power switch itself. Rock it back and forth flick the keyswitch) a couple of times. (or If the fan comes on, but the pilot light· doesn't come on, the Decision may well be operationai ·with the exception of the lamp itself. In NON-keyswiteh models, there is an.alltoo-frequent problem with a loose connection on the wires that connect the RESET button to the WUNDERBUS I/O. Unplug :your Decision, take the top off and, with good lighting, look into the cabinet between the back of the cabinet and the rearmost pc board. Located just to the rear,of'a black connector on the WUNDERBUS are two pins with the' word PRESET printed next to them. A small black (or brown) plasti~ connector with a black wire and a blue wire coming from it should be attached .to the two pins, but is instead lying nearby. The black and blue wires are tied down near to the two pins, so tha,t if the connector ,is loose it will be easy to find. It is a tight fit for large'hands, but you can . maneuver the connector over the pins by holding the connector between two fingers and slide it back on. The blue wire goes on the pin nearest the power switch, the black wi.re on the pin nearest the fan. STEP 5: 2.5. SETTING UP THE FIRST TERMINAL This section covers attaching. ONLY the first terminal. If you're going to have more, these procedures apply in principle, but there is further information under "Terminals" in the MAINTENANCE AND ADMINISTRATION division of this manual. The first terminal connected to a Micronix system is called the console. On mainframe (large) computer systems, the console is used by the system operator. Micronix's.conso1e is used both by the system administrator and ordinary users. When you first' bring up your Micronix system, the console is also the ONLY terminal that you can use. In fact, whenever the system is reset, only the console will be operative. (Making other terminals usable is known as "going multiuser".) 2.5.1. Terminal Settings Terminals have many switch-selectable features, of which only a few concern us at present. The first, and most important, is the baud rate, that is, the transmission rate in bits per second. Both the CP/M system that we will use to check out the hard disk and Micronix initially expect that you will be using a baud rate of 9600. 9600 is the most common baud rate used for terminals connected directly to computers. Look up the baud rate selection, or option switch settings, in the operation manual for the terminal you are using, and set the terminal for 9600 baud. While you are looking at this section of your terminal's manual, also set the switches for: o full duplex - since the Decision echos the 8 characters you type back to your screen, if you see two of everything later, you should double check this setting. o 8 bits - the number of bits used to send a character; o 2 stop bits character; o no parity - parity is an option that _is used for checking transmission accuracy (usually not a problem at 9600 baud); and o on line - as opposed to local, means that ~he keys you type are transmitted to the computer; sometimes this switch will be on the keyboard. - the pattern that marks the end of a The odds are that if you have already been using a terminal with a different computer, it is set up correctly for use with Micronix. Once again, the most likely cause of trouble-here is the baud rate. The usual sign of using the wrong baud rate is that the sign-on messages '(after booting or resetting) will be a nonsensical collection of assorted characters and the letters that you type will be displayed as other letters on your terminal. For example, if you type an "rtf and the characters "-pH appear instead, your terminal is set to 4800 baud. The Decision has software-controlled baud rates, so you must set your terminal to 9600 baud initially in order to use the software to change the baud rate, if you so desire. 2.6. STEP 6: CONNECTING THE RS-232 TERMINAL CABLE NOW, look at the back of your terminal. There will be one or two trapezoid shaped female connectors there, (like the capitol letter "D" lying on its rounded side), the same size and shape of the end of the RS-232 cable we told you you'd be needing. If there is only one connector on the back of the terminal, great. If there are two, use the one labeled "modem", "RS-232", "main port", or "PI", not the one labeled "printer" or "aux". The second connector is not designed to be connected to a computer, and you don't need it. Connect one end of the RS-232 cable (either end is fine) to the correct connector on the back of the terminal. The other end of the RS-232 cable is attached to the connector in the lower right hand corner of the back of the Decision. There are two additional connectors of the same shape and size to the left of this connector, when looking at the cabinet from the back. Don't use them now. Use the rightmost connector, nearest to the side of the cabinet, for the console. 9 TERMINAL DECISIOH Now, plug in the terminal and turn it on. You can use one of the two sockets on the back of the Decision to plug in your terminal, so that the console will turn on when the Decision is turned on. When the terminal is turned on, it may "beep", and you should be able to hear it w~rming up (sounds like a TV set, a high-pitched whine.) After warming up, (5 seconds or so), you should see a marker on the screen of your console called the cursor. The cursqr marks the place where the next character yill appear on the screen. (The cursor precurses the next character.) It will probably be in the upper left-hand corner o~ your screen. If you don't see the cursor on the screen, you may ~eed to adjust your terminal's brightness c~ntrol. Before you leave this paragraph, find your cursor. If you can't find the cursor, something is wrong with your terminal, so you might as well just mark your place in this manual, and return when your terminal is okay. Thanks. -2.7. STEP 7: BOOTING UP CP/M Now that we've got the basic connections made, a terminal and power, we're ready to load CP/M into your Decision. Although there is a complete Micronix operating system already on the hard disk, we'd like you to check things first by using the less sophisticated CP/M. Then you will run the CHECK program mentioned earlier. There is a'-lengthy primer on diskettes embedded in this procedure which the more experienced of you may skip. and Look in the packet of diskettes that came with your take out the disk labeled system COLD BOOT LOADER (CP/M) With the power on to your system and the console, insert this disk in the floppy disk drive. If you are familar with floppy disks, this should be no problem and you should skip the next section. For those of you unfamiliar with the use of floppy disks, the next section is for you. 10 2.7.1. TUTORIAL: Care and Feeding of Floppy Disks TIlere are two sizes of floppy disks availablewfth Decision systems': 5 and 1/4 inch and 8 inch. Disks of both'sizes consist of a black plastic envelope with' a circular piece of recording material on the inside. The recording material is visible in t,he center' hole of the disk; and through an oblong slot between the center and one edge of the diskette. Floppy disks are read and written through this oblong slot. Be careful never to touch the recording material revealed though the oblong slot. TIle oil naturally occuring on your fingertips will ruin the magnetic material. 'The recording material can also be damaged by: being scratched, heated, folded or getting wet. Floppy disks are cheap and convenient, but somewha t fragile, so be care,ful when you handle them. The top side of a floppy disk is the side with the label on it. The label is always ,next to the edge opposite the oblong slot, so the label is the best place to hold floppy disks~ When inserting a floppy disk, hold the disk with your thumb on the label and your other fingers underneath. (It may happen that you have bought a bulk quantity of blank floppies without labels. In this case, the labels would go on the smooth side, the one without the seams folded over on it.) ~( ) Now for the difference between 5 and 1/4 and 8 inch diskettes. We'll talk about 5 and 1/4 inch diskettes first. The major difference is their size: 5 and 1/4 inch diskettes are 5 and 1/4 inch square. The other important difference is something called "write-protect". When a diskette is write-protected, it may be read, but not written on. Write-protection is a physical mechanism that cannot be overridden in software, so it provides a good way of protecting valuable data on diskettes from accidental erasure. Cassette tapes in stereo systems have a similar protection scheme. 11 The write-protect notch on a 5 and 1/4 inch diskette is on the left hand edge when your are holding the diskette properly (by its label) •. When this notch is covered, the disk is writeprotected. Left uncovered, the diskette can be written on or erased. ,0 , notch-covered 1:1 o© t{: , 10 r notch-open 10 A WRITE-·PROtECTED 5 1/4" DISKETTE AN UNPROTECTED 5 1/4" DISKETTE Eight inch' floppy disks have the write-prote'ct notch in a different position. The write-protect notch is on the edge of the diskett,e nearest the oblong opening. And,' to confuse the issue, 8" diskettes ,use the opposite scheme from 5 and 1/4 inch diskettes: when the notch is open, the disk is write protected; when the notch is covered, it is write enabled., Make sure you've got that straight, or forget it if you don't use 8" diskettes. notch covered notch open -/ L 0 -' @ • @ • I 0 10 I 10 AN UNPROTECTED 8" DOUBLE-SIDED DISKETTE A WRI~E-PROTECTED 8" SINGLE-SIDED DISKETTE 12 NOTE: The following discussion of formatting applies only to new diskettes, or those you wish to recycle. Do n~t format any of the diskettes that came with your system.' Before new floppy diskettes can be used the first time, they must be formatted. Formatting adds a timing patter.n to a disk that must be there before an ordinary read or write can occur. Even if you bought blank preformatted diskettes, they should' be reformatted on your Decision before you use them. The fdj program should be used for this. The Decision accepts the following diskette formats: -5 and 1/4"North' Star compatible, single and double density, single and double-sided, 35 and 40 tracks. For use exclusively with Micronix, use: double density, doublesided, 40 tracks. Soft-sectored Micro Decision format is also supported. ' 8"IBM 3740 compatible, single and double density, single and double sided. For use exclusively with 'Micronix, select double density, double sided, 512 byte se,ctors when using the fdj program. Micronix can handle the other format options as well, but this is the most efficient. If you buy a diskette with software on it, it is already formatted, SO DON'T FORMAT IT or you will erase the software. The diskettes provided with your system all have software on them and don't need formatting. If you're curious about the meanings of some of the terms used above, here we'll discuss single versus double sided. There is no difference in appearance between single and double sided 5 1/4" floppy diskettes. However, the 5 1/4" diskettes that are labeled and sold as double sided, have passed a test for doublesidedness; the diskettes labeled as single-sided FAILED this test. You should buy 5 1/4" diskettes certified as double-sided. There is a physical difference between single and double sided 8" diskettes. If you look at the drawings of 8" diskettes on the previous page, you will notice that one is labeled "SINGLE-SIDED", and the other is labeled "DOUBLE-SIDED". The difference between the two is the location of the index hole. The index hole is a small (1/4" or .6 cm.) hole located between the large hole in the middle of the diskette and the label. The index hole for single-sided 8" diskettes is located at about 6:30, a little off to the left below the center hole. In double-sided 8" diskettes, this hole is located further to the left, around 7 o'clock. This physical difference allows the hardware and software to distinguish between single and double sided 8" diskettes. If you want to use double-sided 8" diskettes, you must buy them this way. 13 The last ,point to discuss about floppy diskettes is how to open and close the drive doors. There are at least three types of drive doors. In every case, closing the door causes the diskette to be clamped in place through the hole in its middle. Please close the door gently, so that you don't mangle the edges of the cent'er hole in the d·iskette. The first type of door isa flap .that covers. part of the slot where you slide in a diskette. To open the door" lift up the flap. Slide the diskette in as far as it will go·and close the door by pushing the flap down gently. The se~ond type of door is like a latch handle. To open the latch, turn the latch counterclockwise so that it pivots to a position above the slot. Slide the diskette in as far '"as it will go and close the· latch by turning it clockwise until it is vertical. Simple enough? To open The third type of door is used on 'some 8" drives. the door, press the rectangular button with the red indicator light in it. The door will pop open revealing the slot. Slide the diskette in' ·as far as it ·will go. This time ,there will be a "click" ' when the diskette is in far enough. If it is not, it will pop out like toa~t from a toaster. Just slide it in ag~in, gently, until it clicks. Then, press down gently on the gate above the slot until it too clicks into place. Now you're all set. You should NEVER close the door of a drive without a diskette in it. Closing the drive door moves the .reading and writing heads into position for contacting the diskette. Without a diskette in place, the heads are in position for crashing together, possibly cracking or scratching each other. This is why there was a piece of cardboard in the driv~ when your system was shipped. The red light that is on the front of disk drives is called an activity light. When the activity light'is ON, it means the diskette is being read or written. NEVER open a drive door when the red light is ON. 2.7.2. Getting Ready to Boot. We're back on track now. We assume that your Decision and the console terminal are up and running with their communications cable connected and the baud rate set to 9600. 14 After power is applied to the Decision, the computer is ready to be booted. The word "booting" refers'to the phrase "to pull oneself up by one's own bootstraps". For computers, booting means loading in the operating system by reading in the first sector on the disk. The first sector contains enough instructions to read in the first two tracks on the diskette. On the disk labeled COLD BOOT LOADER (CP/M)>> the operating system is completely contained on these first two tracks.' Resetting the computer tells it to re,load the operating system from the diskette into memory and to produce a prompt on the con$ole screen to tell you that it' ~s ready for further instructions'. Now, with the CP/M diskette in your floppy disk drive, close the door and press the red RESET switch. On keyswitch models, give the key a quick flick clockwise; a spring will push it back to t,he ON position (away from RESET) si,milar to a, car's ignition switch. have now arrived at checkpoint 2. We Checkpoint 2: After you RESET the system, the red activity light on the front of the floppy disk drive should begin to blink. After ,a pause, the screen may be cleared; depending on your terminal, and the CP/M cold boot sign-on message and a prompt are displayed: Morrow Designs 48K CF/M 2.2 E4 AB: DJ /DMA 5 1/4", CD: DJ /DMA 8", E': HDC/DMA M5 A)[ ] Once you see the CP/M prompt, "A)", CP/M has been successfully booted. Those of you familar with CP/H may like to take a look around by typing DIR" prompt- Well, there are two possiblities here: one, you've got the diskette in upside down and the system tracks are on the other side; two, the system tracks are unreadable. Hopefully, you forgot to insert the diskette label side up and close the door. If the diskette is in correctly and the activity light goes on and off after you reset, then we have a problem. You'll need to replace the diskette with another Micronix COLD BOOT LOADER (CP/M) diskette. Try your dealer. 16 2.8. STEP 8: CHECKING THE HARD DISK We've finally reached the most important checkpoint. The reason for using CP/M ~s that it is someWhat simpler than Micronix, and possibly a lot more familar to you. Now that you have reached this step, you know that your terminal works and that you can read floppy disks. The moment of truth has arrived. Is the software that was carefully copied on the hard disk'by the technicians at Morrow still readable? The CP/M program that checks the hard disk is called, appropriately enough, CHECK. All CHECK does is attempt to read every sector on your hard disk. If CHECK is successful, you can probably boot up the hard disk and Micronix. If not, we'll explain to you how to initialize the hard disk for Micronix. Ready? Okay, type CHECK and carriage return. The CHECK program will be loaded by CP/M and ask you which drive to ,check. A> CHECK Drive Drive C) D.rive D) Drive A) B) O. (if you have only one drive) 1. 2. 3. Drive: A A) mS B) mlO C) m16 Selec tion: [] We want you to check Drive 0, so type an "A". Next, you are given the choice of three drive capacities: 5, 10 and 16 megabyte. Most Decisions are shipped with 10 megabyte miniwinchester hard disks. If you aren't sure which disk you bought, check your invoice (your copy of the bill). The final selection required is the type of system: CP/M or Micronix. Please enter a "B" for Micronix. either CHECK prints a line on the screen for each unreadable sector that it encounters. When it is finished, the total number of unreadable sectors is displayed. If you have more than 25 unreadable sectors, you will have to reinstall Micronix. If CHECK finishes (as signaled by the return of "A)") with zero or less than 25 bad sectors, the hard disk should be alright, and you are ready to boot Micronix. If your hard disk failed CHECK, skip the next section. 17 2.8.1. Booting Mlcronix Once CHECK has passed your hard disk, you are ready to boot Micronix. This is done by running a CP/M program on the same There are four different boo,t . diskette as the CHECK program. programs, one for each size of hard.disk: MSBOOT ' MI0BOOT M16BOOT HDBOOT 5,mega,byte 10 megabyte 16 megabyte for systems with 8" hard disks You boot Micronix by typing the name of one of these CP/M programs', and ,.' pressing RETURN. Since most Decisions have 10 megabyte miniwinchesters', most of you will be typing 'A)MIOBOOT Micronix loader for the hard disk Files' and Micronix will go through the process of loading itself. (Use the other boot programs if you have other capacity hard disks.) 'If you are curious about the messages that you see on the screen at this time, there is an explanation of the messages during loading in Section 3.2, Using Standalone Micronix. Booting Micronix is complete when you have the superuser prompt, N, on your screen with the cursor waiting beside it. You can proceed to the narrative FIRST TIME USE OF MICRONIX. Please do not follow the instructions in the next chapter, INSTALLING MICRONIX ON THE HARD DISK, because Micronix is already there. Then look through the division- on MAINTENANCE AND ADMINISTRATION for information on adding new users, copying diskettes, backing up your hard disk, adding more terminals, configuring Micronix to your terminals and maintaining a healthy file system. Installing a printer is the last section of the Installation portion of this manual. 2.8.2. If CHECK FAILS ••• The following discussion assumes that your hard disk failed the CHECK test. Don't be upset if it did. It used to be that we would tell you to reinstall Micronix regardless of the condition of the data on the hard disk, so you really haven't been set back. 18 If your hard disk is accessible but has 25 or more unreadable sectors, you must reformat your hard disk and reinstall Micronix. The chapter called INSTALLING MICRORIX _ ON THE HARD DISK is what you need to proceed with the reinstallation. How do you know that the hard disk is accessible? Two ways. The red activity light on the hard disk should be on, or flicker during the CHECK program. And if the CHECK program reports unreadable sectors, it is reporting the status from the hard disk controller, so the disk is accessible. If CHECK can't read the status, it will tell you so and you should return to the section on CHECKING FOR HIDDEN DAMAGE. CHECK's inability to read the hard disk status points to possible hardware problems that might be an unseated board or poor cable connections. If you find a loose board or cable, you may want to try CHECK again after reseating the board or connecting the cable. If CHECK still fails, then you need to install Micronix, the subject of the next chapter. 19 *************************************************** * * * * * * * * * * * * PLEASE DO NOT FORMAT YOUR HARD DISK IF * YOU PASSED CHECK WITH LESS THAN 25 ERRORS. * THE FOLLOWING CHAPT.ER IS FOR THOSE WHO * MUST RE-INSTALL MICRONIX ONLY. * * You are, of course, welcome to read this * Chapter for the information it contains. * * *************************************************** 20 3. INSTALLING MICRONIX ON THE HARD DISK You will need to follow the steps in this section (the next 10 pages or so) only if your system failed the CHECK program as described above. These procedures are also used to restore Micronix on a hard disk when the root' file system was destroyed. However, there is a considerable amount of useful information about Micronix in general contained herein, so you may wish to read through it in any case.' This section explains how to get a fresh copy of Micronix and all its software onto a hard disk. 'During this process, everything that was previously copied on the hard disk is overwritten. If you have been using your hard disk and have files on it" these will need to be restored from the backups that we hope you made. (If you are adding an additional hard disk, all you need to do is make ,a file (mkfs) system on it.) There are three stage~ in installing Micronix: 1. Formatting the hard disk, 2. Using the Standalone Micronix diskette skeletal system on the hard disk, and 3. Booting up the skeletal hard disk Micronix and copying the rest of the software to it. to build a These steps are carried out by using one software command for each stage. The remainder of this section explains the three software commands necessary and how to tell if they are working correctly. 3.1. FORMATTING THE HARD DISK This procedure assumes that you are using a 5 1/4" miniwinchester hard disk as your root device. It is possible, though not likely, that you have an 8" or 14" hard disk instead. In these cases, you should run the CP/M program formathd instead of the program formatmw described below. You will need to know the storage capacity of your hard disk. The 5 1/4" models are either 5, 10, or 16 megabytes, as indicated by a number in their model designation (for example, "m5") • Boot up CP/M (the COLD BOOT LOADER) as described Leave the boot diskette in the floppy drive. Enter the capacity and sector size (always 512 the command line as shown: formatmw mD size 512 test 21 earlier. bytes) on where m# is the drive type. For example, to format the 16 megabyte drive, with the CP/M boot 'diskette in the drive and with the A) prompt displayed, yo~ should type: formatmw m16 size 512 test This will take around 45 ,minutes., If you'run th~ formatmw program without the test option, it will only take about' five minutes, i~stead of 45 minutes. The difference is that the test option reads and writes various test patterns, while formatmw without the test option writes only the byte E5 (hex) and checks to see if the sector can be read. Using formatmw without the test option may hide a problem that involves a pattern that is different than a sector filled with E5's. The decision, to use test or no~, is ,up to you. The information displayed process will look like ,on your screen during this A)formatmw m16 size 512 test Formatting. 'Checking format. Testing. Bad sector report. No bad sectors detected. A)[ ] If FORMATMW Seems To Be Having Problems: In this example, everything went correctly and problems occured. What type of problems can occur? Well, types of problems are the most likely if any happen: formatmw program can't access the controller or drive, bad sectors are discovered while verifying the drive. When formatmw has, trouble accessing the HD-DMA board it provides a terse but unequivocal report: no two the or controller Controller does not respond. This report means that formatmw issued a command to select the drive arid nothing happened within a reasonable length of time. You should check to see that the HD-DMA board is well seated. If the controller is working, formatmw next tries to check the drive status, and reports a failure as Can't read drive status. This may mean that the cables that connect the drive to the controller are loose, or the drive is not functioning correctly. If you have an extra hard disk located in an external cabinet, make sure that the power to it is on. 22 Lastly, if the formatmw program succeeds in reading the drive status, but finds that it is not ready, you will be told Drive not ready. The last two messages, "Can't read drive status" and "Drive not ready", are signals to you that there are p~oblems with the hard disk. You may be able to solve the problem yourself. Prime places to check are the two cables between the controller and the drive, and the the four wires that run from the power supply 'to the drive. Look in the HD-DMA Technical Reference Manual for illustrations on how these cables are connected. The second type of problem occurs after the drive has been formatted.. After displaying the message "Checking ,format ", the formatmw program attempts to read every sector on the 4isk. If there are any problems, a report is produced stating the type of error, the track, head and sector number. This report is called the bad spot table. Unless there are excessive bad spots (more than 128), this table will be written to the drive automatically. If, in the bad spot table report, there are many errors labeled as "Soft", you may wish to try to run the formatmw program a second time. Soft er~ors represent marginal sectors, that is, sectors that can be read after several attempts. The sectors with Soft errors are set aside along with the sectors that have "Hard" errors, "Hard" meaning . completely unreada-ble. Reformatting sometimes fixes Soft errors, so these sectors are not consigned to the bad spot table. 3.2 USING STANDALONE MICRONIX The Standalone Micronix diskette contains the Micronix operating system and the absolute minimum of the programs that are needed to install Micronix 1.6 on the hard disk. Trying to fit Micronix on a floppy disk isn't easy; besides, floppy disks operate at a much slower speed than hard disks. You don't want to, or need to, use the Standalone· Micronix floppy disk except for special occasions. As soon as you can, make a backup copy of the Standalone diskette and stash it away in a safe place. (See Copying Micronix Diskettes, Maint. and Adm.). There is one other thing we need to mention about the Standalone Micronix floppy diskette: it should be write-protected when used. 5 1/4" floppies should have a write-protect tab, while 8" floppies should have a no tab in place. The Standalone diskette you received will already be write-protected. Write-protection will prevent you from inadvertently damaging your precious Standalone Diskette. (The ability to write-protect Standalone Micronix diskette is a feature added with the release of Micronix 1.61). 23 Insert the "Stand Alone" diskette for Micronix 1.6 into the floppy drive ,and press Reset. Your Decision is now primed for action. Your display should now be: Booting micronix.mw Micronix 1.61 Copyright 1983 Gary Fitts· 256k memory 14 cache blocks 20 processes disks: djdma hddma root dev: djdma/76 swap'dev: nodev/O Root' d~vice is Read-only Welcome to Micronix. The stand-alone floppy system that you are now running is designed to initialize your hard disk, and to perform surgery on it if necessary. Please do not attempt to run multiple users,yet. To initialize your hard disk: IF YOU HAVE an mS with the HDDMA controller an m10 with the HDDMA controller an m16 with the HDDMA controller any drive with the HDC controller TYPE source source source source mSinit m10init m16init hdinit Then boot micronix from the hard disk. If you have any questions, please read the installation section of the Micronix User's Manual. Note: All standard Micronix configurations will include controllers instead of HDC controllers. HDDMA If eve·rything went Okay, does this all look familiar? right, you should have seen the lines above displayed on your terminal. We'll give a quick explanation of these lines mean. Booting means that the program that starts Micronix has been read sucessfully. If your Stand Alone diskette is unreadable, you will never get the message "Booting". Make certain that you have inserted the diskette correctly. The booting program next tries to load the file micronix.mw. If this fails, the message "BAD LOAD" will be displayed. You may want to try again, because if you can't load this diskette, you'll need to acquire a replacement from your dealer (or Morrow). The next line displays the release level of Micronix, 1.61 in this example, and a Copyright notice. 24 After the Copyright notice, the next six lines give a report on the system you are using. The report for your system will be different than this one if you are using more memory, the HDC controller, etc.. The last line of this reP9 rt states: "swap dev: nodev/O". In English, this line is telling you that your swap devic~, used for .swapp,ing bet~een use,rs, is no device at all. So don't ever type the word "exit" (which causes Micronix to become multi-user) while you are using StandAlone Micronix, or you'll find yourself swapped out into space! Now, on to business. The message beginning "Welcome to Micronix ••• " should still be on your screen., It states the same warning as in the paragraph above (do not attempt to run multiple users). In fact, you don't want to do anything until your hard disk is ready. Just follow instructions. Next to "II", type: 'source m5init for 5 megabyte miniwinc~esters, source mlOinit for 10 megabyte miniwinchesters, source m16init for 16 megabyte miniwinchesters, or source hdinit for any hard disk using the HDC controller. This is the single software command that you use to initialize your hard disk. The source program works something like CP/M's SUBMIT program. The source command expects the name that follows it to be the name of a file containing other commands to be followed. And, indeed, each of these four files, m5init, ml0init, m16init and hdinit, contains the necessary commands to prepare your particular hard disk. Once you have pressed , the process of initialization is automatic, and takes about 30 minutes to complete. Presuming that you have successfully formatted your hard disk just previously to this, everything will happen automatically. If you get any errors during this process, you should proceed with these instructions anyway, since almost all of the files on the Stand Alone floppy are duplicated on the distribution volumes that you will now install. 25 3.3. BUIlJ)l~G A SKELETAL MICRONIX While you are waiting for initialization to complete, we thought you might appreciate an explanation of wha"t's happening. So here goes. (Most of the commands used during initialization are explained' in MAINTENANCE AND' ADMINISTRATION, so the descriptions here are brief arid not detailed.) mkfs systemthis command adds make a file organization to your recently formatted hard disk; specifically, mkfs writes the information . necessary for an empty Micronix file system to your hard disk. This takes about a minute. badspots copies th~ bad spot. table from 'the hard disk to a file that is used by fsck in the next step. fsck file system check- this command is the very effective file system repair and maintenance program. It checks the new file system for any errors, and fixes them if it finds arty. (You should use this daily.) The fsck command is used here with the "-t" option, which means that fsck will "test" every sector in the file system. This takes from 15 to 25 minutes. era mount erases files. mount a file system- mount is used to add, in this case, the new file system on the hard disk to the file system on the Stand-Alone floppy disk. chmod change file access mode- adjust the access permissions for the new file system on the hard disk. cptree copy directory trees- copies groups of files from one part of a file system to another; in this case, from the floppy portion to the hard disk part of the file system (remember, mount added the hard disk's file system to the Stand-Alone floppy file system.) Takes about 3 minutes. In link names together- a way to have two (or filenames for the same file. ddt dynamic (machine modifies the hard the hard umount unmounts file system- finishes writing mounted file system before it is removed. more) disk tool- allows the editing of object code) files; this particular command the file "micronix" so that Micronix uses disk instead of the floppy disk, and adds disk as the swap device. 26 to the echo simply echoes whatever follows it. sync synchronize- force all disk buffers to be written to 'the disk they belong on. Sync is ALWAYS used before turning off Micronix. You have read up to this point t but the system has not completed initialization. Great! This gives us a little more time to talk about "sync". Do you remember any of the old war movies, where the sargeant looks his men in the eye and says: "Ready? Synchronize your watches ••• NOW!" The idea was to set all of the watches to the same time so that if anyone was late he couldn't blame his watch. Synchronization is a little different with Micronix. What is synchronized in Micronix is sectors in memory with the same sectors on disk. Any operating system uses some memory as a temporary storage place for information to be read from or written to disks. Micronix, as a matter of fact t has room for 14 such places (remember the "14 cache buffers" report during the loading process?). Besides the cache buffers, which are used for data, Microriix also keeps information about the file system and open files in memory. This speeds up the operation of Micronix a lot, memory being much faster than disks. This also means that the information in memory can be changed without changing the corresponding information on disk. So, sync forces all the buffers and information in memory that have been changed since the last sync to be written to the corresponding plac'e on the disk. Then t memory and disk have been synchronized t that is, they are the same. Just imagine the trouble'you could have without sync! Suppose, for example, you had just finished writing a really tremendous resume', or an encryption program the National Security Agency is sure to outlaw. In your excitement, you shut off your system without typing sync! Fudge! Great Jehosaphat! Even though the editor program said that it was finished writing, your file is still (or was still) in the cache buffers when you turned the system off. Too bad. There are other, even worse things that can happen if you shut down or reset prematurely. What if you are running multiuser? Suppose that you type sync, and then as you reach for the power switch another user makes a change on the disk? You want to be sure that no other programs are running. This is all taken care of by the down command. So please make it a habit to type II down before turning off the power or resetting the system. Note that down is rather draconian - it pulls the rug out from under everyone (but in an orderly fashion). For this reason, it only works for the super-user, who presumably knows how to warn everyone first (See TURNING YOUR MICRONIX SYSTEM ON AND OFF). 27 On th~ other hand, anyone can use sync at any time. The system itself does a sync at the end of every command, and also one every 30 seconds for good measure When running multi-user. When Okay. succinct message, the init'ia1ization ,process has completed, a Disk initialization complete. II [] will be displayed on your screen, fo11~)1ed by the "II" prompt. We are going to reset the system and load Micronix from the hard disk. What do you think you should do before resetting? Please type 41 down Micronix is down. [] After the' activity ,light on the floppy drive stops flashing, remove the Stand-Alone Micronix diskette and put the COLD BOOT LOADER, (CP/M) diskette back in, and reset with the reset button,or the keyswitch. You are now ready for the final stage of initialization. 3.4. BOOTING A SKELETAL HARD DISK MICRONIX The previous stage, initializing the hard disk, created a file syste'm and copied enough software to it to get things started. In this, the final stage, you will copy the rest of the software (and on-line documentati9n) that is a part of Micronix to the hard disk., But first, let's boot the hard disk. Booting Micronix-on the hard disk is essentially the same as booting the Stand-Alone Micronix floppy. After you have booted CP/M, use the boot command for your hard disk to load Micronix. The boot commands are m5boot mlOboot m16boot hdboot Loads Loads Loads Loads Micronix Micronix Micronix Micronix from the 5 megabyte miniwini from the 10 megabyte miniwini from the 16 megabyte minimini for the HDC disk controller In this example, we are booting a 10 megabyte miniwinchester with the mlOboot command. You, of course, should substitute the correct command for your hard disk. Type "m10boot m10boot Micronix Loader for the HD-DMA. Files: micronix Loading 28 and 'so on until the "II" prompt appears. stage three. You are now ready for 3.5 ADDING THE SOFTWARE The Micronix system on your hard disk has a bare minimum of software on it now. The remainder of the software is on the diskettes labeled Volume I,' Volume II, etc. You may also have diskettes labeled "Whitesmith's CIt or Pascal if you purchased them. Each of these diskettes are added to the file system by the use of a single software command, repeated for each diskette. The CP/M software (such as Logicalc and Personal Pearl) that was included with your system is installed with a different ,set of commands. Please remove the CP/M Cold Boot Loader diskette from the floppy drive if you haven't done so already, and insert the diskette labeled Volume I. This diskette should be write-. protected, as it is your master copy of the software. These diskettes, (the Volumes), contain a portion of the Micronix software in fp format. The software command you need to type is source finstall . After typing it, your display looks like II source fins tall x bin x bin/form x bin/date "beep! ., 11 [] Copying Volume I takes about 3 minutes and is done by the commands in the file finstall, which stands for first installation. If you remember from the last stage, the source command takes the name that follows it as the name of a file with commands to be executed. The finstall file has a command that extracts files from the volume (fp x). The last line in finstall will echo a "beep" to your terminal to signal completion. When the first volume is finished, remove it and insert the second volume. This time type /I ! s source fins tall x bin/ddt x man/manl/account.l "beep!" /I [] The "!s" is shorthand for lire-execute the last command that began with sIt. The Micronix shell, the command line interpreter, remembers the last twenty commands you have used. 29 The only problems you may have during this stage will involve the floppy diskettes. The fp command may produce some error messages it it encounters difficulty while reading a diskette. ,This may result in enly a pertien ef the diskette being cepied. For example, if fins tall has, treuble halfway threugh a diskette, yeu will get a message like x bin/wall Read errer block 280 en disk djdma/12 bin/wall: I/O errer x bin/upm In this example, the fins tall script failed to copy bin/wall. Semetimes there will be several unreadable files. Please cepy the names of the' files labeled with the message "I/O errer" sO' yeu can get geed copies frem yeur dealer or Morrow. iIf finstall can't read the diskette at all, message that is like yeu will get a # seurce fins tall Velume not in fp fermat. "beep!" II [] Yeu may want to' remeve the diskette, and reinsert it and try again. Make certain that yeu are inserting the diskette cerrectly. If the diskette is unreadable, yeu can try to' get a replacement frem yeur dealer er, get ene frem Merrew. After each velume has been cepied, remqve it and insert the next velume, until all diskettes have been cepied, including "c" and Pascal if yeu have them. The same cemmand, nls" fer seurce finstall, is used each time to' sta~t the cepy. Each diskette will take between three and seven minutes to cepy. If yeu are an experienced Micrenix user, yeu sheuld run the fsck cemmand after cepying the last diskette. Fer the majerity ef yeu, the next sectien explains hew to' run fsck, and will familiarize yeu with Micrenix. 30 4. FIRST TIME USE OF MICRONIX ----- -- - ---- This chapter of the INSTALLATION division explains what you should do the first time you use Micronix. We will ask you to run one more check, then give you a tour of the file system. During the tour, you will be provided with the commands for movin~ about the. file system on your own, and a map of the f~le system to help you find your way. The div.ision of the manual, MAlNTENAHCE AND provides in':"'deptp. explanations of how the file system check program works, how to format and copy diskettes and how to back up the hard disk. By the time you have finished installing and checking ,.Micronix you may have had enough of computers for the day. However, you should start backing up Y9ur hard disk the same day as you start creati~g files of your own on it. So don't delay reading and using the section ,on backing up the hard disk. nex~ ADMINISTRATION, 4.1. CHECKING THE FILE SYSTEM Possibly you are a little tired of all the checks you have run on your system. Well, the check you are about to use is the one that you will use every day to ensure the health of your file system. Let's get it started at once, an~ you can read the explanation while it runs. Type # fsck /dev/root and read on. Having a system programmer on call to repair your file system would be quite an expensive luxury. Instead, the file system. check command is your ,system programmer simulator. The fsck command explores the entire data structure that makes up a file system, checking for damage using the knowledge and experiance of the system programmer that wrote fsck. You see, the Micronix (and UNIX) file systems are made up of several parts that cross-reference one another. By comparing the references in one part of the file system to the other parts, the fsck program can determine if all the references are consistant with one another. If references in parts of the file system disagree, fsck corrects the differences by repairing the file system. Often, this repair work will be unnoticable to users of the file system. Occasionally, fsck will discover damage to a file or files. When this occurs, a report of the damaged files, called "fsck.victims", is created that contains the names of the damaged files and the nature of the repairs made to them. 31 There are two ways a file sy~tem can become damaged: through a hardware malfunction and by shutting down the system improperly. A hardware malfunction that damages the file system involves an error irlwriting to the disk, or the loss of one or more sectors on the hard disk. 'Shutting down the system improperly"occurs'-wneii tliepower-'Is'turrie-d---6ff'~' or'lost-'suddenly', while a program or disk access is in progress. ;While you may never shut off yoursyst~m improperly, you can't be certain that there won't be a power failure or 'that the hardware will function perfectly forever. This is one reason why you should run fsck every day. The other reason to make running fsck a daily habit is that small, minor file problems can grow and multiply if not corrected early on. Fsck can detect problems as subtle as a single block being ,claimed by two different files. It will attempt to correct the situation and will let you know the outcome. By now, fsck should'be finished. your display looks something like: If everything went well, . II 'fsck /dev/root Checking /dev/root Checking 'I-list, first pass ** Checking the free ,list ** Checking the I-list, second pass ** Checking connectivity '380 files, 47 special, 28 directories, 250 small, 100 large, 0 huge 30188 blocks, 732 I-list, 130 indir, 0 in2dir, 4502 data 4632 used, 24822 free, 0 bad II [] ** Some of the statistics reported on the last three lines may be different for your system. There are other lines that may have been displayed when you ran fsck. The free list may have been rebuilt, for example. The only case where you need to take action is if the line ** Hunting up filenames of casualties is displayed. The names of the casualties are also kept in the file fsck.victims. If you have any victims, you should,replace them from backups. (See Fsck.victims in MAINTENANCE AND ADMINISTRATION.) 32 One more note about fsck, before moving on. This time we ran fsck as the first step in exploring Micronix. In fact, running fsck is the first thing you should do every day, before anyone else is using the system. If any files are being used while fsck is being run, the files involved will be changing and fool fsckinto thinking that some damage has occured. In this ,case, fsck may cause the damage. You may use fsck only while in single user mode, or on unmounted file systems. - Mounting is explained later, but just remember: RUN FSCK BEFORE STARTING ANYTHING ELSE. 4.2. SETTING THE DATE The Decision that you' . are using has a clock in it that will need setting every time the system is turned on. The clock supplies date and time information for the file system. Files in Micronix keep a record of the last date they were modified, which can be used to select files for backup .on a basis of when they were last changed. The. only way this will work is if you remember to set the clock after running fsck. To set the clock, you simply type "date", followed by the date and time in the requested format. For example, to set the clock to 11:03 a.m. on April 14, 1983, you would type /I date apr 14 1983 11:03 Thu Apr 14 11:03:41 1983 1/ [] The clock in the Decision is a 24 hour clock, so ,that 2 :00 p.m. is represented as 14:00. To convert an afternoon or evening hour to the 24 hour clock representation, add 12 to the hour. For example, to reset the time of the clock to 4:12 p.m., you can type 1/ date 16:12 Thu Apr 14 16:12:41 1983 /I [] The date command recognizes the different parts of the date through the use of hints. For example, one or two digits followed by a colon C:) means the time of day. A one or two digit number preceded by the first three letters of a month is expected to be the date. A four digit number without a colon is considered to be the year. So, the hints are: a colon in the number means time, the first three letters of the month means a date, and a four digit number without either of these hints is the year. Here are a few examples: /I date date /I date /I date 11 dec 31 23:59:59 1983 17:00 1984 apr 1 33 -the last -sets the -sets the -sets the second before 1984 clock to 5:00 p.m. year to 1984 date to April 1st The date Notice that you never specify the day of the week. command will always know which day it is, if you provide the date. 4.3. MOVING AROUND THE FILE SYSTEM Now that you've taken care of some de·tails, . how would you like a look around?· One of ,the nicest features of the Micronix file system. is that it allows the use of mUltiple directories. Each directory can have a· name that relates to the files that are kept in that directory. .This helps you to organize your hard disk, and may help you in remembering where you have left certain files when the file system gets large. To help you get a feel for file systems, we would like you to visualize a group of rooms. In each room, there are file cabinets and doors which lead to other rooms. The file cabinets and the doors all have names on th(am. The file cabinets in this analogy represent files, and the rooms represent directories. The dOQrs that lead to·other rooms are the pathways to the other rooms, that is, di.rectories. In the discussion that follows, the words "room" and "directory" will be used interchangeably. There are three commands that will assist you in around the file system, and visiting different rooms. commands are: moving These cd change directory, lets you move between rooms, dir directory list, lets you see what's in a room, and pwd path way to directory, tells you what room you are in. Whenever you enter the Micronix file system, you start out in the room that is determined by your user name.· During this first visit, there is only one user name available and it is "root". Later, you can add other user names. The root directory is the beginning of the file system. The doors in this room, in other words, lead to the rest of the file system. Let's take a look around by typing dir . II dir a badblocks bin II cpm dev etc f fins tall lost+found micronix tmp usr [] Most of the names in this directory are probably unfamiliar to you now except for micronix, and possibly finstall. As it turns out, micronix, fins tall and badblocks are the only files in the root directory. The rest of the names are the names of other directories written on the doors. Visualizing this room, the root directory looks like: 34 a o I I I I I I I etc o I I I I I I lost+ I I found I I I o I I r I I I cpm I usr I bin I dev I I I I I o I I I I I micronix I ==== I I I I I I o I I I I o I I I I I I I I I I fins tall ==== o I I I tmp I o I I I I I I I I I I I f I I I I I I I o I I I I I I I I badblocksl ==== I I +----------+ +----------+ +----------+ I I I I I I To save us some timet we will tell you that there's nothing behind some of the doors. The tmp directory will be used later for temporary files. The lost+found room is used by fsck as a place for keeping "orphaned" files and directories. The "a" directory will have user directories branch off from it. The "f" directory is set aside for adding file systems on floppy disks to the hard disk file system with the mount command. Before we leave root t you should become aware that the root directory has an unusual name. If you type pwd t you can see root's pathname. Pathnames are ,the sequence of doors that you must go through starting at "root" and ending at a particular file. 1/ pwd / II [] The slash (/) ,by itself represents the root directory. You will see later that this slash is at the beginning of all other full pathnames t as the root is the ancestor of all other files and directories. 35 4.3.1 The BIN Directory Now we are going to walk through the door labeled "bin" and visit the Ibin directory. The command, II cd bin II [ ] moves us there, and /I dir account badspots cal cat chars chmod clean cmp comm cp cptree create cu cxr dar date dc dcheck ddt df diablo diff down du echo edit far fd'j field file find form fp fsck grep 'group hd hel,p icheck 'kill last lines In login lpr Is mail make man mkdir mkfs mknod 'more mount msgs mv ncheck netact rietcp netdaemon -netmail od owner passwd paste pilot print ps pwd recon rm rp sh sleep sort split stty su sum tail td 'tee touch tree tty umount unique update upm wall wc who word write gives us a look around. Quite a lot of files here, eh? The bin directory contains most of the Micronix commands in the form of files. In fact, the name "bin" refers to binary (executable) files. Some of the files here may look somewhat familiar. For example, the date command is near the bottom of the first column, a~d fsck is near the bottom of the second column of filenames. Sbme command names are pretty cryptic, while others are actually English words related to the action of the commands. Later, you will be given the knowledge of how to create "aliases" for the command names that you'd like to change. 36 4.3.2 The DEVICE Directory Let's move on to another directory. We are currently Ibin, as shown by using the path way to directory command: in 11 pwd Ibin 11 [] We want to go through the door in the root room labeled "dev" , but currently we are in the room behind the door labeled "bin". If you use the change directory (cd) command from here 'with the name of the "dev" door alone, it won't work: II cd dev dev: no such file or directory /I [] It looks like "dev" isn't there, but that is only an illusion caused, by looking for the dev door while were visiting the bin room. What you need to do is specify that you 'are looking for the door to dev from the root room, named slash (I). To do this, you use the change directory (cd) command and specify ,that the dev room is fo~nd by starting at the root: II cd Idev /I [] This works because we spelled out the path way to the directory that must be followed: starting at root (I), look for dev. More on path ways to,directories later. Let's examine the dev room. 11 dir centO centl cent2 cent3 console diabO diabl diab2 diab3 fla /I [] fIb fIe fld hda hdb hdc hdd io ml0a mlOb mlOc mlOd mI6a mI6b mI6c m16d mSa mSb mSc mSd mem mfa mfb mfc mfd null root swap ttyA ttyB ttyC ttyD ttyE ttyF ttyG ttyH ttyI ttyJ ttyK ttyL The device directory is filled with the names of the devices used by Micronix. For example, console is the first terminal device, ttyB is the second terminal, ttyC,is the third terminal, centO is the first centronics type device, and m16a is the first miniwinchester of 16 megabyte capacity. All the files in dev are called special files. Each file has, instead of data, two numbers that refer to the software driver for the device built into the Micronix operating system. Information sent to the file Idev/~tyC is routed through the 37 driver to a device, for example, a printer, by Micronix. Don't worry if "software driver" is a foreign phrase to you. You won~t be tested on this. So, you could say the the /dev room is the place in the file system where the connecti-ons to the devices, like terminals and hard disks, are found. Let's move on to the /etc room. 4.3.3 The ETC Directory It - is easy to remember the name of this directory by Files that are used in thinking of it as the "et cetera room". system administration are stored here. Let's move into /etc and look around. /I cd /etc II dir banner group init II [] motd mtab netmap passwd rc signon terminals ttys utmp The files in /etc are all text files, except for init. For example, the passwd file contains user names and their encrypted passwords. The group file contairis similar information about groups. Motd stands for message of the day. You can type out motd by typing the command: /I type motd You will later edit the motd file to display reminders or inspirational 'quotations to yourself and others as users log in. The signon file contains the message that appears on the console after a system reset. The banner file is an interesting one. Take a look at it by typing II type banne r The division of this manual called MAINTENANCE AND ADMISTRATION has more to say on editing these files. 4.3.4 The USR Directory The acronym "usr" stands for "user service routines". routines as What's actually kept there aren't so much directories. Let's take a look at /usr: II cd /usr II dir adm bin /I [) spool upm man pub Immediately, the "bin" entry looks familiar. Don't confuse this bin directory with the one described earlier though. This brings 38 up an important point: You can have two files or directories with the same ~me. so long as they aren't both at the end of the same path. for example t you could have two files named "john" 011 the system. in different directories such as la/john and Ib/john. The /usr/bin directory contains more executable binary files. The adm directory is used by Micronix as a storeplace for login times. The pub directory contains only on~ file: a table of characters and their ASCII equivalent in octal and hexadecimal. The spool directory is used as a temporary storage place for print spooling. Spool is also used by the mail and networking programs. The upm directory is used by upm for terminal emulation information. The man directory leads us in the direction of a vast repository of information. Change directory to man and take a look: /I cd man /I dir manD manl /I [] man2 man3 man4 manS The man directory contains 6 subdirectories. Each subdirectory has files for all the pages in a section of the manual. The man command t as in MANual, accesses these pages, so that information about all Micronix programs, subroutines, system calls, devices and files are on-line and readily available. The help command uses these same files in the man directory. While we're here, let's examine the path way to the man directory. We started at the root, I, changed directory to usr, and changed to man. So the pathway we wind up with should contain each of these names, I, usr and man. And, indeed it does: /I pwd lusr/man II [] The initial slash (I) stands for the root directory. The second slash is a divider between subsequent directories. If we had changed to the man2 subdirectory of man t the path way to directory would be lusr/man/man2. You can visualize getting to man 2 as starting in the root room, walking through the door labeled usr t going through the door marked man, finally into man2 room. 4.3.5 A Map Of The File System At the beginning of this tour t we promised a map of the file system. After you have used the Micronix system for a while t you will become familiar with the various names and path wayst and won't be needing a map. For now, here is a map showing the file 39 system as it currently exists. +--~--+ +-----+ I I I I bin 1 I a -+-+- +\ 1 +-----+ +-----+ I 1 f l 1 etc I I I 1I -+--------+- I -+-+- -+ \ root micronix, finstall, badblocks \ -+-+- +- I I -+--------+- -+-+- -+ 1 1 I 'llost+1 1 I~_ \ dev I 1 tmp 1 1found \ I spool usr adm I -----1 __ I +-----+ +-----+ +-----+ 1---- . I~_ upm 1 bin I -----1 1----- +------------------------------+~ I +-+- I -+-+- I I man -+------------+ I -+-+- -+-+- -+-t- I I I I I I I mana 1 I manl\ I man21 I man3\ \ 1 I man41 -+-+ I I manS \ +-----+ +-----+ +-----+ +-----+ +-----+ +-----+ You can add new files and directories where you like to the root, or any other directory. The initial path ways to these directorie.s are important, however, so don't go renaming "man" to "manuals", or "bin" to "commands" because you will make these directories impossible to find for the.prQgrams that;know where they are now. 4.4 ADDING A PASSWORD FOR ROOT You are now approaching a momentous occasion: you are about to add some security' to your Micro~ix system. As the system stands,' anyone can become the root by resetting the system and booting Micronix. The root is also known as the superuser because there is absolutely no protection from the person logged in as root. The root user can examine any file, or remove any file. The reason for the root's power of unlimited access is that a user must exist that cart access all the files for backup, or to use fsck. You can easily prevent this unlimited access by using the passwd command to install a password for the root. Once you have installed a password, you will have to remember what it is because you will use it every time you reset the system or log in as root. If you ever forget or lose the root password, you will have . to "operate" on the passwd file from the Standalone Micronix disk and remove the root's password. Okay. Let's choose a password for root.. You should probably write it down, and keep it someplace safe. Suggested passwords are nonsense words, or, even better, combinations of letters and numbers at least eight characters long. As an example, let's use "az804me2". 40 1/ passwd New Password (or RETURN fQr no password): Once again to be sure: 1/ [] The characters "az804me2" were typed after both colons in the example. The passwords you use will never appear on the 'screen for security reasons. The reason for typing the password twice is to check that you typed it correctly the first time. 4.5. GOING MULTIUSER The transition from single-user to multi-user Micronix very simple. Just type is 1/ exit and press ml0boot and Micronix will begin loading from the 10 megabyte hard disk. If you have installed a password on the root, you will be required to log-in as root and use the password. After logging in, there are two thing.s to do: o run fsck on the /dev/root device, and o set the date. Both fsck and date have been explained previously. It is possible to load Micronix without using CP/M. Reading the section in MAINTENANCE AND ADMINISTRATION about' the SYSGEN command will explain how to create a diskette that loads Micronix directly. 43 5. CONNECTING THE PRINTER Before you attempt to connect a printer, please finish the rest of the installation procedures for Micronix. If you are successfully running a multi-user Micronix, you are ready for printer installation. Micronix and the Decision come equipped to handle four types of .printer interfaces. The interface refers to the physical connection, the cable, between the· printer and· the Decision. The interface also refers to the method used by your printer to stop the transmission of characters to be printed when it gets behind in printing, and how it restarts transmission. This is called handshaking. The four types of interfaces are: 1. Serial printers handshaking, (or "RS-232") with 2. Daisy-wheel printers standard interfaces), 3. 'Serial printers with hardware handshaking, and 4. Parallel printers with centronics-style interfaces. with 50 pin X-ON and cables, X-OFF (Diablo If you have either the first or second type of printer, you're in luck. You can skip the rest of this section and start reading PLUGGING IN THE PRINTER. If you don't have one of these two types, or are unsure of which type you are using, read on. With parallel printers, the handshaking is built into the parallel interface. Serial printers use either software handshaking or hardware handshaking. Software handshaking means that when the printer's buffer is full it sends a character to the computer to stop the computer from outputting more characters. The printer sends a different character when it is ready to receive again. The character that Micronix recognizes for stopping transmission is X-OFF. Other aliases for X-OFF are control-S, DC3 and 13 hex. The character that restarts output is X-ON, also known as control-Q, DCl and 11 hex. If you have a serial printer that doesn't use X-ON and X-OFF, for example, it uses ETX and ACK instead, . you'll have to try hardware handshaking. Hardware handshaking makes use of one of the wires in an RS232 cable to start and stop output from the printer. When the printer wants to stop transmission, it lowers the voltage on this . wire. To continue transmission, the voltage is raised again. If your printer uses hardware handshaking, please read the section on cables in the DEVICES section of the Micronix technical manual because, unfortunately, there is no such thing as a real life standard for either printers or computers. Hardware handshaking between a printer and the Decision will probably require modification of the RS-232 cable. After modifying your cable, read the next section, called PLUGGING IN YOUR PRINTER. 44 Parallel printers using Centronics-style interfaces will also need to have a special cable made for the,m. P~ease read the section on cables in the DEVICES division, or buy the cable from Morrow then return to the next sectiQn and follow instructions for parallel printers. The software for handling Centronics interfaces is built.into Micronix. 5.1. PLUGGING IN YOUR PRINTER Okay, here's where you'll need to be able to see the back of your Decision again. There are probably two unused connectors of the type you need on the back of the Decision, so it will be much easier to be able to see what you are doing. If you are using a serial printer, the connector you need is just like the one the console is connected to: a trapezoid (like , a D lying on its rounded part) ,that matches the end of ,the RS-232 cable. The console is connected to the rightmost of' three connectors, looking at the Decision from the back; you should connect the serial printer cable to the LEFTMOST connector., The connector in the middle is reserved for a second user. There is a diagram of the Decision back panel on a green page at the beginning of INSTALLATION division of the User Guide. For those of you with parallel printer cables, you need the 50 pin connector immediately above the serial printer connector. There, are two 50 pin connectors on the back of y,our Decision; the upper one is for connection to'an 8" disk ,drive. Obviously, you will connect your printer to the lower one. The 50 pin connector is not "keyed": that is, it is quite possible to plug in your parallel cable upside down. Well, read on for some guidance. On many cables, pin 1 is labeled by having a red stripe on that edge. Or, if you constructed your own cable, you should know where pin 1 is. The 50 pin connector on the back of your Decision has pin 1 on the left hand side when looking at the back of the cabinet. Plug the parallel cable into the Decision with the red stripe, and pin 1, toward the left (while looking at the back of the Decision). Parallel printer cables that are built by Morrow have an additional way of telling you which way to plug the cable in. The red stripe will be on the left from the back AND the cable will hang down without covering the connector. So, if you put the connector on upside down, the cable will be folded over and cover the connector. Install the connector so that the cable hangs down without obscuring the connector. 45 5.2. TESTING YOUR PRINTER Everyone' have your printer connector plugged in? Turn the printer ON, make sure that it is ON-LINE, and we'll try it out. (There are several different expressions used for "on-line" by printer manufacturers. Most often, though, there will simply be a switch labeled online, and usually a light will go on to indicate on-line status.) There are three different test comone for serial printers, and two for mands for printers: parallel printers. The differ~nce between the commands is in the way ~he device is named. For serial printers, set the printer to 1200 baud, and try typing . % echo A > /dev/ttyC If your printer can't be set to 1200 baud, you can try this command anyway, but, at best, you'll get the wrong letter. The next 'section explainS how to change your baud rate. Skip ahead, change your baud rate, and tryout the Jlecho" command again. Fo~ parallel daisy-wheel printers, try % echo A > /dev/diabO and for Centronic style 'parallel printers, use % echo A > /dev/centO Everybody get an "Alt on your printer? Those of you who got an "A", get an'A in interfacing, and should start reading the next section, ADJUSTING MICRONIX FOR YOUR PRINTER. For the rest of you, interfacing printers IS non-trivial. Just in case our problem is a trivial one, please check to see if: o your printer is turned on (and plugged in), o the printer is set to ON-LINE, o there is paper in it (many printers won't print unless they can sense a piece of paper in them; the same is true for printer ribbons), o the cable is plugged in at both ends (at the correct connector; re-read. the beginning of this section, please.) If you have a parallel cable, you can also try plugging it in upside down. After trying all of the suggestions, try the suggested command again, please. If you get a different letter than an "A", there are some wires scambled in your parallel cable, or your serial printer is set to the wrong baud rate. If none of these suggestions helps, your cable is suspect. Home built cables should be rechecked and store bought cables checked for fl~ws. RS-232 cables, whether home-made or 46 purchpsed, can be checked by using them to replace ,the cable connecting your console. Parallel cables can be checked for continuity using an ohmmeter or continuity tester. It is possible that other problems with your printer will surface later.' The most common 6f these-is missing letters or words after several sentences, or even many lines, have been printed successfully. When this happens, it looks like everything is going great, until the printer starts pounding out nonsense. What has happened is this: Your printer has a small buffer built into it that stores letters until they can be printed. If the letters are received slightly faster than they can be printed, everything works well until the buffer gets completely full. Then the printer signals the computer to stop sending by way of handshaking, but the handshaking doesn't work. The garbled outp-ut is the result of the handshaking' not working, and being hidden because the printers buffer can almost keep up. When you received some correct letters and/or words, the problem is the handshaking. Handshaking is the most common difficulty faced by owners of new printers or systems. If handshaking is your problem, you have two choices available: try to solve your handshaking puzzle, or reduce the baud rate at your printer and Micronix. It may be that your cable has one wrong wire that a diligent search will uncover. Then a~ain, reducing your baud rate may turn out to affect the speed of your printer very little because it was accepting characters much faster than it could print them anyway. 5.3. ADJUSTING MICRONIX FOR YOUR PRINTER If- you have a, serial_ printer with software handshaking operating at 1200 baud, you can forget this section and go on to USING YOUR PRINTER WITH MICRONIX. For the rest of you, the changes you need to make are simple. The file that determines which printer port and handshaking to use is called /etc/ttys. You can either use the recon program or edit /etc/ttys. The recon program is pretty much self-documenting. All you need to do is type "recon" while you are logged in as root. We will edit the /etc/ttys file so that it agrees with the type of printer you are using and you can see what it is that recon does. (There is an example of using recon in the section on Additional Printers several pages ahead, information on recon in the Terminals section of MAINTENANCE AND ADMINISTRATION, and more information on /etc/ttys in the reference manual in the Files division.) Please ~og in as root and type /I edit /etc/ttys The editor responds with the number of file, and a colon (:) prompt on the next tible diskettes are hard sectored, with tored means that there is a hole punched marking the beginning of each sector. 47 lines in the /etc/ttys line. North Star compaten sectors. Hard secin the diskette material There is also an extra hole that marks the first sector. Micro-Decision diskettes are soft sectored. Soft sectored diskettes have only the single ,hole that marks the first sector. by You can check to see if a diskette is hard sectored or not looking through the e ttyC 300 lprlst shake finish with a dot • write out the file :w "/etc/ttys", writing 14 lines :q q~it II [] Easy enough. Now, Micronlx has been configured to use a 300 baud serial printer with hardware handshaking. If YQU make a mistake while typing, the backspace key (or leftarrow key) lets you bac~ space over the error. If you feel like you may have °really messed up, do not enter the write command (w), but enter q! instead and start allover. ' For those of you with parallel printers, you will be changing a line in the file, and removing the worqs "lpr" and "1st" from the serial printer line. If you are using a daisy-wheel printer, you are changing a line beginning with "diabO". For centronics-style printers, the line begins with "centO". The following script assumes you are using a centronics so substitute "diabO" for "centO" if you are need to. Begin with the edit command given above. find the lpr entry :/lpr/ ttyC 1200 lpr 1st :c ttyC • :/centO/ centO :c centO lpr 1st change the line period finishes change find your printer change it by retyping the line a dot ends the change write the file :w "/etc/ttys", 14 lines :q % [] quit That's it. You have modified Micronix for use with your printer. Unless you had to make your own cable, it was a pretty painless process, wasn't it? Now, for the moment of truth: let's see if it works. NOTE: Those of you that are using daisy-wheel printers and the diabO interface should read the entry in the Programs section for diablo. The diablo program provides the extra control codes required for micro-justification that parallel daisy-wheel printers require. 48 5.4. USING LPR, THE PRINTER COMMAND When we first tested your printer~ we used a command~ "echo", and directed its output directly to the printer. In Micronix~ all output directed to the file with the name of your printer interface (/dev/ttyC, /dev/diabO, or /dev/centO) will go directly to your printer. The problem with this is: what if two people try to use the printer at the same time? The answer is that both people get to use the printer simultaneously and the result'ing output is a real mess. The lpr program provides a solution to this problem. The lpr program copies files to be output to a sp,ecial directory called /usr/spool/lpr. Many people can be using the lpr program simultaneously because it copies each person's output into a separate file in the /usr/spool/lpr directory. And, if there is no printing going on at, the moment, lpr awakens a daemon. The daemon handles printing out the line (queue) of printer ,files ,one at a time, allowing you to go onto something else instead of waiting for the printout to finish. The lpr daemon is assigned to printing out the files in the /usr/spool/lpr directory. The lpr program always checks first to see if there is already a daemon awake, so that there are never two lpr daemons around at the same time. Once a daemon is awakened, it functions as a process independent of any user or terminal. It is as if there were a ghost in the machine that handles printing. When there are no more files to print~ ,the lpr daemon goes back to sleep. The changes that you made in the file "/etc/ttys" inform the lpr daemon which printer interface to use. Let's make a test of your changes to /etc/ttys, by printing it out using the lpr. daemon. % lpr /etc/ttys % The second % prompt should appear before the file /etc/ttys starts printing. This is because the daemon works independently of the lpr command that you type at your terminal. As soon as the lpr command finishes copying /etc/ttys to /usr/spool/lpr, control is returned to you. The technique used with lpr is called "spooling". The name spooling refers' to using software for collecting printer output and passing the output along to the printer at a rate the printer can handle. The entry for the lpr command in the Programs section of this manual explains the options available with lpr. People using parallel daisy-wheel printers will need to use a different way of invoking lpr~ because they must add the micro-justification codes for their printers. To use lpr, you should type the line % type /etc/ttys I diublo I 49 lpr, 5.5 USDfG YOUR PI.INTER WITH CP/M The Micronix CP/M emulator, upm, is- configured so that output sent to the CP/M LST: device goes directly to your printer interface file (/dev/ttyC, /dev/centO, or /dev/diabO). For serial printers- this was already set up for you by the presence of the le-t ters"lst" oil. the t-fyC line in file / etc / ttys • Otherwise you put "1st" on the diabO or centO line yourself a page or two back. If you are the only user of the Micronix system, this may be acceptable. There are situations where you will use this LST linkup, such as using the PRINT command under WordStar. However, there will be times when you'd rather use the Ipr command for printing instead. As mentioned previously, if multiple users send output to the LST device at the same time, the printer will intermingle their words in the most avant garde fashion. Also, the printer users all have -to wait until the printing is finished before- sta-rting sODlething else. -The lpr daemon eliminates these problems. If you're not interested in using lpr and you are the sole user of a printer, you can skip this section. llowever, you should read the next section on configuring- WordStar. 5.5.1 Using LPR Wi-th' CP/M Using the lpr daemon from upm is a two step process. The first step is changing the connection made between the -LST: device and the ttys file entry for your printer. You want to change this so that your output for the printer is directed to a temporary file in your directory. Assuming you are in the- upm emulator (see upm in the programs division of the Reference manual), enter A)LST:prntfile NOW, -everything that CP/M sends to list goes into prntfile. To get the daemon working on printing prntfile, you need to temporarily escape from upm, and start up the daemon-. This is done by using the exclamation point (!) to escape from upm: A>!lpr prntfile This command sends the contents of prntfile to the printer's spooling file, where it waits for the daemon to get it printed. (The exclamation point causes upm to pass the command onto Micronix). The data is still there in prntfile, though, and if you send more stuff to printfile via LST, it just gets tacked onto the end of what's already there. So when you go to print it (by entering "!lpr prntfile") you'll reprint what you printed a little while ago. Sooooo. ., you have to empty printfile out before using it as the recipient of further LST: output. 50 Typing this more listing: command empties prntfile and prepares it for A>LST:prntfile This is basically a return to step one. The command empties the contents of prntfile without deleting fts name from the directory. The next time you want to start the daemon again, go back to the second step, tI!lpr prntfile". 5.6 ADDITIONAL PRINTERS This section explains how to configure Micronix to use an addi tional printer. To make it e,asier on us, we will assume you are connecting a serial printer to interface /dev/ttyB. ttyB corresponds to the center RS-232 connector on the rear of the chassis, between the console and first printer connections. If you are adding a parallel printer, the earlier sections will provide enough information for altering the information in this section to fit your parallel-configuration, if you extrapolate a little. For example, instead of using ttyB, you would use centO for a Centronics style printer interface. The first thing to do is change the /etclttys file and add in the name you h~ve chosen for your new printer daemon. That's right, if you have two printers,' you can have a daemon for each of them, and they must have different names. We will use the name tpr for our second printer daemon, to keep it straight from lpr (our other daemon's name). This is the name that we need to add to the entry for ttyB, using the recon program: /I recon Micronix 10 configuration 1 2 3 4 5 Help Configure login terminals Configure printers Quit and ABANDON all changes Quit and KEEP all changes Choose 1 to 5 --) 3 At present, the printer configuration is - A printer called lpr is connected to parallel port O. It uses a Centronics parallel interface. - The default CP/M list device is the lpr printer. Do you want to make any changes? (y or n) --) y How many printers do you want to connect? Choose 1 to 9 --) 2 Please specify a name for each printer. The name is arbitrary, but it traditionally ends in 'pr'. There should be one printer named lpr • Name for printer number 1 --) lpr Name for printer number 2 --) tpr 51 Please specify the type of interface for each printer. The options are Serial, Centronics-parallel, or Diablo-parallel. Interface for the lpr printer (S, C, or D) --) C Interface for the tpr printer (S, C, or D) --) S Serial, printers require a baud rate. The most common are 110 300 600 1200 2400 4800 9600 Baud rate for the tpr printer --) 1200 Serial printers also need a handshaking method. The options are XON-XOFF and CLEAR-TO-SEND. Handshaking for the tpr 'p.rinter (C or X) --) C Finally, you must specify an 10 port for each printer. The options for serial printers,are ttyB through ttyL; The options for parallel printers are portO .through port3. Parallel port for the lpr printer --) 0 Serial port for, the tpr printer --) B Last but not least, you should specify a default CPM list device. Name of printer to use as LST: device --) lpr The proposed printer.configuration is - A printer called tpr is connected to serial port ttyB. It runs at 1200 baud and uses CLEAR-TO-SEND handshaking. A printer called lpr is connected to parallel port O. It uses a Centronics parallel interface. The default· CP/M list device is the lpr printer. Press RETURN to continue --) 1 Help 2 Configure login terminals 3 Configure printers 4 Quit and ABANDON all changes 5 Quit and KEEP all changes Choose 1 to 5 --) 5 II [] The handshaking options given here, XON-XOFF or CLEAR-TOSEND, correspond to software handshaking and hardware handshaking, respectively. If this isn't clear to you, reread the section on Connecting the First Printer. One more thing. The first time you invoke tpr, Micronix will still respond "Command not found". The secret is to try a second time. Micronix will rebuild its internal listing of commands (hash table) if a previously unknown command is invoked twice, and, of course, if it's really in there. 52 6. INSTALLING YOUR CP/M SOFTWARE One of the wonderful things about your Micronix system is that you can use most of the software that was developed for the CP/M operating system. The CP/M emulator, upm, creates an environment for CP/M programs that is almost indistinguishable from an ordinary CP/M operating system. (For details on how upm differs from "ordinary" CP/M, check the description of upm in the Programs section of the Reference Manual. It will also tell you how such CP/M details as disk drive assignments relate to the Micronix file system). Included with your Micronix system are several packets of diskettes which have CP/M software on them. These are essentially the same programs distributed with Morrow's CP/M systems. The programs include: o NewWora, the Mercedes-Benz of wordprocessing, o Microsoft's MBASIC (BASIC 80), o Micro Mike's baZic (Z-80, North Star compatible BASIC) o Logicalc, a financial modeling and .report generation package, commonly refered to as a spreadsheet program, o Personal Pearl, a database program designed for ease of use and complete management of data, and o Correct-it, a spelling correction program. You might also have ,purchased some of the Whitesmith software, such as the C programming language and Pascal. The Whitesmith's software is not. on CP/M formatted diskettes, . but should be added with the finstall' command. (See Chapter 3, Adding the Software). These software packages are not included on your hard disk when it is delivered mainly because of licenSing restrictions. There is an additional reason for not adding all the software packages to your hard disk: altogether, they would take over 2 megabytes of space on your hard disk. What you need to decide is which of these packages you are going to use. Then, you can copy and install the chosen ones on your hard disk. Of course, there is nothing to keep you from installing all of them aside from disk space conservation. Please peruse your documentation for the software packages and decide which ones you want. Except for the BASIC's which are combined on one diskette, each software package comes on its own diskette (or set of diskettes). Select the diskettes with the software you want to use in preparation for the next step. 53 6.1 Copying CP/M Diskettes to the Hard Disk The Micronix p~ogram for copying CP/M diskettes is named far (short for floppy archiver). The far program possesses a working knowledge of the layout of CP/M diskettes, and how to read and write them. The CP/M emulator" upm, does not know what to do with CP/M formatted diskettes (it uses the Micronix file system, which differs radicaliy from the one used in CP/M) so you need to use far to provide the interface between Micronix's file system and CP/M floppy disks. Your Micronix file system bas a directory set up for CP/M files t named cpm. There is nothing sacred or special about /cpm; it's just a convenient space for copying your software to. Later, you can move or copy files anywhere you want them.. . To get ready to copy diskettes, let's move into the /cp~ directory with the command II cd /cpm II [] Now that you're in position, insert a diskette that you'd like to copy into a floppy drive. The floppy disk drives are known by seve'ral names t depending on the drive type. Here are the three mos't common floppy drive device names: - 5 1/4" hard sectored diskettes, or MicroDeci~ion soft sectored, single or double sided, first drive mfa2 - 5 1/4" soft sectored, double-sided diskettes, nonMorrow formats, first drive, fla - 8" IBM 3740-formatted diskettes, also first drive mfa We'll consistently use mfa, since that's what most of you will be using, and expect the rest of you to substitute mfa2 or fla where ever we use mfa. The application software distributed by Morrow comes on soft-sectored 5 1/4" diskettes. (If you have an older Decision, you may need to upgrade the DJ/DMA with new PROMs so it can read soft-sectored diskettes). The command that current directory is: wil~ copy an entire diskette to your II far mfa -xv x BAZIC08.COM x ••• II [] The x option stands for extract files, and the v means "verbose" (that is, "Tell me what'S going on as you perform the copy.") This command will continue unassisted until the entire diskette is· copied unless your hard disk file system becomes full. If you get an out-of-space error, you will need to clean out your hard disk first. 54 You -can repeat the far command with each diskette that you want to copy to the hard disk. If it was the last command that you used, remember that you can use the shorthand form, If, as in II ! f far mfa xv lc.com x lc. set x ... II [ ] and the shell will expand this into the last command used (beginning with "fn) and extract the files from diskette. 6.2 that you the next Customizing Software Much of the software that is written these days is designed to be interactive., And, most of the terminals sold are somewhat intelligent, that is, they can move their cursor about, clear their screens, and maybe "even insert irt the middle of a line. Since there are so many degrees of intelligence and prec~ous little standardization in the codes they use, the terminal is what you customize the soft-ware for. Customizing software normally requires that you run an installation program that comes with the software to incorporate your terminal type into the software. You may also be asked to specify a printer model. We really can't provide information' about all the customizing procedures that exist. We would never finish the book about them, because ,the number of programs is constantly growing. What we will do is give you some hints' about how to customize your software for Micronix, and describe two program customizations in detail. Here are the general guidelines for running the installation programs: 1. You will find the programs in the /cpm directory, if that is where you copied the floppies to. 2. With the current distribution software, their names are nwinst.com for NewWord, lcset.com for LogiCalc, welcome.com for Personal Pearl, and kins.com for Quest. 3. Pick a terminal from the menus you see. Since upm has a built-in terminal emulator, you may be choosing one of these three: ADM-3a, Soroc IQ-120 or ADM 31. There is more information on terminal selection in the section on Terminal Emulation and upm. 4. If you are offered a printer driver menu, always select the CP/M LST: device driver. 55 5. If you are offered a printer selection menu, and you don't see your printer mentioned, you are always safe by 'specifying "TTY-like printer." 6. If you encounter a selection of communication protocols, answer "none", since this will be handled by Micronix. 7. If you are technically astute, there are usually many installation options that you can specify beyond terminal and printer type. Most of these have minor impacts on the operation of the software, and thus are not required. Refer to the manual for the software to locate these de,tailed options,. What you mustn't do is use special S-100 video boards and If an installation program offers custom drivers with Micronix. a custom terminal driver, you must ,reject the offer. The same goes for adding an I/O or video board of your own and adding a custom driver for it. Micronix jealously guards its privilege of handling lnput/output" and will quash any attempts 'to do it directly. (Actually, there is an illdirect way ,for doing this by using the io or' mem devices which will work i,Xl some cases • See the Devices section of the Reference Manual. You can also purchase a version of Micronix that allows you to add custom drivers, but it's for system progratmners only.) The same warning goes for printer installation. WordStar, for example, offers to patch in its own drivers for you. You must firmly refuse 'such ,offers because they won't work. Micronix has what' is ,called, an interrupt driven I/O system which is superior to the techniques that can be accomplished with a software only approach. Always select the LST: device for printer output. Some software packages expect that you will be using floppy disks, and will have to divide their package between two drives. Since you are using a hard disk this won't be necessary. What might be necessary is if you go out and buy software, you may have to dig into its manual and find out how to change the default drive specifications. The software that comes with the Decision has already been modified for this. When you become familiar with the workings of .upm files, you will see that there are advantages to having several versions of the same software package installed at various places in the file system. For example, if you have three users, each with a different level of terminal, you would have to run the WordStar installation program three times, creating WordStar command files in the /cpm directory with three different names. Or, you could put the command files into the users' respective home directories. Or, use upm's terminal emulation. 56 For more information, refer to the writeup on the upm program in the Programs section of the Reference Manual and to the section on .upm files under Customizing the Environment in the MAINTENANCE AND ADMINISTRATION division of the User's Guide (whew!). 6.3 Terminal Emulation and upm The upm program has the capability of emulating different terminals. A terminal emulator converts the control characters that your terminal and a terminal-configured piece of software use to communicate "special effects". These special effects are things like moving the cursor around, clearing the screen or highlighting parts of the screen. By converting control characters you can make several terminals all look the same for software. This may allow you to use the same configured version of software for all your terminals. Terminal emulation may also be of use to you if you have an unusual terminal that is not listed in software installation programs. You would simply add your terminal specifications to the Micronix file /etc/terminals, and upm will emulate one of , the more common types of terminals for ,you. Then, you install software for the terminal that upm is emulating. There are three different terminals that upm can emulate: an ADM-3A, a Soroc IQ-120, and an ADM-31. These three terminals represent increasingly sophisticated levels of terminal "intelligence". The ADM-3A,the least intelligent, can clear the screen and move the cursor., The Soroc IQ-120 represents the next level. The Soroc can do everything the ADM-3A can do, plus it can display characters in high or low intensity and has erase to end of screen and end of line functions. The most intelligent terminals have all the capabilities previously mentioned, plus delete and insert line and character functions. The ADM-31 has all of these capabilities and represents the "highest" level of terminal intelligence. 6.3.1 Turning Terminal Emulation On and Off Terminal emulation is activated by adding the terminal type to a line in the /etc/ttys file. upm notices that the ttys file has been changed, and searches for the line corresponding to the port that the terminal running upm is attached to. If this line has a terminal name on it, upm then searches the file /etc/terminals for the matching terminal. If there is no terminal name on the line in the ttys file, or a matching terminal in the terminals file, upm turns off terminal emulation. Terminal names are added to the /etc/ttys file with the recon program. The recon program displays the names of terminals in the /etc/terminals file, asks for the name of terminal connected to each login port, and adds the name to the line for 57 that port. If you examine the ttys file after using recon, would see that terminal names have been added after the "term=", as in ' ttyA 9600 login you word ter1tl=mor20 In this case, the terminal name is mor20. If you prefer not to use the recon program to add terminal na~es, you can .add the names yourself with an editor. Be careful not to leave a space between "term=" and the terminal name. The terminal name must be of the abbreviated mnemonic names' listed in the one /etc/terminals file. (See the ttys (5) section in the back of this binder). recon will also tell you Which of the three terminals (ADM3A, Soroc, or ADM-31) that upm will emulate. This is the . terminal .that you must install your software for. When you use terminal. emulation:--the control codes sent t~ the emulator must The emulator, in turn, be one of the three terminals emulated. translates these control codes into the ones needed by your terminal. This only works if you install your s.oftware properly. Just remembe.r' to install your software for the terminal that upm is emulating', as reported by recon. 6.3.2 Terminals File The /et~/terminals file contains the names and capabilities of the ._terminals tha t you will be using on your system. Initially, the. terminals file has only about twenty different terminal names in it, so you may not find your terminal in the file. The terminals file is purposely short in an attempt to reduce the time spent scanning through the file looking for terminal names and capabilities. Each terminal definition in /etc/terminals begins with an abbreviation for the name of the terminal. The abbreviated names of terminals are the ONLY items in/etc/terminals that begin in column 1,- the leftmost.column. After the abbreviation, the full name of the terminal may appear. On the lines that follow the terminal's name are the definition of the characters that communicate special effects. If your terminal name is not listed,. you can add it by following the directions given in the entry in the Reference Manual for Files, terminals (5), in the back part of this binder. An explanation of what terminal characteristics are required to qualify a' terminal at a particular level is also explained in terminals (5). 6.3.3 Upm's Notepad: The upmttyX File The process of checking files to see if changes have amount of time. In fact, the the longer it will take upm to the /etc/terminals and /etc/ttys been made takes upm a noticeable longer t~e /etc/terminals file is, search through it. To reduce the 58 time added by including terminal emulation. a special file is created for each login 'port when upm is executed. If upm finds this file and neither /etc/ttys or /etc/terminals has been modified more recently than this file.' then upm uses the information in this file for terminal emulation. This file is in the /usr/upm directory. and is named upmttyX, where X is a letter representing the port, for example. A for the console (upmttyA). If you do not have a /usr/upm directory, upm will never be able to create the special file upmttyX, and will take 10 seconds or so to start working every time. Once a upmttyX file has been created, upm will start working much quicker. If your file system lacks this directory, you can make one by typing # mkdir /usr/upm II [] upm will change the upmttyX file if it discovers that either the files /etc/ttys or /etc/terminals have been changed since the upmttyX file was created. This means that you don't need to signal a change in terminal type to upm because upm will always check for it. 6.3.4 EXAMPLE: Installing NewWord As an example of what to do when customizing a CP/M program, we will point out what you need to do to customize NewWord. The nwinstal program handles installation of NeWWord, and contains enough explanations to guide you through. And, if you need more help using nwinstal, you should refer to the NewWord installation manual (Nuts and B~lts), for assistance. We will quickly step through the procedure to point out the potential trouble spots. You begin installing NewWord by executing providing answers to the first two prompts: nwinstal and /I nwinst Copyright NewStar Inc., 1983 Name of file to install? nwu File to hold installed NewWord? nwl The name of the file to hold the installed NewWord is actually up to you. We suggest that you choose a name that reflects the terminal (or printer) that you are installing. In this example, we are using the name nwl to stand for NewWord installed for a level 1 terminal. (See terminal emulation). There are two things that you must do next: select your terminal, and select your printer. To select a terminal, enter menu selection A. A list of terminals will be presented. Either select your own terminal, if you only have one terminal, or select one of the three emulated terminals if there are going to 59 be several terminals. of terminal emulation. Please refer to the' previous explanation The next step is to select a printer. Menu selection B allows you to pick a printer. If your printer is on this list, all you have to do is enter the correct letter. If not, chose either the draft printer or the typewriter printer. Draft printers are not expected to have any special features; typewriter printers have the ability to backspa~e, whcih makes special effects, such as boldface print easier to print. NewWord always sends its 'output via the LST: device, so your modifications to Micronix will correctly handle printer output. At this point, you are finished with normal installation of NeWWord. We would like you to make a few more modifications at this point. Of course, you are free to modify other installable features as you see fit. There are five delays used by NewWord. We would like you to disable all of them by setting them to O. From nwinstal's Main Menu, sele7.,t Menu D. Then change the Short, M,edium, Long and Cursor Position delays to O. This will improve the performance of NewWord considerably for use with Micronix. The changes made to NewWord utilizing the nwinstal disable most of the internal timing used, by the program. Some of the best software available for CP/M was written to simulate multiprocessing on single processing systems. NeWWord is very good at this, but Micronix is, of course, better. If you have a program that allows two activities to occur simultaneously, such as typing'and printing, or typing and screen rewriting, you'll want to disable, if possible, the internal timing loops that drive these functions. Internal timing loops are short programs that run rapidly in a circle, simulating a stopwatch. The problem with this is you don't want to waste the power of your CPU by making it pretend to be a clock. Your Decision has a perfectly good clock in it already. Most of the timing delays required by a program will occur naturally as a result of multi-user Micronix's normal processing. If the removal of timing loop delays adversely affects the use of a program, put the needed one back. An example of a needed delay is the medium delay in NewWord. Without the medium delay, you will immediately be presented with a Help Screen whether you need it or not (unless you disable all Help). 6.3.5 ANOTHER EXAMPLE: Customizing Personal Pearl The Pearlsoft people want to make things as easy as possible for you. Unfortunately, 'there's no mention of an Ins tallation program anywhere in the manual. There is, however, on page ~, a mention of a "Welcome Disk". After looking carefully through 60 your packages of diskettes for a "Welcome Disk" for Personal Pearl, you dug out this manual and hoped we would provide you with a few clues. Well, we're sorry about the lack of a "Welcome Disk". Your Pearl Softwa-re is on three diskettes labeled 1 of 3, 2 of 3 and 3 of 3. We suggest that you follow the instructions previously offered for copying the diskettes to your hard disk. Once you have done this, you can use the wel~oae program that is now in the /cpm directory, and proceed with installation of Pearl. You can skip the section on copying (creating working) diskettes: you've already copied all of your software to the hard disk. Select the Personalize option to add in your terminal type. There is more information on Installation in Pearl's Appendix C, in the Advanced Features section of the manual. 61 A. Installing Word Star· For those of you who have purchased (or own) WordStar, we have included this section on information specific to installing WordStar. The instws program handles installation of WordStar, and contains enough explanations to guide you through. And, if you need more help using instws, you should refer to the Word Star Installation Manual (Section 3), for assistance. We will quickly step through the procedure to point out the potential trouble spots. The first phase of the instws'program allows you to select your terminal, which should ~e easy. (Either select your own terminal, if you only have one terminal, or select one -of the three emulated terminals if there are going to be several terminals. Please refer to the previous explanation of terminal emulation). The next step is to sel~ct a printer. WordStar will modify itself to provide any special control characters your printer may desire. Simple enough. Now, we come to the potential trouble-maker, the Communications Protocol Menu. WordStar graciously offers to handle the protocol for you, which you don't need. Please type N for "NONE required" (or protocol handled outside of WordStar, which it is). If you capitulate to this offer, your very first attempt to access your printer through WordStar will result in WordStar being halted, and the message attempt to execute illegal instruction: core dumped being displayed. Micronix traps programs that attempt to perform I/O, and assumes that a mistake has been made. A special file, named core, will be created under the assumption that you are debugging a program. Since your mistake is of another nature, just remove (erase) the core file. (Core files are described in the Files' section of the Reference Manual. See upm in the Programs section for a list of illegal instructions). Your next choice is the selection of Printer Drivers. Always select the LST: device, since the actual handling of I/O will be performed by Micronix. The instws program will tell you to use the STAT command to assign a device to LST:, but this is unnecessary for upm users like yourself. The section on Connecting Printers has more information on using your printer with Micronix. At this point, you are finished with normal installation of WordStar, and you will be asked if modifications are complete. We would like you to bravely state that they are not by typing N. This brings you to the PATCHER routine, which lets you select individual bytes to be changed. The following table contains a list of the bytes that you should patch for maximum efficiency: 62 LOCATION NMOFUS: NMOFUS:+1 DELCUS: DELMIS: DEL4: DELS: OLD VALUE NEW VALUE 01 01 10 05 64 09 FF FF 00 00 00 00 COMMENTS Number of users Also number of users Cursor delay Cursor delay Sign-on delay Refresh delay There may be other bytes that you wish to chang~ at t~is time to personalize WordStar. You can find more information about this in section 8 of the Installation Manual for WordStar. When you are finished, enter 00 as the address to change. Note to MD20 terminal users: Morrow's MD20 terminal almost emulates an ADM 31 terminal. (If you have chosen to use upm's terminal emulator, you should ignore this note). Select the ADM 31 terminal from the terminal menus. Then, while you are using the PATCHER, change the order in which the row and column are transmitted by WordStar with ' CB4LFG: 00 Column before line flag FF The MD20 will now work correctly with Word Star., The changes made to WordStar utilizing the PATCHER disable most of the internal timing used by the program. Some of the best software available for CP/M was written to simulate multiprocessing on single processing systems. WordStar is very good at this', but Micronix is, of course, better. If you have a program that allows two activities to occur simultaneously, such as typing and printing, or typing and screen rewriting, you'll want to disable, if possible, the internal timing loops that drive these functions. Internal timing loops are short programs that run rapidly in a circle, simulating a stopwatch. The problem with this is you don't want to waste the power of your CPU by making it pretend to be a clock. Your Decision has a perfectly good clock in it already. Most of the timing delays required by a program will occur naturally as a result of multi-user Micronix's normal processing. If the removal of timing loop delays adversely affects the use of a program, put the needed one back. An example of a needed delay is DEL3: in WordStar. Without DEL3:, you will immediately be presented with a Help Screen whether you need it or not (unless you disable all Help). 63 / /usr/upm, 59 A A Map Of The File System, Activity light, 14 additional software adding, 53 ADM 31 3A, 39 57 ANOTHER EXAMPLE: Customizing Personal Pearl, B BAD LOAD,' 24 Bad-spot table, 23 BADSPOTS, .26 banner file, 38 Baud rate console, 8 sign of wrong, 9 bin directory, 36 Block, 32 Boards insertion, 4 loose, 4 Booting CP/M, 15 CP/M problems, 16 hard disk, 28 Micronix problems, 16 Buffers, 27 C Cache buffers, 27 'CD, 34 example, 37 Centronics, 45 CHECK, 17 Checking for Hidden Damage, CHMOD, 26 Clock setting, 33 Closing drive doors, 14 Command not found, 52 configuring parallel, 48 serial printer~ 48 Connections, 9 3 64 60 connectors back of Decision, 45 Console, 8 Cooling, 5copy CP/M floppies, 54 Core files, 62 CP/M copy files program, S4 directory, 54 dtskettes, 54 prompt, 15' softwlire, 53 CPTREE, 26 Cursor, 10 D daemon print, 49 Daisy-wheel problems, 48 Date, 33 DDT, 26 dev directory, 38 Diablo, 48 DIR, 34 Directory, 34 Disk activity light, 14 buffers, 27 Diskette handling, 11 Diskettes, 13 Double-sided, 13 soft-sectored, 54 down, 42 Drivers custom, 56 Duplex full, 9 E ECHO, 27 emulation terminal, 57 ERA, 26 etc directory, 38 EXAMPLE: Installing NewWord, exit, 41 59 65 F Fan-. 7 far, 54 File system, 34 active, 33 damage to, 31 finstall, 29 Floppy disk drives, 14 floppy disks copy CP/M, 54 handling, 11 Flushing disk buffers, 27 Formats diskette, 13 Formatting problems, 23 .fp, 29 FSCK, 26, 31 Fsck.victims, 31 G Getting Ready to Boot • • • , Grounds, 6 14 H handshaking, 44. problems, 47 types, 44 Hard disk CHECK, 52 17 external, 22 location, 5 types, 17 Hard errors disks, 23 Hash table, 52 Humidity, 5 I If CHECK FAILS ••• , 18 Illegal instructions, 62 Index hole, 13 Inserting . floppy disks, 11, 14 Insertion of pc boards, 4 installation Micronix software, 29 summary, 1 interface, 44 66 K kill, 42 L LN, 26 logoff, 41 lpr configuring, 48 from upm, 50 use, 49 LST:, 51 configuring, 48 M man, 39 manual directory, 39 map file system, 40 MD20 terminal, 63 message of the day motd, 38 mfa2, 54 Micro Decision format, 54 Micronix stand alone flop'PY, 23 MKFS, 26 Modifying for Multi-user, 63 Moisture, 5 Monitor error messages, 16 Motherboard, 4 MOUNT, 26 , 35 Multiuser, 8, 41 o off, 42 P parallel connector, Parity, 9 Passwords, 40 pathnames, 35, 39 PC boards loose, 4 Pilot light, 7 Power requirements, 6 print daemon, 49 print spooling, 49 45 67 printer connection parallel, 45 serial, 45 printer problems, 47 printer additional, 51 interfacing, 44 problems, 46 Programs single to multi-user, PWD, 34, 39 example, 37 63 R read error booting, recon, 51 24 RESET connection, light~ 8 7 Root, 35 user, 40 RS-232 connector, 9 missing cable, 2 printer connection, 45 S serial printer connection, 45 Setting the date, 33 shake, 48 Shell, 30 signon file, 38 Single-sided, 13 Soft errors disks, 23 soft-sectored diskettes, 54 software adding CP/M, 53 fresh installation, 29 Soroc IQ 120, 57 source, 25 spooling, 49 Static, 5 Stop bits, 9 Superuser, 40, 42 swap device, 24 Switched outlets, 6 SYNC, 27 update daemon, 41 68 T terminal emulation, 57 Terminal checkout, 10 connections, 9 first, 8 Morrow, 63 setup, 8 trouble, 9 Terminals File, 58 The BIN Directory, 36 The DEVICE Directory, 37 The ETC Directory, 38 The USR Directory, 38 Time set t.ing, 33 Timing loops, 60, 63 ttys, 48 Turning Terminal Emulation On and Off, 57 TUTORIAL: Care and Feeding of Floppy Disks, U UMOUNT, 26 Unpacking, 2 update daemon, 41 upm, 57 upmttyX, 59 Using LPR With CP/M, 50 V Video boards, Volumes, 29 56 W Write-protect 5 1/4" floppy, 12 8" floppies, 12 WUNDERBUS I/O, 4 X X-ON/X-OFF, 44 69 11 BACK PANEL CONNECTIONS (KEYSWITCH MODELS) ~nockout ~I for device cables L L..e..J ? S' ttyH }tr ,~ .( ttyG ~ $\----tt-yO-)+ ( ttyE IF''i::::r--~ (centO or diabO).c:lParaliel Printer¢C e( Aux J@ c\ ttyC }c J ,-+( External 8- Floppy IoOl 1 @{"'-t-tY-B~J@ c( tty A )@ NOTES: For systems without MULT/IO boards: Connect your console te-rminal to ttyA. Connect your serial printer to. ttyC. Connect an optional second terminal or printer ttyB. For systeas WITH MOLT/IO board(s): The only restriction on your configuration is that the console must be connected to ttyA. Micronix Operating System user's manual MORROW. ----------~--------- MAINTENANCE TAB L E AND ,0 F ADMINISTRATION CON TEN T S ---------, ---------------------.~-' 1. 1.1 1.2 1.3 1.4 1.5 ·. A DAY INTBE LIF~ OF A SYSTEM ADMINISTRATOR. • • • Turning oh the System. • • • • • • • • • • • • • • • Going Multi-user • • • • • • • • • • • • • • • • Routine Physical Maintenance • • • • • • • • • • • • End of the Day Backup.. • ••••••••••• Turning the System Off. • • • • • • • • • • •• 2. CHECKING THE FIr,;E SYSTEM • • • • • • • • • • • • • • • Things 'l:lOT To'; Do To Your File System • • •• 2.1 FSCK: Tender Loving 'Care for Your File System. 2.2 Before Using Fsck: Inactive File Systems • • • • 2.3 2.4 Using Fsck • '. • • • • • • • • 2.4.1 The -t Option.' ••••• • • • • • .' 2.4.2 The -n Option. • • • • • • 2.4.3 The -b 'Option. • • • • • • • • 2.5 EXAMPLE of Using FSCK. • • • • • • • • • • • 2.6 Fsck Victims • • '. • • • • • • • • • • • 2.6.1 Victim 1 : File's data possibly corrupt. Victim 2: Possibly truncated. 2.6.2 2.6.3 Victim 3: Orphaned directory 2.6.4 Victim 4: Orphaned file • 2.6.5 Victim 5: Directory's name changed. Victim 6: File's data lost. 2.6.6 2~6.7 Victim 7: File's name changed • • • ' • 2.6.8 Disaster Victims • • • • • • • • • • • • • 2.7 Other System Checks - dcheck, icheck and ncheck. ·. ·. ·. ··· ... .···· . . . · ·· . . · · ·· · · · ..·..· ···· · ···· ...........· . ·... · . .". · . 3. 3.1 3.2 3.3 MAINTAINING FREE DISK SPACE. Checking Disk Usage: dUe • • • • • • Disk Free Command. • • • • Finding Types of Files: find. 4. USERS. • • • • • • • • • • • • • • • • • • • • • • • • 4.1 4.2 4.3 4.3.1 4.4 4.5 ·......·... Adding New Users: account. Removing a User. • • • • • • •••••••••• Changing Accounts. • • • • • • • • • • • • • • Logging Directly Into a Program. • • • • • • • Keeping Track of Accounts, Timewise • • • • • • • Account Maintenance Summary. • • • • • • • • • • • • 3 3 4 4 5 6 6 6 7 7 8 9 9 9 10 11 12 13 14 15 16 17 17 18 18 18 19 20 21 22 24 24 25 26 28 28 · ....• 5. ADDING TERMINALS • • • • • • • • • • • • • 29 6. CUSTOMIZING THE ENVIRONMENT •• • • • • • • • • • • • • 32 33 33 6.1 6.1.1 6.1.2 6.1.3 6.2 6.2.1 6.2.2 6.2.3 7. 7.1 7.2 7.3 Message Files. • • • • • • ••••••••• Message of the Day • • • • • • • • • • • • Custom Banners • • • • • • • • • • • • • • • • • • Sign-on Message. • •••••• Command Files. • • • • • • • • • • • • • • • • • • • Log-in Commands: The .sh Script • • • • • • • • • • Routine Commands File: I etc/rc • • • • • '. • • • • Configuring upm With .upm. • • • • • • • .• • • • • SECURITY • • • • • • • • • • • • • • • • • • ·. • • • • • • • • • • • • • • • ••••• File Acces s Permis'sion • ..'. • • • • • • • • Protecting Diskettes • 34 35 35 35 39 41 42 ·. 42 8. COPYING FLOPPY DISKETTES • • • • • • • • • • • • • • • Preparing Your Diskettes (Formatting) • • • ' ••• 8.1 8.1.1 FDJ's Menu Selec tions : 5 114" Drives. • • • • • • 8.1.2 FDJ's Menu Selection~: 8" Drives. • • •• 8.1.3 FDJ's Other Selection • • • • '. ' • • • • • • • • 8.1.4 Format Options: fdj One~liners. • • • • • .• Ch~cking the. Hard Disk's Free Space. •• • 8.2 8.3 Copying CP1M Disket. te~ .' • • • • • • • • • • • • 8.4 Copying Mlcronix 'Diskettes ,. • • •. ~ • • • • • • 8.4.1 Summary of Copying Micronix Diskettes • • • • • • • 8.5 Wri ting The System Trac,ks (SYSGEN) • • • • • • • • • 8.5.1 Backup of the Cold Boot Loader • • Copying a ~icronix Loader • • • • • • • • • • • • • 8.5.:2 8.5.3 Backup of the Stand Alone Master • • • • • • • • • 48 9. 9 •.1 9.2 9.2.1 9.2.2 9.3 9.4 10. 10.1 10.2 10.3 10.4 11. 12. 12.1 12.2 12.3 ~asswords. '. . · . . . ... . . . . · .. . . . . · . • • •• • • BACKING UP YOUR HARD Dr'S~ ••• • • Short Term .Bac kups • • • • • • • • • System-wide Hard Disk Backup First Hard Disk Backup • • • • • • • • •• Daily Hard Disk Backups. • • • • • • • Restoring Backed Up Files. • • • • ••••• Restoring Your Hard Disk • • ·. ·· .. .. .. .. .. .. . . . . . . . . ·.. ·· .. .. ·................ ADDING A HARD DISK . . . • • • • • • • • • • • • . . . CONSOLE ERROR MESSAGES . . . . . . . . . . . • • • • • File System Warning Messages • • • • • ·.... Operating System Warning Messages • • • • • · . . DESPERATE MEASURES • Runaway Terminals. Replacing the Root Password • • • • • • • • Repairing the Root Hard Disk • • • • Conclusion • • • • Fatal Error Messages • • • • • • • • • ·.... 43 46 48 49 51 52 52 53 54 55 58 58 59 60 61 62 62 63 63 64 65 66 67 67 69 71 72 73 74 74 78 79 Appendices A. A.l A.2 eA.3 A.4 A.5 A.5.1 A.5.2 HARDWARE ADDENDUM FOR MICRONIX SYSTEMS • • • • LIS T A-I A-2 A-3 A-4 A-5 A-6 A-7 A-8 A-9 ·... Removing the Decision Cover. • • • ••••••• Checking Internal Connections. • • ••••••• Removing the S-100 Module Boards • • • • • • • • • • Modifications for Automatic Hard Disk Boot • • • • • Installing Additional Disk Drives • • • • • • • • • • General Inf~mation. • • • • • • • • • • • • • Connecting an 8 Inch Floppy Disk Drive • • • • • • 0 F 81 81 81 83 84 86 86 87 FIG U RES . · · · · · ·· · ·· · · · · · · ·· ·· ·· ·· ·· ·· ·· ·· ·· · ·· · · · · · ·············· ······· Decision Cover Screws. • Disk Drive "'Cable Connections • • • Retaining Brackets for S-100 Module Boards Decision MPZ80 CPU Board • Automatic Hard Disk Boot DJDMA Board Configured for Automatic Hard Disk Boot. Automatic Floppy Disk Boot DJDMA Board Configured for Automatic Floppy Disk Boot. Connecting an 8" Floppy Disk Drive 81 82 83 84 85 85 86 86 87 MAINTENANCE AND ADMINISTRATION This section of the Micronix User's Guide explains what you need to know and do to keep your system up and running. In most cases; we will tell you the complete command lines to use. In others, we will just describe what commands to use, and you will fill in some blanks to fit the command to your customized system. Administering a multi-user system with a hard disk is not as simple as ,caring for a microcomputer with floppy disks. With the microcomputer, administration consists of backing up diskettes by copying them. But with a hard disk, you need about an hour plus twenty-five or so diskettes for each backup. Not a very practical solution. Don't get upse~, because this section details an improved, systematic backup scheme that minimizes the need· for time and media. As system manager,You also have to concern yourself with creating new user ac~counts, removing old ones,· keeping the hard disk from beco~ing-full) addJng new printers or programs, and managing the. sy:stem in general. The file system itself is more complex, which is both a blessing and a potential problem. Well, the good news is that the Micronix system comes with a complete set of the tools that you need for maintaining and administering your system. You can do a thorough job of administration with a handful of commands and fifteen minutes a day, with an additional half hour once a week. This will allow you to back up, check for free disk space, and maintain your file system's integrity with very little effort. The bad news isn't really "bad". It is simply that there is no mechanism that will encourage you to maintain your file system. You can run your Micronix system without backups or checks, until something goes wrong. Then, you may lose several days' or several months' work. We can only try to reinforce the notion that an hour and a half per week spent on routine maintenance is vastly preferable to the aggravation of trying to replace lost files. Maintenance and below, in that order. Administration covers the topics shown o A day in the life of a, system administrator - A fable to introduce you to life in the fast lane o fsck - the file system check program, and what to do when it turns up something unpleasant o df & du - the "disk free" and "disk usage" programs that help you manage disk space 1 o Customizing the Environment - adding and removing users, adding hardware, plus a garden of ~onderful miscellaneous tips :that exercise the finer points of Micronix to your benefit o System Security - implementing passwords and protecting files o Copying Diskettes-- Formatt.ing, copying with a single drive, "SYSGENing" a loading diskette, CP/M vs. Micronix file systems o Backing up and Restoring the Hard Disk - $tep-by-step backup procedures, and how ,to use the backups when, the need arises o Desperate Measures - get'ting 'out of tight spots like forgetting the root password, freeing a locked-up terminal, and repairing a wounded root directory. o Cons'ole Error Me~sages - These are messages that get sent to the console as warnings that something undesirable just happened or is about to happen to the system. You'll find the appropriate responses listed here as well as explanations of the messages. Not particularly fun re~ding, but bandy. 2 1. A DAY IN THE LIFE OF A SYSTEM ADMINISTRATOR Before you go delving into the intricacies of system maintenance and administration, we'd thought that you would appreciate sharing the experience of an experienced system . administrator. So, we installed a hidde,n cam·era in the office of one our Beta-test sites, and filmed the entire day's activities. The version presented here was edited, of course, to the· bare essentials, and all embarassing scenes removed. We fabricated names to protect the innocent, and to make it impossible for the subject to file an invasion of privacy suit. Our experienced administrator's name is Clair. The company he works for has been using a Micronix system for over a year, and Clair has been responsible for maintaining the system every day of that period, except for .his 2 week vacation at Lake Tahoe. We chose Clair for this study because he has never ·called and asked us to replace a lost data file that wasn't backed up, (a hopeless task). We are sorry that we can't give Clair the recognition that he truly deserves. . 1.1. Turning on the System Our saga begins with Clair walking into his office and sitting down at his desk. He swivels his chair to face the Decision cabinet, and takes a key out of his pocket·. Clair inserts the key in the Decision, and turns it all the way to the right, so the Decision is now on and reset. The light on the floppy disk drive starts to flash, and Clair realizes that he needs to find the Micronix Load diskette. Clair is a meticulous person, and manages to keep everything in its place. It's just that he's a little groggy this morning. He scratches his head, and looks on the table where the Decision sits for the Load diskette. And sure enough,there's a diskette with the word "LOAD" printed on the label in shaky letters. Clair slips the diskette into the drive,and closes the drive door just. as the light flashes off. The next time the light turns on, the solenoid in the drive clicks and the Loading message appears on the console. Clair turns back to his desk and takes another sip of coffee from a foam cup. In another half hour, he seems to be thinking, the guys in engineering will have a pot of strong French roast coffee going. (Clair drinks about three cups of coffee before his eyes are fully open most mornings.) The hard disk has quit humming and whirring, so Clair swivels to face the console again, and logs in as "root". Clair smiles to himself while entering the password, as if the root password, known only to himself and one other person, has some special meaning for him. Then, he enters the correct time and date. According to his 10 function LCD diver's watch, it is exactly 8:17:31 on July 6. 3 # date July 6 8:17:55 Wed Jul 6, 1983 -8:17:56 # [] So, Clair enters a date several seconds in the future, and waits to hit'. the return a t, the end of the date command until the· time syncronizes' perfectly with his watch. This isn't really necessary, but Clair likes to be picky about little things. Next, ~Clair starts up the file system check does this by simply typing .' program.' He # fsck /dev/root Checking Idev/root ... and turning back to his desk. Clair knows that fsck takes about 5-minutes to complete, so he can get on with the business of the day. He looks first. at this appointment calendar, sighs, gets up and walks out of the rOOm. 1.2. Going Multi-user The clock built into our hidd~n camera indicates that about minutes have elasped since Clair wandered out of his office. He appears to be slightly flustered-; must be a new ~ecretary in the office. Clair, glances at the console. Fsck has finished, and, as usual, there weren't any "victims". Good. Clair types the word· ~'exitn after the prompt, sending Micronix into the business of becoming a multi:-user system. As the hard disk begins to hum and whizz, he faces back to his desk, and reaches for· the top of his "in" stack. Several minutes later, the Micronix banner and the log-in prompt (Name: ) appear on Clair's terminal, and on the other terminals that have been turned on around the office. Micronix has "gone multi-user" and is ready for the .day's work. 14 1.3. Routine Physical Maintenance Several hours have passed since Clair began his workday. At this moment, Clair is returning to his office after lunch (we can tell from the mustard smeared on his tie).. Before settling down at his desk, Clair elects to perform the physical maintenance necessary to keep the Decision in top working condition.' He reaches around to the back of' the Decision cabinet, and grabs something that is located right in the middle of the back. As his hand comes back into view, holding a black square of foam rubber, side. This is the fan filter, which sits cabinet. Clair walks out of the room to filter is washed in lukewarm, mild soapy allowed sit until it is completely dry. Fifteen minutes later, you can see that he a little dusty on in a holder outside the washroom. The water, blotted dry, Clair re-enters his office with 4 is one the fan and the fan filter in hand and a smile on his face. He seems to appreciate the extra goof off time that being system administrator provides him with. He reaches around to,' the back of the Decision, 'folds the foam filter in half, and fi.ts it back into its enclosure. Monthly maintenance completed, Clair goes back to work. only other physical maintenance that can be done is to· wipe the cabinet with a damp cloth. 1.4 End of the Day The off ~kup As the end of day approaches, our camera discloses a tired and wired looking Clair: he really should do something about his caffeine addiction. Maybe acupuncture, or a few sessions with a hypnotist. Nevertheless, dependable Clair prepares to perform the daily backup ritual. He reaches for a couple of formatted floppy diskettes, inserts the first one into the floppy disk drive, and closes the door. Clair has been logged in as an ordinary user all day, so he first needs to .. become the superuser, root. He uses the su (switch-user) program to change his user identity. % su Password: 1/ [] Now, he system. has the power to ,access any file or directory on the Clair has already checked to see that all the other persons using the system have logged off with the who command. If he were to backup a file while someone was writing to it, that file would not be correctly backed up. It isn't really necessary that everyone be logged off, just so no one change any file during the backup process. Then, he types /I fp cril / Enter volume name: System backup by Clair W. 1/ [] Clair knows that those letters after the fp command will £reate a new fp volume, replace those files that have been modified since the last backup (i) and request a label for the volume. Fp runs pretty fast, but Clair is getting little impatient to go home. a The backup process itself is automatic, except for inserting diskettes and pressing return. Clair appears to be grumbling about something, but he has conscientiously backed up the system for over a year now without complaining to anyone. Maybe if he were to share the root password with someone besides that secretary, he wouldn't need to leave so late every night. 5 when the backup program finishes, Clair care·fully labels the diskette (it only required one today) with the day's date, puts it in the bottom drawer of his desk, and carefully locks his desk. 1.5. Turning the System Off Well , that's it for today • superuser after backing up, types Clair, still logged in as the /I down Micronix is down[] to bring down the operating system gracefully. Then, he turns the key on the front of the Decision to the left to turn off the power, removes the key, and sticks it in his pocket. Another day, another dollar. Clair gets up, and moves out of ·view. 2. CHECKING THE FILE SYSTEM By now, you are aware that the file system is both the organization of data and the data itself on a hard disk or diskette. Assuming 100% performance of' hardware, software, and the personnel uSing them, your file system will last forever, and never have a problem. In the real world, the people, hardware, and software operate at perhaps 95% of perfection. This means that there will be occasions that create problems for your file systems. 2.1. Things NOT To Do To Your File System These are the things that are most likely to give your file system a headache: 1. Resetting the system without first giving the down command 2. Interrupting power to the computer or the disk drive 3. Copying a file to a "/dev/" disk device file that contains a file system 4. Hardware problems within the disk drive It is a good thing to be able to recognize a hardware problem when you see one, because running fsck on faulty hardware may do more harm than good. The symptoms produced by the first 6 two improprieties above are: the computer will be off (no power), in a halt state (you can't get it do anything, even though it has power), or it will be in a typical post-res~t condition. The third action results in a "not a file system" error message whenever you try to mount the device. Copying or redirecting data directly to a /dev file can be disastrous, but usually hard disks are protected from such a snafu attempted by anyone but the_ superuser (root). If you copy to a floppy /dev file, with or without a file system on it, the diskette becomes worthless (of course, you can always reformat it and use it again). The fourth difficulty, hardware problems, are the most difficult to deal with. A hardware problem may raise its ugly head by not allowing you to boot from the disk properly. Or, it 'may show up during operation. The console terminal may become flooded with read or write error messages for the disk drive (please refer to the Console Error Messages section for a translation of the messages). So, if you can't boot, or if you suddenly get a ju~p in the frequency of read/write error messages, suspect _ your hardware and have it fixed BEFORE running fsck. Otherw{se, fsck will be zipping around trying to fix nonexistent problems. 2.2. FSCK: Tender Loving Care for Your File System The Micronix file system is an elegant beast. Therefore, rather than teaching you to be a Micronix systems programmer, and forcing you to hack away at blocks on the disk, we have provided you with fsck, your "systems programmer program". Fsck, which stands for file system check program, takes advantage of the cross-referencing inherent to Micronix for checking the system and repairing it whenever possible. Fsck also looks for logical inconsistencies in a file system, such as blocks that are claimed by two or more files. Fsck settles conflicts over multiply-claimed blocks by making a copy of the block and giving it to all the files that claim it. The names of the (possibly) affected files are reported to you, so that you can t~ke the appropriate responses. The section named Fsck Victims explains how to handle your damaged files. You can use fsck on Micronix file systems on both hard and floppy disks. Fsck will perform identically on each, taking much longer with hard disks because of their greater-storage capacity. The next sections tell you how to use fsck. 2.3. Before Using Fsck: Inactive File Systems There is a very important pre-condition for using fsck: the file system you use it on must not be active. Active file systems are being used, that is, they have files "opened" by a You can be sure that a file program for reading or writing. 7 system is inactive by unmounting itt or checking it before it is mounted. (See mount in the Programs section of the Micronix Reference Manual, and Section 8.4 of Maintenance.) Immediately after resetting your Micronix system, there are no mounted file systems. This makes the time immediately after a reset an excellent time for running fsck. If you are not certain which file systems are can use the mount command to see what's mounted. mounted, you II .mount m16b on Ib II [] tells you that "m16b" is mounted,on directory lb. So, if you want. to check device m16b, you must first unmo~nt it by typing II cd I II umount m16b II [J If someone is using the file system, the umount command will tell you "device busy". A device is busy when files on the device are opened by a program, or someone has moved his current directory to somewhere on the device. The root file system is an exception to the rule about checking inactive file systems. The root file system is always active when' Micronix is running. You can use fsck on it when no one else is .running prpgrams, ·i.e., when you are in singleuser mode after resetting the system. Fsck can fix most problems on the root 'file system. H9wever, problems with the root directory, (I) will be recurrent: fsck·will fix them, but they'll come back. The solution to this dilemma is found in the section called Desperate Measures. (You will need to repair the root file system from the Standalone Micronix floppy.) 2.4. Using Fsck Thefsck command expects the name of a disk drive device as an argument. The disk in the drive, of course, must contain a file system to check. Disk device names are listed in the Idev directory. To make things simpler for you, a partial listing of disk device names and descriptions of the devices is included here: Idev/root always the name of the root device (virtually always your internal hard disk) Idev/m16a the name of the first 16 megabyte miniwinchester hard disk device (D 0, which may be the same as your root device) Idev/m16b the name 'of the second 16 megabyte winchester hard disk device (# 1) 8 mini- /dev/mlOa the first 10 megabyte drive (D 0) /dev/hdca the first drive using the HnCA controller /dev/mfa the name of the first 5 1/4" (mini) drive (II 9) /dev/mfb the second 5 1/4" drive (II 1) /dev/fla the name of the first 8" floppy drive (II 0) /dev/flb the second 8" floppy drive (II 1) floppy These are the device names that you will most often be using with fsck. There are also three options available with fsck, -t, -n, and -b: -t fsck test-reads every block on the device -n fsck report~:·~problems,· but doesn't fix anything -b fsck will take the list of block numbers that follows the b flag and add these blocks to files in /badblocks, effecti~ely removing them from the syst~m. 2.4.1. The -t Option Test-reading all the blocks on a hard disk might take as long as half an hour (typically 20 minutes for 16 megabytes). Generally speaking, you should run fsck with the -t option once a week at least, and more t"requently if you start getting read/write error messages. on the console. Running fsck with -t on a floppy disk is fairly quick, and a good way to check floppy disks. 2.4.2. The -n Option The -n option will report the problems it finds in a file system without doing anything about them. This is useful for surveying the extent of the damage to a file system. Generally speaking, you want to fix a file system, not just "talk" about fixing it, so you won't be using the -n option very often. 2.4.3. The -b Option The -b option is designed for use with virgin file systems on hard disks. Hard disks come from the factory with a known and acceptable percentage of unusable areas (badspots), which are ke~t in a special map so they don't get used for reading and writing. When you create a new file system on a hard disk, the information in the hard disk's badspot map must be adde.d to the file system. The badspots program can read this map, and create a list suitable for the -b option. Here's how you would use the 9 -b option· with bad spots on a new file system on your megabyte hard disk: third 10 U fsck -b 'badspots /dev/ml0c' /dev/mlOc Checking device ... ~lOc 1/ [] 2.5. EXAMPLE of Using FSCK Let's take a look at an example of using fsck. On this occasion, we were checking a file system on a 5 1/4" diskette in the first drive, with the--t option: 1/ fsck -t /dev/mfa Checking /dev/mfa: Hunting for bad blocks ** Checking I-list, first pass ** Checking the free list ** Checking I-list, second pass ** Checking connectivity 3 files, 0 special, 1 directories, 2 small, 1 large, 0 huge 760 blocks, 17 I-list, 1 indir, 0 in2dir, 203 data 204 used, 537 free, 0 bad If l] After displaying the message "Hunting for bad- blocks", fsck proceeded to read every sector on the disk. If it had found an unreadable sector, it would have reported it, and marked it for attempted repair by a later phase of fsck. For this double-sided floppy, the test took about 1 minute. The lines beginning with u**" mark the four normal phases of fsck. Each phase looks at the selected file system in a different way. Any problems discovered by fsck are reported on the terminal and marked by fsck for repair. Whenever fsck does something that affects a file, it makes an entry in the file fsck.victims. The next section tells y~u how to deal with the victims. Here are a few more examples of fsck. Each of the following example commands is described in the right hand column: fsck fsck fsck fsck /dev/hda /dev/root /dev/fla /dev/mfb test the first hard disk using the HDCA checks the root file system examines a disk in the first 8" drive looks at a disk in the second 5 1/4" drive If you are curious about what fsck actually does, out more by reading about fsck victims. 10 you can find 2.6. Fsck Victims It's Monday morning, and,' as part of your well-established routine, you are running the, fsck program right after turning on the Decision and resetting Micronix. As your eyes begin to focus, you notice that there are signs of a party in the computer the empty wine bottles certainly weren't lying abou't when room; This might be cause for concern, you left on Friday afternoon. if the revelers neglected to shut down the system properly. Unfortunately, this appears to be the, case. As fsck proceeds through th~ file system, it uncovers and reports on several problems., You wait for the fsck program to complete its checks. After the usual summation of files and block usage, the lines ' ** Hunting up filenames of casualties.' A copy of this list will be saved in the file "fsck~victims" appear, followed by a list of the affected files. As the "system administrator", your work is cut'out for you. You need to salvage as many of the files and directories in the victims list as possible. In some cases, total recovery is possible. In others, the files will have to be restored from backups if possible, or an obituary sent to the owner, ff not. Fsck has done its best to fix your file system; it has located the source and nature of problems and handled them in such a way as to make the system usable without further damage. There is still some detective work involved, though, that requires your vastly superior human intellect. The first step in recovering victims is to print out ,a list of the victims. This will save you some time, and provide a space for making notes about the victims. Fsck creates the file fsck.victims in whatever directory you happen to be in when you execute fsck. Send the file to the lpr daemon, # lpr -i fsck.victims II [] and get the listing from the printer. looks like this: The listing we are using /dev/root: a/david/init/exec.bak: File's data possibly corrupt a/len/Util/Edit/YY: Possibly truncated lost+found/dir342: Orphaned directory lost+found/fileI329: Orphaned file a/dir261: Directory's name changed a/rik/ws/invent: File's data lost a/jayne/Euro/file2284: File's name changed What luck! This printout provides us with one example of each of the 7 possible types of fsck victims. Notice that the filenames 11 don't, start with a slash (for the root directory); the filenames in the victims file will begin with the names of the subdirectories of the root file system being checked. 2.6.1. Victim 1: File's data possibly corrupt A file's data is corrupted if a Read Error occured while reading 'a file block when using fsck with the· -t option. . Fsck does its best 'to copy. the un~eadable block to a new block,- f9r the sake of avoiding further corruption. You'll have to look at the contents of the file to see how much of the data was successfully copied. If the file isn't a textfile, you may want to restore it ·from a backup C?py just to be safe. A second way that a file's data may become cor~upt is because 'of a duplicate block. If you recall, fsck checks to see that each block in a file system is used only once. Blocks that are used more than once are called duplicate blocks. When more than one· file claims possession of the same block, all files are given a copy of the block, but only one file will be correct (the other files will have a strange 512-byte segment in them that just doesn't belong). Let's look at the message from our example victims file: a/david/init/exec.bak: File's data possibly corrupt Right off, the filename provides us with some important information. The file with corrupt data is in a subdirectory of la/david. The la/david directory is the home directory of the user named "dav:ld". So, the user david would be the .person who decides whether the file is really corrupt or not. There is a second clue in this name that can help. The filename ends in ".bak u , suggesting that it is a backup file. Let's look in the /a/david/init directory and see if there is another "exec" file: # Is -1 /a/david/init/exec*. rw-rw-rw1 david 605 Mar rw-rw-rw1 david 609 Mar rw-rw-rw1 david 639 Mar II [] 1 13:12 /a/david/init/exec.bak 3 9:21 /a/david/init/exec.c 3 9:22 /a/david/init/exec.o The "Is _1" program produces long directory listings of the files beginning with "exec". You can see that there is a more recent (March 3) version of "exec.c", so having corrupt data in the exec.bak file probably doesn't hurt anything. If the file with corrupt data was very important, for example, a list of yesterday's financial transactions, it should be recovered from the last backup that (we hope) you made. Suppose the corrupted file was named "a/BoA/accounts/receiv". To recover this file. take the diskette (we will assume 5 1/4" for this example) from last night's backup and insert it in your first floppy drive. Then type 12 II mount mfa / f U cp /f/BoA/accounts/receiv la/BoA/accounts II umoun t mf a 1/ [] which mounts (attaches) ,the diskette in directory /f, copies the file "receiv" to the proper directory, and unmounts the diskette. ~ If you have several diskettes from yesterday's backup, or the file was backed up on a different day, you may have to repeat this process (mount, cp, umount) until you find the diskette with the file on it. If the file is not on the diskette, the message "No such file or directory" will be displayed on the line after the cp command. Unmount the diskette and repeat this sequence of commands with other backups until you are successful. May your conscience take note: Careful labeling of your-backups is always worthwhile. 2.6.2. Victim 2: Possibly truncated Fsck has two ways of telling how long a file is. First, there is a record for the file that says how many bytes are in it. Then there is the list of blocks claimed by the file, which implies a certain length in bytes, at 512 bytes per block. If these two figures disagree, fsck proceeds on the assumption that the size record is more reliable than the block list. Thus the blocks that go beyond the size record get chopped off, or truncated. Hence the message "possibly truncated". Once again, the person who owns the file is in the best position to decide if the file has been truncated. Let's look at our example message: a/len/Util/Edit/YY: Possibly truncated The file in question" "YY", is in a subdirectory of the user "len". You,as the system administrator, may decide to attempt to replace the file ttyy" from backups. Or, you can talk to "len" and tell him that his file has been truncated. If "len" isn't at work yet, use the mail command to send him a note: 1/ mail len Len - The file Util/Edit/YY was reported as Possibly truncated this a.m. If you need to recover it from backups, see me later. -- Rik • II [] A note like this in the owner's mailbox is appropriate for almost any action you might take with someone else's files. The file's owner may have a more recent backup (made Saturday before the party got rolling), for example. If you replaced "yy" from the backup made on Friday, "len" would lose all the changes made on Saturday, and possibly not notice it. Always be considerate of other users. Communicate with them before copying over their files. 13 If Len wants "YY" restored from backups, follow the same sequence of instructions (mount, cp, umount) as in Victim 1. 2.6.3. Victim 3: Orphaned directory In the ,"real" world, an'orphan is a parentless child. In the world 'of Mlcronix, an orphaned directory has no name and doesn't know who its parent directory is. Normally, there are two ways a'directory is conn~cted: by its name appearing in another directory (the parent directory), and by a special entry in the directory ,itself,knowu'as dot-dot ( •• ). Orphaned directories are somehow missing' both of these connections. Because the name of the . directory is, ,not known, fsck constructs a ,name for it. The name is made by concatenating the letters 1tdir" with ~ number (the, '~inode number" ,but you don't need to know that). And, because ,the orphaned directory has no parent, it is given a "foster" parent, the /lost+found directory. Let's look at our example victim: lost+found/dir342: Orphaned directory You ,can see that the orphaned directory is indeed now a "child" of lost+found, and it has a name, dir342, made from the letters' n,dir" and a ,number. After changing to the directory lost+found, we'll use the owner command to see whose directory it is: II cd /lost+found II owner dir342 bob dir342 # mv dir342 la/bob II mail bob Hi Bob - Look's like. you're missing a directory: fsck found a directory of your's loose in the system. It has been renamed /a/bob/dir342. Use mv to get the name right again. - Rik /I [] As the systema4ministrator, we moved dir342 to Bob's home directory, la/bob. When Bob reads his mail, he should use the dir command to examine this directory. Bob would type % dir dir342 Func Exec % [] Util to discover what's in this directory. Then he would use a mv (move) command to rename it, and coincidently replace it in its proper position in the ~!le system: % mv dir342 Prog % [] 14 For this victim, the solution was simple. Bob recognized the orphaned directory as his Prog subdirectory, and moved it back to where it belonged. The three subdirectories of Prog, (Exec, Func and Util), and all their files and subdirectories were unharmed by the experiance of having an orphaned ancestor. 2.6.4. Vic tim 4: Orphaned. file An orphaned file is a file without a name in any directory. In Micronix parlance, this file has no parent directory; thus, it is an orphan. Our victims list provides us with an example to play· with: lost+found/fileI329: Orphaned file Obviously, we need to discover the name of the orphaned file. A good place to start is to get the name of the file's owner by using II Is -1 file1329 1."'len rwxrwxrwx II [] 768 Jan 6 12:25 file1329 We are still in the /lost+found directory after helping Bob. The Is -1 command shows that the orphan's owner is Len, and that the file has read, write and execute permission, is 768 bytes long, and was last modified Jan 6, at 12:25. Now we have some clues about the mysterious file1329. The file command can tell us more: II file file1329 file1329: Text file II [) File1329 is a text file, so it should be relatively safe to "type" it out. This is a task for Len, since it is his file, and he should be able to recognize it. If Len recognizes his file, he should use mv to restore it to its old name. As it happens, Len recognized file1329 as a "makefile" for some networking software he was writing. To get file1329 back in its place, Len typed % mv /lost+found/fileI329 /a/len/Util/Net/aakefile % [] changing its name and moving it simult~neously. If file1329 had been unidentifiable, it could have been removed by typing /I rm file1329 II [] while still in the lost+found directory. 15 2.6.5. Victim 5: Directory's name changed A directory with a name-change is less serious than an orphaned directory, and easier to repair. A directory's' name changed because it either had an illegal name (the slash character, for example), or -its name didn't appear in its p~rent directory. The name-changed directory is still in its place in the file system because it has maintained its-link to the parent directory (the dot-dot, •• , directory entry); the problem is that it has lost its name. . Fsck handles this p~Qblem by ~king up a name for the nam~ changed directory and entering it in the parent directory. The names used are constructed by adding a number -to the letters "dir"~ Let's take a look at our victims file example: a/dir261: Directory's name changed You can see that the directory's name has been cha~ged "dir261". And, more important, the directory dir261 is not the /lost+found directory,. but is a subdirectory of fa. So, know where dir261 belongs: it's still in place. All we need do is discover its rightful name. The owner command will give the information we need: to in we to us II owner dir261 johnv dir261 II [] This is the point where some familiarity with your file system will come in handy. Dir261 is owned by the user johnv, and is ,a subdirectory of fa. The /a directory is where users' home directories are created. It takes a small inductive leap to guess that dir261 is actually johnv's home directory. To change the name of dir261 to johnv, simply use # mv /a/dir261 /a/johnv II [] If ,you can't determine the true name of the changed-name directory, you should send some "mail" to the owner (or talk to him) about the problem. , mail jobnv John - One of your directories bas lost'its name: temporarily named /a/dir261 ••• Rik it is /I [1 Because dir261 IS John's home directory, John will be unable to log-in to get his mail. What will happen is this: Name: johnv Password: Last logged in on ttyD, May 24 16 15:53 /a/johnv: No such file or directory Name: [] John won't be able to log-in until you, as the root, (mv) /a/dir261 to /a/johnv so that John can log-in. 2.6.6. Victim 6: change File's data lost This is a nas~y one. File's data lost means exactly that there is a filename' without any data to go with it. All that is left of . the file is ilS name, and, hopefully, some backups of it. a/rik/ws/invent: File's data lost Our sample file is called /a/rik/ws/invent. To restore it from a backup, we first find the diskette with the most recent backup on it, insert it in a floppy drive, and type (for 8" drives) 1/ mount fla /f # 'cp /f/rik/ws/invent /a/rik/ws 1/ umount'fla 1/ [] .A If you don't have a backup of a file whose data simply inform Rik, so he can type is lost, you % rm /a/rik/ws/invent % [] and remove the file's name, which is all that is left. 2.6.7. Victim 7: File's name changed A file's name is changed because it contains an illegal character in it. The best example of an illegal character in a filename is the slash (/). If a. filename has a slash in it, you won't be able to access it because the slash is the divider between directory names. Micronix would see the slash in your filename and assume a directory name preceeds the slash. Fsck builds a new name to replace a defective one by adding a number to the word "file". (The number is the inode number, if you are interested). Let's examine our victim: a/jayne/Euro/file1221: File's name changed From the filename, we can see that file1221 is in a subdirectory of Jayne's home directory. The correct course of action here is to send Jayne some mail, or talk with her about file1221 having had its name changed. When Jayne remembers, or discovers, the file's name, for example, "clients", she can change it by typing % mv Euro/file1221 Euro/clients % [] 17 , from her home directory. 2.6.8. Disaster Victims This wouldn't be a complete discussion of fsck.victims unless we pointed out to you that your list of victims won't be like our sample list. What. is more likely is that you will either have one or two victims 'with corrupt data or changed names, or a veritable flood of orphaned files and directories. When you have several victim's, the techniques outlined here will be of great help. However, if half your file system has been ravaged, other methods are in order. An incident resulting in a large number of fsck.victims is likely related 'to a- hardware malfunction. If this malfunct:l.on were to reoccur just after you finish rebuilding your file system, imagine how upset you'd be. So, instead of leaping into the fray, we suggest that you check out your hardware first. The easiest thing that you can do is reconstruct your system from scratch, if you have been keeping good backups. The instructions for doing this are in the Installation part of this Guide. Start· by formatting your hard disk, which will simultaneously check out your hardware and map out unusable blocks. If you have trouble formatting, you definitely have a hardware problem, and should call your Service Representative. After formatting, follow the instructions for Installing Micronix on the Hard Disk, and Adding the Software. The finstall script can be used to add your backups to the system. To restore your backups, start with the oldest backup diskette, and continue until you have restored the most recent backup. 2.7. Other System 'Checks - dcheck, icheck and ncheck Although fsck offers the simplest and most comprehensive check, and is the recommended program to use, three other programs dcheck, icheck and ncheck- are also available to check and maintain the system. These programs are mentioned for completeness only, since fsck performs the same checks as these programs. Information on these programs is contained in the Reference Manual in the Programs section. 3. MAINTAINING FREE DISK SPACE Keeping your hard disk from filling up is possibly the hardest task in maintaining your Micronix system. Creating files, copies of files, backup files, revisions of files, temporary files, archives, etc., is so easy to do, you will be surprised at how easy it is to fill up 10 or 20 megabytes of storage. You can use the df (disk free) command to monitor the amount of free space remaining in a file system. 18 The place to start in keeping some free space is with each user doing their part. Users need to remove temporary files or directories, and move long-term backups to floppy disks. It may be convenient to have every revision of a program or text around; but it sure will fill up a hard disk in a hurry. A Micronix system with a single user might go for a couple of months before running out of space. A system with several users' might last only three weeks. When users prove unable to control their use of disk space, it is up to the system administrator to provide some assistance. You can do this by using the du command to monitor each user's disk usage. You can send mail to the users that are hogging disk space, asking them to clean up their act. If this fails, you can \ try stronger methods, such as public humiliation (list the space hoggers in the message of the day). You may actually need more disk space' than your present hard disk p~ovides. The way you can determine this is to calculate the amount of space used by the resident programs and their support files, for example, the data 'liles in a database. The du command (explained -in the next section) will calculate this for you. If the programs alia files share'd' by all users take up most of the hard disk, there will be no space for user files. The solution is to move shared data files to a new hard disk, keeping the users on the original disk. Making an additional hard disk a part of the file system is explained in the section on the Routine Commands file, mounting commands. 3.1. Checking Disk Usage: du The disk usage command (du) counts the number of blocks used by files in' a directory, including all the files in subdirectories. Remember that a block is 512 bytes, or 1/2 k of disk space. So, if a directory uses 2000 blocks, it is taking up one megabyte of disk space. The Micronix file system is organized so that the user directories are all subdirecties of fa. This makes it simple to locate each user's home directory and summarize the portion of the file system that they are using. We should point out that any file can grow until, it has used all the free space in the system. There aren't any limitations put on programs or users that prevents them from overindulging in disk space use. Let's look at a file system that is shared by programmers and text writers and see how the du command works: 19 _II du -8 la/ • . 1 lalalliene 403 lalcpm 1589- la/david 1003 lalfrank 4_/a/howard 1 (a/john .1216 la/len 12 la/marc 35 laiinike 3 I a/network 82 la/n.orm 1136 la/rik II [1 A glance at this list uncovers the major disk users: David, Frank, Len and Rik. If disk sp_ace, has become (or will soon become) an issue, a pleas_ant note can be mailed to these users requesting that they be more considerate, and use floppy disks for backups. You might guess that for this command to work, shared data space, i.e., databases, would have to be kept in a place other than a subdirectory of a user. The du command compiles disk usage reports for the fi~es or director,ies listed after the command and options. Du recognizes two options, -s Summarize disk usage for names specified, or -a All files and subdirectories are reported. If neither option is used, is produced. a summary of disk usage by directory Individual users can benefit by using the du command. For example, Len could discover where he is using all that disk space by typing "du -a la/len", which would list out every file and directory connected through his home directory with the blocks used. 3.2._ Disk Free Command The disk free command (df) is simple, quick and easy to use. Compared to the trouble you will be in if you don't have any free blocks left to use in a file system, you should use df every day, if not more often. The disk free command counts the number of free blocks remaining in a file system. This makes df the exact opposite of du, which counts the blocks in use. To use df, you simply specify the names of the file systems that you want to check. For example) II df I dev I root 20 8117 /dev/root II [] informs you that there are 8117 free blocks remaining in tbe root file system. Keeping in mind that a block is 512 bytes long, 8117 blocks corresponds to 4.0585 megabytes remaining on root, a heaithy amount. How much free space is necessary? Well, that depends a lot on your daily use, and how many people are using the system. A nice rule ~f thumb would be to maintain 1 megabyte, that is 2000 blocks, of free space available on each hard disk file system. If you ever get down to only 100 blocks of free space remaining, you are in imminent danger of running out of free space. The solution is to clean up the file system by convincing users to remove unused files or copy old files to backups. The find command can be used to find old or unused (not recently accessed) files. 3.3. Finding Types of Files: find The find command:~s the system administrator's, and user's, most useful tool for uncovering unused files. The find command uses information that is part of the description of fil~s (the inode) to select files. For example, find can be used to print a list of the files that haven't been modified (written to) in 90 days, as in # find la/jan -mtime +90 -print /a/jan/Pilot/stat.c /a/jan/Pilot/global.c /a/jan/Foreign/term.h /a/jan/Foreign/bio.c /a/jan/Foreign/cio.c II [] which discloses that Jan has some files that haven't been modified in more than 90 days. Files such as this (unmodified for 90 days) are prime candidates for removal to a backup diskette. Another use of the find command is to seek out and remove files in ypur own user directories. For example, some wordprocessors create files with the extension ".bak" every time they are used to edit a file. Eventually, this means that you will have two copies of every file you have ever edited. The find command can locate and remove these files, as in % find. -name " •• bak" -exec "m {}j" % [] which starts in your current directory, and searches it and all its subdirectories removing files with the .bak extension. As a system administrator, you could use this command to free enormous amounts of disk space in the entire file system. However, many 21 people will not take kindly to your removal of their files. Please save despotic measures (removing other people's files without their- permission) for situations when reason has not prevailed. Here's one more idea for using find. Whenever a program bombs, an image of the memory it is using, and a copy of the process status, is saved in in the· current directory in a file named "core". Since not everyone appreciates just what a core file is, (it is used for debugging purposes), they may remain in the file system, unused, forever. You may want to search out "core" files that are over a week long by typing n find la -name .core -a~ime +7 -print /a/len/Edit/YY/core II [] This time, we found only one "core" file over a week old. The next thing to do is send Len some mail asking him (politely) about the file. We have only touched upon the power of the find command. If you want to learn more about find, check out the entry for find in the reference manual, under Programs. 4. USERS Users aren't the people Who use Micronix; users are the names that people log-in with. This may seem somewhat confusing, but "user names" are all that a poor computer knows about. A person logging in as the "root", for example, becomes the root for the computer, regardless of the person's true identity. The computer's only communications with you are the keys that you type on the keyboard, so typing "root" as your user name makes you the root. Files and directories are owned by·users. Thus, logging in as a particular user makes you the owner of that user's files. The "user" system is the basis for "security" on the Micronix system. And, even if you don't desire any security, having each person log-in as a unique user· helps to organize the file system and provides more information about the files in it. The information about user names is kept in the file called /etc/passwd. Each line in this file is called an account. An account describes between five and seven characteristics of a user name: 1 2 3,4 5 6 7 the user name an encrypteq password user and group identification numbers space for a descriptive comment the home directory the program to execute after log-in 22 Here is a typical account from the /etc/passwd file. colons (:) are,used to separate characteristics. Notice that sandy:5ui7i9W5pHdj:21:3:Sandy E. 555-1212:/a/sandy:/bin/sh The user name is the same as the name entered during log-in. The encrypted password is a disguised form of the password the person must know to log-in as that user. All users should have passwords if you' desire system security, but they are not mandatory. It is po~ible for some users to have passwords while others do not. The user and group identification numbers are used in file descriptors (inodes) as a shortened form of the user or group name. Programs that include user names in their output, like owner and Is, use the /etc/passwd file to convert the user identification number to a user name. After the identification numbers, a space is provided for a This is often the real name of the comment on the user name. user, and their Phone number. Comments are optional. When you skip an optional field, there should be two pairs of colons side-by-side with nothing in between them. A /etc/passwd entry with no comment entry would look like sandy:5ui7i9W5pHdJ:21:3::/a/sandy:/bin/sh Users are placed in their home directory a'fter logging in. The home directory is also established as part of the information about a user. For example", using the cd (change directory) command without an argument moves the user to their home directory. The last characteristic of a user is the name of a program to execute after log-in is complete" Usually, this is "the shell", a program that interprets commands typed by the user. It is also possible to use other programs instead of the shell, for example, a word processing program. Having a log-in program other than the shell restricts that user to that program. The user restricted in this manner logs out automatically by quitting the program. More on this in the section on changing the accounts. Micronix initially has only one user: the root, or superuser. Although it is possible to use Micronix with only the root user name, this is not recommended. The root user is only intended for use by the system administrator for backups and maintenance. An inexperienced root user can swiftly destroy the entire file system with a simple command (which we'll tell you about later). To prevent the accidental destruction of your carefully configured Micronix system, you and your associates should always use their own user names. The root user name should be reserved for system administration tasks. 23 How do you create, change, or remove users? Well, it's almost easier done than said. The account command does all the tricky work; all you need to supply is the user name,. One thing we need to mention: only the root user can use the account program. 4.1.' Adding New Users': account Before using the account command, you should select a user name. ' User names can be up to eight letters long. Since this is the name used' for receiving mail, it is best to pick a name that will be recognized by other people. Also, the name should be entirely in lower 'case letters. Let's start up the account program and add the user jayne. II account A) B) C) D) E) F) Function complete. II [] which removes all the ".bak" files, and then copie~ all Jayne's files to a 5 1/4" floppy diskette with a file aystem on it. (If there isn't a file system on the floppy disk, td will tell you and offer to make one for you.) Now, you are safely backed .up. You can remove Jayne's files by typing II rm -r la/jayne Last chance before obliterating jayne. II ["] OK? (Y/N)y The rm command with the -r option is very potent. This is the simple command that can destroy an entire file system if used carelessly (or maliciously). To prevent accidental damage to your file systems, don't log-in as root unless you need to, and only share the root password with people you trust. Now, for the second step. Use the account program and select "b", for "delete an account". A list of the current users will be displayed, and you will be prompted for a "User name:". Simply type "jayne", select "ftl to finish, and you're done. 4.3. Changing Accounts There are four characteristics of accounts that change with the account command: the the the the you can user name, password, home directory, and shell, or log-in program. You will use the change function to add passwords to previously unprotected users, or to change the default home directories and login shells that are created when you add accounts. 25 Changing the user name is the simplest change operation. The account program will request the current user name, then the new user name t and _you're done. From now on, the new user name must be entered at log-in t and will appear in- output as the name of the owner of files. The home directory is not changed. Changing the password is almost as simple. Once again, you will need to supply the name of the account you wish to change. Then t you will be asked to provide a password. While you enter the password, the screen display (echo) will be turned off. Since you won't be able to see what you are typing, you-will be asked to enter the password a second time to double-check what you think you typed. The password is then encrypted for entry in the letc/passwd file. (The passwd command can also be used to enter or change passwords. Non-root users can use passwd to change their own passwords.) The next characteristic that you can change is the home directory. Say, for example t you add a new hard disk mounted in the root directo~y as lb. You;want to move the home directory of user "becca" from.f a/becca to Ib/becca. The first thing you'll need to do is create the directory on the b drive. (account automatically. creates home directories on the a drive, so normally this particular step isn't needed.) Assuming that the new hard disk has been formatted (formatmw), a file system put on it (mkfs), and it is mounted, use the "make directory" conimand (mkdir) to create becca's new home directory: H mkdir Ib/becca H [] You're not done yet, though. You still need to use the account program to tell Micronix to always log becca into that newly-created directory. You also should "give" the ownership of the directory to the user by the owner co~and: H owner -becca Ib/becca II [] If the directory originally created by the account program (/a/becca) isn't going to be used, copy the old files to the new directory and remove the old one in order to keep the file system neat. # cptree la/becca Ib/becca # rm -r /a/becca 4.3.1. Logging Directly Into a Program Perhaps the most interesting account characteristic that you can change is the log-in program, or "shell". Normally, when a user logs in, a program called Ibin/sh is executed. This is the Micronix shell, which puts the command prompt on the screen and 26 sees that the jobs you want done get done. Micronix users almost always access programs by way of the shell program. The thing to understand is that the shell .program i$ just another ~rogram; you could just as easily set up a user that automatically executes a word. processor or demonstration program (or any program, for that matter) as soon as he logs in. When this user finishes with the program, he is logged out of Micronix. So in effe~t, you have created a login name that automatically performs a single function, without giving the user access to other functions o-r to the operat'ing system. Such users are called "restricted users". Remember, though, that "user" in ten;ns of a login name doesn't have to correspond one-to-one with actual human beings. The superuser, who logs in as "root", might be any of ten different people who happen to know the root password. A restricted user may ~n fact be a typist who logs directly into and out of a wo~d processing program, but it could als,o be a 'login name that does nothing but display som~ advertisement on the terminal. Other uses of the restricted. user feature are: o Logging directly into the Cp/M emulator instead of Micronix o Creating login names that perform specific functions like who (report who is logged onto the system), tty (tell me which port I'm connected to), or date (what day is this, anyway?) SIMPLE EXAMPLE You want to set up the system so that you can walk up to any terminal, and without logging on yourself, find out who else is currently logged on. Use account to create a user named "who" with no password and a startup shell of Ibin/who. From now on, anytime you login as "who", you will get the report you wanted. It displays momentarily, then the login banner reappears. BETTER EXAMPLE: To lock a user into a wordprocessor named ws.com (a CP/M program) in the /cpm directory, you would change their shell, with the account command, from Ibin/sh, to /bin/upm A:/cpm B:.I B: A:ws What you have done here is (1) execute the CP/M emulator; (2) then you assigned the A: and B: drives to /cpm and the user's home directory, respectively. (3) You switched the current drive over to the B: drive, where the user's text files would reside. (4) Finally, you executed W8, a CP/M wordprocessor on the A: drive (which now corresponds to directory /cpm). When the user 27 gives the "exit" command for the wordprocessor, he is logged out, and the login banner returns. 4.4. Keeping Track of Accounts, Timewis~ Micronix has a built-in program called last that tells you how much time each user has spent logged ,on to the sys~em. You can get this data In a number of levels of' detail~ including start and finish times of each individual session. 4.5. Account Ma-intenance Summary You have seen that Micronix initially has -only one user, named "root". You quickly grasped that root should create other "users n ,. and learned that the account program was the way to do' this. You can add users and remove them with account. You can specify a password, a home 'directory, and a login shell. Passwords are optional, but strongly advised. Home directories are created for new users on the a drive, but can be moved anywhere in the file system.' The login shell is wide open for customization, but it defaults to the Micronix shell if you don't specify otherwise. You can examine the 'results of running the account program by looking at the /etclpasswd file. Finally, the last program will tell you who has sp'en't how much time on the system. 28 5. ADDING TERMINALS Terminals are a computer's ears and mouth. Computers "listen" to what you type on the keyboard, and respond via the-ir video-screen "mouths". Back in the 70's, when UNIX was being developed, video-terminals, alias crt's, were rare and expensive; teletypewriters were used instead. Teletypewriters are noisy, mechanical monsters that use a gang of solenoids to,pound out a , computer's responses, and have a hard-to-use keyboard of cylindrical keys. Teletypewriters, also known as ttys (pronounced teetee-whys) , are" still¥used to send telegrams and cables. Anyone forced to work in a room full of ttys is slowly tortured to deaf by the noise. Today, we are blessed by having crt's as terminals. Crt's (cathode ray tubes) work quietly, emiting only a high-pitched whine which soon becomes inaudible. They also, don't require paper, ribbons, or solenoids to pound out messages. They have civilized typewriter-like keyboards and work as much as 175 times' faster than the old ttys. Terminals ~re connected to the Decision through serial ports. When transmitting through serial ports, letters ar.e converted from their_internal form of 8 bits wide to a stream of 10 bits, which includes start and stop bits. So, a terminal that operates at 9600 baud, that is, 9600 bits per second, can transmit and receive 960 characters per second. The old ttys can manage, at best, 600 characters per minute. There are a number of variables in the way that these ports operate. Many computers require you to s,et switches inside them so that the computer and the terminals understand each other's communications. With Micronix, these switches have been replaced by programs and files that determine how to set up the ports. The primary file of concern to you is the letc/ttys file, which was discussed at length back in the INSTALLATION section of the User's Guide. In Micronix, the /etc/ttys file is used to establish the initial configuration for both serial and parallel ports. The /etc/ttys file also provides a connection between the ports and the software that will use the ports. For example, the serial ports can be used by either terminals or printers. Initially, the /etc/ttys file is set-up so that the first two serial ports, ttyA and ttyB, will be connected to terminals, and the third serial port, ttyC, will be connected to a serial printer. Let's take a look at the lines of the /etc/ttys file that describe this set-up: ttyA ttyB ttyC The 9600 9600 1200 login login lpr 1st format of the ttys file is quite 29 simple. Each line, describing one port~ begins with the name of the port. If you look in the /dev directory you will find the same names. After the name of the port comes the baud rate and the name of a 'program associated with the port. "login" means that this is a terminal portthat·users can log in on. "lpr" means this is a printer' port 'that will be used by the lpr program. You could swap these . settings around.by editing the file~ and swap your device connections on the Decision accordingly, and things would still work. But don't run off and do that right now. There are 14 different, baud rates that you can use with Decision serial ports. They are 50 75 110 134.5 150 200 300 the 600 1200 1800 2400 4800 9600 19200 Changing baud rates or port connections is done by editing the letc/ttys file~ which can only be done by the root. You can configure a serial port for a terminal by adding the baud rate and the word "login" to the line for the port. For details on the format of the / etc/ttys file', you should review the pages for ttys in the Files part of the Reference Manual. Or you can let the recon program (for recon-figuration) handle the details for you. The recon program makes changes to the letc/ttys file through an interrogative process, similar to the account program. Changing the printer configuration is discussed in the section on Configuring Micronix for your Printer in the INSTALLATION section of the User's Guide., Here, we'll discuss using recon to change your terminal configuration. One point we must make before going any further is that the console must always be connected to port ttyA and set to 9600 baud. During the loading process, Micronix doesn't use the /etc/ttys file; instead, Micronix assumes that there is a terminal connected to tty A and set to 9600 baud. If you'd rather set the console to 19200 baud, you can do so after going multiuser, but you'll have to reset the console to 9600 baud every time you reset the system so that you can communicate with single-user Micronix. (Many terminals tend to lose characters if operated at 19200 baud~ anyway). 30 When you type the reeon command, you will be provided with S choices: 1 Help 2 Configure login terminals 3 Configure printers 4 Quit and ABANDON all changes S Quit and make the changes You want to select "2" to make changes in terminal configuration. The recon program will tell you which terminals are currently configured for login, and ask if you wish to change this. If you respond "y" for yes, you will be required to list all the ports that you wish to'designate as cap~ble of logging users in. (Even if you don't have as many terminals as ports, setting up all the serial ports not used for printers as logincapable may prove invaluable, as will be discussed later in this section under Desperate Measures.) To specify the ports to the recon program, it is sufficient to type just the last letter of the' serial port name, for example, A for ttyA, or D for ttyD. And you will always need to include ttyA, f~r the console. If your Decision has the standard three serial ports, ttyA, ttyB and ttyC, and an additional three ports, ttyD, ttyE and ttyF, on a MULTI/O board, you would enter the letters ABDE F to select these five serial ports for login, reserving ttyC for a serial printer. Next, you will need to enter a baud fate for each of these ports. You will also be reminded, to spec ty 9600 baud for ttyA. You should select the highest speed possible for the rest of the ports connected to terminals, which will usually be 9600 baud. Remember that the baud rate for the terminal has to match what you say here. When you have finished entering baud rates, the main menu (the S choices) will be redisplayed. If you are satisfied, type "Sit to make the changes effective immediately. If you aren't satisfied, you can type "2" and redo things. And if you are hesitant, perhaps you'd do best by typing "4" and getting things straight first. The changes made by the recon program go into effect as soon as you type "5" to quit. The recon program will go and adjust baud rates to agree with the new /etc/ttys file. You can type type /ete/ttys to observe the changes made by recon. If the changes you made disrupt your communications with Micronix, you might have to reset the system and run the recon program while in single-user mode. This is the worst that can happen, and isn't really very bad at all. 31 6. CUSTOMIZING THE ENVIRONMENT The Micronix operating system makes it easy for you to alter the outward workings of Micronix in ways that make day-to-day operations more convenient for the system manager and other users. We call such changes "customizing the environment" because there are no definite prescriptions for specific changes. We will provide suggestions and examples, but your situation and experience will determine Which features you customize. These are changes that anyone can make, with no knowledge of Micronix programming. Now needs? then. What features are open for adaptation to your o your command prompt, o shorthand abbreviations of your most-used commands (aliases), o the order in which to search directories ·for command files, o routine commands to be automatically executed at login time, o routine commands multi-user", o the message of the day, o the initial sign-on message, o the login banner, and o the directories emulator, upm. to and be executed when LST: device to the use system with the "goes CP/M Changes are accomplished by using a text editor to modify certain Micronix files. The editor can be either the Micronix editor (edit) or a program such as WordStar. The easiest customizing changes to explain, and understand, are the various message files. These files are read by Micronix at the appropriate times and displayed on the console or user's terminal. We'll talk about these first. The other aspects that you can customize involve creating a new file with the text editor that contains nothing but a list of normal Micronix commands. The new file must have a certain name and be in a certain place so that Micronix can find it at the appropriate times. A typical example of this feature is to put an fack command in a file called /ete/re, so the file system automatically gets inspected every day when you go from single to mu'iti-user mode. You could put mount commands into the same file to get any additional hard disks mounted without having to enter the commands manually. 32 The files involved in this customizing process are called: o /etc/rc - the routine commands to be executed while going multi-user, o .sh - commands for customizing the user's interface, the shell, and o .upm - drive and LST: device designations for the CP/M emulator, upm. We'll discuss follows. 6.1. each of these files in one of the sections that Message Files The message fi,,~es are ordinary ascii character files that are transmitted to a terminal in exactly the form that they appear in the file. Thus, by using an editor, you ~an create the very image that r~ want to appear on the screen. NOTE If you use a CP/M-based editor ,like WordStar or NewWord, you will need to run the clean program on the file after you finish editing it. Repeat this cleaning process each "time you edit the file,. Example: after editing the message of the day with NewWord, at the Micronix prompt enter clean letc/motd. In the examples we will be using, we use the Micronix edit program. The edit program is a line-oriented editor, meaning that it works on a single line at a time. This makes it nice for the purposes of this manual, but you may prefer to use a screen oriented editor. Screen-oriented editors allow you to edit a whole screen at a time by moving the cursor to different positions. WordStar and NewWord are screen-oriented editors. 6.1.1. Message of the Day The contents of the message of the. day file appear when users log in. The same message is used for all users, making it an ideal way to convey information of general interest. Messages are entered by editing the flmotd" file, for message of the day, in the "/etc" directory. 33 For example, to change the message to read "The hard disk is almost full again. Please remove old files", you would enter the following: /I cd /etc /I edit motd "motd", 1 lines COMMENTS (don't type) deletes' all lines :%d adds new lines :a The hard disk is alaost full again. Please remove old files. until you type the dot in col. 1 • writes it out to the disk :w "motd", 3 'lines :q and quits editing! /1 [] Now, every person who logs on to the' system will see the message about the hard disk filling' up. The message of the day file can be changed every day, as needed. Your next message could be a thank you to the people who cleaned up their act by copying old files to backups, and removing them from the hard disk. Remember that you can temporarily get rid of the message of the day by deleting the file /etc/motd (rm ./etc/.otd), or by changing its name (mv /etc/motd /etc/o1dmotd). 6.1.2. Custom Banners The banner appears on terminals While Micronix is waiting for a log-in name. You may wish to edit the "banner" file in the "/etc" directory to customize it for your environment. You could, for example,edit the banner to reflect the name of your business. Note that in this example you delete the old banner entirely. If you just want to make a few changes to it, DON'T delete it first. /I edit /etc/banner "/etc/banner", 15 lines COMMENTS (don't type) :%d removes the old banner ready to add lines :a WEST COAST SHIPPING AND STORAGE "You don't wait for our freight" Tracking and Invoicing System a dot in col. 1 to finish • :w w writes the file, and "/etc/banner", 9 lines :q /1 [] q quits 34 This editing session changes the banner to something more appropriate for the business described above than "Micronix" in 3D letters. Of ,course, we don't mind if you leave our banne'r up. If you don't want a banner at all, just rm or mv the file. 6.1.3. Sign-on Message The sign-on message is displayed on the console whenever Micronix is reset. Thus, only the first user to log-on will see this message. The delivered sign-on message assumes that, this user has logged in ~s "root", and issues reminders about the responsibilities and hazards of being the superuser. You can change this message, which is in the ,file /etc/signon, to suit your particular environment. For example, you might include in the message instructions for running fsck, correcting the date and going mult~-user. This way, instructions are always available to the person bringing up the system, and can be edited as necessary to reflect your individual practices. 6.2. Command Files "Command files", in the parlance of UNIX, are known as scripts. Just think of a script used by actors and you get the idea. A script is a list of commands to be followed that can be interpreted by a program, usually the shell. As mentioned previously, a script is just a list of the same sort of commands you use day in and day out; using the script, however, saves you the time and effort of remembering to' enter' routine commands. The scripts that we are inte·rested in here are the ones that Micronix will "automatically" look for at certain points. The is executed when the first person to log in at the console types "exit"t causing the system to "go multi-user". The .upm script is used by the upm program to designate disk drives for the CP/M emulator. The next three sections give examples of what you can do with these scripts. 6.2.1. Log-in Commands: The .sb Script The .sh script is the user's principal tool for customizing his or her working environment. After a user has typed in their log-in name (and their password), a shell program (command interpreter is started for them. You may recall from our earlier discussion of "accounts" that a user has a home directory and a login shell. The home directory is usually la/username, and the shell is normally a program called Ibin/sh, which processes Micronix commands. When the /bin/sh program starts up, it always looks in the user's home directory for a file named .sh If the shell program finds the .sh file, it reads it and executes the commands that it finds there. Applications of the .sh file are given below. If .sh isn't there, the shell program just proceeds to display the Micronix prompt. 35 Turnkey Users The .sh file may seem to be theidea.l method for creating a "turnkey" user, that is, one that automatically executes a file. (If you want to create turnkey user~, look up the account command description, earlier in this chapter, for instructions on Changing the Shell.) The difference between using .sh and account for turnkey users is that' account creates restricted u'sers" that is, they are logged, out when they finish with the turnkey program. The .sh turnkey programs exit to the Micronix prompt without logging the user 'out. If you only use .sh to start up turnkey programs, you really misusing .sh, and overlooking most of its potential. are Aliases With the .sh file, you can change the name of, or abbreviate, your favorite commands. This is called creating aliases. An alias has exactly the same meaning as'an alias in real life: an ass'umed name. The aliases' that you will use are there to replace long or often-used command lines with an alias named by you that is easy for you to remember.,' For example, typing %.a1ias ws "cd -/ws; upm b:/backupws" % [] causes your shell to substitute the letters "ws" for the line "cd -/ws; upm b:/backup ws", saving you 22 keystrokes. If you often work with CP/M formatted'floppy disks, here are several aliases that you can use: alias fard "far mfa" alias farr "far mfa -r" alias farx "far mfa -xu , (displays floppy directory) (copies to the floppy) (copies from the floppy) The "far" command reads or writes floppy diskettes in CP/M format. (More information about far is contained in the section on COPYING FLOPPY DISKETTES, and in the Program entry for far.) If you have trouble keeping the r and x flags straight, you could create these aliases: alias copy to "far mfa -r" alias copyfrom "far mfa -x" 36 As an example ~ the following command,s show the listing of the filenames on a diskette~ and copying (extracting) a file from the diskette: % fard maint.bak first.doc install. txt %' copyfrom first.doc % [] There are other aliases that are useful for dealing with floppy disks that have Micronix file systems on them. To use a Micronix disk~ you must first mount ,it (see the section on COPYING MICRONIX DISKETTES~ or the program pages for moUnt.) You can create aliases for mounting and unmounting diskettes~ as in alias mof "mount mfa If;dir If" alias umof "cd; umount mfa" to save time when using these commands. These examples demonstrate stri~ging sequential commands together with the semicolon. "mof" connects the floppy file system to the If directory and then displays the current directory there; "umof" takes you out of that directory (a precondition for unmounting) back to your home directory, and then unmounts the floppy. By keeping all these aliases in your .sh fi1e~ they are ready to use as soon as you log-in. You can check which aiiases you have in effect at any time by typing the command "alias" by itself. Path Another aspect of your environment that you might need to change is called the path., The path is the list of directories to be searched for the program that you have requested. The default path is: first, your current directory; next, the directory Ibin; and finally the directory lusr/bin. You would want to change your path if, for examp1e~ you have programs installed into a directory that is not part of the default path. Suppose you have added a directory with database programs in it, called /db. You would add this to your path by typing path • /db Ibin lusr/bin making Idb the second directory to be searched for commands. (The dot stands for your current directory.) If you want this path to be in effect every time you log in, put the path ca.mand in your .sh file. Otherwise it stays in effect only until you log out. 37 Another interesting, and fun~ aspect of the environment to change is 'the prompt. The prompt tha t comes with your system is a percent sign (%), or a pound sign (H) for the superuser.You can change the prompt to make it more descriptive by substituting the user name for the percent sign, for example, prompt JIrik: " changes the prompt to "rik: f l . Leaving a space after the prompt If having your own name makes your command line easier to read. on the command lines isn't interesting enough, you can try s,omething like prompt "-What is your command. master? .. for a real feeling of power, or prompt "Like, how's your karma?" if - you want to be mellow. Adding the prompt line to y~ur .sh file will make it automatic arid permanent, until you remove the line :from' • sh. Miscellaneous .sh Tricks You can also add other commands to your .sh file. Yo~ can include the mail command, for example, and automatically check your "mailbox" while logging in. Another neat one is to include the command echo There are 'who I lines' users on the system. which will report how many other users are logged in. The thing to remember with most .sh commands is that they will take some time to execute EVERY time you log in. If you are sometimes impatient, you can interrupt these commands by typing rubout or delete. If you are always impatient, refrain from adding commands to your .sh file. The alias, path and prompt commands are built into the shell so they will be done quickly; thus, they can still be used by impatient people. 38 The .sh file belongs in your home directory. Use an editor program to create your own .sh file. (Remember to "clean" the file if you create it with a CP/M editor like NewWord). For starters, here is the .sh that we have been talking about ("rik" on the first line is the customized prompt): rik: type .sh alias fard "far mfa" alias copy to "far mfa -r" alias copyfrom "far mfa -x" alias mof "mount mfa /f;cd /f" alias umof "cd;umount mfa" prompt "rik: " path. /db /bin /usr/bin echo There are ' who I lines ' users on the system. rik: [] 6.2.2. ·Routine Commands File: /etc/rc The commands in the /etc/rc file are automatically executed as part of the proces& of going multi-user. After the root user has accomplished the' tasks of checking the root file system and setting the date, the command "exit" is typed to make the system go multi-user. 'Since you can count" on this point being reached reliably, it is a good place to perform routine tasks. Typical tasks that belong in ary files from the previous day's file systems, mounting those file Let's look at the /etc/rc file Micronix system. this file are removing temporactivities, testing additional systems, and waking up daemons. that may have come with your /I type /etc/rc echo Starting update daemon echo Starting network daemons netdaemon update II [] The echo commands are pretty straightforward: they display the message that follows them on the console. netdaemon is the command that wakes up the network daemon which manages networking. update awakens the update daemon. The update daemon is responsible for periodically executing the sync command, which synchronizes disk buffers in memory with the appopriate blocks on the disk. No multi-user system should be without an update daemon to watch out for it. with it. So, you see that you already have a routine command file some commands in it. Now we'll tell you how to improve on One of the things that you do when you use a computer is generate temporary files. Some programs, such as edit, create temporary files when they are used. Humans are also known to be 39 the creators of temporary files • Micronix has prepared for this by having a spec~al directory appropriately named /tmp. Making the /tmp directory truly temporary should mean that files are erased from /tmp on a regular basis. This is obviously a job for the rc file. Including the commands echo Removing temporary files era /tmp/* ~roa /tmp. sends a message-to the console and removes any files in the /tmp directory. NOw,- files left in the /"imp -directory are truly temporary, because they will be removed by the rc.- file. Another routine task that you ,may be faced with is mounting additional file systems. Your Mlcronix system has the root file system "built-into" it, so it isn't-mountable. But, if you buy another ha_rd disk to use with your system, it will need to be mounted every time after you reset the system. To mount the disk drive, you have to enter a mount command, along with the name of the drive and the place in the file system to mount it, and wait for the process to complete. For example, to mount a second 16 megabyte hard disk, the command is mount m16b /b You should put this command in the rc file have to think about doing it every day. And, remember that file systems should be checked mounted. So, we'll bundle these two commands them to the rc file, as in so that -you won't we hope that you before they are together, and add 'echo Checking the second file system. fsck /dev/m16b echo Mounting the second file system. mount m16b /b When you type "exit" from single-user mode, the commands in the rc -file will be executed. After the echo command reports "Checking ••• ", the fsck command performs-its thorough checks of the unmounted file system on the second hard disk. This will take about 5 or 10 minutes, but is well worth the time. Then, the second echo command notifies you that it is "Mounting ••• ", and the mount command adds the new file system to the directory lb. From this time until the system is reset, the second hard disk will comprise the /b directory. 40 OK. Let's add the commands we discussed to the rc file and see what we've got: II type I etc/rr;. echo Checking the second file system. fsck /dev/m16b echo Mounting the second file system. mount m16b /b echo Removing temporary files from /tmp. era Itmp/* echo Starting upWate daemon echo Starting network daemons netdaemon update 6.2.3. Configuring upm With .upm "upm" is Micronix's way of imitating CP/M~ which is an operating system quite distinct from Micronix. It is there to enable you to take advantage of all the well-tested and inexpensive software atfailable for CP/M systems. ".upm" is a file that you create to tell upm Where to find and put things. CP/M has a very different file system from Micronix. The location of a file under CP/M is determined by which dis,k drive it is on. Therefore a CP/M filename might be "A:frogeyes''-, meaning the file "frogeyes" is on drive A:. Get this straight right now: There is no inherent connection between CP/M drive names (like A:) and Micronix directories (like la). You make these connections with explicit commands. The details of using upm are discussed under "upm" in the Programs section of the Reference Manual. The .upm file sets up drive designations for the CP/M upm. A .upm file is no't a shell script. Rather~ it is a set of instructions that are passed to upm. When upm begins to execute, it looks for a .upm file in either the home directory (like a .sh file), or in the current directory. A typical .upm file looks like emulator~ % type .upm a:/cpm b:./ Ist:/dev/ttyC % [] which sets the A: drive to the /cpm directory and the B: drive to the current directory. Any printer output to the LST: device is routed to the port ttyC~ where presumably a serial printer is connected. The upm entry in the Reference manual provides a clearly written and detailed description of how upm works~ and what you can do with your .upm file. 41 7. SECURITY Whether you like it or not, your Micronix file system requires that you do something about security. You might only need to secure your files from being erased by the nine year old computer wizard on your home system. Or, the files you wish to pr-otect may contain truly sensitive material, such as your payroll accounts ~ 'financ'ial analysis of your next year's sales potential, or letters to your mistress. Security in Micronix .is ~ocused on two issues: passwords and file access permission. Passwords are relatively easy to discuss and implement; file access permission is' a more .complex topic, and an ongoing process. This being the case, we'll talk about the easy one - passwords - first, and tackle access permissions next. Finally, we'll talk a little about file systems on floppy disks, and the threat they may pose to your system's security. 7.1. Passwords, Passwords are en,tered for each user with the passwd command or with· the change account selection of the account program (explained toward the beginning of this division). Thepasswd program prompts the user for the information required, and is self explanatory. Whenever passwords are entered, the display to the terminal is turned off. So don't be surprised when the letters you type for your password are not displayed. This is done for security. Passwords are kept in encrypted form in the file /etc/passwd. A user's "passwd" entry also contains several fields of information, which were collected when the user entry was created with the account program. This includes the user's name, a numerical user and group identification number, comments about the user, his home directory and command interpreter program. This informaion was explained previously in the section on Users. A typical /etc/passwd file will have entries that look like: root:kse86bklsdf:O:O:super:/:/bin/sh pam::l0:l:Pam Smiles, sec.:/a/pam:/bin/sh The colons separate fields of information. Passwords are the second field of information. Looking at the -encrypted password for root only discloses the encrypted word. Thus, the passwd file may be read by anyone without disclosing anyone's unencrypted password. Notice that Pam is not using a password so her password field is empty (the two colons come together ::). Because Pam isn't using a password, anyone can log-in as "pam" and become the owner of her files. Now, maybe the files owned by Pam aren't considered sensitive security-wise, but the issue extends beyond Pam's files. For example, just knowing 42 Pam's name would allow an intruder to log on to your system. And once.logged in, the intruder has access to more than Pam's files. The first thing that a clever intruder does is look at the /etc/passwd file and get the names of other user's without passwords. The /etc/passwd file cannot be read-protected without disrupting other Micronix programs, thus the passwd file will always be accessible. The intruder who has logged in 'as Pam has free access to files owned by Pam, to unprotected files owned by anyone else, and to files shared by other members of' Pam's group. (See the next section or the Programs division entries for ebmod and. owner to get more informat-ion on groups and file ownership.) If you feel like we're trying to encourage you to force all the people on your system to use pas:swords, you're right 4. Although it is possible for an individual user to provide protection for his or her files, your system is exposed to great danger by having even a single user without a password. Always The individual user can add a password to new user accounts. change the password if they so desire. And periodically check the ·password fi~e for 'Unprotected accounts. You can use the grep program to pick out accounts with blank password fields. II grep "::[0-9]" /etc/passwd pam::lO:l:Pam Smiles, sec.:/a/pam:/bin/sh II [] The grep command picks out the lines in the file that contain two colons (::) back to back followed by any number ([0-9]). Don't forget to quote the search pattern ("::[0-9]") or the shell will expand the pattern, before it reaches grep. An entire chapter could be written on ways of broaching file system security~ Breaking a system's security has become something of a sport among hackers (computer programmers and lifeforms that prefer dealing with computers to dealing with people). Most of the ways of breaking into UNIX systems, which includes Micronix, rely on having access to a user account. Password protection denies this basic access to intruders. Hopefully, the people who have legitimate access to the system won't be your security risks by giving away their passwords. Be especially careful deciding with whom you will share the root password. 7.2. File Access Permission Micronix creates files that are accessible to any user. The owner of a file, that is, the user who requested the creation of the file, may choose to limit access to the file. This is useful even in a solitary user environment because it allows the user to write-protect files to prevent accidental erasure. In more sensitive environments, changing the access permission of files must become a routine, as files are created without any protection. 43 Micronix divides the users that may access a file into three categories: o owner - the owner/creator of the file, o group - members of the owner's group, and o other -all other users. The owner. and other categories are clear in themselves; groups are a special category that hasn't yet been.. mentioned. The group category allows the users on a syst~~ to sh~re aec~ss with .other group members. Membership in a group is determined by the information in. the fete/group file. We would like to refer you to the Files section of the Reference Manual for more i~formation about establishing group, membership, if you are interested. Our experience has shown us that. few installations actually make use of groups. ' For each of the three categories of users (owner, group and others), ,the same three ·types of access permissions are possible for files: ' read,. write and execute permission. The, 1scommand ~th -1 (long listing option) displays the access permissions for files, as part of the listing. As an', example, we can create a file by redir'ecting the output of an echo' command and look at the access permissions for it: % echo Hello % 1s -1 test rw-rw-rw- > test 6 Jun 14 17:38 test 1 rik % [] The first nine characters in the listing for "test" .are the access permissions. (The name'of the file owner, rik, appears' shortly after the access permiSSions). With only a little bit of deduction, you can see that r stands for read, w for write and for permission denied. What's missing in this example is x for execute. Micronix assumes that redirected output will be a text file, not an executable one, so execute permission is denied here. You should also note that read and write permission is given for all three categories: owner \ other group I / rw-rw-rw- This means that our test file is totally unprotected. Now, let's take a look one of the programs in the /bin directory and see how it is protected. % 1s -1 /bin/fack 1 root rwx--x--x 27833 Mar 31 11:34 /bin/fsck % [] 44 The fsck program is certainly one that you wouldn't want to erase by accident, or allow anybody to change. Looking at the Is listing for fsck, you can see that the file is owned by the root user, ,who has read, write and execute permission. All others have execute-only permission: reading and writing the fsck file is denied. So, anybody may execute the fsck program, but on}..y tlie root can copy it (read permission) or change it (write' permission). Keepi~g in mind that files are created with all permissions granted to everyone, you need to. know how to set the permissions to protect your files and directories. The ebaod program can change the access permissions on b,oth files and directories. The description of how to use the chmod program in the Reference Manual is quite good, so we won't repeat it here. Rath~r, we~ll give some examples ·of how to protect your files and directories tha t will work until you, fe,el like reading the reference entry. The most common way that you,will be setting your access permissions to protect a file is removing all permissions for others. Then only ~ou, the owner, will be able to access the file. The way to do this is with the command % chmod go-rwx test % Is -1 test rw------- 1 rik % [] 6 Jun 14 17:38 test which denies (-) the group and others read, write and execute permi,ssions on the file test. You will substitute your own . filename(s) for "test" when you use chmod. Since you ,will need to use this chmod command to protect any file that you create, you might want to alias it to save yourself having to type it and remember it. For example, % alias deny "chmod go-rwx" % deny topsecret % [] makes "deny" an alias for "chmod go-rwx", and on the second line, "denies" access to the file "topsecret" to the group and others. Add this alias to your .sh file to make it automatic. To add write-protection to the files you don't want to inadvertantly erase yourself, you can use the command % ehmod u-w topsecret % [] which write-protects the topsecret file from your, own misdoings. Read, write and execute permissions work somewhat differently for directories. Read permission allows the listing of the directory with dir or Is. Write permission allows files to be written in a directory, or filenames changed. Neither read nor write permissions do anything that protects the files within 45 the directory, that is, a file that is in a write-protected directory may be written to, unless the file itself is writeprotected. In Micronix, a directory is a special file containing filenames and links to files. Read or write protecting a directory controls the ability to read or write 'in the directory,. not in the files listed by the directory. Execute permission for directories means permission to search through a directory. Essentially, searching is a form of reading 'the directory performed by the operating system to access the link to a file. When eXecute/search permission is denied on a directory, ·no files or subdirectories listed in that directory, may be read or written. This means that you can protect files within' a direc,to,ry and its subdirectories by removing execute' permission for it,~ The deny alias we set up earlier will serve here to remove execute permissions (and incidenti1y read and write permissions) 'from adirec.tory that we want to protect. % mkdir -secret % 1s -1 secret d--rwxrwxrwx 1 rik % deny secret % 1s -1 secret d-rwx----1 rik 32 Jun 15 11:04 secret 32 Jun 15 11:04 secret % [] ~n this example, we created 'a directory named "secret" .and displayed its initial access permissions: it's open to anyone. Then, 'we changed it using the deny alias (for chmod go-rwx) to remove'petmissions for everyone except the owner. NOW, any file copied or 'created' within secret; and any subdirectories, will be protected without having to use chmod on the individual files. 7.3. Protecting Diskettes There are three system security aspects relating to diskettes: backups, the standalone Micronix diskette and mounting diskettes. The issues here a somewhat advanced; only an experienced UNIX or Micronix user would be a real threat in these cases. Access to the root user (presumably on a different Micronix system) is also necessary for most of these techniques. And, 'adding protection for these cases may involve a nuisance factor that far outweighs the benefits. The most obvious of these threats involves backup diskettes. While you are backing up your hard disk, you are creating duplicate files on a file system on a floppy diskette. These 'files, as are all files in Micronix, are created with all access permissions. What this means is that anyone who has access to the backup diskettes can mount a diskette and examine any file on it. There are two things which you can do to prevent this: keep the diskettes locked in a safe place (not a bad idea in general), and use chmod to limit access to the files on the diskette. For example, to limit access tO',files -on a ba'ckup di'skette, you need to type 46 % mount mfa /f % chmod go-rwx /f/* % umount mfa % [] The chmod command limits access· to the owne·r, presumably the root, of the files on the diskette. As explained in the previous section, removing execute/search permission from a directory prohibits access to its files and subdirectories. This three step process would weed to be repeated for any backup diskette containing sensitive files. You can make this process simpler for yourself by creating a file with thes~ three commands in 'it, and executing the file by using the source command with the diskette already inserted. The Standalone Micronix diskette forms the second diskette security hazard. Anyone who has access toa copy of the Standalone and can reset the 'system can become the superu$er, and acceSs any file on the hard disk file system. Once again, the solution is to keep the Standalone diskette locked in a safe place. Adding ·a'password to the root user on the Standalone is not advised, because having the Standalone is protection against forgetting or losing the root password. The third and final hazard posed by floppy diskettes will be outlined only. Essentially, a person with access to the root user on a different system can create a shell progra1tl on a floppy diskette that will enable him or her to have root privileges on any Micronix system that the diskette can be mounted ori. This is getting rather paranoid, since it involves: a knowledgeable user with bad inten.tions who knows the root password on another Micronix system, and an ordinary password on your system. If you feel that it is necessary to protect yourself from this, you can restrict the use of the mount command to the root user by using chmod (or the deny alias). Then, only persons who know the root password will be able to mount diskettes. (Anyone knowing the root password won't need to mount a special diskette to have unlimited access to the file system). Such draconian measures as this are generally reserved for' banks and the National Security Agency because of the inconvenience involved in restricting mount to the superuser. To summarize, most of the security problems involving diskettes can be eliminated simply by keeping the diskettes with sensitive material on them under, lock and key. Since you wouldn't want to lose any of these diskettes anyway, locking them away is a practical and almost painless solution. 47 COPYING FLOPPY DISKETTES 8. You will be duplicating floppies to create redundant backups of the hard disk or if you have data you want to share with other users. We'll give you step-by~step.- instructions for copying diskettes momentarily. "Source diskette" means the floppy you want to copy; "destination, diskette" is the freshly formatted that you'll copy to. The general procedure goes diskette something like this: 1. Use the df command to make sure you have enough room on the hard disk to receive the contents of the source diskette. 2. Format the destination diskette with the fdj program. 3. If you want the destination diskette to be "mountable", that is, if you want it to possess a Micronix file system, give it one with mkfs. 4. Copy the source diskette into a temporary hard disk directory. 5. Copy the temporary hard disk directory to the destination diskette. 6. Remove the temporary-hard disk files. NOTE: If you are copying a floppy that was produced by dumping a single chunk of the hard disk, it would probably be easier for you to get duplicates.by repeating the hard disk dump instead of using the procedure above. And, if you have two floppy drives, you won't need to use the hard disk for temporary storage because you can copy directly between the floppies. 8.1. Preparing Your Diskettes (Formatting) New diskettes must be prepared before using them with your Decision. This preparation is called formatting, and serves three functions: o dividing the diskette slicing up a pie, surface into sectors, o filling in the sectors with an "empty" byte E5), and o marking the first sector of the diskette with a byte that labels the diskette with the type of format used. pattern, like (the When you buy floppy diskettes they have (most likely) been preformatted. This is all well and good because diskettes are tested during the formatting process. However, you want to 48 format, diskettes specifically for use with the Decision for the best results. Also, if you are planning to recycle old diskettes, it is a good idea to reformat them, as formatti~g will erase everything on the diskette. Formatting erases EVERYTHING that was previously on a diskette, so never format a diskette that contains files you want to keep. The Micronix formatting program is called' ,fdj, short format DJDMA (DJDMA is your floppy disk controller board.) get the ball rolling, 'you can type for To % fdj DJDMA Formatter 5 inch soft sectored formats A) Morrow single sided B) Morrow double sIded 5 inch hard sectored formats C) Single sided D) Doub1e sided E) Morrow Micronix 8 inch formats . F)' CP/M standard singl~ density G) Mo~row CP/M double density H) Morrow Micronix Do it yourself I) Other which invokes the fdj program in interactive form. We'll show, you how to use fdj's ,menu first, for 5 1/4 and 8 inch formats, then we'll explain fdj's command line options, for noninteractive use. 8.1.1. FDJ's Menu Selections: 5 1/4" Drives If you have a 5 1/4 inch drive, you will be selecting one of the first five (A-E) formats. These five formats are divided into soft and hard sectored types. Micronlx diskettes are hard sectored. Hard sectored means that there is a hole punched in the diskette material marking the beginning of each sector. There is also an extra hole that marks the first sector. Micro Decision diskettes are soft sectored. Soft sectored diskettes have only the single hole that marks the first sector. You can check to see if a diskette is hard sectored or not by looking through the small hole in the, diskette envelope (called the index hole) and rotating the disk material through the large hole in the middle and counting the holes. As soon as 49 you have seen several holes t you know you've got a hard sectored diskette. Soft-sectored diskettes have a single index hole in them. Please be aware that there are also 16-sectored diskettes available which will not work with your system (you use 10)t but these are rare. If you are planning to use both sides 'of the diskettes maximum capacitYt buy diskettes certified as double-sided. for 'The -f-i-rst two -fo-rmat -selections· are fQr creating diskettes compatible with the Morrow Micro Decision. The Micro Decision format create~ 1024 byte sectors on soft sectored diskettes. Obviously, you will want to select A for compatibility with single sided Micro Decisions t and B for double sided • .The next three format selections are for hard sectored diskettes. Selections C'and D create formats compatible with North Star Computers hard sectored formats. The North Star format is 35 tracks of 512 byte sectors. You must t of course, select either single or double sided depending on the capability of the other system you wish to exchange information with. All Micronix systems come equipped with double sided drives. The E selection is the one for use with Micron'ix systems. E selects double-sided, 512 bytes sectors and 40 tracks per side. This gives you the maximum storage capacity possible for 5 1/4" diskettes. After selecting a format for 5 1/4 inch diskettes, you will be asked to choose a drive number. As far as the fdj program is concerned, your drives are numbered from 0 to 3. In single drive systems, the drive number will always be zero. (Confusion factor: some programs number drives 0-3, while others use letters a-d. There is a direct correlation between the two. The thing that determines the drive number isa jumper or switch inside the disk drive.) . Selection: A) drive B). drive C) drive D) drive Selection: 0 1 2 3 Drive O. Insert a write enabled diskette in 5 1/4 inch drive 0 Press promp~, respond sysgen. Using the SYSGEN program is very simple. We would like to point out that when you type drive .names you don't want to type a sysgen Morrow Designs Sysgen Version 4.4 Source drive name (Or return if in memory) A Source on A, then type return A>[ ] When SYSGEN asks for your "Source drive name", you respond by typing the letter "A". The next line "Source on A" is just asking you if you are ready. If the old Cold Boot Loader is still in the floppy drive, you are ready, so type . After you see the line "Function complete", remove the Cold Boot Loader from the drive, and insert the copy. Type "A" for "Destination drive name", and sysgen mlOload Morrow Designs Sysgen Version 4.4 Destination drive name (Or return to warm boot) A Destination on A, then type return Function complete Destination drive name (Or return to warm boot) A) [] Remove the Cold Boot Loader diskette when the line 60 "Destination drive name" appears and insert the diskette to be copied to. Then type "A", and . The difficulties you might encounter are: the diskette you are trying to use is not formatted correctly, or the file you are trying to copy, for example ml0load, is not on the CP/M diskette. The five files we mentioned previously should all be on the ','Cold Boot Loader (CP/M)" diskette that was delivered with your'system. You can use the CP/M "DIR" command to examine the directory of the diskette you are using. Unformatted, or wrongly formatted diskettes, will cause the SYSGEN program to get lost and never complete. This is a nonrecoverable error, meaning that you will need to reboot CP/M. The section called PREPARING DISKETTES (FORMATTING) will help you get your diskettes formatted'correctly. 8.5.3 BaCKUp' of the Stand Alone Master You definitely want to have more than the single copy Stand Alone Micronix diskette that came with your system. This is the diskette that is used to rebuild Micronix from backups if the hard disk has been corrupted, or if you are in need of Desparate Measures (see the chapter by that name). We even considered "forcing" you to make a copy, but decided to leave it up to you to do. There are two steps in making a copy of the Stand Alone diskette. The first step is to copy the diskette using the instructions in the section called Copying Micronix Diskettes (8.4.1). The second step is to make the diskette loadable by using SYSGEN (under CP/M) and copying the floppy disk loader (SYSGEN DJLOAD) as explained in the previous section' (8.5.2). Or, you can use an alternative procedure that works for soft sectored diskettes ONLY. Stand Alone diskettes produced after November '83 are soft-sectored. The procedure is to copy a disk image to a temporary file, copy the file to a formatted diskette, and erase the temporary file. Simply type, % cp /dev/mfa2 /tmp/temp % cp /tmp/temp /dev/mfa2 % era /tmp/temp remembering to change diskettes between the first and second copy. This procedure will work for any 80ft sectored doublesided diskette. Once you have finished the copy by either method, put both the original and the duplicate Stand Alone Micronix diskettes away in secure locations (preferably two separate secure locations, to guard against fire or theft). 61 9. BACKING UP YOUR HARD DISK ------- Making regular backups of the hard disk is one of those onerous tasks that most people don't like to do. And, you can probably use your .Micronix system most of the time without needing to resor~ to your backups. Of course, if fsck discovers that a prized file has been trashed, or if a well intenti.oned associate cleans up your directory, .wiping out two months work, you will wish that you had been keeping good backups. What are good backups? Well, ideally, you should be able to recover 100% of the most recent version of a'file from a perfect backup. This is possible for files that are unchang.ing, for example, a configured version of your favorite word processor program.' But for files that are in the process of being modified, or written for the first time, everything that has . changed since the last backup is missing from that ba·ckup. The trick is'to decide how often to perform backups. With a once a week backup procedure, you risk losing as much as a week's work. Then again, if you' back up every half hour you will spend most, of your time backing up instead of worki'ng. We will outline tw() procedures for backing up: a short term procedure and a daily procedure. You should optimize these yourself by selecting the length of time between backups for the . way that you use your system. 9.1 Short Term Backups Short term backups are copies of individual files that may be created at any time by the individual responsible for the files. Since this is dependent on the individual moods and whims of users, it is not considered totally reliable. But, if a person has failed to make a backup during the day and loses his file, than he or she is responsible for it. Basically, a short term backup is made by using tAe copy (cp) command. The user simply makes a copy'of the file he or she wishes to backup in another directory. To restore a lost file, the user copies it back from the backup directory. Ideally, the backup directory is ona different disk device. For example, if you have a second hard disk that is mounted on the /b directory, you can make your temporary backups by coping to a directory appropriately named /b/backup. To copy a file named BACKUP from the current directory to the backup directory, you would type % cp BACKUP /b/backup Now, you have a copy of BACKUP in a place that will be safe even if your current directory is lost. If you aren't so disks, you still can floppy disk with a directory, and at the fortunate as to be able to afford two hard use short term backups. You can mount a file system on it to use as the backup end of the day. either put the disk away as 62 an additional backup or erase all the files on it and reuse it the next day_ Or, create a backup directory on your root file system by typing % mkdir lbackup and let backups. people use this as their routine place for short term At the end of the day, before performing a system wide (permanent) backup of the hard disk, the files in the packup directories should be removed. This will prevent the backed up files from being backed up twice on the permanent backup, and keep the hard disk from filling up with redundant 'files, that is, copies of old temporary backups. You can remove all the files in the backup directory by typing II rm /backup/* 1/ [] 9.2 System-wide Hard. Disk Backup ~. Of all the things that you will do with your system,. backing up the hard .disk is both one of the most important. and most neglected tasks. Only businesses and universities with full time computer system personnel actually seem able to routinely back up their systems. All we can do is to urge you to follow the suggestions in this section which will provide you with some protection from the winds of fate, and the inevitable process defined by Murphy's law. 9.2.1 First Hard Disk Backup When you received your Micronix system, it came with a complete set of backups for the operating system, programs and manual pages. These files are, by this time, all on your hard disk. You have also configured your system by adding a printer, passwords, user accounts, etc. What we'd like you to do is to .backup the entire hard disk the first time. Then, you will have a set of diskettes with your entire CONFIGURED system on them. If you ever need to rebuild your root file system from scratch, you would use this first set of backup disks and not need to reconfigure. We will name these diskettes the CONFIGURED MASTERS. This backup will take longer than any other backup. This is because you will be using the -i (incremental) option for the first time. The incremental option writes an entry in the file /etc/dtab with the exact time of day of the backup, and the directory where the backup started. In subsequent backups, this entry will be used to determine which files have changed since the last time you backed them up. The subsequent backups are known as incremental backups. 63 To perform your very first backup, you first need to prepare a pile of diskettes. For systems with 5 1/4" drives, prepare at least eight diskettes by formatting them. If you are using an eight inch drive, you will need four prepared double-sided diskettes. For information on formatting, read the previous section on Preparing Diskettes. Then, label these prepared diskettes with the title CONFIGURED MASTERS VOLUME II DATE: filling in the date, and numbering the Volumes starting with 1. use. Insert the Volume 1· diskette Then type, in the drive that you want to II fp cril / for a disk in 5 1/4" floppy drive 0, or # fp crilf /dev/fla / for the first 8" drive. The £P' program should merrily copy the. entire files system. When you run out of·room on the floppy disk, fp will advise you to· insert a new disk. The fp program copies a portion of the file system that you wish to backup with the pa thnames unchanged.' For example, if you have a file named /a/rik/ws/.upm,, the directories a, rik and ws will be saved on the backup diskette, and the file .upm copied. This means that the file .upm will have identical pathnames on the hard disk file system and fp backup volume. 9.2.2 Daily Hard Disk Backups For every other backup after the first, you will be using the incremental feature of backup. The incremental option, -i; will cause fpto read the /etc/dtab (for date table) file to get the last time 'a backup was performed on the directory. This will result in only the files that have been modified or created since the last backup being included in this backup. You can use the same diskette that you used for the first daily backup until it becomes full. Fp essentially copies files to the floppy disk, and won't destroy other copies. However, it will replace old copies of files with their more recent versions. If you wish to keep daily records of old versions around, you should use a separate diskette for every day. You will also be safer using a different diskette for every day's backup rather than filling up the same diskette. If you have used one diskette for a whole week's backups, and that diskette is lost, you could be in big trouble. Regardless, always label your backup diskettes with: BACKUP DATE DISK # 64 If you use a diskette for several days' backups, write the dates of each day you used the diskette, so that you know what you've got. The instruction to use for a daily backup is /I fp cril / for 5 1/4" floppy 0, or /I fp crilf /dev/fla / for 8" floppy drive 0 If you remember to do this every night before going home, _you will be fairly safe. If you keep duplicate copies of the diskettes in differen~locations and you will be safer still. After you have been performing- ~aily backups for a month, you will have quite a stack of Backup diskettes. ' You can imagine what it will be like finding a file to restore out of this pile of diskettes. What you need to do at this point is to erase the /etc/dtab file (era /etc/dtab) and follow the same procedure as listed in First Backup to c~eate new CONFIGURED MASTERS. The new set of CONFIGURED MASTERS will require more floppy diskettes than the first one because your ~ilesystem has undoubtably grown, so have more prepare.si diskettes _at hand. After creating new CONFIGURED MASTERS, you can recycle your old daily Backup diskettes. y'ou may also start recycling the CONFIGURED MASTERS diskettes, after yo~ have two complete- sets of_ MASTERS. In other words, when you start to make your third set of CONFIGURED MASTERS, you can reuse the diskettes that YOll used for the first set. This way, you will alwa.ys have at least one complete set of MASTERS on hand at all times. 9.3 Restoring Backed Up Files There are two ways of going about this, depending on whether you are restoring individual files, or, the entire file system. The next section discusses restoring the entire hard disk. To restore an individual file, locate the diskette with the desired file on it. You can use fp to list the Volume directorr, as in II fp which displays the fp directory diskette in the first 5 1/4" drive. When you find the appropriate diskette, you use fp with the x, for extract, option to get it back. For example, to get the .upm file back in the /a/rik/ws directory (mentioned in an earlier example), type /I fp x a/r1k/ws/.upm x a/rik/ws/.upm II [] and you're done. 65 9.4 Restoring Your Hard Disk If some awful calamity befalls your hard disk and you must rebuild it from scratch, you will be using the instructions included in the INSTALLATION Chapter on Installing Micronix on The 'Hard Disk. (If it is your second hard disk that suffered the, disaster, follow the instructions for Adding ~ Hard Disk to prepare the disk instead.') There are three st~ps 'to this proc.edure: 1. Formatting the hard disk, 2." Using the Stand Alone Micronix diskette ,sk,eletal system on the hard disk" and 3. Booting up' the' skeletal hard disk Micronix and the rest of the software to it. to build a, copying You will be following these instructions exactly as they are listed in the InstallatioriChapter until you reach the part on adding the software from 'the Volumes'using' finstal1 (during step 3). At this point, we'd like you to use the Volumes created in the earlier section on First Hard Disk Backup, named the CONFIGURED MASTERS; instead of the Volumes sent with your system. This will Save 'you from having to re'configure your system. If you have a more recent version of CONFIGURED MASTERS, use it. The procedure you use is to insert the first Volume of your CONFIGURED MASTER diskettes which you created during the previous section, and type # source finstall and wait for the process to complete. Then, insert the second disk, type !s (shorthand for "source finstall"), and wait, and so on with all the Volumes. use the same command to incorporate all the daily backups that you have made since the last time you made CONFIGURED MASTERS, starting with the OLDEST backup first. If you accidently restore older backups after more recent ones, the most recent backups will be copied over by the older backup. Eventually, you will have added all the files that were backed up using the daily backup routines and your system should be as good as'new. ~en, 66 10. DESPERATE MEASURES If you are reading this chapter of the manual, you must either have a serious problem, or just be curious. What are desperate measures? They are techniques that allow you to r~cover from serious problems without requiring deep knowledge of Micronix. The -problems that we will teach you how to .deal with here are: o Freeing up program, a terminal that was captured by o Replacing a forgotten root password, and o Repairing the root Micronix diskette. file system from a runaway the Standalone You might have come to this chapter looking for a translation of a message that appeared on your console. The explanations of console messages are contained in a later chapter of this division named Console Error Messages, of course. This' chapte'r will ba.i:l you out of other difficulties, and does explain how to use fsck from the Stand Alone Micronix diskette. 10.1. Runaway Terminals Eve:r see a runaway terminal? Runaway terminals mos.tly get away from the designer of a new piece of software. What happen~ is that the new software has a serious defect (a bug) that causes Micronix to ign9re everything you type on the terminal .to try and stop the program. The program just keeps running wildly along, doing its own thing. On a simpler system, this problem is solved by resetting the computer. With Micronix, you don't want to reset the system: you might damage the file system and/or disrupt other users who don't have any problems, but will if you reset the system. What you do instead is KILL the program. Now, maybe you don't like killing things, but relax. In Microriix, you kill a program by sending a signal to Micronix that gracefully halts the runaway program. Killing a program, (actually better described as killing a process), stops execution of the program, closes all its open files, flushes all disk buffers and releases the memory and swap space used by the program. After killing the program, the runaway terminal will show the normal shell prompt and respond correctly. Killing a program is a three step procedure: 1. Log on as yourself on a working terminal, 2. Identify the process number of the offending program, 3. Kill the process. 67 STEP ONE The . first step may be performed in two ways. If yo~ have more than one terminal hooked up to your Decision, log in on one of the other terminals. If someone is currently logged in, you can use the su program (switch user) to temporarily log-in. For example, suppose your user name is john and you want to temporarily login on someone else's terminal. After asking the person politely, you would sit down and type % su john Password: % [] Now, you are logged in at two different terminals. (You also do this as superuser, but it's more complicated.) could If you don't nave two terminals, we hope you were paying attention earlier (during the Addi'ng Terminal'chapter) and left unused ports configured for log--in. Micronix comes configured for two terminals:' one on port ttyA, and 'a second on ttyB. If you have a single terminal system, your terminal is the console, and is connected to port ttyA. And is also the runaway teminal. So here's the trick: reach,around the back of your Decision, remove the RS232 connector from the ttyA socket (in the lower right hand corner of the back), and plug the connector into ttyB, immediately to' the left ,of ttyA. NOW, type a RETURN and you should s e e ' Name: john Password: Last logged in on ttyA at 11 :37 Thu Jun 22, 1983 % [] As the example shows, you should log in as. yourself, and you'll be ready for the next step. If our trick doesn't work, and you're certain that the RS232 cable is plugged in correctly, you must have changed the /etc/ttys file so that. ttyB is not a login port. Maybe you made ttyC a login port? If nothing is plugged in there, try connecting your ca~le to it instead. If you can't login, your only option is to reset the system and run fsck. You should also add the word "login" to the entry for port ttyB in /etc/ttys, or use the recon program, so you won't get stuck again. STEP TWO Once you are logged in on a functioning terminal as your self, you need to identify the offending process. To start with, let's call your runaway program "mustang". To get the process number of mustang, you use the process status program, ps, to display all current processes: 68 % ps a PID TrY 2 ttyA 4 ttyA 5 ttyA 6 ttyB 7 ttyB COMMAND· -sh update mustang -sh ps %[] The process number of mustang, also known a$ PID, is readily apparent in the output of ps as being 5. ~s is what we needed from step two, so onward. STEP THREE The final step is to kill the program. with the command This is simply done % kill 5 % [] Look over at the runaway terminal and see if the shell prompt, usually a percent sign (%), has appeared. If it hasn't, you might need to use ps a to see if you got the process number Once your runaway terminal is back, log off on the wrong. terminal you are temporarily using by typing exit. If you only have a single terminal, you need to switch the RS232 cable back to port ttyA. Otherwise, you're done. 10.2. Replacing the Root Password This procedure is reserved for those instances when you have (Perhaps some malicious somehow forgotten the root password. person has changed it without telling you, the "official" system administrator.) You will need the root password to backup the entire file system, create or change user accounts, check the file system with fsck, etc. And you can only change the root password when you ARE the root. A real catch-22, eh? Well, where there's a will, there's a way. You should have a copy of the Standalone Micronix floppy diskette safely locked away somewhere. (If you don't lock the standalone diskette away, anyone can use this procedure.) With Micronix properly brought down, load the system with the Standalone Micronix floppy in the floppy drive. (This will involve booting CP/M and using the DJBOOT program, unless you have SYSGENed DJLOAD onto your Standalone diskette). Then, we want to edit the /etc/passwd file on the hard disk. This is a three step process, with fairly simple steps, so here goes ••• 69 STEP ONE The first step is mounting the ,hard disk. This is performed with a single instruction. The only trick to it is knowing which hard disk to mount. There are four possible hard disk names which you could use with the mount command. Each name is related to the size and capacity of the first hard disk in your system, your root ,hard disk. Here are the four possible·names: m5a m10a m16a hda 5 megabyte capacity.5 1/4" hard disk 10 megabyte capacity 5 1/4" hard disk 16 megabyte capacity 5 1/4" hard di~k any capacity 8" or 14" hard disk Choose one of these four names for the mount and umount commands that follow. Do NOT use the name "root", because when you are using the Standalone Micronix, the root device is the floppy diskette, and you want to change the passwd file on the hard disk. Okay, insert your choice on the command line that follows (where we used mlDa, insert the chosen name instead, if different) : II mount m10a /b . II [] If this doesn't work, again. you've chosen the wrong name. Please try STEP TWO The mOUnt command in step one added the hard disk to /b of your floppy file system. NOW, we can edit the passwd file, and remove the encrypted password from the entry for the root user. d~rectory # edit /b/etc/passwd "/b/etc/passwd" [reading] 14 lines :/root/ root:l"ie)3rBnvHo:O:O:Super User:/:/bin/sh :c root::O:O:Super User:/:/bin/sh • :w "/b/etc/passwd", 14 lines :q 11 [1 The bold face type is, as always, the letters that you will type when you edit the passwd file on the hard disk. The first editor command, It/root/", locates the line with the root user entry. The "cit command stands for change this line. On the following l~ne, you type a new root entry without a password: just enter the line exactly as it appears in our example. A period by itself 7D on the next line ends the change. Then, exit the editor by typing "w" and tlq" UM FOR HICRONIX SYSTEMS Removing the Decision Cover 1. DISCONNECT the Decision power cord from the AC power' receptacle on the back panel. 2. Locate the four (6 x 32) screws on the base of the computer. Figure 11-1 shows the underside of the computer and the location of these screws. Figure A-I: Decision Cover Screws 3. Remove the screws and put them in a place where they are not likely to drop into the Decision. 4. Slide the cover toward the front of the computer, lift the cover off. and then WARNING: The Decision contains hazardous voltages inside. Extreme care should be taken when installing cables and components within this system. Never open the cover unless the AC power cord is disconnected to prevent electrical shock. A.2 Checking Internal Connections The Decision is shipped from the factory with all internal connections in place, but sometimes connectors are jarred loose during shipping. If you are unable to successfully power on the Decision after installation, we recommend that you remove the cover, check the disk drive connectors, and make sure that the S100 module boards are securely seated in the motherboard. 81 The disk drive connectors should be securely connected to the connectors provided on the drive controller boards. The next figure illustrates proper disk drive cabling~ HOC OMA OJ OMA Figure A-2: Disk Drive Cable Connections If the' cable connection{s) does. not appear as in illustration, remove the cable CAREFULLY~ Turn it over reconnect it. Be careful not to bend any of the pins in process. The cables will always extend over the back, that side without parts, of the disk controller boards. the and the is, If you are' satisfied that all connections are made properly, but are still unable to get your system to operate correctly, contact your dealer. 82 A.3 Re.oving the 8-100 Module Boards The S-100 module boards (the printed circuit boards you see when you lift off the cover) are secured by a retaining bracket and four screws (see Figure A-I). To ensure that these boards are properly seated in the 14-slot motherboard, or if you find it necessary to remove one or some of the boards (to enable an automatic hard disk boot, for example), you should follow the procedure outlined below: 1. Make sure all p~wer to the computer is OFF, Decision is unplugged. and that 2. Remove the Decision cover. (See Section A.l 3. Remove the four screws holding the retaining ,brackets lift the brackets off. the ) and Figure A-3: Retaining Brackets for S-100 Module Boards 4. Grasp the top corners of the board and carefully pull the desired board out of the motherboard (gently but firmly). 5. To return the board to the card cage, slide the S-100 module board into any available slot. It need not be the slot from which you removed the board. 6. Reseat the board by gently rocking the ,board from side while firmly pressing down. 83 side to S'. When you have finished the hardware reconfiguration;, make' sure that any disconnected cables have been properly 'reconnected (see Section A.2) and the boards are well seated in the motherboard. 8. Return the retaining brackets to their original, location (se,e Figure A-3 ). 9. Return the Decision top cover. A.4 Modifications for Automatic Bard Disk Boot If you wish to enable the automatic hard dt'sk. boot of the Decision. you must change the settings of Switch 16D on the Decision MPZ80 CPU board. This board is illustrated in Figure A-4; the required switch settings are provided in Figure A-S • Note that switches may be protected by plastic covers; these covers must be removed ,to change the switch settings. but should be put back on the switch after the changes have been made. Z~ CPU EJ MPZ80 rev 2 Figure A-4: Decision MPZ80 CPU Board NOTE: When first applying power to the computer. the hard disk performs a 4 second warm up/diagnostic. There will be a slight delay between resetting the system. and the signon message that appears. Subsequent resets will immediately display the sign-on message. 84 ··OFF:ON ,I .. .' 1 To enable an automatic hard disk boot, Paddle 4 must be ON and Paddle 5 must be OFF on the MPZ80 (see Figure A-5 ). • 1.2 '-,' The DJDMA board must also be modified to enable an automatic hard disk boot. A shunt must be installed between jumpers A and B at J2 (near bottom of board). Figure A-5: Automatic Hard Disk Boot DRIVE CABLES EXTOO OVER THE BACK zaOA D 2732 (D78OC-1> DJDMA Automatic Boot OFF INTERRUPT JUMPER OPTIONS VI / D D ~J2 ABC DJDMA rev 2 L8123 Figure A-6: DJDMA Board Configured for Autoaatic Bard Disk Boot 85 If you decide to return to an automatic floppy disk boot» the board configuration process is reversed. Switch 16D of the MPZ80 CPU board should be set as illust'rated in Figure A-7 ~ Paddle 4 must be OFF and Paddle 5 must be ON. The DJDMA controller board must also be modified; a shunt must be in, place to jumper B to C. The shunt on P3» connecting pins 2 and 3 must be in place. Figure A-7: Autoaatie Floppy Disk Boot zaOA D 2732 (D78OC-1) DJDMA Automatic Boot ON o / O J2 cea ABC oJ3 DJDMA rev' 2 LS123 Figure A-8: DJDMA Board Configured for Autoaatie Floppy Disk Boot Refer to the MPZ80 section of the Decision Manual for further details. A.5 A.5.1 CPU Technical Installing Additional Disk Drives General Information Up to four drives of the same type (i.e. four or four hard disk drives) may be connected to controller boards installed in your Decision. ever» will only discuss the addition of one drive. If you wish to install any other type the "Add-On" documentation supplied .by Morrow 86 floppy disk drives each of the drive This manual» how8 inch floppy disk of drive» refer to with your drive. A.5.2 Connecting an 8 Inch Floppy Disk Drive Eight inch floppy disk drives are connected externally, through the 50 pin connector just above the daisy printer connector on the rear panel of the computer. The cable required for this connection is available from Morrow. Specify Morrow part number 060-50782P when ordering. 1. Plug one end of the cable into the Decision rear panel 50 pin connector, just above a similar 50 pin connector for the daisy printer port. The ribbon cable should come out of the bottom of the connector, and the stripe on t~e cable should b~ on the left (looked at from the back of the Decision). 2. Plug the other end of the cable into the corresponding pin connector on the back panel of the disk drive. The ribbon cable should come out of the bottom of the connector, and the stripe on ,the cable will be on the left (looked at from behind the drive). . D~ o. ac en po at= 10 I " 1 ~ 0:.::=:;0 a::::=Jo ~o o::::=Jo ~ ~ -- III!II I: II ~ • - _ ... P::':. . ___ ,..J&. -::--:::- r:II sa Ii; :-~,- ::'~-~ ~~< Figure A-9: Connecting an 8t1 Floppy Disk Drive 3. The 8" drive can now be accessed as /dev/fla. 4. If you have added a dual 8" floppy disk drive unit to your system, the left drive will be accessed as /dev/fla; the right drive will be referred to as /dev/flb from Micronix. 5. The last drive connected to the cable must be terminated. All drives purchased from Morrow will have termination on the last (or only) drive. If, after you add an 8" drive, you start getting write errors, there is a problem with termination on the last drive. The pins on the termination resister for WRITE GATE and WRITE DATA must be lifted. If you are unable to located these pins, call Customer Service for assistance. 87 / 7etc/banner~ 34 /etc/motd~ 34 /etc/passwd~ 42~ /etc/rc, 33, 39, /etc/signon, - 35 /etc/tty~ 31 70 73 A Access directory, 46 file,' 44 Account command, 24 program, 42 Accounting information, 28 Accounts, 22 changing, 26 Alias, 36 deny file access~ 45 fdj, 53 to list, 37 B Backup of the Stand Alone Master, Backups incremental, 63 short term, 63 Bad free list, 77 Bad inumber, 78 Badspots~ 9 Banner, 34 Baud rate, explained, 29 console, 30 Block, 19, 21 size, 51 Blocks, 21 Boot floppy for Micronix, 60 C, Cables control, 87 data~ 87 external floppy, 87 Casualties fsck, 11 CHMOD, 45 Clean, 33 Command directories, 37 Command" files, 35 configured masters, 64, 65, 66 88 61 Configuring . -upm With .upm, 41 terminals, 31 Connecting an 8 Inch Floppy Disk Drive, Console, error messages, 74 baud rate, 30 Copying a Micronix Loader, 60 Copying CP/M, 59 Core files, 22 Corrupt files, 12 CP (Copy) Command, 62 CP/M, 41, 57, 69 CP/M format files, 33 SYSGEN, 58 Cptree command, 26, S6 Custom Banners, 34 Custom prompt, 38 D Daily Hard Disk Backups, Delete an account, 25 Deny file access, 45 Device names, 8 DF, 53 Diagnostic hard disk, 84 Dir-name, 14 Directory, 46 Disaster Victims, 18 Disk free df, 20 Disk usage du, 19 Diskettes formatting, 49 Disks device names, 8 Dot-dot ( •• ), 14, 16 Double-sided 5 1/4", 50 Micronix, 50 Drive 0, 50 Drive problems 8", 87 drives double sided, 50 DU, 19 Duplicate block, 12 64 89 87 E Edit, 33, 70 Encrypted, 23 Encryption, 26, 42 Error Messages, 74 Etc/passwd file, 23 Exit, 39, 69 F Far command, 54 Far alias, 36 FDJ, 53 FDJ's Menu Selections: 5 1/4" Drives, 49 8" Drives, 51 Other Selection, 52 File access, 44 File system, 6 mounted, 8 root, 8 File systems active, 7 File's data lost, 17 Find, 21 First Hard Disk Backup, 63 Format Options: fdj One-liners, Format 8" , 51 formats other, 52 Formatting aliases, 53 fp, 65 fp command, 64 Free list, 77 FSCK, 6, 40, 71 Fsck options, 9 program, 67 Fsck.victims, 11 G General Information, GREP program, 43 Groups, 44 86 H Hard disk new, 26 Hard-sectored, 50 HDCA, 75 HDDMA, 75 90 52 INDEX Home directory, 23 changing, 26 I Incremental backups, 63 Index. hole, 50 Inode , 77 , 78, 1, 71 K Kill, 69 kill a program, 67 .L Last command, 28 Load diskettes, 60 Load Micronix, 58, 60 Log-in Commands: The .sb Script, Log-in program, 23 Logging Directly Into a Program, Login, 30 problem, 17 Logout, 69 exit, 39 Lost+found, 14 Lpr, 30 LS command, 44 M M10boot, 58· Megabyte, 19, 21 Memory allocation fault, 78 Message of the Day, 33, 34 Messages console, 74 Micronix format files, 33 Minor device, 74 number, 75 mkfs command, 55" 56, 73 MOTD file, 34 Mount, 8, 40, 70, 73 command, 55 alias, 37 security, 47 N Name-changed directory, 16 file, 17 No more space message, 76 91 35 26 o Orphaned directory, Orphaned file, 15 Out of range block, OWNER, 16 Owner command, 26 14· 77 P Panic messages, 79 Parent directory, 14 Password file, 22 changing, 26 Passwords, 24, 42 Path, 37 Port configuration, 29 Process table, 78 Prompt, 38 Protecting directories, 46 files, 45 PS command, 69 .Q Quoting commands, 43 R Recon program, 30 Removing users, 25 RESET, 58, 60 restoring files, 65 orphaned files, 15 the hard disk, 18 corrupt files, 13 orphaned directories, 15 Restricted users, 27 RM command, 25 Root directory, 71 fsck, 8 Root user, 23 Routine command file, 39 S Scripts, 35 Search path, 37 Search permission, Sector size lK, 51 Serial ports, 29, 46 30 92 INDEX Shell .sh file, 33, 35 Sign-on Message, 35 Soft-sectored, 50 Source, 66 Standalone Micronix, 67 protecting, 47 Stopping runaway program, 67 SU, 68 Summary of Copying Micronix Diskettes, Swap space, 78 Switch user program, 68 SYSGEN, 58, 59, 69 System errors~ 74 58 T td Command, 55 Temporary files, 40 Terminals, 31 Tmp di'rec tory, 40 Truncated files, 13 Tty command, 27 TtyA, 30 Ttys, 29 Ttys file, 29 Turnkey, 36 , programs, 27 U Umount command, 56 Unclean, 33 Update daemon, 39 Upm .upm file, 33 User log records, 28 User name changing, 26 User numbers, 23 Users, 22 adding new, 24 removing, 25 restricted, 27 V Victim Victim Victim Victim Victim Victim Victim 1: 2: 3: 4: 5: 6: 7: File's data possibly corrupt, Possibly truncated, 13 Orphaned directory, 14 Orphaned file, 15 Directory's name changed, 16 File's data lost, 17 File's name changed, 17 93 12 INDEX Victims fsck, Volumes, 11 66 W Warning messages, Who command, 27 WordStar, 33 78 94 Micronix Operating System user's manual MORROW. Micronix Operating System User's Manual Tutorials Table of Contents 1. INTRODUCTION ••••••••••••••••••••••••••••••••••••••••••• ~ ••• 1. 1. Some Basics........................................... 1 .2. Loggin'g In ••••••••••••••••••••••••••••••••••••••••••• ·• 1.3. Passwords............................................. 1.4. Logging Out ••••••••••••••••••••••••••••••••••••••••••• 1 1 2 2 3 1.5. 'Ma.il •••••••••••••••••••••••••••••••••••••••••••••••••• 3 1.6. On-Screen Messages •••••••••••••••••••••••••••••••••••• 4 1.7. Checking Out the System ••••••••••••••••••••••••••••••• 4 1.8. User Directories •••••••••••••••••••••••••••••••••••••• 6' 2. CP/M 2.1. 2.2. 2.3. PROGRAMS UNDER MICRONIX •••••••••••••••••••••••.•••••••• 6 Entering the "CP/M" Mode •••••••• ~ ••••••••••••••••••••• 7 Upm Modes............................................. 9 Creation of Text Files •••••••••••••••••••••••••••••••• 10 2.3.1. CP/M-Micronix Differences •••••••••••••••••••••• 10 2.3.2. Naming and Ac.cessing Files in upm •••••••••••••• 11 2.3.3. Printing CP/M Files •••••••••••••••••••••••••••• 11 2.4. Transferring Files •••••••••••••••••••••••••••••••••••• 11 3. ADDRESSING DISK DEVICES: mount ••••••••••••••••••••••••••••• 12 3.1. Current Device Files •••••••••-••••••••••••••••••••••••• 13 3.2. Sample Mount Sequence ••••••••••••••••••••••••••••••••• 14 3.3. Device File Structure ••••••••••••••••••••••••••••••••• 15 1. INTRODUCTION In this section you will be given a "hands on" introduction to the Micronix operating system. The tutorials in this section were designed to, help, you see, exactly how the Micronix ope'rating system works. Read th~ough the following pages first, then begin the tutorials. Five main a~eas are covered in this section: 1. Using the Computer. Entering commands, function keys and the type-ahead feature. using special 2. Entering the system., Logging in, establishing directories and files, logging out~ 3. Using the system. accessing files. passwords, Using mail and message features, and 4. Writing and editing text. Using the Micronix text and format commands to create written text. editor 5. Programming. Using languages and programs included in the Micronix Operating System. Begin your introduction to Micronix now by reading through the text and following, the instructions given. 1.1. Some Basics Let us begin with a few simple things to learning to use this system. kee~ in mind while Micronix is geared toward lower case letters. This is especially important when entering commands. This does not pertain to text being entered, just remember that commands are entered into Micronix using lower case letters. Using a computer terminal is similar to using an electric typewriter. At first glance, the computer terminal keyboard even looks like the typewriter keyboard. One common function in all electric typewriters is the RETURN key, pressed at the end of each line to return the carriage. This key is also used on terminal keyboards. Like lines typed on a typewriter, after each command, line of commands and lines of text entered on the computer, the RETURN key must be pressed to effectively terminate the line. This process is not always specified in the tutorials, just remember: Press RETURN at the end of each line entered. One key found on computer terminals and not on typewriters, however,is the control (CTRL) key. Sometimes this key is -1- used to carry out a certain process. This process is performed much like a shift seque~ce to enter a capital letter hold down the CTRL keYt then press the indicated letter. As a form of shorthand t control, sequences are written with a fiAtt and the letter key. An example of. this is the AX sequence used to erase a line. If you happen to enter something incorrectly at the termina1 t there are two ways you may correct it: 1) If it is a short (two or three character) entry, use the BACK SPACE key (if this key exists on your terminal) to bac'k up over your mistake, then retype the entry. 2) If it' is a long entry, use the AX sequence mentioned above. This deletes the line and jumps the 'cursor to the next line so you may begin allover again. If your terminal doesn't have a BACK SPACE keYt' enter AB. This also back spaces the cursor. Micronix. also has a type-ahead feature. This means you may type as fast as you want or enter several commands one after another without waiting·for the system to' catch up. This may look confusing on the screen t btit the characters will be stored and interpreted in correct order. 1.2. Logging In Before you can enter Micronix, your login' name must be entered in the system. Once the system operator installs this t logging in is, easy. If the initial header is not displayed on your terminal screen t try pressing the RETURN key. Type in your login name after the name prompt. Name: Press the RETURN key. Micronix responds with a message that resembles the f,ollowing: Welcome to Micronix. This is an initial welcome message. After the first login t users are greeted with a message similar to the example below: Last login on ttyH on (date and time of last login) 1.3. Passwords Passwords may be entered by using the password command. Passwords are used mainly in larger t multi-user systems. If your setup requires passwords t enter the mnemonic passwd after the shell prompt (%): % passwd -2- The system returns with Name: Enter your established login name.-The system returns with New Password (or RETURN for no password): Type in your password, but do not be surprised that it does not appear o~ the screen. Instead the system prompts Once again to be sure: Type in the password- again exactly as you previously entered it. You may get a message warning you that your password is too short. A "secure". password is at least eight characters in length. Once your password is entered, the shell prompt (%) is returned to the screen and you may resume work in the program. If you entered a password, you must enter it now every time you log in. 1.4. Logging Out Pretend you are finished using the system for the day. To exit Micronix, type in %.exit The system has logged you out and returns header. ~ow with the login Log in again. (If you created a password, you must enter it, too. If you lose your password, the system supervisor can help you enter a new password.) 1.5. Mail Micronix has an inter-user mail service. Sometimes when you log in you may get the message You have mail. Mail provides a convenient means of conveying messages to other system users. If you receive a mail message, simply enter % mail Your letter appears on the screen. At the end of the letter, this message appears: -3- Do you wish to keep your mail? Type yes· or no. _Kept mail is stored in a file called "mbox". To send a following: letter - to another system user. enter the % mai~ (user's login name) Type your letter. After .the la$t line of the letter enter a ~D alone at the beginning of a line. This automatically sends the letter to the specified user. You may also use this feature to send yourself mail. This is a convenient way to remind yourself of appointment~ - jus~ enter your name after the mail command. In fact, why not try the mail feature now and write yourself a- lett,er? 1.6. On-Screen Messages-- It is also possible to send messages via the terminals. The format for sending messages looks like this: % write sally The designated user receives a message on says his screen that % Message from tom tty# (time and date) To establish would enter a two-way cOmlnunication path with Tom, Sally % .bd write tom Otherwise, the message from Tom is only one way - to Sally. Messages are typed on the screen. Each time the RETURN button is pressed, the typed line is sent to the designated person. This process is terminated by entering ~D. 1.7. Checking Out the System Take a look now at what is available on your system. One simple check is to find out who else is logged on. To do this, enter % who A display format: of system users -4- is returned in the following console tty2 root tom day time year jan 25 15:10:30 1980 Another easy· chec,k is for the date •. Enter % date The system responds with the current date and time. Next ask for a listing of your directory: % Is The response here will depend on whether any directories have been made. Next ask for your present working directory. (Very helpful when you want to find out where you are within the system.) . % pwd This display is simply tal (name of a user, like "tom") Change directories to "root" (/), then list this directory % cd / % Is You should get a list that looks something like bin a b etc lib in~tall hdunix cpm fins tall dev include tmp usr hdinit djunix Move down another branch in the tree to display files in this directory. Change directories to "bin" and again display t~e files. % cd bin % Is The result should be a long list of file names. This directory is where many often-used commands live. Feel free to explore them. -5- 1.8. User Directories Once you begin making files, you will need a place to store them. In Micronix (and all UNIX systems) files are stored in directories. It is suggested you name directories so they relate to the work you are doing. For example, you may want to store form letters in a directory called "letters". Or perhaps you may want to store notes for a manual in a directory called "prelim", which are then transferred to one called "book" when the manual is finished. To make a directory called "letters" you would enter: % cd % mkdir letters To remove a ~irectory, you would enter % rm directory/filename % rm directory The first command removed the file from the directory, the second command removed the directory. (It is not possible to remove a directory with files in it.) This brief introduction should give you Micronix works and help you to continue with tutorials. an idea of how the following Additional tutorials are also included in the User's Guide --to the Unix System handbook included with your system. Read through this book and try some of them - you'll find that most of them work with this system! 2. CP/M PROGRAMS UNDER MICRONIX Micronix offers a CP/M look-alike, upm, which provides a close functional replica of the environment that application programs written to run under CP/M expect. Most CP/M programs function unchanged under Micronix. All of the built-in commands found under CP/M are available in upm, as are the transient commands and file reference characters (* and ?). The user will find that upm offers all the functions expected from CP/M file transfer, "housekeeping" functions, program assembly and debugging and system utilities. The user must keep in mind, however, that the intended purpose of upm is to bridge the gap between low-cost multi-user systems and the enormous body of special-purpose -6- software and application programs written for the CP/M system, thus offering true multi-user function and CP/M. The organization of .bd upm differs from that of CP/M. Under, Micronix, there are no records, extents,diskdrives (in the CP/M sense), nor are there file control blocks (FCBs), disk parameter blocks (DPBs), allocation vectors, etc. When the upm program opens a CP/M file, it, is really opening a Micronix file. Upm handles conversion back and forth between CP/M FCBs and Micronix file path names by maintaining a table of correspondences between "drives" and Micronix directories. (Keep in mind that CP/M is more drive-oriented than Micronix. Drive designations in upm are actually directed to files within Micronix. Typically, these files contain the "cpm" file and user directories, but may also be device files.) File I/O is monitored and the extent numbers are changed at the appropriate times by upm. Upm also contains a "Bios jump table", bearing a striking resemblance to the original, and corresponding in function. In fact, once you begin running your 'application programs under upm, you should find yourself in a familiar environment. The' op'eration of upm becomes invisible. The documentation of your application programs applies. Upm does have some limitations: Programs attempting 8080 I/O instruction or interrupt manipulation (such as a program to format the hard disk) will not work, nor will those that "move" a conventional CP/M system, such as MOVCPM or SYSGEN. If a CP/M program does go awry, however, it will have only a local effect; the rest of the operating system will continue running. Current free space in upm stands at 52,064 bytes. Your CP/M program must fit in this space. It is also possible to execute Micronix commands within upm by temporarily escaping to the shell program. This is done by preceding Micronix commands with an exclamation point (!). For ~xample A>!df /dev/dja .sp would display the number of free blocks (1 block = 512 bytes) available on drive A (much like the CP/M STAT command). 2.1. Entering the "CP/M" Mode To access the upm program, enter % upm -7- which returns: CP/M Version 2.2 emulator For Morrow Designs Decision I under Mlcronix With the following Drive designations A: ->./ A) Upm is in the current directory. You may this "drive" and/or designate others. now re-designate To effectively use upm it is ~ecessary to understand the relationship between upm's. concept of drive letters and Micronix' directories. Upm maintains the 16 standar,d CP/M drive~ (A: - P:). Since the most natural analogous structure in Micronix is the directory, upm maintains a table of CP/M-like "drive" designations and the names of the Micronix directories to which they correspond. You may change the drive designation pointers with a command of the form A:dirname so that A is replaced by any of the "drives" (A: through P:) and" "dirname" must contain at least one slant character (/): A> b:./ The above directory. example would point One means of entering the upm "cpm" and user directories: A) a:/cpm returns A) A) A) ->/cpm b:./ A) c:/a/(user name) returns A: ->/cpm B: ->./ C: ->/a/user name -8- "drive B" at your current program is to address the The above display is automatic. It is also poss~ble to get an automatic display of the Micronix-upm" relationship by entering an equal (=) sign after the A> prompt •• sp To obtain a listing of files within these designations, enter the CP/M directory (DIR) command: . A> dir a: (lists cpm) A> dir b: (lists ".") A> dir c: (lists la/user name) You may continue addressing drive designations for all 16 "drives" with a.s mal1Y directories -as you, wish. It is possible to have two or more drive letters the same Micronix directory. As an example refer· to A:/cpm ·B:/cpm C:/cpm are ali valid drive designations. 2.2. Upm Modes Upm also has two distinct modes, DIRECT and INTERACTIVE. If you intend to run only one CP/M application p~ogram, enter in the DIRECT mode. If you intend to run a series of CP/M programs, enter in the INTERACTIVE mode. To enter the INTERACTIVE mode, type % upm alone on a line. To enter' the DIRECT mode, type % upm program name It is also possible to enter upm, designate the "drive" and call a program. These drive designation modifiers may appear as commands to the upm "command console processor" (CCP) , or as a command line. In this example, -9- % upm a:/cpm b:./ b: a:ws the user enters upm with "Drive A" corresponding to the Micronix "cpm" file and "ririv~'Bn to directory' ".", then dfrectly enters the Wordstar program. ' Exit from upm's DIRECT mode occurs immediately completion of the called application program. You may from INTERACTIVE mode by typing exit. upon exit 2.3. Creation of Text Files Herein are some practical suggestions on the handling and transportation of text files between upm and Micronix. We will begin with a description of the differences in their , formats. 2.3.1. CP/M-MicrQnix Di.~ferences, Micronix text files and file'S created under appear the same, but the~e are differences: upm may' 1. At the end of each lirie 6f a Mic ronix ,£i Ie there is a single NEWLINE character; at the end of each line of a CP/M text file there is a RETURN character followed by a NEWLINE character. 2. A CP/M,file's length must be an even 128. mUltiple. of 3. A Micronix file's length may be any number of bytes (although both are constrained to maximum file sizes). 4. CP/M text files are. padded with AZ characters at the end to round them out to an even mUltiple of 128; Micronix text files are not. There is a convenient utility for converting' a text file back and 'forth between the two· formats. To make a text file suitable for Micronix, type % clean filename To make a text file suitable for CP/M, type _% clean -u filename The idea is to "clean" out the excess RETURN and AZ characters at the end of each line, "-u" stands for "unclean". -10- 2.3.2. Naming and Accessing Files in upm A file that is created in the user's directory under Micronix appears under upm. Files in the root or other Micronix directories may not be accessible to CP/M programs under upm because they have been "coded" by the chmod program (1), making them inaccessible to the user, or giving the user read-only privileges. Trying to call these files will result in an error me$sage indicating either the file does not exist or space to write the file does not exist. Wordstar, for example, 'cannot conceive of ' the file differences in Micronix; these error messages may at first be disconcerting to a user who is secure in the fact that a file, or space for the file, .ul does exist on his system. Files entered in uppercase letters are "invisible" to upm, and directories and special files are off limits. (It is possible, however ," to crec{te a new file in a CP/M .program with the same name as a directory or special file. Be careful when naming your fiies!) 2.3.3 Printing CP/M Files CP/M files may be printed by directing them to an output file addressed by the CP/M LST: device. This may be done upon entering:· the' upmmode by following this example: A>LST.:output .fil Executing a print command (the P File Command in Wordstar, for example) sends the output to the file addressed by LST:. This output file may then be directed to the lpr program for printing, following the standard Micronix format for printing files: % lpr output.fil The procedure for ·this is also described in the upm (1) program description in the first section of the Reference Manual. 2.4. Transferring Files Suppose now you want to enter a CP/M program into Micronix that just arrived from one of the many companies that develop CP/M application programs. Copy over the contents of the new diskette using the far program. -11- To copy the contents of a CP/M diskette to the current Mlcronix directory, place the diskette in drive A and type' % far dja -xv Far displays a list of files it is copying. Refer also to the far program in Section 1 of the reference manual for a further description of the flags and reports'av~ilable. Once your program exists in MiGronix, simply address this file in the upm program. Unless this program is system-dependent, it ,should run flawlessly under the Micronix CP /M e~ula'tor. (For f~rther. information on upm see Section 1 of the Reference Ma~ual.) , 3. ADDRESSING DISK DEVICES: mount During the ~nitial sQftw~re set qp, youtransf~rred several diskettes containing the Micronix system onto your hard disk. Once this process was complete, you h~d the beginnings of Micronix' basic file structure on your disk system. This, structure begins ,with the "root" directory. Branching from root are directories and files, some that came with your system, some that you have created or will create, ,to fo,rm the Micronix "tree" structure. The device upon which your system began and will continue to grow is the "root device",. Micronix is structured such that the root device can never be detached from the file system, but the mount program can be used to extend the Mlcronix file system to include additional disk storage devices. Mount makes a temporary logical attachment or'association between these devices and the Micronix file tree. Section 1.3. of the Orientation portion of this binder described three basic types of Micronix files: ordinary files, directories and device files. Device files are the special files that mount uses to associate a directory with" a specific disk device. These files reside in the "/dev" directory and are of two types: 1) character special and 2) block special. Character special files refer to devices that output characters, such as terminals and printers. Block special files refer to devices that read out large sections, or blocks of information, such as disk storage systems. Mount is used only with block device files. When one of these files is "mounted," mount informs the system that the associated device contains a file system. The Micronix "tree" structure is temporarily extended during the time that the device is mounted. In order to preserve the integrity of the file system during this time, Micronix imposes certain "rules" which must be observed while using -12- mount: Mounting a device on the root directory temporarily "clears" all files that previously axis"ted on root. To avoid ariy problems, do not mO,unt a device on root (/). A device can only be mounted once. Trying to mount a device already mounted results in' an error message~ It is possible, though, to r'e-mount 'a ,i'evice that has been unmounted. An error message is also displayed if a user tries to unmount a device while someone else is using it. A device may also be, mounted with a read-only argument. The system is then prevented from writing to the device; files may orily be read from the device. The opposite of the mount command is the umount command. Disks should be unmounted as soon as they have completed their function. Aiways unmount a floppy 'disk before removing the diskette. 3.1. Current Device Files As currently distributed, Micronix has a group of standard files that correspond to devices sold with the system. These files may be displayed by listing the "/dev" directory: % Is /dev The display will be similar to the following: hda fla hdb fIb hdc mfa mwa mfb mwa mfb The of the on. pprB ttyA ttyB ttyC ttyD "hd" files refer to the eight and 14 inch Discus series hard disks (MI0, M20 or M26). File "hda" corresponds to first hard disk connected, "hdb" to the second, and so The disks are connected through HDCA ~ontroller boards. The "mw" files refer to the mini-Winchester hard disks. Again, these units correspond to their logical connection through the HDCDMA controller boards. The eight inch floppy disks are addressed by the files named "fl" and correspond to their connection through the Disk Jockey DMA controller boards. -13- The mini-floppy disks are addressed by the files named "mf" and a letter,corresponding to their connection through the Disk Jockey DMA boards. (The "ppr" files refer to daisY~wPeel printers; ,~he' "ttyll files to terminal, or teletype devices. These are of no concern to mount since they are character special files.) Any data ~itten to th~ device file is transmitted to the associated disk device.' Similarly, reading from the device file causes data to be read 6ff of th~ as~o~iat~d' disk device. 3.2. Sample Mount Sequence To demonstrate how ,a device is addressed with the mount program, let's run through a typ.~cal mount sequence. In thi~" example" we will transfer a system 'file to a diskette in floppy device "fla":, The mkfs command is entered first 'to make a file system: II mItfs /dev/fla Next the device is "mounted i' on a directory. Any directory (except root) may be used. In this example, we'll use a directory named "/f". n mount /dev/fla /f To copy a file named "accounts" in the current directory to the floppy, enter the cp (copy) command as follows: II cp accounts /f To copy a file from the floppy to the current directory: # cp /f accounts • (Remember that "." is a name for the cut;rent directory.) Similar to the copy command is cptree. If you had a need to copy out all the files in the current directory and sub-directories, the cptree command would be the most efficient means of transferring these fil~s: II cptree -v • /f The last device: command entered is -14- umount which unmounts the umount /dev/fla The floppy diskette may now be removed from device "fla".A device may be mounted read-only by entering a "-r" in the command line: option U moUnt /dev/fla/ /f -r In this example, files 'may only be read from device "fla"; no files can be written to the device. 3.3. Device File Structure Device files are unique in that they require no disk blocks, that is, they are "facades" -that can be created and/or removed at will. To understand this more clearly, let's take a look at how these files are created. The following commands were used to create the device files: mknod ttyA c 1 1 mknod ttyB c 1 2 mknod t'tyC c 1 3 mknod pprA c 1 0 mltnod hda b 1 0 mknod hdb b 1 1 mknod fla b 2 0 mknod fIb b 2 1 mknod mwa b 3 0 mknod mwb b 3 1 mknod mfa b 2 12 mknog mfb b 2 13 mknod fla b 2 8 mknod fIb b 2 9 As you can see, mknod was entered with a "c" for the terminal (tty) and printer (ppr) files, indicating these were character special files. The disk files were entered with a "b", indicating they were block special files. The numbers to the right of these commands specify the device the file will refer to. The left hand number specifies the type of controller device. Currently, 1 indicates the HDCA controller, 2 the DJDMA controller and 3 the HDCDMA controller. The number to the right indicates the drive the device will address. A 0 -15- indicates drive A, 1 drive B, and so on. Things get a bit trickier with the floppy drives, though. The 12 indicates drive A, 5 1/4 inch, alternating sectors. The 8 indicates drive A, 8 inch, a1tel=n'at'ing sectors. (Th~se formats are listed in djdma in Section 4 of the Refe~enee Manual.) List out the "/dev" directory again, this time using the "_1" option. You should see a long list of information resembling the following examples': erw-w--w- 1 root 1/2 Jan 14 17:34:54 1982 ttyB crw-w-w- 1 root 1/0 Feb 10 13: 10:43 '1982 pprA b----- 1 root 1/0 Feb 10 15:15:25 1982 hda brw-rw-rw- 1 root 2/8 Mar 01 08:29:28 1982 fia Notice that a tic" precedes the first group of information for the "tty" and "ppr" files. This indicates that they are character special files. The "b" preceding the "hd" and "f1" files indicate they are block special files. The numbers entered with the mknod command are reflected at the' right in the number pa,irs preceding the date. Note that "hda" is connected to the HDCA controller and is addressed as drive A. "Fla" is connected to the DJDMA controller, is addressed as drive A, and is formatted for 8 inch alternating sectors. Summary: Mount is a means of making a temporary, logical association between Micronix and a disk storage device. "Mounting" a device means that device has been attached to a speci~l block device file which addresses a specific disk storage device in-the system. The system imposes certain rules which must when mounting a device. be adhered to Unless a "read-only" argument has been specified, it is possible to read from and write to mounted devices. References mount (1),(2), umount (1),(2), cp (4), mknod (1), -16- (1), cptree (1), djdma Micronix Operating System reference manual MORROW. CONTENTS OF REFERENCE SECTION 1: account * anat (w) archive as (w) boot cal cat cc (W) change chars chmod clean cmp comm common compare compress concat copy cp cpl (W) cp2 (W) cpp (W) * cptree create crypt cu cxr date dc dcheck ddt detab df diff down du edit entab expand far fdj * field file find form fp fsck grep group help hex (W) icheck include init kill kwic last lib (W) lines link (W) In login lord (W) lpr Is macro mail "make PROGRAMS man mkdir mkfs mknod more mount msgs mv ncheck newuser obj (W) od overstrike owner passwd paste pilot print ps ptc pwd ratfor recon rm rp sh sort split stty su sum tail td tee touch translit tree tty umount unique unrot update upm wall who words The "account" program is described in greater detail under Users in the Maintenance and Administration section. "fdj" is further discussed under Copying Diskettes in Maintenance and Administration. There are more details about "recon" under Adding Terminals in Maintenance and Administration. W Files labeled with a "W" are part of Whitesmith's C and Pascal. This is a separately-priced option, so these programs may not be included with your system. They are marked with the word "OPTION" n their heading lines. account (1) 4/6/83 account (1) NAME account - manage user accounts SYNTAX account DESCRIPTION Account is an interactive, menu-driven program for listing, adding, deleting, and changing user accounts. Changes can be made to the account name, password, home directory, and shell. SEE ALSO newuser (1), chsh (1), passwd (1), group (1), owner (1) -1- 4/6/83 anat (1) OPTION anat (1) NAME anat - A-Natural assembler SYNTAX anat [flags] [files] .DESCRIPTION Anat translates A-Natural narrative assembly language for the Intel 8080 to standard assemhlylanguage acceptable for either the ISIS-II asm80 or the Microsoft Macro-SO assembler. Since the output of the 808Q code generator, p2, is A-natural, anat is required to interface the C compiler to existing 8080 software development facilities. The flags are: -i Emit code in changed to Microsoft, and each" ISIS-II format. Identifiers have each "." "@" and each" " changed to "?". Default is in which case each "." is changed to "$" " is changed to n.n. -0 Filename can be specified with the -0 operand so that the output is written to the specified file and an error messag.e is written to STDOUT. Default is STDOUT for output and STDERR for error message. -s Emit an end statement. With a start operand, specifies a starting address. Default is no start address on the end statement. If [files] are present, they are concatenated in order and as the input file instead of the default STDIN. used If -0 is absent, one or more files are present and the first filename begins with "8", as then behaves is if -0 was specified using the first filename, except that the trailing "8" is changed to "m". Thus, anat file.S is the same as anat -0 file.m file.8 If -0 is present, a name directive (title for Microsoft) is emitted using the output file name as the module name; any ".suffix" in the name is stripped off. If there is no -0, but [files] are present, the first input file name is used in the name directive. If neither is preset, no name directive is emitted. -1- anat (1) OPTION 4/6/83 anat (1) Code generation begins in cseg, and reverts to cseg at the end before any literals are emitted. Any symbols not defined by the end of the input file are published via extrn statements at the end. NOTES The start string used with -s does not have as identifiers. . " " and " " mapped SEE ALSO as (1), ld (1), lib (2), cc (1), cpl (1), cp2 (1) NOTE: This program and documentation Whitesmiths, Ltd., and are sold separately. -2- are products of archive (1) archive (1) 4/6/83 NAME archive - archive maintainer SYNTAX archive {dptux} archname [files] DESCRIPTION Archive maintains a group of files combined into a single archive file. The archiver has good protection against data loss through disk overflow and works equally well with text and non-text files (for those systems on which there is a distinction). Exactly one key character must be specified action you wish archive to perform. to indicate which The meanings of the key characters are: d Delete the named files from the archive file. If no names are given, the archive is not altered. p Print the named files in the characters are filtered out. t Print a table of contents of the archive file. If no names are given, all files in the archive are tabled. If' names are given, only those files are tabled. u Update the named files in the archive. If the named archive does not exist, it is created. If no names are given, all files in the archive are updated. If a name is given which is not in the archive, a new archive entry is create~ and its contents becomes the contents of the named file. Otherwise, the contents of archive's entry is replaced with the current version of the file. x Extra~t archive. Non-printing the named files. The files· in the archive are copied out to ordinary files of the same name. The former contents of the ordinary files are destroyed. If rio names are given, all files in the archive are extracted. In neither case does x alter the archive. EXAMPLE To make an archive: archive u newarch.a filel file2 file3 file4 SEE ALSO Brian Kernighan and P. J. P1auger Software Tools ,Addison West Publishing Company, 1976. -1- as (1) OPTION 4/6/83 as (1) NAME as - A-natural assembler for 8080 SYNTAX as -[0* x] [files] DESCRIPTION as assembles A-Natural narrative assembly language for the Intel 8080 to standard format relocatable object images. Since the output of the 8080 code generator is is A-Natural, as is required to produce relocatable images suitable for binding with link. The flags are: -0* write the output to the file *. Default is xeq. Under some circumstances, an input filename can take the place of this option, as explained below~ -x place in the object image only those symbols that are undefined or that are to be made globally known. Currently, this happens anyway; the flag is present for compatibility with other assemblers. If [files] are present, they are concatenated in order and as the input file instead of the default STDIN. used If -0 is absent, and one or more files are present and the first filename ends in's', then as behaves as if -0 were specifed using the first filename, only with the trailing's' changed to '0'. Thus, as file.s is the same as as -0 file.o file.s A relocat4ble object image consists of an eight word header followed by a text segment, a data segment, the symbol table, and relocation information. The header consists of the value Ox1499, the number of sytmbol table byes, the number of bytes of object code defined by the text segment, the number of bytes defined by the data segment, three zero words, and the data segment offset, which always equals the text segment size. All words in the object image are written less significant byte first. The text segment is relocated relative to location zero, the data segment is relocated relative to the end of the text segment. Relocation information consists of two byte streams, one for the text segment and one for the data sement, each teminated by a -1- as (1) OPTION 4/6/83 as (1) zero control byte. Control bytes in the ramge [1, 31] cause the many bytes in the corresponding segment to be skipped; bytes in the range (32, 63] skip 32 bytes plus 256 times the control byte minus 32, plus the number of bytes specified by the relocation byte following. All other control bytes control relocation of the next word in the corresponding segment. The I-weight bit and 2 weighted bit are both always zero for the 8080; the symbol code is the control byte right shifted two places. A symbol code.of 47 is replaced by a code obtained from the byte or bytes following in the relocation stream. If the next byte is less than 128, then the symbol code is its value plus 47; otherwise the code is that byte minus 128 times 256, plus 175 plus the value 0 the next relocation byte after that one. A symbol code of zero calls for no further relocation; 1 means that a change in text bias must be added to the word; 2 means that a change in data bias must be added; 3 is not used. Other symbol codes call for the value of the symbol table entry indexed by the symbol code minus 4 to be added to the word. Each symbol table entry consists of a value word, a flag byte, and a nine-byte name padded with trailing NULs. Meaningful flag values are 0 for undefined. 4 for defined, 5 for defined text relative, and 6 for defined data relative. To this is added 010 if the symbol is to be globally known. SEE ALSO link, cp2, o~j -2- badspots (1) 4/6/83 badspots (1) NAME badspots - bad sector report SYNOPSIS badspots [-p] filesystem ••• DESCRIPTION Badspots is a Micronix utility program which produces a display of bad blocks on a hard disk whose name is given. The program knows how to read the bad map formats of the two Morrow disk testing and formatting programs: FORMATMW and FORMATHD Badspots knows about exactly 6 kinds of disks. 5 inch: M5 MIO MI6 8 inch: MIO M20 M26 The program only works properly on a freshly formatted or tested disk; that is to say, the Micronix file system is written over the the disk's bad sector map. Invalid bad sector maps are flagged in error and no list of block numbers is produced. In particular, either a valid block list or nothing is sent to the standard output, so it is always meaningful to use the block list badspots produces. If there are no bad sectors badspots produces no output. in the disk's bad sector map, The Default Display Mode: By default each bad sector as a Micronix block number. is displayed The -p option causes the cylinder, head, and sector numbers to be printed for each bad sector. EXAMPLE fsck -b 'badspots /dev/mI6a' /dev/m16a -1- badspots (1) 4/6/83 badspots (1) This is the way badspots is used in production at Morrow Designs. The results of badspots are conveyed to fsck in this example. To simply view a list of badspots: badspots hdb The badspots program is clever enough to try adding "/dev/" to the filename used if it is unable to open the file named on the command line. To see that same badspots list expressed as cylinder, head, sector triplets: badspots -p hdb SEE ALSO fsck (1), hdca (4), hddma (4) -?- 4/6/83 boot (1) boot (1) NAME boot - Micronix bootstrap procedures SYNTAX djboot, hdboot, m5boot, m10boot, m16boot DESCRIPTION The CP/M diskette that comes following bootstrap programs: with Micronix includes djboot Boot from the DJDMA controller with a 5 inch inch drive. hdboot Boot from the. HDCA megabyte drive m5boot Boot from the HDDMA drive m10boot Boot from drive the controller controller HDDMA the with or 10, the 20, 5 the an 8 or 26 megabyte controller with the 10 megabyte m16boot Boot from the HDDMA controller drive with the 16 megabyte These are CP /M programs, ie, they are stored on 'the CP/M diskette as djboot.com, hdboot.com, etc, and are invoked from CP/M by typing the name without the .com extension. In each case, they assume that the target disk contains a Micronix file system, and they search its root directory for files that could be Micronix kernels. If exactly one such file is found, it is loaded' ,and execut'ed. If more than one kernel is found, the names are listed and the operator is asked choose one. This allows backup copies or alternate versions to be kept. CP/M's only role in this process is the invocation of the bootstrap program. Once the bootstrap begins executing, it is independent of CP/M, and CP/M itself is overwritten as Micronix is loaded. CP/M can be eliminated entirely by placing the desired bootstrap program on the "system tracks" of a floppy disk. Then as long as that diskette is in drive A, Micronix will boot automatically from the appropriate hard disk 'every time the Decision's RESET buttdn is hit. This should save the op~'rator about 5 seconds per day. (CAUTION: if Micronix is already running, make sure you type sync before hitting RESET.) The loaders that can be placed on a floppy's system tracks are store.d as files on the Micronix CP/M diskette, and are called -1- boot (1) 4/6/83 boot (1) hdload t m5load, ml0load t and m16load, corresponding to the similarly-named bootstrap programs. See below for an installation example. The djboot program has already been placed on the system tracks of the Micronix stand-alone floppYt so if you put this in drive A and hit RESET, it will boot automatically. EXAMPLES SCREEN DISPLAY COMMENTS To boot the Micronix stand-alone floppy: Make sure the diskette is write-enabled Insert the diskette into drive A Hit RESET Machine responds ~achine types :, you type b Loader takes over FFFF :b DJDMA loader ••• To boot Micronix from the m5: Insert the Micronix CP/M diskette in drive A Hit RESET Machine responds Machine types :,'you type b CP/M. announces itself· Type mSboot Loader takes over FFFF :b Morrow Designs CP/M A> mSboot HDDMA loader ••• To prepare -an auto-boot floppy for the m5: Insert the Micronix CP/M . diskette in drive A Hit RESET Machine responds Mach~ne types: you type b CP/M announces itself Type fqpm~tdj. F~llow the instructions to format a new diskette. 512 byte sectors are recommended. Type sysgen mSload Type an A -2- FFFF :b Morrow Designs CP/M A> formatdj A> sysgen mSload Destinatio,n driv~? A boot (1) 4/6/83 Insert the format-ted diskette in drive A and hi t RETURN. The diskette is ready to use boot (1) Insert a write enabled diskette in drive A Function complete ••• To use the m5 auto-boot: Insert the auto-boot diskette in drive A Hit RESET Machine responds Machine types :, you type b Loader takes over FFFF :b HDDMA loader ••• BUGS The bootstrap programs only search the first block of the root directory, so you should limit your root directory to 32 entries (which is a good idea anyway, to speed up rooted file-name searches), or else you should make sure that the Micronix kernel occurs as one of the first 32 entries. -3- 4/6/83 cal (1) cal (1) NAME cal - print a calendar SYNTAX cal [month] [year] DESCRIPTION The cal program is capable of printing full-year calendars or single-month calendars for any year or any month after year 0 (A.D). Cal with no current year. arguments prints a full-year calendar for the Cal with one numerical argument prints a calendar for that year. Month names may be given a english names, abbreviations, or as numbers. ·If a month name is given, a single-month calendar is printed. If both arguments are numeric, the first month. is taken to EXAMPLES cal 1932 Would print a full year calendar for the year 1932. cal august 1955 To print a single month calendar for August, 1955. cal Would print this year's calendar. cal november For a single month calendar for November of this year. be the 4/6/83 cat (1) cat (1) NAME cat - concatenate and print SYNTAX cat file ••• DESCRIPTION Cat reads each file standard output. Thus, in the order given and writes it to the cat file prints the file and cat file1 file2 > file3 concatenates the first two files and places the result in the third. If no files are given or if "_" is given as a file name, cat reads the standard input up to an end-of-file. NOTES Beware of cat a b >a cat a b >b and they destroy the input files before reading them! SEE ALSO clean (1) -1- , cc (1) OPTION 4/6/83 cc (1) NAME cc - C and Pascal compiler SYNTAX cc [options] file ••• . DESCRIPTION Cc is the Whitesmiths' C compiler supervisor; it accepts several types of arguments: Those ending with n. p" are assumed to be Pascal source files and are converted to ".c" files. Arguments ending with ".c" are taken to be C source files and are compiled with each relocatable object module left in the file named for the source with ".0" substituted for ".c". In the same way, arguments whose names end with ".s" are taken to be A-natural source files and are compiled to produce an ".0" file. The following options are meaningful to cc: -c Suppress the loading phase of the compilation, and force object file(s) to be produced for each source file. -S Produce A-natural output. A-natural is Whitesmith's narrative assembly language and is one of the intermediate products of a C compiler run. Normally the A-natural version exists only in a temporary file which "cc" removes. Each of the named ".c" files and ". p" files is compiled into a similarly named ".s" file. cc -S prog.c would produce a file "prog.s" containg the translation of the given C source program. A-natural -i name Passed on to cpp, the C compiler preprocessor. Name is a prefix to be used on "II incl~de -1- cc (1) OPTION 4/6/83 cc (1) -cpm Compile to run under CP/M. -ws Use the Whitesmiths' C library. -xN where N is a number. Arguments of this type are to pass 2 of the compiler; see cp2. -z Strip out control Z's from C source files produced with the aid of CP/M programs (for instance). The -z flag arranges for a precleaning of your source files. The "clean" utility is used to accomplish this. (See clean in section 1 of the Micronix reference manual). The source files are cleaned in place. passed on EXAMPLES To compile echo.c: cc echo.c -0 echo -ws To compile a program which uses the Standard I/O library. cc prog.c To compile a environment: cc prog.c -0 prog -IS, program -0 to be run under the CP/M operating prog.com -cpm Or with the Standard I/O library and for CP/M: cc prog.c prog.com -cpm -IS -0 If you want to see what's going on: cc a.c -v And the compiler passes and flags will be displayed as they are run. If you have written you own library, put it in Ilib and then: cc prog.c prog -lnew -0 To create an object module cc -c prog.c - (The -c stands for compile only (no link» To construct an executable produced object modules: program -2- from several previously cc (1) OPTION 4/6/83 cc a.o b.o c.o d.o -0 cc (1) out -18 To run a compile in the background (so you don't have to wait) cc prog.c -0 prog -IS & SEE ALSO Kernighan, B.W. and D.M. Ritchie, The f Programming Language, (Prentice-Hall, 1978). Kernighan, B.W., Programming in f -! Tutorial Ritchie, D.M., C Reference Manual, (Addison-Wesley, 1976). cpp (1), cp1 (1), cp2 (1), as (1), Id (1), lib (1) -3- 4/6/83 change (1) change (1) NAME change - make global changes in a stream SYNTAX change from [to] DESCRIPTION Change reads the standard input up to an end-of-file. It writes the standard output exactly as it was read, except that all instances of the regular expression from are replaced with to. If no replacement pattern is specified, all instances of the regular expression are eliminated. The rules for regular expressions and replacement patterns are exactly as in edit. EXAMPLE To make a global replacement: change lead gold output SEE ALSO edit (1), find (1) Brian Kernighan and P. J. Plauger Software Tools, Addison Publishing Company, 1976. -1- West 4/6/83 chars (1) , chars (1) chars - count characters in standard input or files. SYNTAX chars [file ••• ] DESCRIPTION The number of characters in each of the named files is printed on the standard output. If it would provide additional information, a total is then printed. If no file names are specified, or if If_" is given as a file name, the standard input is read up to an end-of-file and the number of characters read is printed. Note: On some systems, (but not Micronix), the number of characters in a file is poorly defined. There are sometimes two kinds of files - text and binary. standard input is assumed to be.a text file while files specified.by name are assumed to be binary files. ' The EXAMPLE To count the characters in a number of files: chars file! file2 file3 file4 SEE ALSO lines (1), words (1) -1- 4/6/83 chmod (1) chmod (1) NAME chmod change mode of files (accessibility for reading, writing, & execution; set user/group number bit; set write lock bit) SYNTAX chmod mode file(s) BRIEF DESCRIPTION chmod performs three general functions as noted above: (A) setting up access restrictions to files, (B) setting/resetting the user and group number bits, which is typically used to get around access restrictions under special circumstances, and (C) setting/resetting the write lock bit, which prevents two processes from writing to the file simultaneously. The format of access mode commands is: chmod [u goa] [= - +] [r w x] filename(s) The format of user/group bit commands is: c~od [u g] [+ -] s filename(s), Finally, the format of write lock commands is chmod [+ -] 1 filename(s) You should also refer to the entry on the Is program in this section of the manual, as it close~y relates to the following explanation. Use the "-I" flag with the Is program to monitor the effects of chmod operations. EXPLANATION A. File Access Read, write, and execute access are controlled thr,ough the "mode" argument, which may be an octal number (e.g. 6i7) or a combination of symbols as described below. Before proceeding, you should have a basic 'understanding of the Micronix file protection system. The file protection system allows or denies access to files according to two criteria, namely, WHO wants to get into the file and HOW he wants to 'use it. The~e are three categories of users and three types of access" so there are nine bits altogether which define the accessibility of the file., WHO is represented in chmod commands by these symbols: a - for "all", in other words, the restrictions t~hat you specify will apply to everyone in the system. /is you will see, "a" is not one of the user categories -1- 4/6/83 chmod (1) chmod (1) mentioned above, but rather the sum of all three. u - for "user", in effect the owner or creator of the file. The owner of a file may be changed by way of the "owner" program. Note that only the superuser (login "root") may use the "owner" program. g - for "group", which comprises users with the same group code as the owner. (See "group" in the Files section of this manual). o - for "others", who is anyone covered' by u and g. else in the system not Now, as to HOW these various parties may wish to use the file in question, there are these three categories: r - to read the file; w - to write to the file; x to execute the file, in the case of a program or control string; or searth, in the case of a directory. There is a final set of symbols to consider, the operands +, , and =. "+" will add a privelege. tha t had earlier been restricted. "-" accomplishes the reverse. "=" enables only those HOW's listed after it, and disables those not listed. The general' for~ that chmod expressions take is: cbmod WHO operand HOW filename(s) When performing chmod, keep in without restrictions of any sort. mind that files are created EXAMPLES A. File Access To set up a new file so that only the owner has access (of all 3 types): cn.od go-rwx filename To restore full priveleges to everyone in the system for a that had previously been restricted: cbmod a+rwx filename file To unde'rstand the difference between the + and = operands, consider the following. If the group how has read and 'execute prive1eges only, and you want to give them write ability as well: chmod gTw filename will work, as will cbmod g=rwx filename. However, if you had entered chmod g=w filename, the read and execute priveleges would have been unintentionally revoked. -?- chmod (1) 4/6/83 chmod (1) Multiple chmod operations for the same file may be ~trung together in one command, using commas but no spaces. Say you have a new (unrestricted) file that you want to set up so that you have full priveleges, the group has read only priveleges, and others cannot access it at all. This could be your command: chmod g=r,o-rwx filename EXPLANATION B. Set User/Group Number Bit(s) As noted above, when you try to open a file (either directly or through a program you are executing) your user and group numbers are checked to see whether access is permitted. Now, suppose you execute a program owned by someone else, but to which you have be~n granted execute priveleges. However, within that program is a command to read a file to which only the programmer has access. You will not be granted access, and a "permission denied" message is passed back to your unhappy process. The chmod function being described here can often overcome this sort of problem by replacing your user and/or group number with the numbers of the owner of the program. See the example that follows for further information. EXAMPLE B. Set User/Group Number Bit(s) Programmer Mary has written a program EXTRACT that reads year-to-date information from her company's payroll file (PAYROLL). It is decided that each system user should be allowed to look at his own payroll record. So Mary modifies the program accordingly, and enters chmod go+x EXTRACT to open up the previously restricted execute privelege to other users. However, when John tries to run the program, all he gets is the message "PAYROLL: Permission denied." What has happened is that user John has tried to open the payroll file, which Mary owns and to which he has no access priveleges. The solution in this situation is to invoke chmod so that when EXTRACT goes to read PAYROLL, PAYROLL will think EXTRACT's owner (Mary) is running the program, regardless of who is actually running it. The command in this case (which must be entered by Mary) is: chmod u+s EXTRACT The letter u means that Mary's user number will be attached to any file openings requested by EXTRACT. If the file PAYROLL was owned by someone other than Mary but to which she had group priveleges, the letter g would be used in place of or in addition to the u in the command above. To reset the user/group number flags, repeat the command you -3- chmod (1) chmod (1) 4/6/83 used to set them, but with a minus sign in sign. place of the plus EXPLANATION C. Set Write Lock Bit This function is quite simple and straightforward. Without the write lock bit set, Micronix allows anyone with write access to a file to update it whenever they please. However, some files can become corrupted if write accesses become interleaved. As an example, a data base system written for a single user (such as Personal Pearl) should have its critical data files write-locked. This is accomplished by setting the write lock bit. Enter: chmod +1 database This sets the lock flag on the database. (Since the lock flag applies equally to user, group, and others, the WHO part of the operand may be left out here.) Using a minus sign in place .of the plus in the above command will reset the bit, thus removing .the lock. SEE ALSO group(S) ls(l) owner(l) -4- clean (1) 4/6/83 clean (1) NAME clean - clean CP/M format text files SYNTAX clean [-u] file ••• DESCRIPTION Clean removes return characters from each of the named files and truncates the file upon encountering a CP/M end-of-file character C"Z}. The "cleaning" is done in place. To clean a Micronix use, enter the clean file command. file for general The -u option reverses the process. It stands for "unclean". Use clean -u file to make a file suitable for CP/M programs to look at. EXAMPLE To import a CP/M text file, enter far /dev/dja -x file; clean file SEE ALSO far (1) -1- cmp (1) 4/6/83 cmp (1) NAME cmp - compare two files SYNTAX cmp [-1] file1 file2 DESCRIPTION Cmp compares two given files. Nothing is printed if they are identical. If a difference is encountered, cmp announces the byte number and line number at which the difference occurred. If one, file is an initial sub-sequence of the other, that fact is also noted. If the -1 option is used, the byte number (decimal) and the,differing bytes (octal) are printed for each difference. SEE ALSO diff (1), common (1) -1- comm (1) 4/6/83 comm (1) NAME comm - print lines in common SYNTAX comm [-123] filel [file2] DESCRIPTION Comm prints lines unique to the first named file in column 1, lines unique to the second named file in column 2, and lines common to both files in column 3. Leading blank space is removed for printing purposes. The files must be sorted. If no second file name is given, the standard input is used for the second file. Flags 1, 2, or 3 suppress printing of the corresponding columns. Thus comm -12 prints only the lines common to the two files; comm -13 prints only the lines that are unique to the second file; comm -123 prints nothing. EXAMPLES To find spelling mistakes translit translit translit sort tl a- z u@40" t2 u@12@40" u@12" t3 >t4 dictionary mistakes' A NOTES Only works with sorted inputs. -1- common (1) 4/6/83 common (1) NAME common - print lines in common SYNTAX common [-wN] [-1] [-2] [-3] filel [file2] DESCRIPTION Common prints line_s in the first named file in column 1, lines in the second named file are printed in column 2, lines common to both files are printed in column 3. Leading blank space is removed for printing purposes. The files are assumed to be sorted. If no second file name is given, the standard input is used for the second file. If -1, -2, or -3 is specified are printed. given as an argument, those columns Horizontal positioning of the columns may be changed with the -w option. (Default is 80 columns wide.) -wN - where N is a number - sets the width to N columns wide. EXAMPLES Find spelling mistakes translit A-Z a-z t1 translit a- z "@40" .t2 translit "@12@40" "@12" t3 sort t4 common -2 dictionary mistakes A NOTES Only works with sorted inputs. SEE ALSO Brian Kernighan and P. J. Plauger Software Tools Publishing Company, 1976. -1- t Addison West compare (1) 4/6/83 compare (1) NAME compare - compare two files for equality SYNTAX compare file1 file2 DESCRIPTION Compare reads the two named files, line by line, and announces any differing lines, including the line number. EXAMPLE To find the differing line in two nearly identical files: compare version1 version2 NOTES The algorithm is very poor if lines have been added or deleted to one of the files. Compare will then report that all of the following lines differ when in fact only a small change may have been made between the two files. SEE ALso diff (1) for a more sophisticated text comparator. Brian Kernighan and P. J. Plauger Softwa:t;'e-Tools,- !\ddison Publishing Company, 1976. -1-- West 4/6/83 compress (1) compress (1) NAME compress - compresses files SYNTAX compress [ input [ output ] ] DESCRIPTION The first named file is compressed and written onto the second named file. If no file names are given, the standard input and output are used. If only one file name is given, the named file is used for input and its compression is written to the standard output. If the second named file does not exist, it is created. Compress searches for opportunities to abbreviate long runs of identical characters in an input stream. It encodes these into a form that the expand program can later be used to undo. The remainder of the file is merely copied through. Most text files are probably not worth compressing unless they contain long runsof spaces. Data files, such as executable modules, benefit somewhat from compression. A typical compression value is 7%. EXAMPLE To compress a file (for disk file space saving): compress input compressed NOTES Due to I/O idiosyncracies-on some systems, the standard input and output cannot be used. The automatic-add~tion'of carriage returns, etc. in the input and output streams is unacceptable for this program. The construction compress input output should wo~k regardless of the local environment. SEE ALSO expand (1) Brian Kernighan and P. J. Plauger Software Tools , Addison West Publishing Company, 1976. -1- 4/6/83 concat (1) concat (1) NAME concat - concatenate named files onto standard output SYNTAX concat file1 file2 ••• DESCRIPTION Concat reads each of the files named in its argument list and produces output which is the concatenation (in the order given) of the input files. If no file names are given, no output is produced. EXAMPLE To read a file: concat file SEE ALSO cat (1) Brian Kernighan and P. J. Plauger Software Tools, Addison Publishing Company, 1976. -1- West copy (1) 4/6/83 copy (1) NAME copy - copy input characters to output SYNTAX copy DESCRIPTION Copy simply copies its standard input to its standard output unchanged, up to an end of file. EXAMPLE To copy one file to another: copy
Source Exif Data:
File Type : PDF File Type Extension : pdf MIME Type : application/pdf PDF Version : 1.3 Linearized : No XMP Toolkit : Adobe XMP Core 4.2.1-c043 52.372728, 2009/01/18-15:56:37 Create Date : 2011:05:27 16:33:33-08:00 Modify Date : 2011:05:27 17:35:26-07:00 Metadata Date : 2011:05:27 17:35:26-07:00 Producer : Adobe Acrobat 9.43 Paper Capture Plug-in Format : application/pdf Document ID : uuid:25238604-376c-49a7-b7af-b2cb4bfd23f0 Instance ID : uuid:5af0cc32-b3c4-4926-ab55-692eaa1ff397 Page Layout : SinglePage Page Mode : UseOutlines Page Count : 607EXIF Metadata provided by EXIF.tools