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 "m10bootm10boot
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
DESCRIPTION
Cpl is the parsing pass of the C compiler. It accepts a
sequential file of lexemes from the preprocessor, cpp, and
writes a sequential file of flow graphs and parse trees,
suitable for input to a machine-dependent code generator, cp2.
The operation of cpl is largely independent of any target
machine. The flag options are:
-a
Compile code for machines with separate
registers.
-b#
Enforce storage boundaries according to #, which is reduced
modulo 4.
A bound of
allocations.
0
address
and
data
leaves no holes in structures or auto
A bound of 1 (qefault) requires short,_ intermediate
and longer data to begin on an even bound.
A bound of 2 is the same as 1 except that 4 to 8 bytes
of data are forced to a mUltiple of a four-byte
boundary.
A bound of· 3 is the same as 2, except that eight bytes
of data (doubles) are forced to a mUltiple of an
eight-byte boundary.
-c
Ignore case distinctions in testing external identifiers'
for equality, and map all names to lower case on
output. By default, case distinctions do matter.
-e
Do
-1
Take
-m
Treat each structure/union as a separate name space, and
require x.m to mean that x is a structure and m is one
of its members.
-n#
Ignore characters after the first # in testing external
identifiers for equality. Default is 7; maximum is 8.
not force loading of external references that are
declared, but never defined or used in an expression.
Default loads all declared external references.
integers and pointers to be four bytes long. Default
is 2 bytes.
-1-
-0
file
cpl (1)
4/6/83
cpl (1) OPTION
Write the output to the specified file and write
error messages to STDOUT. Default is STDOUT for output
and STDERR for error messages.
-r#
Assign no more than H variables to registers at anyone
time, where # is reduced modulo 4. Default is three
register variables.
-u
Take
"string" as an array of unsigned characters, not an
array of characters.
If is present, it is used as the input file instead of
the default, STDIN. On many systems, the -0 option and
are mandatory because STDIN and STDOUT are interpreted as text
files, and hence become corrupted.
EXAMPLE
Cpl is usually sandwiched between cpp and cp2, as in:
cpp -x -0 tempI file.c
cp1 -0 temp2 tempI
cp2 -0 file.mac temp2
SEE ALSO
cpp (1)
f Compiler
User'~
Manual for language definition.
NOTE:
This
program
Whitesmiths, Ltd.
documentation
and
-2-
are
products
of
cp2 (1) OPTION
4/6/83
cp2 (1)
NAME
cp2 - generate code for 8080 C programs
SYNTAX
cp2 -[flags] (file)
DESCRIPTION
Cp2 is the code generating pass of the C compiler. It accepts a
sequential file of flow graphs and parse trees from cpI and
writes a sequential file of A-Natural statements, suitable for
input to the A-Natural assembler, as.
As much as possible f the compiler g~nerates free-standing code;
but for those operations which cannot be done compactly, it
generates inline calls to a set of machine-dependent library
routines. The 8080 runtime library is documented in Section IV
of the C Reference Manual.
The flags are:
-p
~o
Emit profiler calls on entry to each function. No
is currently provided for the 8080.
profiler
* Write
the output file * and write the error messages to
STDOUT. Default is STDOUT fo.r output and STDERR for error
messages.
-xU Map
the three virtual sections, for Functions (04),
Literals (02), and Variables (01), to the physical sections
Code (bit is one) and Data (bit is zero). thus, "-x4" is
for separate I/O space, "-x6" is for ROM/RAM code, and
"-x7" is for compiling tables into ROM. Default is 6.
If (file)' is present, it is used as the input file instead of
the default STDIN. On many systems, (file) is mandatory because
STDIN is interpreted as a text file, and hence
becomes
corrupted.
Files output from cp1 for use with 8080 code generator should be
generated with: lI-bO" to eliminate holes in structures and auto
allocation, and "-n8" for full length external names. A boundary
of "-bI" (default) is also acceptable if compact storage is less
important than compatibility with data structures on other
machines. Note that use of the cp1 flags "-b2", "-b3", or "-1"
will produce bizarre behavior and incorrect code in cp2, often
with no meaningful diagnostics.
Wherever possible, labels in the emitted code each contain a
comment which gives the source line from which the code
immediately following obtains.
-1-
cp2 (1) OPTION
4/6/83
cp2 (1)
EXAMPLE
cp2 usually follows cpp and cpI as follows:
cpp -x -0 tempI file.c
cpI -bO -n8 -0 temp2.80 tempI
cp2 -0 file.s temp2
SEE ALSO
as (1), cpl (1), cc (1), cpp (1)
NOTE:
Ltd.
This
program
and
documentation are products of Whitesmiths,
-2-
cpp (1) OPTION
4/6/83
cpp (1)
NAME
cpp - preprocess defines and includes
SYNTAX
cpp
DESCRIPTION
Pp is the preprocessor used by the C compiler, to perform
'define, 'include, and other functions signaled by a I before
actual compilation begins. It can be used to advantage, however,
with most language processors. The flag options are:
-c
Do not strip out /* comments */ nor continue lines that end
with \.
-dna me
Define name; if the definition string (=def) is
included, it reads it in before the input; if "=def"
is omitted, the definition is taken .as "1". The "name"
and "=def" must be in the same.argument - no blanks
are permitted unless the argument is quoted. Up to ten
definitions may be entered in this fashion.
-i
Change the prefix used with 'include from the
default ('''') to the string prefix. Multiple prefixes
to be tried in any order may be specified, separated
by the "I" character.
-0
can be specified with flag. Writes the
output to the specified file and writes error messages
to STDOUT. Default is STDOUT for output and STDERR tor
error messages. On many systems, the -0 option is
mandatory with -x because STDOUT is interpreted as a
text file, and hence becomes corrupted.
-p?
Change the preprocessor control character from # to ?
-s?
Change the secondary preprocessor control character from
to'?
-x
Put
-6
Put out extra newlines and/or SOH ('\') codes to keep
source line numbers correct for UNIX/V6 compiler or
ptc.
@
out lexemes for input to the C compiler cpI, not lines
of text.
Cpp process~s the named file, or STDIN if none is named, in the
order
specified,
writing
the resultant text to STDOUT.
Preprocessor actions are described in detail in the Preprocessor
section of the C Compiler User's Manual. The presence of a
secondary preprocessor control character permits two levels of
parameterization. For instance, the invocation
-1-
cpp
(1) OPTION
4/6/83
cpp (1)
cpp -c -p@
will expand define and ifdef conditionals, leaving all #
commands and comments intact. Invoking cpp with no arguments
would expand both @ and # commands. The flag, -sl, effectively
disables the secondary control character.
EXAMPLE
The standard for writing C programs is
1*
name of program
*/
'include
H define MAXN
100
COUNT things[MAXN];
etc.
The use of uppercase identifiers is not required by cpp, but is
strongly recommended to distinguish parameters from normal
program identifiers and keywords.
NOTES
Unbalanced quotes (' or tI) may not occur in a line, even in
-2-
cptree(l)
4/6/83
cptree (1)
cptree - copy Micronix file hierarchies
SYNTAX
cptree [-v] [source destination]
DESCRIPTION
The contents of the source directory and all its descendants are
copied into the destination directory.
The destination directory must exist, but cptree will create any
needed sub-directories.
If either the source or destination names are not given, cptree
will ask for them.
If -v is in the command line, ~ptree will print
in the tree copy as it is performed.
each
operation
It is permissible to copy a tree into a sub-tree of itself.
Cptree will avoid getting into a wormhole.
SEE ALSO
mv (1), cp (1), rm (1)
-1-
4/6/83
crypt (1)
crypt (1)
NAME
crypt - file encryption
SYNTAX
crypt key
DESCRIPTION
Crypt reads from its standard input and writes to its standard
output, encrypting as it goes, according to the key. Crypt is
its own inverse; to read an encrypted file, all you need to know
is the key word.
Note: this is not a very sophisticated encryption scheme (NSA
would have it overnight).
You can increase the complexity of the encryption by
multiple passes of crypt, each with a different keyword.
using
EXAMPLES
To encrypt a file:
crypt bandersnatch
< ,file > encrypted
to read the encrypted file
crypt bandersnatch
< encrypted
Encrypt a file with three keywords: .
crypt honeybee
< file I
crypt Beaumont
-1-
I
crypt oscar
> encrypted
4/6/83
cu (1)
cu (1)
NAME
cu - call up
SYNTAX
cu device [-s speed]
DESCRIPTION
eu may be used
Micronix machine.
to
connect
to
other
machines through your
When the cu command is given, one process is set up to handle
sending characters to the remote system, one is set up to
receive them. Much of this is not obvious to the user.
When cu is ready it prints a "-It. Thereafter, whatever you type
will be ,immediately sent to the remote port, and whatever is
received from it is sent to your terminal. So, typically, you
press a single key on your terminal, Micronix takes it and
re-transmits it to the remote machine, which will usually send
it back, at which point Micronix receives it and sends it to
your terminal and you see the character on your scre~n!
There is definitely an upper limit to the baud rate you can use
for the remote port - 1200 baud is the highes't recommended. If
the remote machine is another Micronix machine, additional
commands apply. You may copy a file from local to remote machine
via:
-%put "file
Or from remote to local via:
-Xtake file
Note only text files 'may be copied reliably'. This need not be a
drawback, however, because any file can be converted into a text
file, transferred, and then converted back again.
Both the sending and receiving proce$ses recognize
as starting and ending delimiters for file diversion, so that in
order to copy a file from a foreign system to the local one," all
you have to do is get the forelgn system to generate:
-)filename
Text of file
more file •••
...
->
-1-
4/6/83
cu (1)
That is, a beginning marker, the text of the file, and
ending marker.
cu (1)
then
an
To get out of cu type:
EXAMPLE
To set up communication over a modem, get your hardware set up
and then type:
cu /dev/ttyC -s 300
In this example the modem would be plugged into Micronix port
(the third one).
C
Typically, one must reverse the transmit and receive lines in
the cable running from the computer to the modem. One reverse-s
the wires running to pins 2 and 3 of the connector at one end or
the other.
-2-
4/6/83
cxr (1)
cxr (1)
NAME
cxr - C cross reference listing generator
SYNTAX
cxr [ -exclusions ••• ] [ program.c ••• ]
DESCRIPTION
Cxr generates a C cross reference listing for each of the named
files. If an argument begins with a minus, the rest of the
argument is taken as the name of file containing symbols to be
excluded from the cross referencing. The symbols found therein
are added to the list of already excluded symbols. The exclusion
files are free form. The symbols may appear most anywhere, as
long as they are separated by non-alphanumeric characters'. Note
that the output of cxr is in order of appearance. For a useful
listing, run cxr's output through sort. If no cross reference
input files are given, the standard input is used. For each
symbol, the following is printed:
where
is simply the name of the symbol.
is the name of the ,file in which the current instance of the
symbol occurs. is used when the standard input is being
used.
is the name of the function in which the current instance of the
symbol appears. If the symbol is global, no function name is
printed.
is the number of the file.
is the text of the line in which the current instance of the
symbol appears. Leading white space is removed from the line
before printing.
All of the C keywords and the std.h typedefs are automatically
excluded. This includes the preprocessor keywords. Comments,
string constants, character constants, and numerical constants
-1-
4/6/83
cxr (1)
cxr (1)
are excluded.
NOTES
If you make your structure references or function
into onions of parentheses, cxr may gaffe.
EXAMPLE
cxr file1.c file2.c file3.c file4.c >cross
sort sorted
Under Micronix:
cxr *.c
I
sort> output &
SEE ALSO
sort (1), kwic (1)
-2-
declarations
4/6/83
dar (1)
dar (1)
NAME
dar - access MSDOS format floppy diskettes
SYNTAX
dar device [flags] [files]
DESCRIPTION
Dar provides a simple interface to MSDOS floppy diskettes.
It may be used for backing up files on diskettes, and
recovering them as necessary. "Device" is assumed to be the
name of a Micronix special file (such as mfa) corresponding
to a floppy drive that contains a MSDOS diskette. Note that
mfa stands for mini floppy A. Dar can copy files in either
direction, and can also be 'used to read the directory of a
MSDOS floppy. When the -v flag is used, it reports the
amount of space still available on the diskette.
Names such as /dev/mfa may be abbreviated as mfa. You
check the names of the storage devices by entering
can
dir /dev (return)
Currently only
are recognized.
single sided 5.25" IBM PC format diskettes
The flags are:
-c
Create. Start a new dos diskette from scratch.
Remove all files, clean out the file allocation
table. This option must be used to copy fils to a
freshly formatted diskette. It may be used in
conjunction with any of the other arguments, and
if so, it is performed first.
-d
Delete. Delete the named files from the floppy
diskette. If no file names are given, no action
is taken.
-p
Print. Each named file is sent to the
output (most likely your terminal).
-r
Replace. Each na~ed file is copied to the floppy.
If . no file names are given, all the files in the
current directory ar,e copi,ed. If a file of the
same name already exists on the floppy, it is
silently overwritten.
-t
Table. Print a table of contents of the floppy
diskette. If any files are named, only those
named and present are listed.
-1-
standard
dar (1)
4/6/83
dar (1)
-x
Extract. Each named file is copied from the
diskette to the current Micronix directory. If no
file names are given, the entire contents of the
diskette is extracted.
-v
Verbose. Be verbose about it. Each operation is
printed along with the affected file name. Files
deleted are preceded by a "d", those replaced are
preceded by an "r", those extracted are preceded
by "x". The percentage of the diskette that is
occupied, along with the number of bytes still
avai~able, is reported when dar is finished.
At most, one of the flags - d, t, r, x - may be present. If
none are prese~t, -t is assumed. -v may be used in
combination with any of these as in "-xv".
The file list may contain wild card matching patterns to be
applied to the set of file names in the MSDOS diskette's
directory. Refer to the section "Argument Expansion" in, the
sh program writeup in this manual.
-EXAMPLES
You receive a MSDOS diskette and want to copy the files
off. To 'copy its entire contents to Micronix, insert the
diskette into floppy drive A and type:
dar mfa -xv
To copy
process:
a
file from a diskette, changing its name in the
dar mfa -p filename
To copy only
mini-floppy:
the
".doc"
files
> neWDame
over
from
a
MSDOS
dar mfa -xv n* •doc"
To copy a file from diskette into a file that is elsewhere
than your current directory:
dar mfb -p "name" > /dirt •••
(path from root to desired location; you could also specify
a new name)
The following discussion is intended primarily for users
are having trouble getting dar to do what they want it to.
-2-
that
dar (1)
4/6/83
dar (1)
One aspect of dar command syntax somewhat complicates the issue of
using it, namely, the use of quotation marks. An example should help
- clear this up. Let's say your current Micronix directory contains two
files, a.com and a.bak. Your MSDOS floppy contains a file a.pil that
you wish to copy into your current directory. Since this is the only
file on the floppy that begins with "a", you lazily enter dar mfa -xv
a*. Next you are wondering what's wrong when you are faced with the
message "a.com nQt found on diskette / a.bak not found on diskette".
Of course they weren't found -. You didn't even want Micronix to be
looking for them.
What has happened is this: Your command interpreter (shell) thought
you meant to.search the current directory for a match to the wildcard
argument before going out to the floppy for the copy. It indeed found
two matches (a.com & a.bak), so Micronix went gleefully out to the
floppy to copy them. In vain, unfortunately.
The solution here is to use quotation marks around yourfilename(s).
Had you entered dar mfa -xv ','a*", the shell would have left the
command alone,_and dar would have gone directly out to the floppy to
find anything that began with an "a". Success.
Now, just to -set the record straight, there is a further complication
that may help you to understand how the shell operates. Suppose the
file on your floppy is called b.pil instead of a.pil. If you enter
dar .fa -xv b.* (no quotes), the file will in fact be copied,
contrary to the previous discussio~. Furthermore, everything on the
floppy diskette will be copied, much to your chagrin. This is because
your shell took b.* to your current Micronix directory, looked to see
if a file of that name waS really there, and finding no such file, it
passed the command to Micronix as " dar mfa -xv ft. As noted above in
-the description of the x flag, if there is no file specified, the
whole diskette gets copied.
In summary, you should enclose the argument.in quotes whenever you
want to copy specific files from the floppy to Micronix. The only
exception to this is a situation where you have certain files already
established on Micronix and you want to extract only those floppy
files that match the existing Micronix filenames.
SEE ALSO
far - to access CP/M diskettes.
-3-
4/6/83
date (1)
date (1)
NAME
date
~
print or set the date and time of day
SYNTAX
date [year] [month] [date] [hour: [minute: [second])l
DESCRIPTION
Only the super-user may set the time. If no argument is given,
the current date and time are printed. Otherwise, all of the
arguments are taken together with the present date and time to
produce a new date and time. The systems' idea of the time is
set.
[year], [date], [hour), [minute], and [second] are each given as
decimal numbers.
[month] is the name of a month, in English; case is ignored. The
first three'letters of the name of the month must be given.
If any specification is 'omitted, the current value of that
specification is used in its stead. A common error is to attempt
to set the day of the..week. This is not permissable in the
command line.
EXAMPLES
date 25 Dec 1983
date 14:45
NOTES
The clock is subject to hardware-induced problems that may cause
the time to be off occasionally.
-1-
4/6/83
dc (1)
dc (1)
NAME
dc - desk calculator
SYNTAX
dc
DESCRIPTION
Dc
is
a stack-oriented desk calculator allowing integer
arithmetic and conversion. Its operation is much like a Reverse
Polish Notation calculator. It reads the standard input and
writes the standard output. Each token is processed as soon as
it is read; ? is the only error diagnostic. The following is a
list of the tokens, their meanings, and the action dc will take.
A number. The number is pushed on the stack, (i.e.,
remembered). A number must begin with a digit or a minus
sign followed by a digit. For example, to 'input ten in base
sixteen, type Oa.
'
An apostrophe followed by a character is converted to
that
character's ASCII value and pushed onto the stack.
+,- *,/,"10,&, I, . . <,>
These are the binary operators. The top two values on the
stack are combined. Division by zero is not permitted. If a
binary operation is attempted with fewer than two numbers
in the stack, an error will result.
The following are the operators and their meanings.
+'
*
/
%
&
I
<
>
The
add
subtract
multiply
divide
modulo
bitwise and
bitwise or
bitwise exclusive or
bitwise shift left
bitwise shift right
top value on the stack is bitwise inverted. It is an
error for the stack to be empty.
-1-
dc (1)
4/6/83
i
Set the input radix. The input radix is set to the value on
the top of the stack. Values less than 2 are not
accepted. Values larger than 36 are liable to cause
garbage. All further input is assumed to be in the new
radix.
o
Set the output radix t as above.
p
Print the value on the top of the stack.
c
Clear. The stack is emptied.
EXAMPLES
What is 243 in hex?
bd dc
16 0 243 p
What is a capital N in octal?
dc
8
0
dc (1)
'N P
-2-
dcheck (1)
4/6/83
dcheck (1)
NAME
dcheck - file system directory consistency check
SYNTAX
dcheck [-f) file system ••••
DESCRIPTION
Dcheck reads the directories in a file system and compares the
link-counts in each i-node with the number of directory entries
by which it is referenced.
ERRORS
When a file turns up for which the link-count and the number of
directory entries disagree, the relevant facts are reported. A
dangerous situation occurs when there are more entries than
links; if entries are removed~ the link-count drops to 0 and the
remaining entries point to thin air - they should be removed.
When there are more links than entries, some disk space may be
wasted but the situation is not dangerous. If the -f option is
given, "dcheck will try to ratify the situation.
NOTES
Extraneous diagnostics
an active file system.
may be produced if dcbeck is applied to
SEE ALSO
fsck (1), ncheck (1), icheck (1)
ddt (1)
4/6/83
ddt (1)
NAME
ddt - a program for examination and manipulation of
non-text files
SYNTAX
ddt [file]
DESCRIPTION
Ddt can be a handy tool for programmers and others who
manipulate arbitrary (i.e. non-ASCII text) files.
It is functionally analogous to
Research version works with memory,
files.
need
to
CP/M's DDT, but the Digital
while this one works on
Changes made to a file under ddt are immediately effective.
There is no intermediate buffer as with some editors.
Addresses (mentioned below) are given in hexadecimal, (up to six
digits long). If the first character of an address is an
(apostrophe), the value of that number will be that of the ASCII
character following.
The following are valid addresses:
o
6
c3bO
78ba4
b
B
'y
'A
FFFF
'/
Address list may be comma-separated or space-separated.
The following are valid address lists:
O,ffff
0,5,7
'a,'b,'c
0,3000, , a
No command takes more than three addresses. Extra addresses are
ignored.
Ddt always remembers the last file address accessed. In most
cases, if you g1ve no address on the next command, this old
remembered address is used.
-1-
4/6/83
ddt (1)
ddt (1)
Commands:
d - display
Takes 0, 1, or 2 arguments. Displays the contents of the file in
hex bytes on the left and ASCII characters on the right. If no
address follows d, the next 128 bytes, starting at the given
location, are displayed.
Finally, if two addresses are given, that part of the file which
lies between the two addresses is displayed. Examples:
d 0, ffff
d
d 55
d aOOO
f - fill (requires three arguments)
f
A, B, C
The portion of the file which lies between addresses A and
(inclusive) is overwritten with a flood of the characte,r C.
B
If C is large, then the low order byte of C is·used.
Example:
f 0, 3000, e5
writes E5s from 0 to 3000 hex.
r filename (Read)
The file
possible.
on
which
ddt is
ope~~ting
Examples
r new
r lusrsrc/cmd/pbx.c
r letc/dtab
r alb
s (address) Substitute
-2-
is changed tQ filename if
ddt (1)
ddt (1)
4/6/83
Takes 0 or 1 arguments. if no argument is given, the currently
remembered file address is used. The substitute command allows
you to examine and optionallly change the file on a byte-by-byte
basis. After entering the suhstitute command you will be in
"substitute" mode until you exit it by entering a single period
on a line. If while in the substitute mode you press RETURN, the
byte you were looking at will remain unchanged and you will be
stepped to the next byte. If you enter a byte value and then
push RETURN, the byte will be changed to the byte entered.
I (address)
II (search)
Ddt has the ability to search for patterns in a file. When the
"I" command is given, you will be asked to enter a series of
bytes to search for. If an address follows the "I", the search
commences at the given address in the file. Without an address,
the search commences at the current file address.
The "II" command is a shorthand
previously given pattern.
-3-
to
search
again
for
the
4/6/83
detab (1)
detab .( 1)
NAME
detab - converts tabs into an equivalent number of
spaces
SYNTAX
detab
DESCRIPTION
Detab acts as a filter, copying the standard input to the
standard output unchanged with the exception that tabs are
expanded to an equivalent number of spaces. Detab assumes tabs
are every eight positions at columns 9, 17, 25, etc.
EXAMPLE
To prepare a file
understand- tabs:
for
printing
detab output
SEE ALSO
entab (1)
-1-
on
a
device
that
does
not
4/6/83
df (1)
df (1)
NAME
df - disk free space
SYNTAX
df device
...
DESCRIPTION
. Df finds and prints the number of free blocks on each named
device, each of which is assumed to contain a file system.
This command is somewhat analogous to the CP/M STAT command.
EXAMPLE
df /dev/root
SEE ALSO
dcheck (1), icheck (1), ncheck (1), fsck (1)
-1-
4/6/83
diff (1)
diff (1)
NAME
diff - find differences in lines of text files
SYNTAX
diff [-e] file1 file2
DESCRIPTION
Diff is a file comparator intended for use with text files. It
attempts to find a minimal set of differences between lines of
the given files.
Differences are reported by lines of the form
N a R,S
N,M d R
N,M c R,S
Where Nand M are
numbers in file2.
line
numbers
in filel; Rand S are line
Following each line of this type is a list of the affected lines
in file1 marked by "<" and a list of the affected lines in file2
marked by">".
If the -e flag is given, the output takes the format of a
command script for edit to change the first file into the
second.
ERRORS
There are limitations on the size of files. An "Out of
error message is printed if the problem is too large.
memory"
Spurious blanks lines are sometimes generated in output produced
under the -e option.
EXAMPLE
diff apple pear
4
a
7, 9
> A text line
> another text line
> a third text line
-1-
diff (1)
4/6/83
diff (1)
means that one of the changes required is to add lines after line
number 4 in the first file.
After the addition is done, the lines will become lines 7 thru
the second file.
-2-
9
in
down (1)
4/6/83
down (1)
NAME
down - take the system down
SYNTAX
down
DESCRIPTION
The down command is the orderly way to bring Micronix down.
Only the super user may use this command and it
when Micronix is in the multi-user mode.
only
SEE ALSO
User'~
Reference Manual, Installation and Operation
-1-
functions
4/6/83
du (1)
du (1)
NAME
du - occupied disk space, in blocks (512 bytes per block)
SYNTAX
du [-a] [-s] [name ••• ]
DESCRIPTION
Du is a very useful memory management tool that reports how much
disk space is currently being held by the various files in the
system. The flags determine the level of detail given in the
reports. ( -a = all files; -8 - grand total; neither =
directories ) Du is complementary to the df function, which
reports free disk space available per device.
There are several combinations of flags (a, s, or neither) and
arguments (file or directory names), each of which produces a
slightly different breadth of coverage and level of detail. The
examples in the following section address the practical uses of
dUe
First, if you specify a particular filename, the file must be in
your current directory and you have' to us'e one or the other flag
(it m'akes no difference which one you 'choose in this case).
Obviously, du will report' only the size of this on¢ file, in the
format
11###1 filename
Next, if you specify a directory name,
in the current directory, or else you
to it from the root directory (e.g. du
begin at this directory and proceed
the files and subdirectories contained
it too must be contained
can give the path leading
-a /usr/bin). Du will
down the tree through all
within it.
If you don't give a file name or a directory,
you mean the current directory.
du
assumes
that
Options:
-a
All. This flag gives you the most detail, with a block
count for each file. There will also be subtotals for
directories embedded in the list, so don't be surprised if
the bottom line doesn't look like the sum of all the
numbers above it.
-s
Summary. Only a grand total is displayed.
Using
neither flag produces an intermediate level of detail,
where only directory subtotals and a grand total are
displayed.
-1-
du (1)
4/6/83
du (1)
EXAMPLES
To find
enter:
out
just how much space your whole system is using, simply
du -s /
To find out which directory has that enormous file in it:
du / (to begin at the root directory, in this case)
To get the name of the offending file itself:
du -a directoryname
To get an overview of the
system:
top
layer
of
directories
in
the
file
du -s /*
NOTES
If there are several links to the same file, the space used by that
file is counted only once. Space used by directories themselves and
by pointer blocks is not counted, as these are considered ov~rhead
and in any event do not amount to more th~n a, few percent. Dudoesn't
give special consideration to files with large vacant areas within
them; the empty space is counted as if it were filled.
SEE ALSO
df (1), Is (1)
-2-
edit (1)
4/6/83
edit (1)
NAME
edit - text editor
SYNTAX
edit [file]
DESCRIPTION
Edit is a line-oriented text editor which operates on a
temporary ~ of the file it i~ editing so that changes made
have no effect on the file until a w(rite) command i~ issued.
The copy of the text being edited resides in a temporary file
called the buffer.
Commands to edit have a simple and regular structure: zero or
more addresses followed by a single command character, possibly
followed by parameters to the command. Missing addresses ar~
supplied by default'. Certain commands allow the addition of text
to the buffer (i - insert, c - charige, a - append, etc., see
below). Input governed by these commands is merely collected; no
additional commands are recognized in this mode.
To get back to normal command mode, type a' period (.) alone at
the beginning of a line.
'
Edit supports a limited form of regu,lar expression notation. A
regular expression is used in commands arid addresses to refer to
patterns in the text. Following are the specifications for
regular expressions:
1.
Any character except a special character matches itself.
These ,are the regular expre~sion delimiters: { }, [ ],
1, and' sometimes %, *, and $ •.
2.
A 1 matches any character (except newline).
3.
A @ followed by any character except ( or ) matches that
-character.
4.
A string enclosed in [ and ] (or [A and ] ) matches any
character in, or not in, the set consisting of the
characters of the string (example: [abc] matches a, b,
or c). If a substring of the form a-b with a and b
letters
or
digits
within the brackets, it is
understood to mean the set of characters spanned by
the two limits. (Examples: [0-9'] 'matches any digit;
[a-zA-Z] matches any upper or lower letters.)
5.
A regular expression of forms 1-4 followed by * matches a
contiguous run of 0 or more occurrences of the
preceding regular expression. (Examples: * matches any
number of spaces (including zero); 1* matches the
-1-
4/6/83
edit (1)
entire
line
character).
(any
edit (1)
number
of
occurrences
of
any
6.
A regular expression enclosed in { and} matches what the
regular expression matches. [It also has side effects
- see the s - (substitute) command below.]
7.
The
8._
A % as the first character of a regular expression
restricts matches to the left end of the line. A $ as
the last character similarly limits matches to the
right end of the line.
9.
A regular expression matches the
left-most of possible matches.
10. An
concatenation of regular expressions
concatenation of what is matched.
longest
matches
among
the
the
empty regular expression stands for a copy of the last
regular_expression encountered.
To understand addressing in edit, you ne~d to know that at any
time, edit remembers a current line. In general, the current
line is set to the last line affected by the previous line. The
current line is initially set to the last line of the file.
Addresses are constructed as follows:
A (.) addresses the current line.A $ addresses the last line.
A decimal .number (n) add,resses the nth line pf the buffer.
A regular expression enclos~d in / addresses the line found
by searching forward from the current line for the first
line, which is matched by the regular expression. If
necessary, the search wraps around to the beginning of the
buffer.
A regular expression enclosed in \ addresses the line
above, except ~hat search, is backwards through the file.
as
Two addresses ~eparated by a + or - addres$es the line in
the buffer which is the sum ,(or difference) of the two
a9~_r~$J3J~$. _, t~Jgi~ple:
.2+1. t!ldd.:resses the thirdJ.ine of the
buffer.)
If an address begins with + or - addition or subtraction is
taken with respect to the current line (i.e, -5
is
equivalent to .-5).
An address consisting entirely of minus signs or entirely of
-?-
edit (1)
4/6/83
edit (1)
plus signs is taken to mean the line forward or behind the
current line by as many lines as plus or minus signs.
(Example: "--" addresses the line before last.)
Commands may require one, two or no addresses. Commands which
require no addresses regard the presence of an addr~ss as an
error. Commands which accept addresses assume default addresses
if too few addresses are given.
Addresses are separated by a ,. The second address of a two
address
sequence
must correspond to the following line.
(Example: 3,2 is an illegal address list.) A % is shorthand for
1,$.
In the following list of edit commands, the default addresses
are shown in parentheses. The parentheses are not part of the
address, but are used to show that the given addresses are the
defaults. Most commands may be followed by a "p" meaning that
the line is to be printed after the operation is performed. With
many commands this happens automatically.
-~-
4/6/83
edit (1)
edit (1)
(.) a
(.)
The given text (which may be excessively long and/or consist
of many lines) is a(ppended) after the present line and
before the next line if there is one. 0 is legal as an
address for this command; the text is placed at the
beginning of the buffer.
(.,.) c
-
(.)
The c(hange) command first deletes the addressed lines, then
accepts text which replaces these lines.
(.,.) d
(.)
The addressed lines are d(eleted) from the buffer. (Example:
1,$d completely erases the buffer.)
e[l] [filename]
The- e(nter) command causes the entire contents of the buffer
to be deleted, then the named file to be read in. If you are
finished editing one file and wish to switch to another, use
enter. If the file you are presently working on has not been
written, a diagnostic is printed. This is intended to reduce
the possibility of accidental loss of work. The optional
exclamation point overrides this safety feature.
f [filename]
The remembered f(ilename) is printed. If a filename is
given, the remembered filename is changed to it.
4/6/83
edit (1)
edit (1)
(1,$) g/regular expression/command
G(lobal). First, every line in the buffer matching the
regular expression is marked. Then for each marked line, the
command is executed with (.) initially set to that line.
(.) i (.)
The given text is i(nserted) just before the addressed line.
This command differs from append (above) only in the
placement of the text.
(.,.+1)
j
The j(oin) command joins the addressed lines into a single
line. In any case, an additional space is inserted between
the text of the formerly separate lines.
(.,.) 1
The.addressed lines are l(isted) in an unambiguous way.
Control characters are displayed a-s a caret (" . . ") followed
by the upper case letter corresponding to the control
character •. Dirty characters (with the sig-n bit set) 8'ce
displayed as three-digit octal preceded by a· back slashes
("\").
(.,.) m a
The m(ove) command repositions the addressed lines after the
line referred to by the address "a".
n[ I]
Edit ~he n(ext) file, if any, in the argument list. This is
an easy way to edit a group of files without having to
remember all their names yourself. If the exclamation point
is given, the command is forced. (Example: edit abc d ej
••• n ••• n ••• )
-5-
edit (1)
4/6/83
edit (1)
(.,.) p[ll[=]
The addressed line~ are p(rinted) in the specified format.
The "1" means to print in the manner described in the "1"
command (above). The = means to number the lines. Note that
the printing format remains in effect until it is changed
again.
q[! ]
Use the q(uit) command to terminate an editing session. No
automatic write of the file is done. A diagnostic is printed
if the buffer has been changed since the last write command.
This feature offers some degree of protection against
accidental loss of work. The optional exclamation point
immediately following the "q" overrides this safety feature,
(i;e., quit impetuously).
(.)r [filename]
The r(ead) command reads in the named file after '. the
addr.essed. line. If no filename is given, the remembered
filename is used. ,The filename is remembered if there is as
yet no retnembered ,filename. Address "0" is legat for this
command and causes the named file to be read in at the
beginning of the buffer.
(.,.)s/regular expression/replacement/[g]
In the s(ubstitute) command, each addressed line is searched
fqr strings matching ,the regular expression. An optional "g"
(global) may follow the substitute command'. In the presence
of a "gft all occurrences of matched strings are replaced by
the given replacement text. In the absence of a "g" only the
first matched string in each line is replaced. It is an
error for the substitution to fail on all addressed lines.
An .&appearing in the replacement text is
replaced by the
string
matching
the. regular
expression.
(Example:
s/toves/slithy &1 would change "toves" into "slithy toves".)
@n where it is a digit (1 through 9) is replaced by the nth
regular subexpression enclosed in } and {. When nest
parenthesized regular sub-expressions are present, n is
determined by counting occurrences of { starting from the
left.
These regular sub-expressions tagged by number can be
extremely useful in automating otherwise impossible editing
tasks. (Example: s/{[A-Z][a-z]*}, {[A-Z)[a-z]*}/@2,@1/ would
convert a list of people's names from: "lastname, firstname"
to "firstname lastname".)
,
4/6/83
edit (1)
edit (1)
Lines may be split by substituting newline characters into
them. @n in, the replacement pattern is understood to mean
newline.
If no replacement pattern is g'iven, the previous replacement
pattern is used, (i.e., "s/pattern").
If neither pattern is given, then the previous substitute
command is re-executed, (i.e., "s"). This feature saves a
lot of time.
(.,.)t a
The t(ranscribe) command works exactly like the
command, except that a copy of the address~d lines is
after the line corresponding to address "a".
move
pl~ced
u
Undo previous
buffer.
command;
only
works
if
file
is still in
(1,$) w[!] [filename)
The addressed lines are w(ritten) onto the named file. If' no
file name is given, the remembered name, if any, is used. If
the named file exists and is not the remembered file, a
diagnostic
is
printed.
This is intended to prevent
accidental overwriting of valuable files. The optional
exclamati,on . point immediately following the write command
character suppresses this safety feature.
(1,$) x/regular expression/command
Exactly like the global command (above) except that
lines ~ matching the regular expression are affected.
-7-
all
4/6/83
edit (1)
(.+1)
z
edit (1)
[N]
Print the next n lines (default 22). The value n is stickyt
in that it becomes the default value for future scroll
commands. This command is quite useful for marching your way
through text.
Lines are printed with line number. If [1] is given, then
the line is additionally printed in the style described in
the til" command (above). Lines are printed out with numbers
until the n=" sign is entered again.
< file
The named file is read as further input
command may contain further < commands.
for
edit.
The
(.+1,.+1)
address alone on a line causes the text of the addressed
line to be printed. A bl~nk line alone is equivalent to and
is useful for stepping through text.
An
NOTES
Sending a "'c character to edit under CP/M (Digital Research)
will cause your work to be ungracefully lost (but this is
not a problem under Micronix).
SEE ALSO
Kernighan, Brian W. and
(Addlson-WesleYt 1976).
P.J.
Plauger,
Software
Tools,
entab (1)
4/6/83
entab (1)
NAME
entab - replaces blanks by tabs
SYNTAX
entab
DESCRIPTION
Entab acts as a f11~er. copying the standard input to the
standard O\ltput unchanged with the .. exception that groups of
blanks are replaced by a tab wher·e possible. Entab assumes tabs
are every eight positions. at colqmns.9, 17. 25. etc. ~ntab is
useful for speed-i1)g up printing -and: commt,mic~ t;.ion over slQw
paths, or to effect file cC;>Inpression. Detab.is its inverse.
EXAMPLE
To compress a file in which there are many spaces:
entab output
SEE ALSO
detab (1) Brian Kernighan and P. J. Plauger Software Tools. Addison
Publishing Company, 1976.
-1-
West
4/6/83
expand (1)
expand (1)
NAME
expand - uricompress files
SYNTAX
expand [ input [ output ] ]
DESCRIPTION
Expand
reverses
the effe'cts of coDlpress~ Expand is not'
guaritnteed to do anything sensible with input which is not' the
result of a ; compress run. The' fIrst named file' is expanded 'and
written"into the second named file. If no file names are given,
standard' input and'outpti,t are used. If only one file name is'
given,the named ,file 'is used for input, and its expansion is
written to the standard output.
EXAMPLE
A (Micronix) do-nothing pipeline:
...
I compress I expand I •••
SEE ALSO
compress (1)
Brian Kernighan and P. J. Plauger
Software Tools
, Addison West Publishing Company, 1976.
4/6/83
far (1)
far (1)
NAME
far - floppy archiver
SYNTAX
far device [flags] [files]
DESCRIPTION
Far
provides
a simple interface to CP/M floppy
diskettes. It is the primary means of incorporating new
CP/M software into the system. It may also be used for
backing up files on di$kettes t and recovering them as
necessary. "Device'" is assumed to be the name of a
Micronix special file (such as /dev/fla) corresponding
to a floppy drive that contains a CP/M diskette. Far
can copy files in either directiont'and can .lso be
used to read the directory of a CP/M floppy. When the
-v flag is used t i t reports: the amount ·of space still
available on the diskette.
Names such as·/dev/fla may be abbreviated as fla. You
can check the names of the storage devices by entering
dir /dev (return)
Note the different names for 5.25" floppy .drives: mfa
and mfa2. Use mfa to copy to or from diskettes that are
formatted as single-sided. Use mfa2for double-sided
diskettes. Both names will direct the far command to
the same physical device. Using the wrong name by
mistake won't hurt anything; it'll just let you know
that you should use the other one instead.
The flags are:
-c
Create. Causes the previous contents of the
diskette
to be thrown away. The entire
directory
is
cleared
prior
to
other
operations. This won't have any effect on the
actual diskette unless the -r or -d flag is
specified. This flag also has the effect of
disabling the check for a CP/M diskette.
NormallYt far refuses to write on a diskette
which doesn't look like a CP/M diskette. The
-c flag makes any diskette look like a CP/M
diskette.
-d
Delete. Delete the named files from the
floppy diskette. If no file names are given t
no action is taken.
-p
Print.
Each named file is sent to the
standard output (most likely your terminal).
-1-
4/6/83
far (1)
far (1)
-r
Replace. Each named file is copied to the
floppy. If no file names are given, no action
is taken. If a file of the same name already
exists on the floppy,
it
is
silently
overwritten.
-t
Table. Print a table of contents of the
floppy diskette. If any files are named, only
those named and present· are listed. The
,contents of the diske~teare not changed.
-uN
User number. The· default user number is zero.
The
letter u, Iollowed immediately by a
decimal number will cause any of
far's
actions to happen with respect to this user
number. With-t, only files with the same
user number show up,. With ,-r,. file:s are
created on the: diskette with the specified
user number. With· -x, only files with the
same user number are extracted. Most files on
most d~skettes are, "user zero" and you don't
usually have to worry about the -u option
flag. The -u flag may be embedded in the flag
arg~en t as in "-xu14 v" •
-x
Extract. Each named file is copied from the
diskette to the current Micronix directory.
If no file names are given, the entire
contents of the diskette are extracted.
-v
Verbose. Be verbose about it. Each operation
is printed along with the affected file name.
Files deleted are preceded by a "d", those
replaced
are preceded by an "r", those
extracted are preceded by "x". The percentage
of the diskette that is occupied, along with
the number of bytes still available, is
reported when far is finished.
At most, one of the flags
d, t, r, x - may be
present. If none are present, -t is assumed. -v may be
used in combination with any of these.
The file list may contain wild card matching patterns
to be applied to the set of file names in the CP/M
diskette's directory. Refer to the section "Argument
Expansion" in the sh program writeup in this manual.
EXAMPLES
You receive a new CP/M software package in the mail on
diskette and want to run it under Micronix. To copy its
entire contents to Micronix, insert the diskette into
-2-
far (1)
far (1)
4/6/83
floppy drive A and type:
far fla -xv
To copy a file from a diskette, changing its name in
the process:
far fla -p filename
To' copy only
mini-floppy:
the
".doc"
> newname
files
,over
from
a
CP/M
far mfa -xv n*.doc"
To view the file'S of user 3 on a CP/M mini-floppy:
far mfa -u3
To copy them off:
far mfa -u3x
To copy a file from diskette into
elsewhere than your current directory:
a file that is
far fIb -x "name" > /dir/ •••
(path from root to desired location; you
specify a new name)
could
also
The following discussion is intended primarily for users
that are having trouble getting far to do what they want it
to.
One aspect of far command syntax somewhat complicates the issue
of using it, namely, the use of quotation marks. An example
should help clear this up. Let's say your current Micronix
directory contains two files, a.com and a.bak. Your CP/M floppy
contains a file a.pil that you wish to copy into your current
directory. Since this is the only file on the floppy that begins
with "a", you lazily enter far mfa -xv a*. Next you are wondering
what's wrong when you are faced with the message "a.com not found
on diskette / a.bak not found on diskette". Of course they
weren't found. You didn't even want Micronix to be looking for
them.
What has happened is this: Your command interpreter (shell)
thought you meant to search the current directory for a match to
the wildcard argument before going out to the floppy for the
copy. It indeed found two matches (a.com & a.bak), so Micronix
went gleefully out to the floppy to copy them. In vain,
unfortunately.
-3-
far (1)
The solution
filename(s).
have left the
to the floppy
far (1)
4/6/83
here is to use quotation ma.rks around
your
Had you entered far mfa -xv " a *" , the shell would
command alone, and far "would have gone directly out
to find anything that began with an "a". Success.
Now, just to set the record straight, there is a further
complication that may help you to understand how the shell
operates. Suppose the ·file on your floppy is called b.pil instead
of a.pil. If you enter far mfa -xv b.pil (no quotes), the file
will in- fact be cop~ed, contrary to the previous discussion.
Furthermore, everything on the floppy diskette will be copied,
much to your- chagrin. This is because your shell took b.pil to
your current Micronix directory, looked to see if a ~ile of that
name was really there, and finding no such file, it passed the
command to Micronix as " far mfa -xv I t . As noted above in the
description of the x flag, if there is no file specified, the
whole diskette gets copied.
In summary, you should enclose the argument in quotes whenever
you want to copy specific files from the floppy to.Micronix. The
only exception to this is a situation where you have certain
files already established on Micronix and you want to extract
only those floppy files that match the existing
Micronix
filenames.
FORMATS
The far program .can read files on CP/M diskettes with the
following formats:
NorthStar single and double sided;
Morrow single and double sided hard sectored;
Morrow MicroDecision, single and double sided soft
sectored;
Osbourne single sided;
IBM PC single siqed
- PC-DOS)
(CP/M86
only,
see
dar
for
XEROX 820 single sided;
IBM 3740 single density 8";
Various 8" formats (256,
sector, double density).
512,
1024
bytes per
The DJ/DMA attempts to determine the diskette format, and
far
will attempt to translate the dire~tory for the
appropr~ate file system parameters (i.e., number of sectors,
block size, etc.)
-4-
field (1)
10/12/83
field (1)
NAME
field - pick selected fields from each line of the input
SYNTAX
field [-t separator] field-numbers output
DESCRIPTION
Field reads its input line by line. It breaks each line up into
"fields". Then the fields requested by the "field-number"
arguments are printed out in the requested order. By default,
input fields are separated by whitespace (spaces and tabs),
while output fields are separated by tabs. The field separators
can be changed (both at once) with the -t option. The first
field is numbered O. If a line begins with a separator, then
field 0 is taken to be -empty.
EXAMPLES
field 3 0 2 2 temp
reads the password file and writes a list of home directories
and user names to temp. For instance, if /etc/passwd contained
root:xxxxxxxx:O:O:Super:/:sh
sal1y::10:1:Sally Jones:/a/sally:upm
then the resulting temp file would contain
/:Super
/a/sally:Sally Jones
ls -1
I
field 8 1
will print a
permissions.
BUGS AND CAVEATS
Input line
directory
length
is
listing
giving
limited
to 512 bytes. If an input line
-1-
only
file
names
and
field (1)
10/12/83
field (1)
begins with a field separator, then the Oth field is empty.
SEE ALSO
paste (1)
-2-
4/6/83
file (1)
file (1)
NAME
file
SYNTAX
file file1 •••
DESCRIPTION
File attempts to guess the type of each named file. CurrentlYt
the following types of files are recognized:
A-natural source file
Block special file
C source file
CP/M text file
Character special file
Data
Directory
Empty
Executable
Pascal source file
Ratfor source file
Relocatable module
Software Tools archive
Text file
Text processor input
Whitesmiths library
-1-
4/6/83
find (1)
find (1)
NAME
find - find files
SYNTAX
find pathname-list expression
DESCRIPTION
Find ,searches each of the given pathnames for files matching the
given expression. If the pathname of a directory is given, all
files
in
that
directory and all of its subdirectories
(recursively) are searched.
The expression
following:
above
is
built
from
constructions
like
the
-name filename
True if the filename argument matched the current file -name.
Normal shell argument syntax may be used if escaped (watch out
for ' [', '?', ' *', ' A' ) •
Examples: '-name a.out' would match all files named "a.out".
'-name "*.0" , would match all files in the tree whose name ends
in tI. o"
-perm onum
Where onum is an octal number. True
flags match the given number.
if
the
file's
permission
Example:
-perm 777 ' would match all files whose permissions
are "wide open".
-type c
True if the type of the file c, Where c is b, c, d or
block special, -character special directory or play file.
f
for
Example: ' -type f '
-links
True if the file has n links.
Example:
link.
'-links
l ' would consider only files with exactly one
-user name
True if the file belongs
numeric user ID).
Example:
-user
owned by root.
root
to
the
user
uname
(login
name
or
would screen all files except those
-1-
find (1)
4/6/83
find (1)
-group name
True if the file belongs to group gname (group name
group ID).
Example:
"sales".
'-group
sales'
would
consider
only
or
numeric
files in group
-size n
True if the file is n blocks long (512 bytes per block).
-iuum n
True if the file has inode number n.
-atime n
True if the file has been
access~d
in n days.
-mtme n
True if the file has been modified in n days.
-exec command
Always true. If the command is complex it must be enclosed in
quotes (n). If the sequence {} occurs in the command, the
current filename will be substituted for it.
-ok command
Like -exec except that the generated command is written on
the standard output, then the standard input is read and
command executed only upon the response 'y'. In other words,
are asked if it's ok to execute the command. Expect to
something like: < rm /a/smith/books/3.1 > ok ?
the
the
you
see
-print
Print the file name. Always true, causes the current pathname to
be printed. (Note that 'find' does its work silently and if you
don't tell it otherwise, nothing will be printed.)
-newer file
True if the current file has been modified
the argument file.
more
recently
than
If two of the above constr~ctions appear one after the other,
then the effect is a logical AND of the two. That is, a
primitive will be processed only if all of the previous
primitives were successful.
-2-
4/6/83
find (1)
find (1)
EXAMPLES
To remove all files named a.out that have not been accessed in a
week
find / -name a.out -atime +7 -exec firm {}"
To simply list the names of all the file in a hierarchy:
find • -print
FILES
/etc/passwd - to look up user names.
/etc/group - to look up group
na~es.
SEE ALSO
sh (1), fi1sys (5)
-3-
form (1)
4/6/83
form (1)
NAME
form - format text
SYNTAX
form [-t] [-0 output) [file ••• )
DESCRIPTION
Form is a general purpose text formatter with text filling,
underline, indenting, centering, and other useful capabilities.
This document'was prepared using form.
The standard input is read and
formatted
according
to
instructions embedded in the input file; the result is written
to the standard output~
If a list of files names is given, they are used as the input.
If "-0" followed by a file name appears on the command line,
then the output is written to the named file.
If "_t" appears on the command line, then the output is m~de
more suitable for a glass tty, i.e~ long sequences of blank
lines are avoided.
Input consists of text lines
destined to be printed.
interspersed
with
command
lines
If the first character of a line is a period (.), form attempts
to interpret the line as a command; in any case, the text of
such lines will not appear in the output. If a command is not
recognized, it is ignored. Only the first 2 characters of the
command name are significant, the rest are ignored. So, for
example, you may use .break or .br with the same effect.
The following commands are implemented:
.ad
Turn on right adjust mode. Causes the right edge of the text to
be squared up. Spaces are embedded between words in the text if
ne'cessary to achieve this. Right adjust mode is on by default.
It can be cancelled by a .na command (See below). Right adjust
mode will remain in effect forever or until a .na command is
encountered. This paragraph is done in right adjust mode •
• bd n
Cause the next (or number of given) line(s) of text to be
double-striken for bold face appearance. (Default is 1.) With
the mode commands that take a line count argument (.bd, .ce, and
.ul) If you want to embolden, center, or underline a large
-1-
form (1)
form (1)
4/6./83
number of lines and don't want to bother with counting them, the
best way to do it is:
.bd 1000
text
text
text
.bd 0
This paragraph is done in bold face. Printer must have back
spaci~g ability, otberwise overstrike (Section 1) must be used.
Example:
form file
I
overstrike
I
lpr &
.bp n
Begin page numbern. Jump to the 'top of the next page. Set the
page number to n (default ,is sequential· order beginning with 1) •
• br
Cause break. The next input line will begin at the left margin.
Many commands cause a br~ak. Beginning a line with white space
will cause a break •
• ce n
~
Center the next (or number of given) input line(s).
Each line here is centered.
Default is next line only •
• fi
Set filled text mode. All text lines will be filled out with
blanks if necessary so that the right margin is justified. This
paragraph is filled. Fill mode is the initial default condition •
• fo TEXT
Set the footer. The specified text will be printed at the bottom
of each page. If the symbol II appears in the text, the page
number will be substituted for it •
•be TEXT
-2-
form (1)
4/6/83
form (1)
Set the header. The specified text will be printed at the top of
each following page.· If the symbol # appears in the text, the
page number will be printed' in its stead •
• in n
Set the indent. The indent is set to the nth column. The command
".in" is interpreted to mean no indent. Default is O•
• 1s n
Set the line spacing to n lines. The command ".l s 2" is
interpreted to mean double space. The line spacing is set to 1
(default) initially •
• na
No adjust. Turns off right adjust mode. The right edge of the
text will be ragged. This mode gives a more human look as the
average typist does not produce copy with a squared up right
edge. Adjust mode will remain off forever or until an .ad
command is encountered. This paragraph.is done with right adjust
mode turned off.
.
.nf
No fill.
Turns off fill mode.
With fill mode in effect, words are collected
until no more will fit on aline, then a new line is started.
In No Fill mode, each line is preserved in the output.
This paragraph was done in No Fill mode •
• pl n
Page length. The page length is set to n lines long. If no
number (n) is specified, the page length is set to 66 lines
(default) .-
.rm n
Right margin. The right margin is set at column n. If no
(n) is specified, it is set at column 60 (default) •
number
• sp n
Space down
(default).
n
lines.
If no number (n) is given, spaces 1 line
-3-
4/6/83
form (1)
form (1)
.ta n
Set the tab. Value (n) determines 8lIlount of tabbed spaces.
Entered with AI sequence or TAB key. When used with the (.ti)
command, it can be used to produce "hanging" paragraphs •
• ta 10
.,1n10
.ti -10
Melons(TAB>Watermelons, among the nation's
best selling fruit can weigh up to umpteen
pounds.
would produce something like:
Melons
Watermelons, among the nation's best selling fruit can
umpteen pounds •
weigh
up
to
• ti nTemporary indent. The indent is set to a value' (n) for the next line
only. This is quite useful for numbering paragraphs
a negative
value produces a "hanging" paragraph •
• ul n
Cause the ~ (or number of given) input line(~) !£ be und~rlined.
The default ~ 1. 'This pa:rpg}:aph is und-erlined. Printer must have
double-strike capability. If ~, ~ the overstrike program (Sec~
1) for instructions ~ using this program.
-Example:
form
~
I
overstrike> /dev/ttyH
SEE ALSO
edit (1), overstrike (1), diablo (1), Ipr (1)
-4-
11/9/83
fp (1)
fp (1)
NAME
fp .- floppy backup service
SYNOPSIS fp [rxt][vfiqs] [device] [filenames ••• ]
DESCRIPTION
fp allows
system.
you
to
backup files on floppies under the Micronix
In this document the word "volume" will be used to refer to a
single instance of storage medium. for example. diskette. tape
reel, tape cassette. or removable hard disk.
The word "device" will refer to the disk or tape drive which
manipulates the volume. For example floppy drive. tape drive,
hard disk drive.
The word "set" will mean a
single fp run that you get
structur.e. Theoretically, a
an imaginable case with the
series of volumes produced by a
when you make a copy of a large file
set .. could run to 30 volumes or so in
current Micronix system.
FEATURES
* ability to split files across
files.
* minimal seeking on the device
* incremental dumps possible
volumas
for
backup
of
large
to reduce running time.
using
the
central "dtab" dump
table.
FLAGS (choose exactly one)
r
write files to the device.
x
read files from the device.
t
display files on the device.
More flags (optional)
v
verbose - The v flag causes a note to be printed as
each file is processed. The v flag is always on (unless
the s flag is used to suppress it). With the t flag, v
causes extra detail about the files on the fp volumes
to be given. The v flag is mainly here for backward
compatability.
i
incremental - Normally, fp processes all the files it
encounters. With the i and r flags in effect, only
files which have been changed since the dumpdate are
acted upon. The i flag forces fp to make an entry with
-1-
fp (1)
11/9/83
fp (1)
the current date in the file /etc/dtab. (Dtab stands
for dump table.) If this file is lost, so is the memory
of previous' dump. dat-es. One entry in the dtab file is
produced for each file named on the command line. If no
files are named on the command line, the entry in
"dtab" will be for the current directory. If no dtab
file exists, fp will attempt to create one. This will
work subject to the permissions of the /etc directory •.
See the examples for an actual use of the i flag.
c
create - This flag pnly works with the r flag. Create
means to erase any files .that may already be on the
volume. Obviously, you only want to use this with new
volumes, or volumes you are recycling.
1
label s,et
This flag causes £p to ask for a name to
label this set .of volumes with. The lab~l may be up to'
250 characters long.
e
formatting program
If fp encounters an unformatted
disk during a backup opera.tion, it will automatically
invoke the fdj program, which will query the operator
for information and format the currently inserted
diskette. This may save you during a long backup. If
you want to change the name of the formatting program
invoked, use the'eoption, followed by the name of the
program to be used.
f
device file name - Specifying f allows the choice of a
different device name. The default device name is
/dev/fp. /dev/fp is normally linked to /dev/mfa which
is the first 5 1/4 inch floppy drive connected to a
Morrow DJDMA running under Micronix. If your system
uses 8 inch drives, you should relink /dev/fp. HINT use the following commands for an 8" drive system:
cd /dev; era fp
In fla fp
'p
print - Operates similarly to extract, but the files
are sent to the standard output instead of a file. This
is theoretically useful to manually peruse copied
images of text files.
q
quick copy
Normally all files are checked for
readability immediately after being copied to a volume.
Specifying the q flag bypasses this safty feature.
s
silent operation - Normally, in the spirit of micros,
fp announces each file transaction. Specifying the s
flag suppresses much of this printing. You are still
notified of error conditions.
-?-
fp (1)
11/9/83
fp (1)
GENERAL RULES
If the name of a directory is given to fp, it takes it
that dirctory and all its descendants.
to
mean
If no file names are given, the implication is to do all files.
For the t flag, this means all the files stored on the current
volume. For r, this means the current directory and all i-ts
descendents. For the x flag, all files in the set of volumes are
extracted.
If you name your files with absolute path names, that is,
starting with the / of root, any file that you extract will be
restored to its former position in the file system. If you
backup files starting in the current directory, or use filenames
that don't begin with a /, you can restore files to any
directory in the file system.
It's possible for a volume to be full yet contain few or no
files. If a read-back error occurs, the remaining space on the
volume, after the block with the error, will be effectively
marked out.
Links are preserved across fp operations. If you copy a file to
which there are several links, only one copy of the file's data
will be made.
For each file on the volume the t flag, for table, prints the
length in bytes, the modification time of the file at the time
it was copied, the file' sname the way it was when backed up,
and possibly a notation concering which part of the file
represented.
4872 Nov 14 7:30 myfile [part 2]
In the above example, this part of the file is 4872 bytes long,
the file had been last changed on Nov. 14th at 7:30 in the
morning. The file is named myfile, a relative filename and only
part 2 of the file is represented here. Part one fo the file is
found on the previous volume of the set.
The most you can get on a current technology floppy is 800
blocks. 2400 blocks will fit on an 8 inch
floppy.
fp
automatically sets its directory size to one eightieth the size
of the volume, with a minimum of 20 blocks. In the case of soft
sectored 1K 5 inch floppies, the volume size is 800 blocks, the
directory size is 20 blocks. A maximum of 160 entries can be put
on the volume. There are 8 directory entries per directory
block. Sometimes this is wasteful (for instance when the average
file size is small).
When splitting files, fp does not waste space. It writes right
up to the end of the volume.
-3-
fp (1)
11/9/83
fp (1)
EXAMPLES
To produce the first full dump of your file
volumes formatted and:
cd 1
system,
have
many
fp cri!
This creates a new" volume (or set of volumes), backs up
everything starting with the root directory (I), makes an entry
in /etc/dtab, and requests a label for the volumes.
To produce an incremental (the next day for instance):
cd -/ ; fp cri!
Using another formatted Aiskette, this backs up only the files
that have been modified since the last dump of the root.
To print a label for a volume:
fp
I
Ipr
To produce a backup of your directory alone:
cd ; fp cril
To completely restore your home directory from a
volume 1 of the set in the device and:
dump,
install
cd ; fp x
To copy to an 8 inch floppy under Micronix:
fp crf Idev/fla
To copy a single (possibly large) file:
fp r filename
SEE ALSO
fdj(l), for details on the formatting program, and dtab(S).
-4-
fsck (1)
4/6/83
fsck (1)
NAME
fsck - file system check and repair
SYNTAX
fsck [-t] [-n] [-b] filesystem
DESCRIPTION
Fsck is a complete Micronix file system maintenance package.
System crashes may cause the Micronix file systems (as well as
standard UNIX version 6 file systems) to become internally
inconsistent in potentially dangerous ways to your data. It is
also possible for the physical device on which a file sy~tem
resides to develop unreadable spots. The fsck program rectifies
these inconsistencies and maintains the file system.
NOTE! Do 'not run fsck on an active file system. As a rule of
thumb, you should run fsck on the root device while in
single-user mode. Devices other than the root device should be
checked before mounting.
If information in the file system is changing while fsck is
taking its "snapshot" of the state of the file system, it will
get the wrong idea and will try and fix things that were not
wrong in the first place. By typing
fsck filesystem
where filesystem is the name of the device on which the file
system in question lives, you can bring your file system
completely up to par.
The device is referred to by its name as it appears in the /dev
directory (e.g. /dev/fla).
If no specification is made, fsck searches for and
fix all file system problems.,
attempts
to
Options:
-t
Test all of the blocks on the file system to see that each
is readable. Systems on large disks may take some time to
complete.
-n
No changes will be made. Fsck will only look and give you
its professional opinion on what it would do under the
circumstances.
-b
Take a list of block numbers that follows, or the name of a
file containing a list of block numbers, and add these
blocks to the /badblocks directory to remove them from the
file system. Blocks are listed separated by white space
-1-
fsck (1)
fsck (1)
4/6/83
(blanks, tabs and newlines).
One way-to produce a list of bad blocks is to use the badspots
program. The bad spots program reads the b~d spot map on 5 and 8
inch hard disks, and converts_the physical disk addresses found
there to Micronix block numbers, and sends them to the standard
output. Badspots is used with fsck on a newly formatted 10
megabyte hard disk to remove bad spots from the new file system
with_this command
fsck
~b_'badspots
mlOb' '/dev/mlOb
Fsck can fix:
Two files claiming the same block. The block
copy is given to each file.
is
cop~ed
and
a,
File containing -a bad block. An attempt is made to copy the bad
block; in any case, a new block-is allocated to-fill t4e spot.
The
bad
block is assigned to a file in the directory
"badblocks".
Duplicates in
~he
free list.
Allocated blocks in the free list.
Blocks missing from the free list.
Bad block in the free chain.
scratch.
The
free
list
is
rebuilt
from
File for which there is no directory entry (an qrphan). An entry
is made in the "lost+found" directory.
Missing directory self link
t1
II
Missing directory parental link " •• 'J.
Disconnected directory. Appropriate links are made to directory
names in "lost+found," if necessary.
Imbalanced directory entry - link counts. Resolved in favor
the, directory entries, i.e., the link count is changed.
of
Fsck cannot fix:
Bad blocks in the i-list or super block.
Ridiculous numbers in the super block.
SEE ALSO
filesystem (5), icheck(I), badspots(I), dcheck(l), df (1), ncheck (1)
-2-
4/6/83
grep (1)
grep (1)
NAME
grep - find instances of a regular expression in a
stream
SYNTAX
grep [-c] [-I] [-1] [-n] [-v] pattern [filename ••• ]
DESCRIPTION
Lines-in each of the named files matching the regular expression
"pattern" ar.e written on the standard output. The rules for
regular expressions are as in edit.
The following flags are meaningful in the command line:
-c
Only a count of matching lines is printed for each file.
-i
The case of letters is ignored in comparlsons.
-1
The names of files containing
- once, one· on a line.
-n
Each
-v
All lines
matching
lines
are
listed
matching line is preceded by its line number in its
respective file.
~
matching the pattern are printed.
EXAMPLE
To search for occurrences of a string in a file:
grep string file
SEE ALSO
edit (1), change (1)
-1-
4/6/83
group (1)
group (1)
NAME
group - examine or change the group of a list of files
SYNTAX
_
group [-name] file •••
DESCRIPTION
Associated with each Micronix file is a group number. The group
number is used to determine group access' permission. If you are
running a single .user, informal, or very low user-population
system, the whole concept of groups may be irrelevant to you.
The group command can be used to view the group names of files.
The relationship of group names to group numbers is entirely
established 'by the file "/etc/group" [see group (5)].
Group prints the group name for each file given. If the file's
group number has no name, the group number is printed in decimal
instead.
If the first argument to group is a group nam~ preceded by a
hyphen, group attempts to change the group of each of the named
files to the given name.
EXAMPLES
gr~up
flle1 flle2 flle3
to discover which group each of these files belongs to.
group flle1 flle2 flle3
to discover which group each of these file belongs to.
group -sales fi1e1 fi1e2 fi1e3
to "give" each of the files to the group named "sales."
SEE ALSO
group (5)
FILES
/etc/group - group name
<-)
group number relationships
-1-
help (1)
4/6/83
help (1)
NAME
help - help processor
SYNTAX
help [N] topic •••
DESCRIPTION
Help prints documentation '(if it exists) for each named topic.
Complete on-line dOcumentation is resident on the Micronix
system.
Help is the same program as man, execpt that when it is calledas "help" it looks first in /usr/help for a file with the same
name
as
the
given topic. Then, like man, it searches
/usr/man/manO, ••• , /usr/man/man9 in order. These are the
directories
con~aining
the corresponding sections of the
Micronix Reference Manual:
/usr /man/man1
/usr /ma'n/man2
/usr /man/man3
/usr/man/man4
/usr /man/manS
/usr/man/man6
Programs
System Entries
Libraries "and subroutines
Devices
File formats
Other programs (such as CP/M programs)
The liN" option directs help to the corresponding section of
manual.
EXAMPLE
The command line
help help
prints this page.
Entering
help 2 stty
prints the stty.2 file instead of stty.1.
SEE ALSO
man (1)
-1-
the
hex (1) OPTION
4/6/83
hex (1)
- translate object file to ASCII formats
SYNTAX
hex -[flags]
DESCRIPTION
Hex translates executable images produced by link to Intel standard
hex format or to Motorola S-record object file format. The executable
image is read from , if ~pecified, otherwise from the file
xeq.
The flags are:
-h
Do not start record for Intel hex files.
-m*
Insert the string *, insfead of , into the Motoro19 SO
record generated when -s is given.
-rllli Interpret the input file as "raw"- binary and not as object file.
Output is produced as described below, in either format, except
that the starting address of the module is specified by the long
integer 1111.
-s
Produce S-record rather than the default hex format.
+#
Start output with the nth byte. # should be.between 0 and one
less than the value specified by the -#f1ag. -4 +3 produces
bytes 3, 7, 11, 1 5, ••• , -2 +0 produces all even bytes; -1 +1
outputs all odd bytes; 0 is the default which outputs all bytes.
-#
Output every 11th byte. -2 outputs every other byte,
fourth; 1 is the default which· outputs all bytes.
-4
every
Output is written to STDOUT.
Hex Files
A file in Intel hex format consists of the following records, in the
order listed:
1)
A "$" alone on a line to indicate the end of the (non-existent)
symbol table. If -h is specified, this line is omitted.
-1-
hex (1) OPTION
4/6/83
hex (1)
2)
Data records for ~he text segment, if .an,y. These represent 32
image bytes per line, possibly terminated by a shorter line.
3)
Data records for the data segment, if any, in the same format as
the text segment records.
4)
An end record specifying the start address.
Data records each begin with a ":" and consist of pairs of
hexadecimal digits, each pair representing the numerical value of a
byte. The last pair is a checksum such that the numerical sum of all
the bytes represented on the line, modulo 256, is zero. th~ bytes on
a data record line are:
a)
The number of image bytes on the line •.
b)
Two bytes for the load offset of the first image byte. The
offset is written more significant byte first so that it .reads
correctly as a four-digit hexadecimal number.
c)
A zero byte "00".
d)
The image bytes in increasing order of address.
e)
The checksum byte.
An end record also begins with a n:" and is written
with a trailing checksum. Its format is:
as
digit
pairs
a)
A zero byte "00".
b)
Two bytes for the start address, in the same format as the load
offset in a data record.
c)
A one byte "01".
d)
The checksum byte.
8-Record Files
A file in Motorola 8-record format
containing the following fields:
is
a
series
of
records
each
<8 field>
All information is represented as pairs of hexadecimal digits, each
pair representing the numerical value of a byte.
<8 filed> determines the interpretation of the remainder of the line;
valid 8 fields are "80", "81", 82", "88", "89". indicates the
number of bytes represented in the rest of the line, so the total
number of characters in the line is * 2 + 4.
indicates the byte address of the first data byte in the data
-2-
hex (1) OPTION
4/6/83
. hex (1)
field. SO records ~have two zero bytes as their address field; 81 and
82 records have fields of two and three bytes in length,
respectively; 89 and S8 records have fields of two and three
bytes in length, respectively, and -contain no data bytes. is
represented most significant oyte first.
The 80 record contains the name of the input file, formatted as data
bytes. If input was from xeq, XEQ is used as the name. S1 and 82
records represent text or data segment bytes to be loaded. They
normally contain 32 image bytes, output in increasin~ order of
address; the last record of each segment may be shorter. The text
segment is output first, followed by the data segment. S9 records
contain only a two-byte start address in. their field; 88
records contain a three-byte address. The start address of an object
file is the start of the text section.
is a single byte value such that the numerical sum of all
the bytes represented' on the line (except the S field), taken modulo
256, is 255 (OxFF).
RETURNS
Hex returns success if no error messages are printed, that is, if all
records make sense and all reads and writes succeed; otherwise it
reports failure.
EXAMPLE
The file hello.c, consisting of
char *p {"hello world"};
when compiled produces the following Intel hex file:
% hex hello.o
$
:OE000002006856C6C6F20776F726C640094
:000000010
-3-
hex (1) OPTION
4/6/83
hex (1)
SEE ALSO
link (1), obj (1), cc (1), as (1), cpl (1), cp2 (1), cpp (1)
NOTE:
Ltd. ,
This
program
and
documentation are products of Whitesmiths,
-4-
icheck (1)
4/6/83
icheck (1)
NAME
icheck - file sy'stem consistency check
SYNTAX
icheck [-8] [-b numbers] filesystem
c
DESCRIPTION
Icheck assumes "fi1esystem" is the
containing a Micronix file system.
name
of
a special file
Icheck checks the inodes (block pointers) and the free
see that no block is referenced more than once.
list
to
It also prints statistics about the file system.
-s
causes the free list to be reconstructed from scratch.
-b
followed by a list of block numbers will cause the
requested block numbers to be called out when they are
encountered.
Icheck can take several minutes on a large file system.
EXAMPLE
To check the root file system:
icheck /dev/root
NOTES
Be sure that the file system in question is not active.
SEE ALSO
ncheck (1}, dcheck (1)
-1-
4/6/83
include (1)
include (1)
NAME
include - file inclusion
SYNTAX
include
DESCRIPTION
The standard input is copied to .the standard output with the
exception of each line beginning with:
include filename
which is replaced by the contents of the named file. Includes
may be nested; that is, an included file may invoke another file
for inclusion. If a named file is not op~.nable, an error message
is printed· aI1d the program terminates' abruptly.
EXAMPLE
As a compiler preprocessor:
in~lude
index
SEE ALSO
unrot (1), sort(l) Brian Kernighan and P. J. Plauger Software
Tools Addison West Publishing Company, 1976.
-1-
last (1)
5/18/83
last (1)
NAME
last - login-accounting
SYNTAX
last [-s] [user ••• ] [tty ••• ]
DESCRIPTION
Last interprets the user login accounting file (/usr/adm/wtmp).
It 'can be used to gain a perspective of the login history of the
system.
Last displays the starting and ending times of each user .session
as well as the duration of that session. The display is given in
reverse chronological order, most recent first.
If the -s option is specified, only a summary is given. The
summary shows total login time for users or ttys without
breaking it down into single sessions.
If a user name or list of user names is given, then the
is restricted to only those users specified.
display
If a tty name or list of tty·-names is given, then only login
sessions on the specified ttys will be displayed.
If a mixed list is given then the display will include
matching any of the criteria.
sessions
It's possible to enable or disable the historical record keeping
feature. Record keeping is turned on or off based on the
presence or absence of the wtmp file (/usr/adm/wtmp). See the
examples below.
If a login session is abnormally terminated (say by a power
failure), last assumes that the session continued until the
following boot and reports it as ending at "boot" instead of at
a specific time.
EXAMPLES
Print login history:
last
Print usage summary:
last -s
Find out who has been using your tty:
last ttyB
-1-
last (1)
last (1)
5/18/83
Find out how much time oscar has logged:
last -s oscar
Probe the behaviour of a few selected users:
last bill jean harold
Start
recor~
keeping afresh,
type /dev/null
disc~rding
old records:
> /usr/adm/wtmp
Disable record keeping and discard records:
era /usr/adm/wtmp
Save old records and then start over:
cp /usr/adm/wtmp /usr/adm/old
type /dev/null > /usr/adm/wtmp
FILES
/usr/adm/wtmp - the file containing the historical records.
-2-
l~b
(1) OPTION
lib (1)
4/6/83
NAME
lib - maintains Whitesmfth's format libraries
SYNTAX
lib Ifi1e [flags] [files]
DESCRIPTION
Lib performs all functions necessary to build and -maintain
object module libraries. It can also be used to collect
arbitrary files into one bucket. Lfile is the name of an
existing library file or. in the case of replace (-r), the name
of the library to be created.
The flags are:
-d
Delete the zero or more named files from the library.
-r
Replace the zero or more named files in an existing library
or, if no library lfile exists, create a library with
the named files in the specified order.
Named files that are not present in the library
appended to the end .in the order specified.
are
-t
Lists
files in the library in the order they occur. If any
files are named, only those named and present are
listed.
-x
Extract any named files that are present in the library
into files of the same name. If no files are named,
all files are extracted.
-v
Be
-6
Create a file with UNIX v.
Effective only with -r.
-7
Create a file with UNIX v.
Effective only with -r.
verbose about it. Files retained unmodified are each
listed with a preceding "c". Those deleted
are
preceded by a "d", those replaced are preceded by an
"r" and those appended to the end are preceded by an
"a". For the -t option, each file is listed with its
length in bytes.
-1-
6
format,
7
if
none
exists.
format, if none exists.
lib (1)
OPTIO~
4/6/83
lib (1)
At most, one of the flags [drtx] may be present. If none are
present', -t is assumed. Similarly, at most one of the flags [67]
should be present. If none are present, Whitesmith's library
file format is assumed when a new library is created by -r.
The Whitesmith's library format consists of a two-byte header
having the value 0177565, written less significant byte first,
followed by zero or more entries.
Each entry consists of a fourteen-byte name, followed by a
two-byte unsigned file length, also stored less significant byte
first, followed by the file contents proper. If a name begins
with a null byte, it is taken as the end of the library file.
Note that this differs in several small ways from UNIX v. 6
format, which has a header of 0177555, an eight-byte name, six
bytes of miscellaneous UNIX specific file attributes, and a
two-byte file length. Moreover, a file whose length is odd is
followed by a null padding byte in the UNIX format, but no
padding is used in standard library format.
UNIX v.7 format is characterized by a header of 0177545, a
fourteen-byte name, six bytes of UNIX specific file attributes,
and a four-byte length. Odd length files are also padded to
even.
RETURNS
Lib returns success if no problems are encountered, else
failure. In most failures, an error message is printed to STDERR
and the library file is not modified. Output from the -t flag,
and verbose remarks, are written to STDERR.
EXAMPLE
To build a library and check its contents:
lib clib -r one.o two.o three.o
lib clb -tv
-2-
lib (1) OPTION
4/6/83
lib (1)
NOTES
If all files are deleted from a library, a vestigial file
remains. Modifying UNIX v.6 or UNIX v.7 format files causes all
attributes of all ·file entries to be zeroed.
It does not check for large files (over 65534 bytes).
NOTE: This program and
documentation
are
products
of
Whitesmiths, Ltd., and are sold separately with the C compiler.
-3-
lines (1)
4/6/83
lines (1)
NAME
lines - count lines in standard input or files
SYNTAX
lines [file •••
DESCRIPTION
The number of lines in each of the named files is printed . along
with the file name. If it would provide additional in-formation,
a·· total is printed at the end.· If no file names are specified,
or if n_n is given as a file name, the standard input is read up
to and end-of-file and the number of lines is printed.
EXAMPLE
To count the lines in a numher of files:
lines file1 file2 file3 file4
SEE ALSO
chars (1), words (1)
-1-
link (1) OPTION
4/6/83
l.ink (1)
NAME
link - combine object files
SYNTAX
link -[flags]
DESCRIPTION
Link combines relocatable ,object files in standard format for
any target machine, selectively loading from libraries of such
file~
made with lib, to create an executable image for
stand-alone execution,
or
for
input
to
other
binary
reformatters.•
The flags are:
-a
Make all relocation items and all symbols absolute. Used to
prerelocate code 'that will be linked elsewhere, and is not
to be relocated.
-c
Suppress code output (.text and .data), and make all
symbols absolute. Used to make a module that only defines
symbol values for specifying addresses in shared libraries,
etc.
-db##
Set data bias to the long integer #U. Default is end
of text section, rounded up to required storage boundary
for the target machine.
-dr/l Round data bias up to ensure that
low-order binary
specified.
-d
zeros
there are at least II
in its value. Ignored if -db## is
Do not define bss symbols, and do not complain about
undefined symbols. Used for partial links, i.e., if the
output module is to be input to link.
-eb* If the symbol * is referenced, make it equal to
unused location past the bss area.
-1-
the
first
link (1) OPTION
4/6/83
link (1)
ed*
If the symbol * is referenced, make it equal to the first
unused lo·cation pas.t the initialized data area.
et*
If the symbol. * is referenced, make it equal to
unused location past the text area.
-h
Suppress headers in output file. This should be specified
only for stand-alone modules such as bootstraps.
-1*
Append library name to the end of the list of files to be
linked, where the library name is formed by appending * to
"/lib/lib". Up to ten such names may be specified as flags;
they are appended in the order specified.
-0*
Write output module to file *. Default is xeq.
-r
Suppress relocation bits. This should not be
the output module is to be input to link.
-tb/lll
Set text bias
location zero. -
-t
Suppress symbol table. This should not be specified if
output module is to be input to link.
-u*
Enter the symbol * into the symbol table as an undefined
public reference, usually to force loading of selected
modules from a library.
-x*
Specify placement in the -output module of the input .text
and I-weighted bit, .data. If either bit is set, the
corresponding sections are put in the text segment output;
otherwise they go in the data segment. The default value
used, predictably, is 2.
to -the
long
the
first
specified
if
integer INI. Default is
the
The bss section is always assumed to follow the data section in
both the input and output files. It is perfectly permissible for
text and data sections to overlap, as far as link is concerned;
the target machine mayor may not ·make sense of this situation
(as with separate instruction and data spaces).
The specified are linked in order; if a file is in
library format, it is searched once from start to end. Only
those library modules are included which def'ine public symbols
for
which
there
are
currently
outstanding unsatisfied
references. Hence, libraries must be carefully ordered, or
rescanned, to ensure that all references are resolved. By
special dispensation, flags of the
form
"-1*"
may
be
interspersed among . These call for the corresponding
libraries to be searched at the points specified in the list of
files. No space may occur after the "-1", in this usage.
File Format
-2-
link (1) OPTION
4/6/83
link (1)
A relocatable object image cons!sts of a header followed by a
text segment, a data segment, the symbol table, and relocation
information.
The
header
consists
of an identification byte Ox99 , a
configuration byte, a short unsigned int containing the number
of symbol table bytes, and six unsigned ints giving: the number
of bytes of object code defined by the text segment, the number
of bytes needed by the bss segment, the number of bytes needed
for stack plus heap, the text segment offset. Byte order and
size
of
all ints in the header are determined by the
config~r~tion byte.
The configuration byte contains all information needed to fully
represent the header and remaining information in the file. Its
value val defines the following fields: «val &07) « 1) + 1 is
the number of characters in the symbol table name field, so that
values [0, 8) provide for odd lengths in the range [1, 15]. If
(val & 010) then ints are four bytes; otherwise they are two
bytes. If .(val * 020) then :Lnts are
represented' least
significant byte first, otherwise most significant·byte first;
order is assumed purely ascending or purely descending. (val &
0140) »5 1s the strongest for·bounds that are multiples of 0,
·2, 4, 8 bytes. If (val & 0200) no relocation information is
present in this file.
Relocation information consists of two successive byte streams,
one for the text segment and one for the data segment, each
terminated by a zero control byte. Control bytes in the range
[1, 31] cause that 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 short or
long int in the corresponding segment. If the I-weighted bit is
set in such a control byte, then a change in load bias must be
, subtracted from the int. The 2-weighted bit is set .if a longint
is being relocated instead of a short int. The value of the
control byte right-shifted two places, minus 16, constitutes a
"symbol code".
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, the symbol code is its value plus 47. Otherwise,
the code is that byte minus 128, times 256, plus 175 plus the
value of the next relocation byte after that one.
A symbol code of zero calls for no further relocation; 1 means
that a change' in the text bias must be added; 3 means that a
change in bss bias must be added. Other symbol codes call for
the value symbol table entry indexed by the symbol code minus 4
to be added to the item.
-3-
link (1) OPTION
link (1)
4/6/83
Each s~bol table entry consists of a value in~, a flag byte,
and a name padded with trailing NULLs. Meaningful flag values
are 0 for undefined, 4 for defined absolute, 5 for defined text
relative, 6 for defined data relative, and 7 for defined bss
relative. To this is added 010 if the symbol is to be globally
known. If a symbol still ~ndefined after linking has a non-zero
value, link assigns the symbol a unique area, in the bss
segment, whose length is specified by the value, and considers
the symbol defined. This occurs only if -d has not been given.
RETURNS
Link returns success if no error messages are printed to STDOUT,
that is, if no undefined symbols remain and if all reads and
writes succeed; otherwise, it returns failure.
EXAMPLE
To load the C program
Micronix (UNIX/V6):
echo.o
with
separate
I/D
spaces
% link -lc.ll -rt -dbO /lib/Crts.o echo.oj taout
or with read-only text section:
% link -lc.ll -rt -dr13 /lib/Crts.o echo.oj taout
-4-
for
link (1) OPTION
4/6/83
link (1)
And to load the 8080 version of echo under CP/M:
A:link -hrt -tbOxOl00 a:chdr.o echo.o a:clib.a a:m1ib.a
SEE ALSO
hex (1), lib (1), lord (1), obj(I), cc (1), as (1), cpl (1),
cp2 (1), cpp (1)
NOTE:
This
Whitesmit~s,
program
Ltd.,
and
documentation
-5-
are
products
of
In (1)
4/6/83
In (1)
NAME
In - make links
SYNTAX
In namel name2
DESCRIPTION
A link is made between two files (namel and name2). Therefore,
changes made to file namel affect file name2 and vice-versa. A
file may have up to 255 links.
ERRORS
Linked files must be on the same file system, otherwise, a
"Cross-devIce link" error message is displayed.
SEE ALSO
rm (1), cp (1), mv (1)
-1-
login (1)
4/6/83
login (1)
NAME
login - sign on
SYNTAX
login.
DESCRIPTION
Login is executed automatically by init. It requests a user name
(and
password
if
appropriate),
performs
the
required
bookkeeping, executes the shell and begins the user's Micronix
session.
FILES
/etc/utmp
/usr/adm./wtmp
/etc/banner
/etc/motd
/etc/passwd
accounting
accounting
The sign on message
message-of-the-day
password file
SEE ALSO
init (1)
-1-
lord (1) OPTION
4/6/83
lord (1)
NAME
lord - order libraries
SYNTAX.
lord -[c* d* i r* s]
DESCRIPTION
Lord
reads
in a list of module names, with associated
interdepencies, from
STDIN,
and
outputs
to
STDOUT
a
topologically sorted list of module,names such that, if at all
possible, no module depends on an earlier module in the list.
Each module is introduced by a line containing its name followed
by a colon. Subsequent lines are interpreted as either:
defs
- things defined by the module,
refs'
- things referred to by the
mod~le,
or
other stuff.
Refs and defs have the syntax given by one or more formats
entered as flags on the command line. Each character of the
format must match the corresponding character at the beginning
of an input line; a ? will match any character except newline.
If all characters of the format match, the rest of the input
line is taken as a ref or def name. Thus, the format flag
"-dOx????D" would identify as valid def any line beginning with
"Ox", four arbitrary characters and a "D", so that the input
line "Ox3ffOD inbuf" would be taken as a def named " inbuf".
The flags are:
-c*
prepend the string * to the output stream. Implies -s. Each
module name is output preceded by a space; the output
stream is terminated with a newline. Hence, lord can be
used to build a command line.
-d*
use the string * as a fromat for defs.
-i
ignore other stuff. Default is to complain about any line
not recognizable as a def or ref.
-r*
use the string * as a format for refs.
-s
suppress output of defs and refs; output only module
in order.
names
Up to ten formats may be input for defs, and up to ten for refs.
-1-
lord (1) OPTION
lord (1)
4/6/83
If no -d flags are given, lord uses the default def formats:
. "Ox???????? B" ,
"Ox? ? ? ? ? ? ? ? D" ,
"Ox? ? ? ? ? ? ? ?T" ,
Ox? ? ? ? B" ,
"Ox????D", "Ox????????U" and "Ox????U". These are compatible
with the default output of reI (obj).
If there are any circular dependencies among the modules, lord
writes
"not
completely sorted" to STDERR and' outputs a
partially-ordered list. In general, rearrangements are made only
when necessary, so an ordered set of modules should pass through
lord unchanged.
RETURNS
Lord returns success if no error messages are printed, otherwise
failure.
EXAMPLE
To create a library of ordered object modules under Idris:
% .rel
*.0 I lord -c"lib libx.a -cIt I sh
To order a set of objects using Mic.roni;x run:
% nm *.0 ):nmlist
% lord < nmlist -c"ar r libx.a"
I \.
-d"??????T" -d"??????D" -d"??????B" -r"??????U"
I
sh
SEE ALSO
lib (1), obj (1)
NOTE: This program
Whitesmiths, Ltd.
and
documentation
-2-
are
products
of
lpr (1)
4/6/83
lpr (1)
NAME
lpr - line printer spooler
SYNTAX
lpr [-igpqrs] file •••
SUMMARY
(A less technical description follows.)
Lpr causes each of the named files to be queued for printing. If
no file names are given~ the standard input (generally your·
terminal) is used.
Options:
-i
-p
-g
-q
Print ,the file "in place'.' without copying.
Pause before printing~ send a message to the
and delay until the command "lpr -g" is entered.
terminal~
Go. Starts the printer daemon up again after· a 'pause.
Display the printer queue. The owner ;and size of each
queued file is displayed on the standard output (usually
your screen).
-r
Remove all files in the queue owned by you.
-s
Stop the daemon. The queued files are not removed.
Alternate printers are accessed by names such as "dpr" ~ "xpr" ~
etc. See below for details.
DESCRIPTION
In a single user system~ the basic idea of printing is very
simple: you have only one printer and a machine which is able to
run only pne person's programs at a time.
In a multi-user system, things may not be so simple: there may
be more than one printer, and two users may wish to use t~e same
printer at the same time. The lpr program addresses these
difficulties.
Here's how it works in principle. (This indented section is
optional material, not needed by the ordinary user.)
Say that several users all wish to print files. All of them
type "lpr filename" at once. Each one uses the same or a
different file name as is his or her preference.
Each of the several lpr programs creates a
-1-
uniquely
named
lpr (1)
4/6/83
lpr (1)
file in the "spooling directory" and copies the files which
the users wish to print into these files.
Each of the several lpr programs attempts to initiate a
printer "daemon". Be'cause of locking mechanisms, only one
succeeds. (A daemon is a process, just like the ones ru'n
from terminals, except that it exists independently of any
terminal.. It performs its tasks (see below) without human
intervention.
All of the lpr programs finish loading their files into the
spooling directory. Meanwhile, the daemon is still alive
and running.
It scans the spooling directory and observes that it has
several files waiting in line to be pr.inted.
It determines which one is. next in line and starts printing
that one.
Now on to the practical description.
Lpr options:
-i
Print "in place". Normally files to. be printed are
copied into the spooler's directory. With the the -i option
specified, only the name of the file will be remembered and
it will be rea,d and sent to the printer" at print time. It
is therefore important that the file not be removed before
the print finishes. Using lpr this way saves time if you
have an enormous file to print, but does not work if the
material to be printed is not a file (see the example with
"print" below).
-p
Pause before printing. When it comes your file's turn
at the printer, the daemon will send a message to your
terminal and delay until the command "lpr -g" is entered.
This is intended to allow the insertion of special forms or
the like.
-g
~o.
Starts the printer daemon up again after a pause.
-q
Display the printer queue. The owner and size of each
queued file displayed on the standard output (usually your
terminal) •
-r
Remove all your files in the queue. If the file being
removed is also being printed, the printing will be
prematurely curtailed.
-s
Stop the daemon. A fatal signal is sent to the daemon.
The queued files are not removed, so they will be started
over again next time an lpr command is executed. If you
want to remove the files, use lpr -r.
-2-
4/6/83
lpr (1)
Ipr (1)
EXAMPLES
The simplest way to print .afile is:
lpr filename
This does not perform such s.ervices as skipping over creases in
the paper, numbering the pages, etc. (Often, you do not want
these services, since they were performed by another program
such as "form" or Wordstar.) If you do want these services, type
I
print file
lpr
This sends the output of the print program (which names, dates,
ans paginates) to the spooler.
If you are using the "form" program (see,form in this
you can format and print at the same time by typing
form file
(If you
screen.)
I
manual),
lpr
simply
type
"form
file",
the
output
goes to your
If you want to· print directly from your s~reen, without going
through the formalities of creating a named file and running it
through lpr simpiy type
lpr (ret)
Then type your text. When you are finished, type
(ret)
(control-D)
Be aware that when you do this you will not have special effects
(like bold print) and you will not have a disk file of the text.
To do a ".form feed", type:
Ipr (ret)
(ret)
(control-D)
This causes a file to be queued- which contains a single
line-feed character. Lpr generates a printer for~feed after
each file it prints.
ALTERNATE PRINTERS
The name by which the spooler is invoked
invoked as "lpr", it uses the directory
-3-
is
significant.
When
4/6/83
Ipr (1)
lpr (1)
/usr/spool/lpr
for spooling, and it decides which device to write to by looking
in the configuration file "/etc/ttys" for a line containing the
word "lpr". For instance, if the following line occurs in
/etc/ttys
ttyC
lpr
1200
then the lpr program will write to port ttyC at 1200 baud. (See
ports (4) if you don't know what ttyC means.)
Suppose that you want to support a second printer. Say that it
is connected to ttyD, runs at 9600 baud, and requires hardware
handshaking. Think of a name for it such as "dpr," and put the
following line in the ttys file:
ttyD
dpr
9600
shake
(The order of the words is not significant.) Finally, make a
link to lpr named "dpr" by typing ~
cd /bin
In lpr dpr
Now when you type the command "dpr file", the spooler will write
to ttyD at 9600 baud, and it will use
/usr/spool/dpr
for spooling. (It will create this directory
that you don't have to do it in advance.)
SEE ALSO
print
(1),
automatically,
so
form (1), cables (4), ports (4), printers (4), ttys
(5)
FILES
/usr/spool/lpr - spooling directory
/usr/spool/lpr/pid - contains the daemon's process ID
/etc/ttys - To find out where to send the output
-4-
4/6/83
Is (1)
Is (1)
NAME
Is
SYNTAX
Is
[~adfgilrstu]
name •••
DESCRIPTION
Ls lists all the named non-directories first, then the contents
of each named directory. If no names are specified, the current
directory is listed.
There
long.
are tpree basic printing formats: line, multi-column, and
Line format is one file to a line.
In multi-column format, Is produces a rectangular array of file
names sorted down the page and compacted as much as possible
within an 80 column width.
In long format, files are listed one to a line with a lot of
information about each file packed into the line (see -1 below).
Long format is explicitly forced by the -lor -g option (see
below). Otherwise, Is chooses line or multi-cloumn format
automatically, depending on whether its standard output is a
file or a terminal.
Options:
.
, ,
-a
All. Normally, files names beginning with
listed. If -a is specified, they are listed.
-d
Directory. Normally, if a' directory name is given, its
contents is listed. If -d is specified, then only the name
is printed (along with any other attributes called for by
other options).
-f
File ~rder. Disable all sorting and print the files in
order they actually appear in the directory.
-g
Group. For each file, print the name of the owner's group,
instead of the owner's login name. The latter is the
default for long listings. (This option forces a long
listing, whether or not -1 has been specified.)
-i
Print the inode number of each file.
-1-
are
not
the
Is (1)
4/6/83
Is (1)
-1
Long format. Print mode, link count,_ owner, size,
last modification, and name.
time
of
-r
Reverse. Files are sorted in reverse order.
-s
Sizes are given
characters.
-t
Time sort. Sort files by modification
first) instead of alphabetically.
-u
Use the access time instead of the modification time for -t
and -'I.
in blocks (of 512 bytes each) instead of
time
(most
recent
Long printing format is laid out as follows:
Each line refers to one file. The fields printed are:
mode
Mode is the
displayed.
links
access
owner
size
time
name
pe'rmissions of the file symbolically
Links is the number of links to the file.
Owner is the login name of the user who owns the file.
Size is the size of the file in bytes (or blocks
-s option)
with
the
Time is the last modification time (or last access time) of
the file.
The mode takes the form:
-[bcdJrwxrwxrwx
The
~
stands for plain file or permission not granted; the
b stands for block special file
c stands for character special file
d stands for directory
Files may also have the following characters interspersed
within these descriptions:
1 stands for write locked file
s
r
w
x
stands
stands
stands
stands
for
for
for
for
set user or group ID on execution
read permission
write permission
execute permission
-2-
4/6/83
1s (1)
Is (1)
If a letter is missing in the above representation, it
indicates that permfssion for that mode of access: is not
permitted.
EXAMPLES
drwxr-xr-x
The d means this is a directory.
The rwx means
permissions.
the
owner
of
the
directory
has
all
The r-x means those users in the directory's group have
only read and search permission on the directory. Likewise
for others (those users who are neither the owner of the
directory nor in the same group).
-r1-r-:-r- means this is a plain file.
rl- means the file is
locked.
r-- means the file is
readable
readabl~
by
the
owner .and
write
by those .inthe group.
the second, r-- means the file is readable by anyone else on
the syst'em also.
FILES
/etc/passwd - to get names for user ID numbers
fetc/group - to get names for group ID numbers
SEE ALSO
chmod (1) - to change the mode of a file
owner (1) - to change the owner of a file
group (1) - to change the group of a file
passwd (5) - the structure of the password file
group (5) - the structure of the group file'
-3-
4/6/83
macro (1)
macro (1)
NAME
macro - macro
expans~on
SYNTAX
macro
DESCRIPTION
The standard input is copied to the standard output, with macros
expanded along the way. After encountering a line of the form:
define(token,string)
the token'will be replaced by the string everywhere it appears.
A token is a contiguous string of alphanumerics delimited by
non-alphanumerics. Macro exansions are applied recursively [i.e.
define(a,b) define(b,c) is equivalent to define(a,c»). Macros
may be defined with arguments. If the sequence $n where n· is a
digit occurs in the defining string, $n will be replaced by the
nth argument. $1 is the first argument. In an instance where a
macro has ·fewer than n arguments, $n is replaced by the null
string, (i.e., simply ignored). An example:
define (add , $1 + $2 + $3)
add(firstarg, secondarg, thirdarg)
would produce:
firstarg + secondarg + thirdarg
EXAMPLE
As a language preprocessor stage:
macro tm1
SEE ALSO
include (1), ratfor (1)
-1-
mail (1)
4/6/83
mail (1)
NAME
mail - send and receive mail
SYNTAX
mail [-[yn]] [user]
DESCRIPTION
Micronix has an inter-user mail system. The mail program sends
letters to the appropriate system user. Letters are sent to
another user by entering:
% mail user-name
The user-name· may be a "IQcal" name or a "network~' name. Local
names are simply login names (ie, the name by which a user logs
in). Network names look·like machine-name%login-name.
To enter the letter, just begin typing. Enter as many lines as
necessary. Letters are terminated.by entering a si-ngle period,
or a AD at the beginning of the last line.
The next time the user
message "You have mail".
logs in, he will be greeted with the
To read his mail, he simply enters
% mail
The letter is printed on-screen. The user is then
wants to keep his mail.
asked
if
he
The appropriate reply is "yes" to keep it, or "no" to delete it.
Kept mail is stored in the "mbox" file in the user's home
directory.
EXAMPLE
% mail sales%ron
Lunch Wednesday at 12:30?
-Jill
%
SEE ALSO
network (4)
-1-
make (1)
4/6/83
make (1)
NAME
make - automated program construction
SYNTAX
make object •••
DESCRIPTION
The problem of keeping the assembly ins~ructions straight for
large programs composed of many modules is reduced to the
one-time job of writing a complete description file.
The make program reads the file makefile in the curJ;ent
directory. Makefile consists of a number of lines describing
interdependencies
among
program modules and the formulas
necessary to contruct these modules.
Each named target module is then contructed.
Make then "walks" the
files as necessary.
tree
of
dependencies,
updating
target
Lines in the makefile take the form:
product : ingredients ; formula
Where "product" is the name of a target file, "ingredients" is a
space-separated list of files upon which "product" depends.
-1-
4/6/83
man (1)
man (1)
NAME
man - manual
SYNTAX
...
man [N] program name
DESCRIPTION
Man prints documentation (if it exists) for each named program.
Complete on-line documentation is resident on the Micronix
system.
The "N" option directs man to a numbered or-particular section
of the files.
Typing
Is /bin
displays the system
programs~
Typing
Is /usr/man
displays the sections that contain
Reference Manual.
the
EXAMPLE
The command line
man man
prints this page.
Entering
man 2 stty
prints the stty.2 file instead of stty.l.
-1-
documentation
for
the
mkdir (1)
4/6/83
mkdir (1)
NAME
mkdir - make directory
SYNTAX
mkdir newdir •••
DESCRIPTION
Mkdir creates the specified directory or directories. Entries
for n ... and ...... are created automatically.
ERRORS
The given directory names must not yet exist.
write permission on the parent directory.
Mkdir
requires
If a multiple element path name is given, mkdir creates each of
the directories in the path leading to the desired directory.
It is not possible to remove a directory from the system that
contains files; files must first be removed using the rm
command.'
EXAMPLES
mkdir la/sally mkdir /usr/spool/mail
/us~/spool/lpr
Eacb directory created is accessible to any user. It is
advisable to organize your work by keeping related files
together in their own, separate directories (i .e.,
mkdir
programs, mv *.c programs, etc.).
SEE ALSO
rm (1)
-1-
4/6/83
mkfs (1)
mkfs (1)
NAME
mkfs - make an empty file system
SYNTAX
mkfs device [size]
mkfs device [-exclude]
DESCRIPTION
Mkfs builds an empty file system on the named device. This
command is normally used to' initialize blank or outdated
diskettes for use under Micronix. It also initializes hard disks
when they are brand new or if for some other reason you wish to
rebuild them from scratch.
If no size is specified, mount determines the device size
automatically. A numerical argument without a leading "_" is
taken as the desired size (in 512-byte blocks). A numerical
argument with a leading'"-" is taken as a number of blocks to be
excluded from the file system at the end of the device (say for
swap space). In this case, the actual device size is also
determined automatically.
The ilist size is set to
s/43 + s/ 1000"
where s is the file system size determined above. The smallest
practical file system is about 50 blocks.
'Warning! Extreme care should be taken when using this command:
It obliterates any former file system on the device. If, for
example, you entered
mkfs /dev/root
you would have to rebuild your
Needless to say, aim carefully!
entire
file
system
scratch.
ERRORS
"filename: Not a block special file" This message indicates that
you have - specified a / dev file that does not transfer data in
blocks. In practice, any disk drive will be block-special; other
peripherals (printers, terminals, tape drives) are typically
character-special.
EXAMPLES
mkfs /dev/dja
mkfs /dev/hdb -2048
mkfs /dev/hda 18448
-1-
mknod (1)
4/6/83
mknod (1)-
NAME
mknod - create special file
SYNTAX
mknod name type major minor
DESCRIPTION
Type is either b or c for block special or character special.
Major and minor are the major and minor device numbers,
respectively. A special file is created (mode 777) with the
given name. This call is restricted to
the
super-user.
Conventional use requires that all special devices be kept in
the one directory, "/dev".
NOTES
Warning: it is dangerous to have to separate nodes with the same
type and major/minor number. If you want multiple names, use In.
SEE ALSO
In (1), rm (1), mkdir (1), mode (1)
-1-
4/6/83
mode (1)
mode (1)
NAME
chmod - changes mode of files
SYNTAX
chmod mode file •••
DESCRIPTION
The mode of each named file is changed according to mode, which
is an octal number constructed from the OR of the following
mo(jes:
4000
2000
0400
0200
0100
0070
0007
set.user ID on execution
set group ID on execution
read by owner
write by owner
execute (search in directory) by owner
read t write t execute by group
read, write, execute by others
EXAMPLE
Mode 777 file (accessible by all)
Mode 700 file (inaccessible)
Mode 400 file (read only by owner)
SEE ALSO
Is (1), chown (1), chmod(1)
-1-
4/6/83
more (1)
more (1)
NAME
more - file perusal filter for fast terminals
SYNTAX
more [file ••• ]
DESCRIPTION
More allows you to scroll through the named files on a video
terminal, one screenful1 at a time. At the bottom of the screen,
it prints "--More-" and waits. Press carriage return to
continue, delete to quit. If no file names are given, the
standard input is used.
EXAMPLES
To view a couple of files one screenfull at a time:
more file1 file2
To view some
control keys:
man upm
I
documentation
more
-1-
without
having to use START/STOP
4/6/83
mount (1)
mount (1)
NAME
mount - mount a file system
S~AX
mount [device] [directory] [-r]
DESCRIPTION
Mount is u$ed to extend the Micronix file system to inc~ude
additional storage devices. If you think of the system of files
as a large tree, mounting is akin to hanging an additional
ornament off a particular bough.
"Device" refers to the device name as it appears in the /dev
directory. The device name can be entered as (for example)
"/dev/fla", or you can abbreviate it
to
simply
"fla".
"Directory" is the position in the existing file system that you
want the additional file system to begin. The optional -r flag
means to mount the device as read-only.
Mount with no argument displays the current list of 'mounted file
systems. It's advisable to just type "mount" to take a look
before proceeding. That way you'll have a better idea of what's
going on.
When you mount a device, you must specify a certain direc~ory
that already exists. Use mkdir to establish a new directory, if
necessary.
Typically, you would enter something like
mount fla /b
This will graft the file system of floppy drive A into the root
directory as directory "b". From then on Micronix can access any
of the files on the floppy through the path /b/ •••
It's somewhat traditional to mount devices on directories in the
root directory. "/f" or "/b" or "/c" or "/h", for example. This
is not compulsory. It is done perhaps because it simplifies the
concept of the file system.
If you mount a device on a directory that already has entries in
it, it will appear that the existing entries are thrown away.
Never fear; they are still there, and will reappear when the
device is unmounted (umount). This situation would occur in
the example above if directory /b already had files in it from
some other device.
When the system is initially brought up, no devices are mounted
(except the root device, which technically isn't mounted, since
it is the core to which everything else is ultimately attached.
Leave this one to to the semanticians.) However, you can stick
-1-
mount (1)
4/6/83
mount (1)
mount commands into the rc file, so that whatever devices you
want are automatically mounted whenever you go from single- to
multi-user mode.
A device may be mounted at most once. If you mount and mount
again with the same device, the second instance will fail,
yielding the message "File or device busy".
Mount refuses to mount a device which does not appear to contain
a file system. A quick check is made to see that the device in
question is reasonable. If you thought the device did contain a
file system, but mount disagreed, you may run "fsck", whfch
sometimes has the power to turn a non-file-system into a
file-system and in any event will give it a good try. With new
diskettes or a hard disk file system that is corrupted beyond
repair, use mkfs to create a fresh, EMPTY file system.
A file system may be mounted "read/write" or "read only". The
system is guaranteed to change the contents of file systems
mounted "read/write". File systems mounted "read only" are
guaranteed to be unchanged.
You may request read only status with the "-r" flag. Sometimes
read only status is foisted upon you, for instance, if you mount
a write-protected floppy diskette.
EXAMPLES
Mounting a device and addressing a file on it:
Suppose you have a floppy diskette with a directory "letters"
containing a file "memoS". The floppy drive is currently
unmoun_ted and youwan-t to edit memoS_
To mount the device (assume it is the first 8" floppy, named
fla, and you already have a directory named f in the root
directory):
mount fla /f
To access the file for Micronix editing:
edit If/letters/memoS
Observe that this path name crosses a device boundary, from the
root device (probably an integrated hard disk) to the 8" floppy_
It's entirely possible to mount a second floppy drive to the
first floppy's file system, say, alongside memoS in this
example. You could mount it as "g", for instance ( mount fIb
/f/letters/g ) and then address it as /f/letters/g/ ••• This path
thus crosses two device boundaries. This can go on as long as
you have devices and controllers, but why? It's better to just
mount them all to the root.
-2-
mount (1)
4/6/83
mount (1)
To prepare a mini-floppy for use under Micronix:
formatdj -is -t40 -s2 -b512 -dO
(5 inch, 40 track, 2 sides, 512 bytes, drive 0)
mkfs /dev/mfa
(make file system on mini-floppy A)
moun t 'qlf a / f
(mount the new file system)
mkdir /f/newdir
(make' a new directory on the diskette)
cp
*
/f/newdir
(c,opy some files over)
umount mfa
(dismount the mini-floppy)
NOTES
Regarding 5.25" floppy disk driyes, note ,that there are two ways
of addressing these devices in mount commands. Since they are
configured for double-sided use ,-' you would normally refer , to
them as "mfa2", "mfb2", and so on. The exception to this rule is
the case where a diskette was formatted for single-sided use.
When using such a diskette, refer to' the device without the "2",
for example, as simply mfa.
WHEN TO UNMOUNT? you may ask. When using either size of floppy
drive, always unmount (umount command) before removing a floppy
diskette from the drive~ Therefore, if you need to switch
diskettes, first unmount the device, then change diskettes, and
finally remount.
In the unusual case of changing hard disk d~ives (that is,
actually unplugging one and plugging in another), unmount the
first before disconnecting it.
To those of you who recoil at the use of such a verbal
construction as "unmount", we apologize. But if we asked you to
dismount a device, you'd just have silly images of spurs
jangling while you drawl "Whoa, there, old floppy."
-3-
mount (1)
4/6/83
SEE ALSO
umount (1) - to reverse the effects of mount.
fsck (1) - to repair file systems.
mkdir (1) - to create a new directory.
mkfs (1) - to create a file system.
rc (5) - to automate selected mounts.
-4-
mount (1)
4/6/83
msgs (1)
msgs (1)
NAME
msgs - bulletin board and junk mail service
SYNTAX
msgs -fhq [ [-]- number]
DESCRIPTION
The msgs program provides a system wide bulletin board. Any user
may post messages on the board and all users may view the
messages on the board. Using the msgs program is much like
reading the classifed section of a newspaper.
The last message read by each user is automatically remembered.
That is to say each user sees each message once and the system
holds your place.
When the command "msgs" is given an interactive mode is entered.
You are shown the heading of the first message you haven't read
yet.
You are advised of the number of lines remaining in the file.
You are asked if you'd like to see more.
This looks like:
23:
From harold Mon 23 Aug 11:30:22
New database program installed!!
(11 more lines) More? (Y/N/Q)
Mess~ge
Possible responses:
y
n
q
Yes, I'd like to see the rest of this mess.age.
No, I'm not interested in this message, skip me to
next· message.
the
Quit. Get out of the program right now.
(number)
Jump to the message whose number is given, or the next
highest numbered message.
Back up one message for a replay.
s filename
Append this message to the end of the named
-1-
file.
Create
4/6/83
msgs (1)
msgs (1)
the file if it doesn't already exist~ If a minus (-)
follows the's', the previous message will be saved.
If you press the
DESCRIPTION
Obj permits inspection of relocatable object files in standardform for any-target machi~e. Such files may have been output by
an assembler, combined by link, or archived by lib. Obj can be
used either to check their size and configuration, or to output
information from their symbol tables.
The flags are:
-d
Output all defined symbols in each file, one per line. Each
line contains the value of the symbol, a code indicating to
what the value is relative, and the symbol name. values are
output as the number of digits needed to represent an
integer on the target machine. Relocation codes are:"T"
for test relative, "D" for -data relative, ItB: for bss
relative, "A" for absolute, or "?" for anything obj does
not
recognize. Lowercase letters are used for local
symbols, uppercase for globals.
-g
Print global symbols only.
-i
Print all global symbols with the interval in bytes between
successive symbols shown in each value field. Implies the
flags -[d u v].
-0
Output symbol values in octal. Default is hexadecimal.
-s
Display the sizes, in decimal, of the text segment, the
data segment, the bss segment, and the space reserved for
the runtime stack plus heap, followed by the sum of all the
sizes.
-t
List _type information for this file. For each
the data file is: the size of an integer on
machine, the byte order it observes, the most
storage bound it enforces, and the maximum
characters it permits in an external name. If
library, the type of library is output and the
above is output for each module in the library.
-1-
object file
the target
r~strictive
number of
the file is
information
obj (1) OPTION
obj (1)
4/6/83
-u
List all undefined symbols in each file. If -d is also
specified, each undefined symbol is listed with the code
"U" •. The value of each symbol, if non-zero, is the space to
be reserved for it at .load time if it is not explicitly
defined.
-v
Sort by value; implies the -d flag above. Symbols of
value are sorted alphabetically.
equal
If no flags are given, the default is -[d u]; that is, all
symbols are listed, sorted in alphabetical order on symbol name.
If more than one of the flags -[d s.t y] is sel~~ted, then type
information is output first, followed by segment sizes, followed
by the symbol list specified with -d or -u.
specifi-es. zero or more files, which must be in
re10catable format, or standard library format, or in UNIX/V6
library format, or UNIX/V7 library format. If more than one
file, or a library, is specified, the name of ech separate file
or module precedes .any infq,rmation output for it, each name
followed by a colon and a newline; if -s is given, a line of
totals is also output.. If no are specified, or if "_" is
encountered on the command line, xeq is used.
RETURNS
Obj returns success if no diagnostics are produced, that is, if
all reads are successful and all file formats are valid.
EXAMPLE
To obtain a list of all symbols in a module:
% obj al10c.o
Ox00000074T alloc
OxOOOOOOOOU-exit
OxOOOOOlfeT-free
OxOOOOOObeT-nal10c
OxOOOOOOOOU sbreak
OxOOOOOOOOU-write
SEE ALSO
lib (1), link (1), lord (1), cc· (1), as (1), cpl (1),
cp2
(1),
cpp
(1 )
NOTE: This program and document-ation are products of Whitesmiths,
Ltd., and are sold separately.
-2-
od (1)
4/6/83
od (1)
NAME
od, hd - octal or hex dump
SYNTAX
od [-bcdox] file
DESCRIPTION
Od dumps file in one or more formats. If no file name or "-" is
given, the standard input is used. The following flags are
understood:
-b
Interpret bytes in octal.
-c
Interpret bytes in ASCII.
-d
Interpret words in decimal.
-h
Hex words
-0
Interpret words in octal (default).
-x
Interpret bytes in hexadecimal.
EXAMPLE
od -bo file
-1-
overstrike (1)
overstrike (1)
4/6/83
NAME
overstrike - converts back spaces to multiple lines
SYNTAX
overstrike
DESCRIPTION
Overstrike copies the standard input to the standard output.
When it encounters a back space, it replaces it by a "return"
and an appropriate number of spaces, thus eliminating backward
motion in the middle of a line.
EXAMPLE
To prepare a file for
understand back spaces:
printing
overstrike
name relationships
-2-
owner (1)
passwd (1)
4/6/83
passwd (1)
NAME
passwd - enter (or change) login password
SYNTAX
passwd
DESCRIPTION
Passwd is used to change the login password of the given user.
When a user's account is first created, it has no password, that
is, no password will be demanded of the user at login time.
This command may be used to set or change your password. The
super user may set or change, anyone's .password, but, not even
the super user may know what a user's password is. It may,
however~ be changed to something known.
This program is fairly self-explanatory and prompts you for t.he
name of the user whose password you want to change and the
password itself. When you type the password, the "echo" is
temporarily turned off, so that the password is unseen. OnLy the
encryption of the password is kept around. If two or more users
set their password to the same thing, the encrypt,ions will not
be the same.
NOTES
It is recommended, if the intention is password security, that
passwords be long, complicated, fast to type, and frequently
changed.
SEE ALSO
Tutorial in User's Manual
-1-
paste (1)·
4/6/83
paste (1)
NAME
paste - print files side by side
SYNTAX
paste [-t separator] filel file2 •••
DESCRIPTION
Paste reads a line from each file in the order given and pastes
the lines together into single line, which is written to the
standard
output. A tab separator is used unless another
character is specified. A file name of - refers to the standard
input. No attempt is made to line up the columns vertically.
There is no limit on the input line length.
EXAMPLES
Suppose that filel contains
Sally
Samantha
Holly
Agatha
and file2 contains
Mike
Mordred
Garth
paste -t+ file1 file2
would result in the following output
Sally+Mike
Samantha+Mordred
Holly+Garth
Agatha
Is
I
paste -
would give a two-column listing of the current
(alphabetized from left to right, not top to bottom).
BUGS AND CAVEATS
No attempt is made to align the columns
put tabs between the columns.
SEE ALSO
field (1)
-1-
vertically,
directory
except
to
4/6/83
pilot (1)
pilot (1)
NAME
pilot - an author language
DESCRIPTION
This program gets its name from and is loosely based upon that
set of programs written for the CP/M system under' the generic
name PILOT, itself based upon some complex IBM software.
The present incarnation has adopted many of the ideas t but is
not totally faithful to the original PILOT standard.
Pilot is an author language in the sense that it should be
possible for "authors," i.e. non-progra1llDers t to successfully
ana fairly rapidly get something working in the pilot language.
Pilot is a non-structured language, but structured language
enthusiasts may be assured that "rp" (a rational pilot) is
available as a preprocessor. (See rp (1».
In order to run something in pilot, one issues the command:
pilot filename
where the given filename refers to a "pilot script". Pilot
simply read the script and do whatever is requested.
will
To write a "pilot script" one needs only a way to get text into
a file. Most text editors will suffice.
Pilot Operation
In general, pilot reads its input file, one line at a time,
performing the described actions before proceeding. The general
layout of a pilo't command is:
*label command conditional : word1 word2 word3
...
*label is a tag by which one may refer to this line elsewhere in
the script_. It is optional" and in practice, most commands will
not have labels. A label may appear on a line by itself.
command is a single letter command, discussed in detail below.
-1-
pilot (1)
4/6/83
pilot (1)
conditional is either the letter Y or N. A conditional specifier
is optional. If one appears, the command will only do something
if the Y or N matches the current state of pilot's condition
flag.
words are optional and specific to individual commands.
Instruction Summary
A -
C
D-
E J -
MNRS T UW-
accept
call
define
exit
jump
match
new file
return
save
type
unix
wait
instruction Descriptions
A - accept - a: [variable]
One line of input' is accepted from the standard input. If a
variable name is given. a copy of the accepted data will be
stored in the variable.
Examples
a:
a: $save
C - call - c: *label
Jump to the given label, but remember where you were. If a
return instruction (r:) is encountered in the program flow after
the label, pilot will jump back to the instruction following the
call.
Example
c: *output
e:
*output
t: Hello world!
r:
1) Call instruction jump down to "*output".
2) Type instruction - type "Hello world!"
-2-
4/6/83
pilot (1)
pilot (1)
3) Return - go' back to just after the last call
4) exit - all. done!
D - define - d: $move data
The string "data" is evaluated if necessary and then a copy of
the resulting string of characters is stored in the string
variable "name". Note that "$" denotes string variables.
Example
d: $x The cheese
t: $x
1) Definition $x is set to "The cheese"
2) Type - "The cheese" will be typed.
E - exit - e:
This is a simple instruction. Pilot quits when it encounters an
exit instruction. Anything to the right of the colon is ignored.
Example
e:
Stop the whole works right now.
J - jump - j: *label
Go to some other part of the current pilot script file and
continue ex·ecuting instructions from that point on. If no label
name is given, pilot prints "Missing label" and stops. If there
is no such label to be found in the current pilot script file,
"name: Label not found" is printed and pilot stops.
Example
*top
t:Hello
j:*top
This would print "Hello" over and over again forever.
A more useful example:
a:
m:yes
jn: *defa'ult
t: you typed yes
e:
* default
t: you didn't type yes
e:
-3-
4/6/83
pilot (1)
pilot (1)
1) Accept a line from the controlling terminal
2) Match it against "Yes"
3) Jump to *default if the previous match failed.
4) type - "you typed yes" otherwise
M - match - m: pattern,pattern,pattern • •••
Compare the most recent input against the given list of patterns
and set pilot's condition flag based on the outcome. The
following instructions may base their behavior on the outcome of
these pattern comparisons. Two results are possible:
1) The input matched one of the patterns (success).
2) The input matched none of them (failure).
Comparison of each pattern is by a marching window scan.
- Case is ignored, that is, a capital Q is considered
same as a lower case q.
to
be
the
Example
m:a
m:one,two,three
The first will succeed whenever the most recent terminal input
contained the letter "a" anywhere.
The second will succeed if the most recent input contained any
of the three given character sequences which form the words one,
two, three.
N - new file - n: filename
Fairly straightforward: Pilot has been marching along executing
instructions in its pilot script file. When it encounters the
line
n: newfile
pilot will have done with the current file and start executing
instructions with the first line in the file named "newfile".
(There must, of course exist such a file, and it must be
readable.) Pilot stops if it can't read the given file.
R - return - r:
Discussed in C - call (above). A return instruction causes a
jump to the line following the most recently executed call
instruction. If there are no calls for which there have been no
returns, pilot stops. It returns out of pilot to the calling
-4-
4/6/83
pilot (1)
program, as it were. Anything to
ignored.
pilot (1)
the
right
of
the
colon
is
Example
r:
S - save - s: $variable
The current value of the input terminal input register is saved
in the string variable whose name is given. If no name is given,
no action is taken.
Example
s: $phial
T.he most recently accepted input is saved in "phial".
T - type - t: text
A simple command, really. That which follows the colon is simply
sent verbatim to the standard output, (usually the te·rminal). If
the last character of the line is a left slant .(\), then no
"newline" character is sent at the end of the line.
Example
t: A) First selection
t: B) Secona selection
t:
.t: Your choice
a:
==) \
The four lines above are typed.
U - unix - u: command
The command to the right of the colon is executed just as if it
had been typed as a command to the shell. This command gives you
access to the rest of the system. This instruction can take much
longer than any of the others just to get set up. If the
sub-process created by a U instruction is interrupted or
otherwise ~bnormally terminated, pi~ot will stop.
-5-
4/6/83
pilot (1)
pilot (1)
Example
u: Is
u: cat $file
u: pilot zzz
I
form
I
lpr &
Each command is executed. Note that it is possible for pilot to
continue before the command finishes (ex. 2) or for there to
coexist several layers of pilot programs (ex. 3).
W - wait - w: [$variable] [number]
Wait is just like "accept" above only it "times out" after a
certain period. The default period is six seconds. One can
select a different period by placing a numeric value to the
right of the colon as one of the arguments. If the specified
time interval expires before the RETURN key has been pressed,
then the data returned is the single word "TIMEOUT" which can
later be tested.
Example
w:
w: $data
w: 9
w: $fast 2
1)
Accept data for a six second period.
2) Accept data; wait for six seconds; store it in "data"
3) Accept data; wait for nine seconds.
4) Accept data; wait tor two seconds; store it in "fast"
SEE ALSO
rp - rational pilot
-6-
print (1)
4/6/83
print (1)
NAME
print - prints files
SYNTAX
print file1 file2 •••
print [-N] [-IN] [-wN]
DESCRIPTION
Print produces output suitable for redirection to a printer. It
also produces a heading at the top of each page~ including the
file name and the page number of the file.
The following flags may also be used:
-N
Causes column N to be printed.
-IN
Print N lines per page.
-wN
Print page N columns wide.
EXAMPLE
To print a file:
print file
or to print with flag values:
print -4 -1188 -w132 file
SEE ALSO
lpr (1)
-1-
ps (1)
4/6/83
ps (1)
NAME
ps - process status
SYNTAX
ps Lalx]
DESCRIPTION
Ps prints information about processes currently running
system.
Any
on
the
user
is allowed to know the command name other users are
The actual data ~ing proces$ed is not a matter of
public record, however.
running~
Ps can be very
terminating them.
useful
in tracking down errant processes and
Options:
a
All. Print information about
a terminal.
1
Long format. Print detailed information on each process.
x
Print information about all processes not associated with a
terminal.
The following is
output from ps.
al1.-proces~es
associated
with
a description of each possible column in the
STATE represents the current state of the program. It is the
first column in the long format report, with the appropriate
flags arranged in these positions: AlAwLdSwLkSy. The meaning of
the flags is as follows.
Al Alive. The process has not yet terminated. It may be awake
(running without waiting tor input) or asleep (waiting
for- input from, say, a terminal or disk drive).
Aw Awake. The process is not waiting for a slow event and may
. be_ run immediately. The absence of this flag with an
alive process indicates that it is asleep.
Ld Loaded. The process has been loaded into memory.
Lk Locked. The image of this process is currently locked in
main memory, that is, it can't be swapped out to disk to
make room for other processes.
Sw Swapped. The image of this process currently resides on
the swap device. Micronix decides what to swap on the
basis of how often a process is called.
Sy System. This process has made a system call and is waiting
-1-
4/6/83
ps (1)
ps (1)
for the results.
UID
PID
PPID
User ID number. Number identifying the
process.
user
the
Process ID. The identifying number of the process.
Parent's
process.
process ID. The identifying number of the parent
CPU
The CPU priority of the process.
PRI
The run-time priority of the process.
NICE
The user settable priority of the process.
WCHAN The address
sleeping.
TTY
running
of
the
event·
on
which
this
process
is
The name of the controlling tty for this process.
COMMAND .The name of the command. (Usually a close approximation
of what was entered from the keyboard.)
EXAMPLE
To kill your runaway process from another terminal:
1)
Log in.
2)
Type "ps".
3)
Locate the process of interest in the resulting printout.
4)
Type "kill process-ID-number"; ex: "kill 7"
Another route to the same destination is to log into superuser mode
(assuming you have such priveleges) using the su command. Superuser
mode allows you to kill any process in the system t unlike the above
sequence t whicn only allows you to kill your own processes. Use the a
flag in this case to see all processes.
SEE ALSO
sh(l), signal(2)
-2-
ptc (1)
ptc (1)
4/6/83
NAME
ptc - Pascal to C translator
SYNTAX
ptc - [flags] .
DESCRIPTION
Ptc is a program that accepts as input lines of Pascal text and
produces as output a corresponding C'program which is acceptable
to the Whitesmiths, Ltd. C compiler. If is present, it is
taken as the Pascal program to translate; otherwise input is
taken from STDIN.
The flags are:
-c
Pass comments through to the C program.
-f
Set the precision for reals to
Default ds double •
. -k
-mil
single
precision
(float).
Perm,it pointer types to be defin:ed using type identifiers
from outer blocks. Default is ISO standard, i.e., the type
pointed to must be defined in the same. type declaration as
the pointer type definition.
Make II the riumber of bits in MAXINT' excluding the sign bit,
e.g., MAXINT becomes 32767 for -mIS, 1 for'-m, etc. Default
for MAXINT is 32766 [sic]. Acceptable values for /I are in
the range [0, 32).
-0* Write the C program to the file * and diagnostics to
STDOUT. Default is STDOUT for the C program and STDERR
diagnostics.
for
-r
Turn off runtime array bounds checks.
-s#
Make # the number of bits in the maximum allowable set
size, i.e., the size of all sets whose base type is integer
becomes the specified power of two. Acceptable values are
in the range [0, 32). Default is 8 (256 elements).
The CP/M operating system implementation on the Intel 8080 and
Zilog Z80 restricts the acceptable value for n to the range [0,
16];
for maximum portability, this restriction should be
honored.
Identifiers are mapped to uppercase to keep from conflicting
with those declared as reserved words in C. Moreover, structure
declarations 'may be produced that contain conflicting field
declarations; and declarations are present for library functions
that may not be needed. All of these pecadillos are forgiven by
the use of appropriate C compiler options.
-1-
4/6/83
ptc (1)
ptc (1)
RETURNS
Ptc returns success if it produces no diagnostics.
SEE ALSO
cc (1), as (1), cp1 (1), cp2 (1), cpp (1)
NOTE: This program
Whitesmiths, Ltd.,
and
documentation
-2-
are
products
of
pwd (1)
4/6/83
pwd (1)
NAME
pwd - present working directory
SYNTAX
pwd
DESciUPTION
Pwd finds and displays the full path
directory under which it is executed.
-1-
name
of the working
4/6/83
ratfor (1)
ratfor (1)
NAME
ratfor - ratfor-to-FORTRAN translator
SYNTAX
ratfor
DESCRIPTION
The Ratfor preprocessor for FORTRAN enables you to write in a
the free-form structured language, Ratfor, then compile your
programs
with
your
existing
FORTRAN
compiler.
This
implementation incorporates include and macro capabilities.
Ratfor reads from the stan4ard input and writes to the standard
output. It may be used as a fil~er.
Lines of the form:
include file
are replaced by the contents of the named file. Includes may be
nested.
Note
that some implementations include the file
"file.rat". In this implementation, the file must be named
explicitly.
Macro definitions such as:
define(token,string)
or
define(token, ••• $1 ••• $2 ••• $3 ••• )
may appear. The left parenthesis must follow the word define
immediately. In the first case, string is merely substituted for
token ever,ywhere it appears. In th~ second, occurrences of the
form:
token(arga,argb,argc)
are repla_ced by the defining string, but with the values
supstituted for the arguments. The construction $n, where n is a
decimal digit, signifies the nth argument. A given macro may
have at most nine arguments. Macro definitions may be recursive.
Any valid FORTRAN statement is a valid ratfor statement. A
statement or group of statements may be enclosed in curly
brackets It{It and It}". The result is treated as a single
statement. In addition to standard FORTRAN, the following are
understood:
-1-
4/6/83
ratfor (1)
ratfor (1)
if (condition) statement;
The statement is executed if the condition is true.
if (condition) statement; else statement;
If the condition is true, the first statement is executed,
otherwise the second statement is executed. An else go~s
with the last un-elsed if.
while (condition) statement;
The statement is executed repeatedly as long as the
condition remains t'rue (possibly zero times
as
the
condition
is
always tested before the statement is
executed.) The condition may not be left out. For an,
infinite loop, see repeat below.
for (statement; condition; statement) statement;
First, the first statement is executed. Then repeatedly the
condition is tested, and if true, the last statement is
executed, then the second~ If the condition is false, the
loop is br9ken and control proceeds to the next statement
following the for. More clearly: the first statement is the
initializer of the loop, the second is the incrementation,
and the last is the,body of the looV.
repeat statement;
The statement is executed repeatedly.
repeat statement; until (condition);
The statement is executed repeatedly until the condition is
true. The condition is always tested after the statement is
executed, which is to say, the statement will always be
executed at least once.
do limits; statement;
A FORTRAN do loop is set up with the specified limits and
the- statement as the body of the loop. You are relieved of
the burden of dealing with the continue statement and its
statement number.
-2-
4/6/83
ratfor (1)
rattor (1)
number statement;
Statements may be numbered. Numbers may comprise at most
five digits. You need not worry about where on the line the
number appears.
break;
One level of while, for, repeat, or do loop is
of.
broken
out
next;
Tr~nsfers control to the looping mechanism of the innermost
while, for, repeat, or do in which it occurs.
The following abbreviations may be used:
)
)=
<
<=
==
1=
.... =
&
I
.gt.
.ge.
.It.
.le.
.eq.
.ne.
.ne.
.not.
.not.
.and.
.or.
greater than
greater than or equal
less than
less than or equal
equal
not equal
not equal
logical negation
logical negation
logical and
logical or
EXAMPLE
To compile a Ratfor program using Microsoft FORTRAN:
ratfor & I ' II ( ) .
When encountered, they are treated as separated entities,
regardless of the presence or absence of surrounding white
space.
Shell Features:
Command Execution.
The
first
word of a command has special meaning for the shell.
-1-
4/6/83
sh (1)
sh (1)
It expects this word to be the "command name". Wh.en .it
encounters a word which it does not recognize, the shell assumes
it .refers to a program, whic.Q it then attempts to find and
execute.
Path Searching.
If it fails to find the command, it prints an error message. The
shell searches for commands in a series of pre-specified
directories called the "search path". The default search path is
".", "/bin", "/usr/bin". The shell's current idea of the-search
path may be examined or changed by the built-in "path" command
discussed below. If the first word of a command contains a /
(slash) character, then the normal path searching mechanism is
disabled and the shell attempts to execute the exact name
specified.
Directory Bashing.
The shell internalizes the contents of the directories in the
search path, so that in order to locate a command, it does not
need to refer to the file system. This function is intended to
be transparent. If, however, a program is added or removed to
one of the directories in the search path in the middle of a
session, (normally a very rare occurrence) the shell's internal
tables will disagree. In this case it may be necessary to enter
the command's name twice, (causing the shell to remake its
internal tables). There is a significant speed payoff to this
way of doing things.
I/O Redirection
There is the concept
standard error.
of standard input, standard output, and
An accepted way to fashion programs is to have
them read from
the standard input, write to the standard output, and send error
or other transient messages to the standard error.
By default, each process is set up so that its standard input is
read from the controlling terminal and standard output and error
are written to the terminal. The shell has provision to change
this. You may arrange to have input and/or output
read
from/written to files or other processes instead. In the
following example, the command is read from the file.
command
< file
-2-
4/6/83
sh (1)
sh (1)
Input Redirection.
Arrangements may also be made so
input becomes the file:
that
the
command's
standard
command > file_
command »
file
command )& file
command »& file
Output Redirection.
In the first form, (», the command's standard output is sent to
the named file, destroying its previous contents. The second
form, <»), appends the command's output to the end of the named
file. In the third form, ()&), both the standard output and the
standard error are sent to the named file. The last form is the
same as the third, 'except the option is appended to the end of
the named file.
An expression of the form "(a> b) >& c" can be used to split
the output f'romthe command a, standard output to file b,
standard error to file c.
Pipes.
Commands may be piped together, that is, the standard output of
one process can be "connected" to the standard input of another.
The processes are run concurrently. A "\11 (vertical bar) is the
symbol denoting a pipe. The following command line
print file
I
lpr,
would send the output of the print command to the input of the
lpr command.
The shell ~~ its own syntax
limited in length only by
processes. As an example:
cat file
comm1
I
find word1
c0mm2
I
comm3
I
find word2
I
c0mm5
a linear array of pipes,
maximum available number of
for
the
I
I •••
words
etc.
Asynchronous Commands.
It is possible- to run a command asynchronously, or in the
background. Normally, a command is run and the shell waits for
it to finish before prompting for additional input. When a
-3-
sh (1)
4/6/83
sh (1)
colDIIland is run asynchronously, however, the s.hell does not wait,
but .);eturns immediately, while the co_and continues "to execute
parallel to the shell. With this facility, a single user on a
single terminal can be doing several things at once. A pipeline
followed by an ampersand on the command line causes al~ of the
processes, in the pipeline to be run asynchronously. When an
asynchronous command completes or is abnormally terminated, ., the
shell gives notification. The process ID is given when the
asynchronous process is dispatched.
Example:
Is -1&
Argument Expansion.
All words in the command line are subj~ct to
are expanded with the following ,characters:
expansion.
Words
If a word contains any of these constructions, it is evaluated
as a pattern to be matched against the set of extant file names.
That is, the given word will be replaced by the list of all file
names it matches.
Following are the rules for pattern matching.
*
This character is "wild card lf oJ sorts, matching any number
of characters, and any character, including zero.
?
Matches any single character.
...
[
x
]
...... ]
Matches any single character
brackets.
Matches
brackets.
Ordin~ry
any
single
listed
character
NOT
within
the
within
the
characters match themselves.
Matching patterns may be composed of arbitrary
the above constructs.
arrangements
of
If a string of characters is enclosed in quotation marks (If),
all argument expansion is disabled.
-4-
sh (I),
4/6/83
sh (I)
If ~'$tr~~g of characters is enclosed in grave accents ('), that
stOring is interrupted -as -a -corinnand~'--execuied--and"-r~placed by ene
output of the command and broken'into words.
Within braces'(lJ) there may appear expressions of the form X-Y,
meaning that all of the characters between X and Yare
inclusive.
Example:
[A-Za-z)
would match any single upper or lower case letter.
Grouping of Commands
Commands
may
be
grouped
together arbitrarily by using
parenthesis. When enclosed in parentheses, any arbitrary command
or series of commands is treated as a simple command.
Example:
(cd a; comm1)
I
(cd b; comm2)
would. run the first part of the pipeline in
the second in directory "b".
directory
"a"
and
Parenthetical expressions may be nested. There are limits on the
maximum number of- processes allowed, however.
To run a series of commands in the background, for example;
(comm1; comm2; comm3)&
Sequential Execution Operator
More than one command may be put on a line by separating the
command with semicolons (;)
Example
command1; command2
The commands are executed sequentially in the order given
to right).
-5-
(left
sh (1)
sh (1)
4/6/83
Built-In Commands
There are a number of commands internal to the shell:
alias
alias name1 name2
alias name3 "a complex command with embedded spaces"
Aliasing
provides
the
facility
to
rename
or develop
abbreviations for commands. The first form prints the current
list of aliases in effect. The others introduce a new alias.
After these alias commands have been typed to the shell, giving
the command "name1" _will result in issuing the command name2.
That is to say the right hand word or group of words is
substituted for the left. Use unalias (see below) to turn off an
alias.
How to use alias:
If you find you frequently type a long and cumbersome command,
you should consider setting up an alias for it.
Some often-used commands are:
far Idev/fla -xv
mount Idev/dja If
umount /dev/dja
To set up alias, edit the .sh file in your home directory (the
directory in which you find yourself when you first log in). Add
lines like the following:
alias x "far Idev/dja -xv"
alias m IIBlOunt Idev/dja If"
alias u lIumount Idev/dja"
Next
time
you log in, all of these "aliases" will be
automatically set in the shell. You may type just the one letter
abbreviation for the long command.
You may view the alias table by typing "alias".
eliminated with unalias.
An "alias"
is
Note that this feature may also be used to smooth over trivial
name differences found in different systems. If you are used to
typing something else for one of the commands, make yourself an
"alias."
-6-
sh (1)
4/6/83
sh (1)
cbdir (cd)
chdir name
These change the current directory. Micronix maintains the
concept of a current directory. The first form changes the
current directory to the home directory (described below). The
second form changes to the named directory. The command, cd is
synonymous to cbdir, and is easier to type.
dir
dir name
dir names
The "dir" is short for "directory". The first form list the
files in t.he current directory. The second lists the files in
the directory, "name". The third prints the list of names. All
forms print th~ir display in an easily read, alphabetized and
columnar form.
echo
echo args
The first command toggles the shell's command
The second prints the arguments.
echoing
feature.
home
home name
These commands
form prints the
name.
examine or change the home directory. The first
shell's currently remembered home directory
prompt word
This command changes the sbell's prompt. The prompt is changed
to the given word. The default prompt is % or #j the # prompt
indicates super-user.
source file
The shell takes its next input from the named file instead of
the standard input. Input is again taken from standard input
upon reaching the end of the file. A "source" may be nested,
that is, a named file may contain another source command.
-7-
sh (1)
4/6/83
sh (1)
sync
This command calls the sync system
call
(mass
storage
synchronization, see Section 2). It insures that all information
destined for mass storage devices is actually written out. Sync
should always be called before bringing the system down to
insure the integrity of the file system(s).
type file(s)
The contents of each of the named files are printed verbatim on
the standard output.
unalias name
The given name is removed from the alias table.
wait
This command causes a wait until all all asynchronous processes
(if any) have completed. Wait may be prematurely interrupted by
pressing the RUB-OUT ior DELETE key.
-8-
sort (1)-
4/6/83
sort (1)
NAME
sort - sort text files
SYNTAX
sort [-bdfnrutxl [+column] [-0 output] [input ••• ]
DESCRIPTION
All of the named input files are sorted together.
If no input file names are given, then the- standard
instead.
input
is
used
The result is written to the standard output unless an output file
name is given (with the -0 option).
The default sorting key is the entire line.
Ordering is lexicographic, by bytes, in machine collating sequence.
The following optional flags may be used to influence the sorting.
+N
Sort by the Nth column over trom the left.
column O.
-b
Ignore leading blanks
-d
Dictionary order, only letters, digits and blanks are
significant in comparisons.
-f
Ignore case in comparisons.
-i
Ignore non-ascii characters.
-n
Sort by integral
numerical value.
-0
(spac~s
number.
Default
and tabs) in comparisons.
Fields
are
ordered
file Send the output to the named file "sort file
w_ill work.
-r
Reverse. Sort backwards.
-tx
Tab character is set to the character x.
'-' options listed above may be combined.
That is
sort -b -d -f -i
is the same as
-1-
is
-0
by
file"
sort (1)
4/6/83
sort (1)
sort -bdfi
Sort can be used on arbitrarily large files. It is limited
by the amount of temporary file space it can consume.
EXAMPLES
A simple example, to see what a file looks like once sorted:
sort file
To sort by the second column:
sort +1 file
To sort a list of numbers:
sort -n file
To sort a file in place:
sort file
-0
file
To sort the password file by numerical user id
sort +2 -t: -n /etc/passwd
SEE ALSO
unique (1)
-2-
only
4/6/83
split (1)
split (1)
NAME
split -' split a file into pieces
SYNTAX
split [-n] [input] [proto]
'DESCRIPTION
Split reads
pieces.
in
the
given
file
and writes it out again in n-line
The input file remains unchanged. It is only read, not written.
If no file names are given or - is given as the input file
standard input is read.
name
the
If no prototype file name is given, the proto·type file name "x" is
used. The prototype file name is used to generate a.whole series of
automatically generated serialized file names. The serialized file
names are produced from the prototype file name by adding a two
letter suffix. The first two letter suffix used is "aa". The second
is "ab", etc.
If no numerical argument preceded by a minus sign
will be split into 1000 line pieces.
appears
the
file
An argument such as -78 requests the individual files each containing
78 lines be produced.
Split produces meaningf~l re~ults only if used on a text file. Line
counting will be incorrect if applied to files having lines longer
than 512 characters.
Spli t is useful if, fO'r example, you have a file far too large for
your text editor to process. One could then theoretically split the
file, edit the pieces, and then reconstruct the file. An example of
this appears below.
EXAMPLES
Consider the command:
split file
If file is a 7000 line file, the seven files:
xaa xab xac xad xae xae xaf
will be produced, each having 1000 lines.
The command:
split -57 znorg OUT
-1-
4/6/83
split (1)
split (1)
would split the file nznorg'· into possibly many
lines each named:
small
files
of
57
OUTaa OUTab OUTac OUTad OUTae OUTaf
etc. This example also
Micronix file names.
demonstrates
the significance of case for
Split can be used in a pipeline:
man edit
I
split -100
This command would cause the formatted documentation for
command to be written into a series of small files.
the
"edit"
No input or source file name was given so the standard input is read
(through a pipe). Pipes are discussed under the documentation for
"sh" in section I of the Micronix reference manual.
No prototype file name is given here, so "x" is assumed. The files
produces would be named:
xaa xab xac etc.
One way to edit an outrageous file:
split -500 file
edit x*
cat x*
> file
The first command in this example splits the file into 500 line
pieces. The second line summons the editor to work on the pieces. The
third line restores the orignal file. (Make sure you have no other
files whose names begin with x in your directory for this example.)
-2-
stty (1)
4/6/83
stty (1)
NAME
stty - set typewriter (t_erminal) options
SYNTAX
stty [option ••• ]
DESCRIPTION
Stty sets certain I/O options on the current output typewriter.
With no arguments t it reports the current settings of the
options which differ from the default settings.
The following are
raw
op~ions:
Raw mode input (no erase t
parity bitt passed).
kill t
interruptt
quit t
EOT,
-raw Negate raw mode.
cooked
Same as -raw; default is cooked mode.
-nl
Allow
carriage return for new-line, and output CR-LF for
carriage return or new-line; default is -nl mode.
nl
Accept only new-line to end lines.
echo Echo back every
default.
character
typed;
echo
is
asserted
by
-echo
Do not echo characters.
lcase
Map upper case to lower case.
-lcase
Do not map case; default.
-tabs
Replace tabs by spaces when printing; default.
.-
tabs Preserve tabs.
erase
Set erase character to "c";
backspace character is "H" (AH).
kill c
Set kill character to "c"; default kill
delete character is "X" (AX).
-1-
default erase or
or
line
stty (1)
4/6/83
shake
Do hardware
(RS232 CTS) pin.
-shake
No handshaking; hardware handshaking
default.
stty (1)
handshaking using the clear-to-send
is
Baud Rates: 50 75 110 134 150 200 300 600
1200 1800 2400 4HOO 9600 19200
Set typewriter baud rate to number given, if possible.
Micronix presently has no built-in delays.
SEE ALSO
stty (2)
-2-
off
be
su (1)
4/6/83
su (1)
NAME
su - set user identification
SYNTAX
su [name]
DESCRIPTION
Su allows you to change your effective user ID in midstream, so
to speak.
The most common use of this program is to temporarily become a
super-user in order to install a program, change a syste~wide
file, kill off an errant process or other administrative task.
If no name is given, "root" is the default. This puts you in
super-user mode. If "root" has a password, non super-users will
receive a password prompt.
Another use for su is to grab someone else's terminal without"
the delays of logging them out, logging yourself in, and so on.
Any time enter su with a password-protected name, you will
receive a password prompt.
EXAMPLE
su - to enter super-user mode.
NOTE:
Since the super-user has powers that are beyond the reach of
normal users, "root" should definitely be password-protected.
Use super-user with caution and only when necessary. System
defenses that prevent you from making catastrophic mistakes are
suppressed in" super-user mode.
SEE ALSO
passwd (1)
-1-
sum (1)
4/6/83
sum (1)
NAME
sum - compute check sums
SYNTAX
sum [-r] [files]
DESCRIPTION
Sum computes and prints a check sum and block count for each
named file. (Blocks are 512 bytes long.) If no file names are
given, it computes a check sum for the standard input.
If the -r option is used, sum recursively descends the file
hierarchy, summing each file as it goes. In recursive mode,
special files and directories are not summed.
As an example, check sums can be used to verify the integrity of
a file over the phone. Sums are in the range 0 to 65,535. If two
files have identical check sums, it is quite likely that they
are identical.
-1-
tail (1)
4/6/83
tail (1)
tail'- prints the last few lines of a file
SYNTAX
tail [-N] [file]
DESCRIPTION
Tail, prints the last n lines (default = 10) of the named file.
If no file is given, the lastn lines before the first
end-of-file encountered on the standard input are printed.
br
-
BUGS
Tail reads the entire file in order to obtain the last few
lines. If n is too large, tail will fail since it stores the
text of lines in memory.
-1-
td (1)
td (1)
4/6/83
NAME
td - tree dump (file backup)
SYNTAX
td [-a] [-dN] [-hN] [-i] [-u]
DESCRIPTION
Td is your primary tool for routine backing up of fi.les. You can
select the whole file system (not the normal procedure) or
certain parts of it. You can also do incremental dumps, which
means copy only those files that have been cha~g~d since the
last td. Incremental dumps are standard procedure in proper
system management. Micronix maintains a "dump table" that keeps
track of what was dumped when.
Files dumped with td are usually placed on floppy diskettes, but
you can dump to hard disks just as well.
It does.n't matter if your dump won't all fit on one diskette; td
allows you to chapge diskettes on the fly. Each dislt is filled
to capacity, then the program asks for operator service. In this
sense it does need a bit of babysitting.
Before beginning a major dump, you should have a stack of
formatted diskettes (see program fdj ). These diskettes must be
pre-formatted but they need not contain file syst"~ms. Td will
notice that a diskette has no file system and ask you if it
should-make one. It will then call the mkfs program for you.
Unlike some other back-up systems, this program's back-ups are
in file system for~, meaning it is easy to look through a dump
with the mount/dir, ncheck, or Is -R commands.
Td is a hybrid, in that some options must be entered on the
command line while others are handled interactively.
Command Line Options:
-a
All. Dump all files. Without this flag,
1000 blocks long are dumped.
-dN
Day. Dump only files newer than N days old. Avoid using
this flag along with the incremental option, because the
results depend on when the last incremental dump was
performed, which gets confusing. Use the d and h options
only when you mean "Copy all of the files changed since
this many days/hours ago, regardless of whether they were
dumped before or since then."
-hN
Hour. Dump only files newer than N hours old. Note: The -d
and -h options are additive.
-1-
only
files
under
td (1)
-i
4/6/83
td (1)
Incremental. This flag, whe-nu~ed withou~ _,the "u" opt.tqn
(see below), copies the files that have been changed since
the last incremental dump WITHOUT updating the dump table.
Therefore you could perform another incremental dump later
and even if the files remain unchanged in the meantime,
they'll s-till be included in the dump.
NOTE: If you want this incremental-without-update to take
effect, respond F (for full) at the interactive "full or
incremental" prompt.
-u
Update the central dump table at the conclusion of
a successful dump. Be aware that using -iu has the same
effect as using neither option, and responding I (for
incremental) at the "full or incremental" prompt.
Update~
Interactive Options
Source Directory: Respond the pathname of the directory you want
the dump to start at. The dUmp will follow downward through
all of the subdirectories until all appropriate files have
been copied.
Dest'ination Device: Enter thepathname (I devl ••• ) 6f the floppy
or hard disk to which you are, dumping. For example, enter
Idev/f1a for an 8" floppy.
"Do
you want a full or an incremental dump (F/I)?" Respond
accordingly and press RETURN. If the
directory
you
specified as the Source above isn't in the dump table
(having never been dumped previo'usly), td defaults to a
full dump.
"Insert new media and press RETURN to 'continue or type the name
of a new deVice." Insert a formatted diskette into the
drive you designated as the Destination Device. You can use
diskettes that already have some files on them, assuming
they are in Micronix format.
Note that if you are dumping a file that has the same
pathname as one on the disket'te, the dumped one replaces
the existing one. You can use this fact to your advantage
if you 'employ one diskette over and over as the recipient
of regular incremental dumps. It will then always contain
the latest'n'greatest versions of the files in the source
directory. The danger inherent in this approach is that if
anything damages that diskette, you won't have yesterday's
or the day before's to restore from~
-2-
td (1)
td (1)
4/6/83
The "type the name of a new d.eV'ice" optio-n allows you to
switch destination devices without getting out of the td
program. Thus you could fill up a floppy on /dev/fla and
then move on to /dev/flb without getting up to swap
diskettes.
EXAMPLES
The normal case: incremental backup with update of dump
table. Dumping directory la/jane to 5 1/4" floppy drive A td
Source directory: la/jane
Destination device: /dev/mfa
••• full or incremental (F/I)? I
Incremental backup of /b/joe/ws
table on 8" floppy drive A -
WITHOUT
update of dump
td -i
Source directory: /b/joe/ws
Destination device: /dev/fla
••• full or incremetttal (F/I)? F
Backup of all the files created or modified within the past
8 hours on hard disk m16b td -h8
Source directory: /
Destination device: /dev/m16b
••• full or incremental (F/I)? F
TO EXAMINE THE CONTENTS of a 5 1/4" backup diskette: Insert
diskette into the drive, and type
mount /dev/mfa /f
cd /f
dir
(more cd's and dir's, if desired)
cd /
umount /dev/mfa
-3-
the
td (1)
4/6/83
td (1)
TO RESTORE A SINGLE FILE (e.g. /usr/bin/adventure) frOlll an 8"
backup dl$kette: Ins~rt the diskette, and type
mount /dev/fla /f
cp /f/usr/bin/adventure /usr/bin/adventur:e
umount /dev/fla
TO RESTORE AN ENTIRE DIRECTORY (say b/bi11) froa a 5 1/4" backup
diskette: Insert the diskette, and type
mount /dev/.fa /f
cptree /f/b/bill /b/bi!l
umount /dev/fla
FILES
letcldtab - the central dump table
SEE ALSO
cp (1), cptree (1), fdj (1), ,mount (1), ncheck (1), mkfs (1)
-4-
4/6/83
tee (1)
tee (1)
NAME
tee - a pipe fitting
SYNTAX
tee [-a] [-i] [file ••• ]
DESCRIPTION
Tee reads the standard input and writes it unchanged to
standard output, making copies in each of the named files.
the
Options
-a
Append. Data is appended to the end of each named file,
rather than being over-written.
-i
Ignore.
Interrupt signals are ignored.
EXAMPLE
edit
I
tee record
will keep a record of the editor's responses to commands.
-1-
touch (1)
4/6/83
touch (1)
NAME
touch - updtate the modiflcation time for a file
SYNTAX
touch file
...
DESCRIPTION
Each of the named files has it's modification time set to the
current time. This is done by reading a character from a file
and then writing it back. No file's data is changed.
EXAMPLE
touch file
-1-
4/6/83
translit (1)
translit (1)
translit - transliterates characters
SYNTAX
translit from [to]
DESCRIPTION
Translit can be used to perform a variety of useful character
mapping
functions.
Translit
modifies
its
input
on a
character-by-character basis. Translit changes each character in
its from set to the corresponding one in its to set. If there is
no to set, the effect is to remove each character found in the
from set. If the to set has fewer characters than the from set,
the last character in the to set is repeated as many times as
needed to fill out the to set.
Notation of the form x-y may be used as shorthand set notation
to mean all the characters lexically between x and y, where x
and yare letters of the same case or both digits.
If
is the
understood to
specification.
first character of the from specification, it is
mean all characters not in
the
following
Notation of the form @377 (an "at" sign followed by up to three
digits of octal) may be used to specify characters by ASCII
value.
If the from set contains fewer characters than the to set, or if
the
is used as above, the last character of the to set is
sufficiently replicated to fill the from set to the size of the
to set. Furthermore, contiguous characters which are elements of
the to set for which there is no explicit corresponding
character in the to set are collapsed to a single occurrence of
the last character in the specification for the to set.
EXAMPLES
To replace all occurrences of x by y:
translit x y output
To change x to y and y to x:
translit xy yx output
-1-
4/6/83
translit (1)
To delete all occurrences of A:
translit A output
,To map all lower case into upper case:
translit a-z A-Z output
To put one white space separated symbol per line:
translit @40@11@12 @12 out
SEE ALSO
change (1), edit (1)
NOTE
Translit is analogous to the UNIX tr program.
-2-
translit (1)
tree (1)
4/6/83
tree (1)
NAME
tree - draw a picture of the file system
SYNTAX
tree [starting_directory] [-a]
DESCRIPTION
Tree draws a picture of the file system tree structure starting
from the root directory. Optionally, a different starting
directory can be specified. Only directory names are listed,
unless the -a option is given, in which case all files are
listed.
Directories on which
are shown as empty.
the user does not have search permission
The picture is drawn on the standard output, so it ~ormally
appears on your screen, but it can also be sent to a printer·
(see below).
EXAMPLES
To see the entire accessible file system:
tree
To see Mary's directory hierarchy:
tree la/mary
To see all files in Mary's hierarchy and print the result:
tree la/mary -a I lpr
SEE ALSO
du (1), find (1)
-1-
tty (1)
4/6/83
tty (1)
NAME
tty - get terminal name
SYNTAX
tty
DESCRIPTION
Tty is' a simple program that attempts to look up ,the full path
name and number of the current "tty" device (teletypewri-ter or
terminal). Normally, this is the name of the'Micronix (terminal)
port'you-logged in on.
To ascertain your
typical response is
device
number,
enter
the
tty command. A
/dev/ttyB
meaning that you are on "ttyB".
If np associated file name can be found, the message "not a tty"
is printed instead.
FILES
/dev - Directory in which to search for file names.
-1-
umount (1)
4/6/83
umount (1)
NAME
umount - dismount a file system
SYNTAX
umount special
DESCRIPTION
The named special file is dismounted.
The special file
mount command.
must
have
been previously mounted with the
It is not permitted to dismount a file system with 'files
open. Diagnostic: "Device busy".
still
Sometimes it is necessary to use the "change directory" command
before dismounting a devi'ce'. As an example:
cd /; umount /dev/dja
EXAMPLE
umount /dev/dja
to dismount a floppy.
SEE ALSO
mount(l) - to mount file systems
-1-
unique (1)
unique (1)
4/6/83
NAME
unique - eliminate adjacent duplicate lines in an
I/O stream
SYNTAX
unique [-n]
DESCRIPTION
'Unique reads the standard input and wr~tes the standard output.
All but one of each set of adJacent· duplicate. lines are
eliminated. Otherwise, the text is copied through unchanged. If
the -n option is given, a count of the number of duplicates of
each line is printed along with the text of the line.
EXAMPLE
To eliminate all duplicate lines in a file:
sort temp .
unique output
NOTES
In order to assure adjacency,
presorted.
SEE ALSO
sort (1)
-1-
the
file
in
question
must
be
4/6/83
unrot (1)
unrot (1)
NAME
unrot - reformats lines produced by kwic
SYNTAX
unrot
DESCRIPTION
This is a special purpose program for use with kwic - the key
word in context index generator. 'Output is ass~ed to be
d'est1ned for printing on an 80 character wide device. Unrot
reads the standard input and writes the standard output. A,
dollar sign ($) is assumed to be the folding marker put in by
twic. A blank column running down the middle of the page will be
produced. To the right of the middle column will be keywords
with following context. To the left will be context preceding
the keyword in the original line.
'
EXAMPLE
To create a keyword in context index:
kwic temp1
sort temp2
unrot ~'temp2 >index
SEE ALSO
kwic (1), sort (1)
-1-
update (1)
4/6/83
update (1)
NAME
update
SYNTAX
update
DESCRIPTIQN
Upd~te
periodically
updates t,he syst,em's disks from the
in-memory c~che. It call,$ s.ync, (2) once every 30 seconds. Update
puts itself in the background and' runs silently.
Update. 'also: checks the Micronix configuration file /etc/ttys
every
30: seconds.
If
this
has' changed,it sends a
reconfiguration signal to the fnit process. This will' take care
of reseting 'baud rates, etc., as specified in .the ttys file.
The usual way to invoke update is to put the command
update
in the /etc/rc file (see rc in section 5). This will start the
update process every time the system goes multi .... user. The
advantages of running update are (1) less chance of data loss
during a crash, and (2) automatic reconfiguration when the t~ys
file is changed. The disadvantage is that update uses memory
space, and may cause swapping every 30 seconds if there is not
enough memory for all active tasks. This can be cured by adding
more memory, or not running update. This is not as serious as it
sounds, since both sh and upm call sync at the end of each
command, and reconfiguration can always be forced by ty~ng the
command
II kill -1 1
SEE ALSO
init (1), ttys (5)
-1-
upm (1)
upm (1)
10/17/83
NAME
upm- - CP/M -2-.2-- for -Mic-rel'l=ixSYNTAX
upm [upm arguments] [cpm program] [program arguments]
DESCRIPTION
Upm duplicates as closely as possible Digital Research's CP/M
2.2 operating system. It is essentially a r~write of CP/M using
Micronix system calls. It allows CP/M tools (such as "WordStar")
and Micronix tools (such as "edit") to be used interchangably on
the same files. Moreover, since Micronix runs on a Z-80, upm
need not emulate an 8080. All CPM programs run at full speed.
(The name "up-in" was coined from the words UNIX and CP/M.)
This is a long document (about 20 pages) • Its sections-, in order
of appearance, are:
Overview
Getting Started
Running Modes
Drive-Directory Correspondence
Entering Upm
Customizing the Environment
Auto Entry
Terminal Emulation
Printers
Printer Handshaking
Policing the Printer
System-Wide LST Device
Select Errors
File Names
Bios Jump Table
Built-In Commands
Control Characters
Submit Files
Test Files
Upm and the Background
Trace Mode
Exiting Upm
Bugs
Overview
Upm provides a close functional replica of the environment which
applications programs written to run under CP/M expect. Most
CP/M programs (such as Micropro's WordStar word processing
program) will run unchanged under upm.
The intended purpose of upm is to bridge the gap between
multi-user UNIX and the large amount of special-purpose software
available for the CP/M operating system
giving
true
multi-user function for CPM software, and making up for the lack
of some of these applications running directly under UNIX.
There is no significant difference between the way application
programs are run under upm and the way they are run under CP/M.
All documentation for these programs is valid. (However, some
CPM documentation is oriented toward floppy disks. It may
contain such phrases as "insert the working diskette into drive
A". With Micronix, just as with a hard-disk CPM system, the user
must realize that no insertion is needed.)
-1-
upm (1)
upm (1)
10/17/83
Upm is intended to be a means whereby applications software
written f~()-r CplM may be -run ullc-hanged~d:i=r:ee.tJ.y-:nnd~r ~1cronix:~~.
Under Micronix there are no records. no extents. no disk drives
in the CP/M sense. no file control blocks (FCBs). disk parameter
blocks (DPBs), allocation vectors, etc., but upm does a good job
of pulling the wool over the eyes of most CP/M programs.
Some CP/M programs do not work under upm, however, because of
system dependence. For example, programs containing the 8080
instructions "in", "out", or "hIt" will not work. The instant
one of these instruceio~s is encountered, the operating system
will be notified and the offending program will be terminated.
In a multi-user system such - as ,Micronix, all access to the
hardware must be very tight~y controlled and coordinated. If the
above instructions were allowed, user programs could usurp the
operating system's control over itsresou1;'ces. If a CP/M pJ:'ogram
goes awry it will have only a local effect - the rest of the
operating system will continue running. Corrective action. if
required. can be taken from another terminal on the system. (See
the section on "exiting upm" below.)
Getting Started
Upm runs on the-Micronix operating system, whose file structure
is quite different from that of CP/M. The first thing you'll
need to do to run your CP/M package is to copy it over to
Micronix using the far (Floppy ARchiver) command. (See far in
Section 1 of the Micronix Reference Manual.) Be sure you are in
the directory that you want the programs to reside in. Insert
your CP/M floppy diskette into floppy drive A and type:
% far fla -xv
for 8" diskettes. or
% far mfa -xv
for 5 1/4"
diskettes)
diskettes.
(mfa2
for
double-sided
soft-sectored
The
far command copies all of the files on the CP/M diskette
to the Micronix file system and places them in your current
directory.
ov~r
Now, type
% upm
and you're off and running! There's still a lot more to
however, so as soon as the novelty wears off, read on.
Running Modes
-2-
learn.
upm (1)
upm (1)
10/17/83
Upm has two modes: DIRECT and INTERACTIVE. If you intend to run
only one CP/M application program, use the DIRECT mode.
If you intend to
INTERACTIVE mode.
run
a
series
of
CP/M
programs,
use
the
To enter INTERACTIVE mode, type
% upm
(You can also log in directly to upm. When used this way, upm is
called the "cpm .shell" , since it looks as though you have simply
logged onto a hard-disk CP/M system. See account in Section 1 of
the Micronix Reference Manual.)
,
To enter DIRECT mode, simply type the program name after the
shell prompt, just as though it were a Micronix program. For
example, you can enter Wordstar directly from the Micronix shell
by typing
% ws
The shell will set up the emulator for you. (Just how it is set
up is detailed below in the section on "auto entry").
You can also get into the direct mode by typing
% upm program_name
By itself, this has no advantage over the more direct approach.
But it allows you to include other arguments to upm on the
command line. This is discussed in more detail below.
Drive-Directory Correspondences
CP/M uses a "flat" directory structure, where all the files on a
disk are globbed together in a single huge directory. You can do
the same thing under Micronix if you want, but sooner or later
you will -want to take advantage of the Micronix hierarchical
directory structure to better organize your work. So to use upm
most effectively, you should understand the relationship between
CP/M drive letters and Micronix directories.
CP/M organizes its information by drive letter (A: - P:). Since
the corresponding structure in Micronix is the directory, upm
maintains a table of CP/M drive letters and the names of the
Micronix directories to which they correspond.
The
special
command
"=" displays
relationships currently in effect.
For example,
-3-
the
drive-directory
upm (1)
10/17/83
upm (1)
A>=
A: -) /cpm
B: -) ./
tells you that the A drive corresponds to the directory /epm,
and the B drive corresponds to the directory "./" (the current
directory). (If these directory names seem mysterious, type the
command "help pathnames".)
You may change the drive designation pointers with a command
the form:
of
B:dirname
wherein B may be' re,placed by any of the letters A through P, and
dirname (directory name) must contain at least one slant
cha:racter ' (" /"). Upm recognizes a directo'ry name by the presence
of at least one "/". If the directory name doesn't already
contain a slant, you can alwaYS add one by putting a ./ at the
beginning. As an example:
If you want to set drive B to th,e subdirectory called "letters",
type
A> B:./letters
Remember that "./letters" means "start in the current directory
(.) and look in the subdirectory (/) called letters." (If you
had typed B:letters, it would have looked like a request to
execute a program called letters from drive B.)
Entering upm
Perhaps it would help to understand this idea of drive-directory
designations if we walk through some typical examples of
entering upm.
Typing
% upm
returns
Morrow Designs upm
N Bytes free
A: -) ./
A>
-4-
upm (1)
10/17/83
upm (1)
Now drive Acorre~ponds tQ the current directory (./).
may now -re-des-ignate this "driven and/or designate others.
You
One common setup is to address the directory /cpm (where many of
the CP/M application progr~s live) as drive At and the user's
current directory as drive B.
A> a:/cpm
A> b:./
returns
A:
->
/cpm
B: -) ./
The above display is automatic.
It is also possible
to
request a display of the Mj.cronix-upm relationship by entering
an equal (=) sign after the A> prompt.
Customizing the environment
Drive designation modifiers may 'be used as commands to upm (in
INTERACTIVE mode), on the command line, or in a upm "startup"
file called ".upm".
Upm can be customized to come up, in any configuration you
choose. There are three places upm takes its configuration
information from (in order of appearance):
1)
In the .upm file in the current
home directory.
2)
The command line (entered to the right of the word "upm").
3)
Interactive commands (only in INTERACTIVE mode, of course).
example
follows:
An
of
directory
or
the
user's
drive-directory designators on the command line
% upm_ a:/cpm
b:./
b:
a:ws
This means: run upm, set drive A to the Micronix directory
"/cpm", set drive B to the directory "./" (your current
directory), select drive B as the "current drive", then run ws
from the A drive.
The order of events from the time upm is called is as follows:
1)
attempt is made to read the .upm startup file in the
current directory. If this fails, an attempt is made to
read this file in the user's home directory. The .upm
startup file may contain drive designators, drive select
commands, a LST: redirection command, a CP/M program name
An
-5-
upm (1)
upm (1)
10/17/83
and argumen~s. The CP/M _program may be given as a Micronlx
file name OR a CP/M program-name. '"The- -couatins -found :tri' 'the
.upm file are executed in the order they appear.
o
2)
The command line is scanned for drive designators, drive
select commands, a LST: redirection command and a CP/M
program name and its arguments (if any). The commands found
on the comma~d line are executed in the order they appear.
(Drive selection occurs first; program execution second).
If both a startup file (i.e., .upm) and command line
arguments are present, the arguments take precedence. If
two .upm files have been set up, the one in the current
directory takes precedence over the one in the hoae
directory.
So, for example, if a .upm file' sets drive B: to one
directory and a 'command line argument sets i,t to another,
the command line will win. This: lets you selectively
override your standard settings.
3)
A choice is made. If no CP/M program name was specified on
the command line or in the startup file, upm goes into
INTERACTIVE mod'e and gives a CP/M prompt (e.g. "A)"). if a
pro'gram was specified, that program is immediately run. '
The features described above may be used to customize upm, and
can be used to 'advantage in conjunction with shell startup
files. Some examples follow.
A possible .upm file might contain:
A:/cpm
B: ./
LST:/dev/ttyC,1200
B:
Which means:
Make CP/M drive A refer to Micronix directory "/cpm".
Make -CP/M drive B refer to Micronix directory
current directory).
".1"
(your
Arrange to have printed output sent to ttyC at 1200 baud.
Select drive B.
With
the
preceeding
.upm
fil~
in
existence,
you need only type "upm", and the .upm file will be scanned and
everything will be set up as described.
This spares you the hassle of repeatedly
designation commands each time you enterupm.
-6-
typing
in
drive
10/17/83
upm (1)
It's also possible
line. Conside-r:
% upm
a:/cpm
upm (1)
to specify more information on the command
b:./
lst:output
b:
a:ws document
This command tells the system to:
1) Start upm.
2) Set drive A to /cpm
3) Set drive B to ./
4) Arrange to have printed output written onto
"output" on the currently logged drive.
5) Select drive B
6) Run WordStar
7) Pass the' argument "document" to WordStar
the
file
Admittedly, it would 'be a bit cumbersome to type this entire
command every time. Instead, you could use the alias command to
make a "shorthand" command line.
Simply create a shell startup file named ".sh" in your home
directory containing (amoung other things):
alias ws "upm a:/cpm b:./ lst:output b: a:ws"
The shell (command interpreter) will read this
you log in.
file
each
time
When you want to run WordStar, type:
% ws document
and the above command is run for you.
Auto Entry
As mentioned above, it is often enough to type the name of a CPM
program after the shell prompt. Here is what happens when you'
type
% prog
1.
The shell looks through each directory in its "search path"
(see below) for a command called "prog". If found, it is
run.
2.
If not found, the shell appends ".com" to the name, getting
"prog.com", and looks for that file.
3.
If prog.com is found, the shell sets up upm as follows:
drive A is set to the directory in which the file was
found. Drive B is set to the user's current directory.
-7-
upm (1)
10/17/83
upm (1)
Dri ve B is selec:ted as the current drive.
Gommand -i-s exeeuted -from the A drive.
Finally,
the
So for example, suppose that "ws.com" is in the directory /cpm.
If you type
% ws document
then the shell silently expands this into
% upm
a:/cpm
b:./
b:
a:ws
document
and runs it.
If you get the response "command not found", then the file
ws.com was not in the shell's search path, that is, ws.com was
not in your current directory or in any of the directories where
the shell ordina~ily looks for c.ommands. To remedy this, you
could give the command
% path.
/bin /usr/bin
/cpm
This tells the shell to look first in "." (your current
directory), then in "/bin", then in "/usr/bin", and finally in
"/cpm". Better still, put this command in your .sh file, so that
you don't have tp retype it each time you log in.
The default path, ie, the path you get if you don't say
otherwise, i s "
/bin /usr/bin". You can change this to
anything you want with the path command.
Note: The shell's automatic upm set-up does not work for all
CP/M programs. For instance, the Logicalc program lc.com insists
that it be on the "currently logged drive", (whereas WordStar
can be on either the currently logged drive or the A drive). So
the best way to run logicalc is to put the following alias in
your .sh file:
alias lc "upm
a:/cpm
b:./
lc"
Then logicalc will run happily as long as you remember that your
spreadsheet files are on your B drive.
Terminal Emulation
upm 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
-8-
upm (1)
upm (1)
10/17/83
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 I etc I terminals, 'and upm will emulate one of
the more common types of terminals for you. Then, you install
software· for the terminal th~t 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". TIle ADM-3A, the least intelligent, can clear the
screen, and ~ove the cursor. The Soroc IQ-120 represent's the'
next level. 'The Soroc can- do everything the ADM-3A can do, plus
it can display characters in high or low intensity a,nd 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.
The use of levels categorizes similar terminals in a small
number of groups. This allows the terminal emulator to translate
many different terminals' control codes into three subsets,
requiring only (at most) three different configured versions of
software. Your terminal may have many bells and whistles that
aren't included in the highest level definition, but software
writers rarely make use of unusual features when creating
software for use with general purpose terminals.
The recon program will display the terminals listed in the
letc/terminals file, and tell you which terminal upm will
emulate for your terminal selection. Install your software for
the terminal emulated. If your terminal name is not listed by
recon, you can add it by following the directions given in the
entry in the Reference Manual for Files, letc/terminals, in the
back part of this binder.
Terminal emulation is activated by adding the terminal type to a
line in the letc/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, .bd 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 by 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 that port.
-9-
upm (1)
upm (1)
10/17/83
If you examine the ttys' file aft_er ,using recon, you would, see
that -terminal -names -hav-e 1:)t~e-n added -afte-rthewotd-Uterm:l", as
in
ttyA 9600 login term=mor20
In this case, the terminal name-is mor20. If you prefer not to
use the recon program to add terminal name,s, 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
one of the abbreviated
mnemonic , names
listed
iri
the
/ etc/termi,nals file.,
Ini.tially,
the letc/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.
The .process o~. checking the Jetc/terminals and /etc/ttys files
to see if c:hanges have been made takes upm a 'noticeable amount
of time. In fact, the longer the /etc/terminals file is, the
longer it will take upm to search through it. To reduce the time
added to include terminal emulation, a special file is created
for, each login port when upm is executed. It ;upm finds this file
and neither /etc/ttys or /etc/term,inals has been modified more
rec'ently than this file" then upm uses the information in this
cache file for terminal emula.tion. 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 tile 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
/1 []
upm will change the upmttyX file if it discovers that either of
the files /etc/ttys or- /etc/terminals has been changed since the
upmttyX file was created. This means that you don't need to
sigpal a change in terminal type to upm because upm will always
check for it.
Printers
Or how to select the best way to talk to your printer.
There have to be half a dozen ways one could set
with upm.
First,
consider
your
up
a
printer
environment: Are you going to be running
-10-
upm (1)
upm (1)
10/17/83
single user all the time? Are many users going to be using
printer? Will you be printing software listings or text?
one
Next consider your requirements: Are you going to use special
forms that will be changing? Will you run many small files or a
few large ones? Do you want to allow simultaneous printer access
or lock out 'later users, returning the message "Busy"? Are you
going to print many copies of a single large file?
,
\
Let's try to sort all of this out.
Most all CP/M applications programs send their printer output to
the LST: device.
Upm can be taught to take those characters sent to the LST:
device and 40 any of a number of things with them. If you don't
tell it otherwise (the default condition), characters go into
the LST: device and appear on the controlling terminal (on your
screen). This is normally not very useful or beautiful.
The easiest way to send these characters to a printer is to:
1. Attach the printer to one of the I/O ports on the back
of the Decision, say to ttyC, and then,
2. Put the word "1st" on the ttyC line of the Micronix
configuration f~le /etc/ttys. (Also, put the baud rate on
this line.)
All this is explained in detail in the documen~s calle.d
"printers" and "ttys" (type the commands "help printers" and
"help ttys").
Once you have done this, anyone who uses upm on your system will
automatically use the same printer. BUT, this doesn't police
simultaneous access to the printer. If users are located within
shouting distance, or if it is very unlikely that two people
will ever be printing simultaneously, then this is enough.
Otherwise, read on.
You can arrange to have characters from the LST: device sent to
a file and saved up for later access. This can be useful if you
want to print something again and again, or if you want to print
later or on another machine. Entering
A>LST:file
is the command to accomplish this. Characters sent to the LST:
device are written to the file named after LST:. "File" may be
any arbitrary Micronix file name. It need not contain a slant.
(Be careful though, as any previous contents of this file will
be lost.) If the file did not previously exist, it will be
created.
Once you have saved your output in a file, you can send
the printer with the "lpr" program by typing the command
-11-
it
to
upm (1)
upm (1)
10/17/83
A>!lpr file
The exclaimation point is the way to run a Micronix command from
the CP/M environment. This will send files to the printer in
first-come-first-served order, making sure that different users
do not interfere with each other. There is more information on
this below.
You can send characters direct to a "character special file" (or
in other words to some other port).
A>LST:/dev/ttyC
channels characters coming from the LST: device to "ttyC" into
which might be plugged a printer. If you get the message "File
or,device busy", that's the case. You'll be able to a~cess the
tty as soon as whoever has it right now releases it. 'If you get
the message "Permission denied", you should get your local
super-user (possibly yourself) to execute theco1IlID1lland:
# chmod a+w /dev/ttyC
to enable writing to the device. Ttys used like this should not
be listed ,in the / etc/ ttys file as "login" ports. You need to
choose which ports you will use to log in on and which ports you
will use as printers. In addition, you can specifiy the baud
rate of your printer. (Default is whatever the device was set to
before.) It is always a good idea to specify your baud rate.
Also be sure your hardware and software baud rates agree:
A)LST: / dev It tyD, 1200
would send ',characters to ttyD at a rate of 1200 baud.
Printer Handshaking
Micronix
supports
Clear-to-Send
(CTS)
and
X-on, X-off
handshaking. If it asks (as WordStar does), you should tell 'your
CP/M program to do no handshaking, as Micronix will be handling
that end of things:-X-on, X-off handshaking is always there and
you don't have to specify it. If you don't use it, it doesn't
get in the way.
CTS handshaking, however, needs to be carefully set up. Note
that the Morrow Designs Wunderbuss I/O (found in Decision I
table top models) has CTS coming out on pin-8 of the 25-pin
connector,s. This is not standard. The CTS pin is normally
ignored. If you specify the CTS type of handshaking described
below, no data will be transmitted until the signal on pin-8 on
the Wunderbuss 10 (pin-5 on the Mult/IO) is TRUE. (See the help
files on "printers", "setup", and "cables" for details.)
The following command line
-12-
upm (1)
upm (1)
10/17/83
would send characters through the CP/M LST
9600 baud with CTS handshaking.
device
to
ttyB
at
Policing the Printer
If you want only one person to be able to access your printer at
a time, type:
# chmod u+l /dev/ttyC
(The # is a super-user shell prompt. You should log in as "root"
(the super-user) to execute this command.) This will set the
single write lock bit, after which only one user will be able to
access the printer (ttyC) at a time. Other users will get the
message "File or device busy." With the lock bit set, once a
user gains access to the printer, he will hog it until he either
A) exits from upm, or B) types the command
A> LST:
to release the printer (by re-assigning it to "nothing").
If you want many users to be able to use
(and do your own policing), type:
the
printer
at
once
# chmod u-l /dev/ttyC
to clear the lock bit. In this state, the users will have to
decide amongst themselves when to print. You'll also probably
have to move the paper to "Top of form" manually after printing.'
If two users try to print at once, the characters will be
intermingled (very ugly).
If you prefer to have software make the use decisions for you
(set up a spooling printer), use the Ipr program. It is
recommended that you prepare your printed copy by formatting it,
sending it-to an output file (as described above), then type the
command
A> !lpr file
Lpr is good at handling large printing jobs done on the same
type of paper with printers which never fail, etc. Lpr works in
a deferred bulk fashion. If you want immediacy, use the direct
tty method outlined above. See 'lpr in section 1 for more
details.)
The system-wide LST device.
It is possible to designate a particular device on the system to
-13-
upm (1)
10/17/83
upm (1)
be the recipient of all output from all instances of upm which
are send-fng chara-cter-s to their res-p'e'ct-i'veLST -:-de--\1'iees. -(:No-te
that if a user has specified a LST de,vice in his own .upm file,
it will override the system-wide LST device.)
This is accomplished by making an entry in the. letc/ttys file.
The /etc/ttys file is scanned by upm for a line containg the
word "1st". If such a line is found, then upm arranges that LST
characters will be sent to the device named by the first word on
that line.
We desperately need an example of this simple
your "/etc/ttys" file contains:
concept.
Suppose
ttyA login 9600
ttyB login 9600
ttyC 1st
1200
Any upm program run on the system will send its LST output to
ttyC as specified.
The Micronix /etc/ttys file as shipped has such an entry.
Select Errors
It is not posst-ble to get a CP/M SELECT ERROR under upm.
If you select a drive which has as
directory, upm inquires with the line
yet
no
corresponding
Select a directory for drive D:
for instance.
You should respond by typing the name of a Micronix directory
(/a/tom/letters, for example). Upm will continue badgering you
~?ti1 you do.
This feature can be used to change directories right in the
middle of a program (WordStar as a good example):
Change the logged drive to drive E: (previously undefined).
Upm will ask you for a directory name. Respond with the
name of the directory you want to refer~nce. Drive E: will
now correspond to that new directory (and you didn't have
to get out of WordStar do to it).
File Names
Upm intervenes in all file transactions originated by the CP/M
program. When the CP/M program thinks it is opening a CP/M file)
it is really opening a Micronix file. Upm handles conversion
-14-
upm (1)
upm (1)
10/17/83
back and forth between CPIM FCB's and Micronix file path names.
It maintains a table of correspondences between CpIM drives and
Micronix directories. For example) a CpIM program might read
from a file named
B:TEST.DOC
Here fiB" indic;ates CP/M drive B and tiTEST •DOC" .is the CpIM file
name. Suppose for a moment that upm is currently remembering the
correspondence
B: -) lalhubert
then the above CP/M file name would be translated to:
/a/hubert/test.doc
We see here that ":8:" got translated
TEST.DOC got translated to "test.doc".
to
"/a/hubert/" and
File Names
CpIM file names are all upper case. Upm converts these to all
lower case Micronix file names as seen in the above example.
(If a "I" appear-s in a CpIM file name) it will be converted to a
because "I" has special meaning in Micronix file names.)
"I"
It should be noted that some files may be inaccessible from upm
because they have "Cp/M impossible names". This is no great
stumbling block, however, as one can simply rename the Micronix
file(s). (See mv in Section 1 of the Micronix Reference Manual.)
For file names to be accessible from upm the rules are:
All lower case letters.
Maximum eight character filename.
Maximum three character extension (optional).
Names without an extension may be at most eight
long. and should have no final " "
No question marks (?)
character in the name.
or asterisks (*) may be used as a
Examples of valid upm accessible file names:
a.doc
z.f
example. txt
prog.c
characters
ppp
peter
-15-
upm (1)
upm (1)
10/17/83
BIOS Jump Table
Upm ,also contains a "BIOS jump table" bearing a striking
resemblance to the, original, and corresponding in function. The
two BIOS calls, "read sector" and "write sector," are considered
illegal as they have no corresponding function in the Micronix
environment. All the other'BIOS calls are allowed, however, some
are silently ignored. (See the CP/M 1.1 Operating System Manual
for more information on the CP/M BIOS.) The BIOS calls having to
do with character I/O are fully implemented. If you've never
heard of a BIOS jump table, ignore this section.'
Built-In Commands
Here is a summary of the available built-in commands under upm.
Some of these are also discussed at length elsewhere in this
document.
Note that character case is insignificant under CP/M but matters
to Micronix. In the following table, CP/M-ish things are given
in upper case; Micronix-ish things in lower case.
=
Displays drive-directory correspondences.
!command Run a Micronix command. Any valid
appear after the exclamation point.
shell
co~and
may
ERA
Erases specified files.
DIR
Displays file names in the directory.
exit
Leave upm. This is the
INTERACTIVE mode (short
another terminal).
REN
Renames a specified file. Exactly as in standard CP/M. REN
new = old.
SAVE
Save memory contents in a file.
UNIMPLEMENTED.
If you want to patch'files, see the Micronix utility
(in Section 1 of the Micronix Reference Manual).
only way to get out of upm
of killing the process from
ddt
TYPE
Types the contents of a file.
USER
Move
to
another
area
within
the same directory.
UNIMPLEMENTED.
All files are considered to be "USER 0" for the purposes
of CP/M programs. The far (1) utility can be used to
access files with any user number on a CP/M floppy.
-16-
upm (1)
upm (1)
10/17/83
A:
Select a drive.
A:/directory
Set a new drive-directory correspondence.
LST:file
Send LST: output to a file Creat- the
exist.
file
if
it
didn't
LST:tty
Send LST: directly to another tty. (X-on 'X-off handshaking
will be used by default.)
LST:tty,speed
Send LST: directly to a tty and set the speed. (Again
X-on, X-off handshaking used by default.)
LST:file,speed,cts
Send LST: output to a file and set the speed, and ·CTS
handshaking. Output is inhibited until the CTS line (pin-S
on the Wunderbuss or pin-S on the Mult/IO) is ,dri.ven TRUE.
LST: Iprogram
Send (pipe) the ;LST.: output to another program. Note that
if this' cOInmand is entered from the shell, the command
line must be in quotation marks or else the shell will
interpret the pipe incorrectly; i.e: entering.'
upm 1st: Ilpr
will be parsed into two commands by the shell. You can
convey the intended meaning by enclosing the upm LST
redirection argument in quotes, thusly:
upm "lst:llpr"
LST:
Disconnect LST:. LST: reverts to
appear on your screen).
the
default
(characters
Control characters
The control characters discussed below are effective only when
the "standard" CP/M console I/O calls are used.- They will not be
understood if the CP/M BIOS jumps or CP/M direct I/O calls are
used to generate the output or requestinput~
Ap _ printer toggle.
Normally console output is sent only to the console. If you type
AP, console output will be sent to both the LST device and the
console. If you type Ap again, console output is once again sent
only to the console.
AS - suspend console output.
-17-
upm (1)
upm (1)
10/17/83
-
-
If, while console output is occurring, a-"'S is received,'" it -is
interpreted as an instruction to temporarily suspend further
output. When in suspended mode, any character will restart the
output, except AC which will cause upm to exit immediately •
... C - abort.A "'c as the first character of an input line will cause an exit
from upm.
AR - retype current input line.
Submit files.
Standard CP/M submit file format is- implemented. IMPORTANT:
Submit file operation works only in upm's INTERACTIVE mode. From
the user's point of view, operation under upm is identical to
operation- -under CPM.
Here is the way' submit- files work internally, under both CPM and
upm. Please note that that this is OPTIONAL TECHNICAL material,
needed qnly by programers with special requirements. We repeat
it here only because it is very hard to fihd - this in- the CPM
documentation.
The submit file is named "A: $$$ ~SUB"
Upm checks for the presence of a submit file just before
issuing its prompt ( "X>" ). A submit file consists of a
series of records. Each rec-ord represents one CP/M command.
Each - record is 128 bytes in length. The records are in
reverse order within the submit file.- Last record first,
first record last, etc.
The first byte of each record gives the length of the
command line found in the following 127 bytes.
The following 127 bytes contain the CP/M command exactly as
one would enter it from the console.
Standard CP/M reduces the length of its submit file by
record upon executing each command.
one
Upm doesn't actually change the size of the file, but keeps
track of where it is.
Text Files
Herein are some practical suggestions on the handling of text
files and the successful transportation thereof between CP/M and
Micronix. Also included is a description of the differences in
their formats.
-18-
upm (1)
upm (1)
10/17/83
CP/M text files and Micronix text files are identical, except
for the following:
1.
At the end of each line. of a Mlcronix text file 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 multiple of 128 bytes.
A Micronix file's length may be any number of bytes (both
are constrained to maximum file sizes). 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 conyenient utility for converting a text file back
and forth between the two formats. (See clean in Section 1 of
the Micronix Reference ·Manual.) To make a text file suitable for
Micronix, enter:
% clean filename
To make a text file suitable for CP/M or upm, enter:
% clean -u filename
The name clean comes from the idea of cleaning out the excess
RETURN characters and . . Zcharacters at the end; "-u" stands for
"unclean".
Upm and the Background
Non-interactive CP/M programs may be run in the background. The
asm assembler is an example of a non-interactive program.
Running something in the background means you don't have to wal t
for it to finish, but are able to do something else on the
system while waiting. See also the section on background
processes in "sh" in section 1 of the Micronix reference manual.
It is also possible to run a non-interactive CP/M program in the
background_ at reduced priority so that the subjective response
time is not as adversely affected.
% asm program &
Would cause the named program's assembly proccess to
be
initiated, but you would immediately regain control of the
console. Note that this command must be issued from the shell.
% nice 5 asm program &
Would cause the same action as above but at a
level. (The default "nice" is 0.)
-19-
reduced
priority
10/17/83-
upm (1)
upm (1)
Trace Mode
Upm incorporates a trace mode for use in tracking down trouble,
or to analyze CP/M system call usage (or for any other reason
which comes up).
To run upm in "trace mode", type:
% upm -v .
(The -v stands for verbose.) Each CP/M call mad'e by the CP/M
program running under emulation will be displayed on your screen
as a single character.
Below is a
characters.
CPM call
name
RESET
CONIN
CONOUT
READER
PUNCH
LIST
DIRECTIO
GETIO
SETIO
PRINTSTRING
READBUF
CONSTAT
VERSION
DISKRESET
SELECTDISK
OPEN
CLOSE
FIRST
NEXT
DELETE
READ SEQ
WRITESEQ
MAKE
RENAME
LOGIN
CURDISK
DMA
GETADDR
PROTECT
GETRO
SETFILE
PARMS
table
CPM call
number
of
the
Upm trace
letter
0
A
1
B
3
D
.D
3
'4·
5
E
F
6
G
7
8
9
10
11
H
I
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
CP/M
J
K
L
M
N
o
P
Q
R
S
T
U
V
W
X
Y
Z
[
\
]
calls
and
the
associated
Description
system reset
console input
console output
reader input
punch output
list output
direct I/O
get I/O byte
set I/O byte
print string
read console buffer
get console status
return version number
re~et disk system
select disk
open file
close file
search for first
search for next
delete file
read sequentially
write sequentially
make file
rename file
return login vector
return current disk
setD MA address
get addr (alloc)
write protect disk
get read/only vector
set file attributes
get addr (disk parms)
-20-
upm (1)
upm (1)
10/17/83
USERCODE
~READRANDOM
WRITERANDOM
SIZE
SETRANDOM
32
33
34
35
36
a
b
c
d
e
set / get user code
read ~ra-ndomly
write randomly
compute file size
set random record
Exiting upm
You may leave INTERACTIVE mode by typing "exit" as a command.
Exit from upm's DIRECT mode occurs immediately upon completion
of the called application program.
The appearance is that the CP/M program was run directly
Micronix and then returned 'directly to Micronix.
under
If a program "bombs, freezes up, locks up, crashes," etc., what
can you do? (Sometimes you can restore control by hitting DELETE
or RUBOUT, but if you are running under upm, that will not
work.) One feature of Micronix is that a single 'crashed program
cannot bring the whole system down. The system manager can
"kill" the abberant program from another terminal. ,Here is what
the system manager should do:
Remember that each terminal 'is called tty-something, such as
ttyA, ttyB, etc. Let's say that the crashed program is running
on ttyB. Log in as "root" on another terminal, and type the
command "ps a". This will give the Process Status of tasks
running on the system. The lIa" me'ans "tell me about All the
tasks, not just the ones belonging by this terminal". A list of
tasks will appear, including those belonging to ttyB. Note the
numbers of all the tasks associated with ttyB. You want to kill
all of them (not just the ones called "upm"). Say that tasks
number 4, 6, and 7 are listed as belonging to ttyB. You should
type
11 kill 4 6 7
The # is the super-user shell prompt, not something you type.
Unless you have logged in as the super-user (who is usually
called "root") you won't be able to kill someone else's
programs. This will terminate the offending program, and will
also log the user out. The user can then log back in and
proceed.
BUGS
Here is a collation of
likely to work under upm:
all the sort of things which are not
8080 Instructions:
-21-
upm (1)
10/17/83
hIt, in,
upm (1)
o~t
Hardware specific programs:
Hard disk formatters.
Floppy disk formatters.
Modem programs.
CP/M specific programs:
MOVCPM, SYSGEN
CP/M specific calls (the CP/M call 27 ~eturns nonsense, because
there is no allocation bit map, but this is often harmless.)
SEE ALSO
Upm tutorial in User Reference Manual
CP/~l.l
Operating SYStem Manual
by Digital Research, (C) 1976, 1977, 1978
clean (1), far (1), Is (1), chmod (1), ps (1), mv (1)
CREDITS
CP/M is a trademark of Digital
Res,~arch.
WordStar is a trademark of MicroPro International Corporation.
UNIX is a trademark of 'Bell Laboratories.
upm is a product of the Morrow Designs software group.
-22-
wall (1)
4/6/83
wall (1)
NAME
wall - wri te to all use-rs
SYNTAX
wall
DESCRIPTION
Wall reads the standard input up to an end of file, then sends
this to the terminal of each currently logged in user. You can
enter
wall [return]
message •••
more message •••
. . D [control-D]
to broadcast a message with your terminal as the standard input.
Alternatively, you can broadcast the contents of a particular
file by entering
wall
< filename
Its normal use is to inform users of immediate system status.
Only the super-~ may ~ wall.
EXAMPLE
wall
System going down in 3 minutes -- Please prepare
.. D
After which, each user would see:
Broadcast message •••
followed by what appears above.
SEE ALSO
su (1) for entering superuser mode.
-1-
who (1)
4/6/83
who (1)
who
SYNTAX
who
DESCRIPTION
Who prints a list of the currently logged-in users of Micronix.
FILES
/etc/utmp
(current user information)
-1-
words (1)
4/6/83
words (1)
NAME
words -- count words in s'tandard 1nputor flIes
SYNTAX
words
DESCRIPTION
The number of words in each of the named files is pr,inted
alongside the file name~ If no file names are specit1ed t or if
"_" is given as a file name t the standard input is read up to an
end-of-file and the number of words encountered is printed. A
word is defined as a contiguous string of non-blanks separated
by blanks characters. A blank is a space t tab t or newline
character.
EXAMPLE
To count the words in a number of files:
words file 1 file2 file3
SEE ALSO
chars (l)t lines (1)
-1-
Micronix Operating System
reference manual
MORROW.
CONTENTS OF REFERENCE SECTION 2:
SYSTEM ENTRIES
Introduction to System Calls
access
alarm
break
chdir
chmod
chown
close
creat
csw
dup
exec
exit
fork
fstat
getpid
getuid
gtty
indir
intro
kill
link
mknod
mount
nice
open
pipe
read
seek
setuid
signal
sleep
stat
stime
stty
sync
time
umount
unlink
wait
write
INTRODUCTION TO SYSTEM CALLS
This section of the manual lists all Micronix system calls.
The syntax for these calls is in most cases identical with
that for Unix Version 6 system calls, differing only in the
assembly language register names. For most purposes, Section
II of the Unix V6 Programmer's Manual can be used as a
reference in place of this one.
Call syntax for both C and assembly language is given.
Familiarity with one of these languages is necessary to
understand this section.
Many system calls take a file name. This can be an arbitrary
path name, of unlimited length, but it must be terminated by
a
O-byte,
and the calling process must have search
permission on all directories in the path.
An error during a system call never causes an automatic
error message, but an error number is always available (see
below), and the program can request a standard error message
if it wants [see perror (3)].
C System Calls
The type of declarations given for system call arguments are
not meant to be copied literally;
they
are
simply
indications of how the system will treat the arguments. A
string, for example, is always acceptable in place of a
(char *) argument. When no declaration is given, an int is
expected.
From C, an error is indicated by an otherwise impossible
return value. This is usually -1; the individual sections
specify the details. The error number is always left in the
external variable, errno. This variable is not cleared on
successful calls, so that it remains available across
message writes, etc.
Assembly Language System Calls
Syntax
is given for A-Natural (Whitesmith's) assembly
language. Translation to Intel or Zilog mneumonics is
straightforward. For example, the chmod system call in
A-Natural is
sys; chmod; name; mode
-1-
In Intel assembly language, this looks like
db
db
dw
dw
sys
chmod
name
mode
The "sys" byte that begins each system call is a synonym for
"restart 1". The names of the calls themselves are synonyms
for I-byte quantities that can be found in the individual
sections, or by inspecting
or
including
the
files
/include/an.h
and
/include/intel.h. Succeeding in-line
arguments, if any, are always 2-byte quantities. A "name"
argume?t is always a pOint,er to a null-terminated string.
Registers are preserveq. across system calls, except for the
error flag and error number (see below), and for any return
values (see the individual sections). For the sake of
portability, however, it is unwise to depend on this.
From assembly language, ,an error is always indicated by
turning on the carry bit of the condition flags. Thus a
system call can be followed by a jc (jump on carry) to
handie an error return, or a jnc (jump on no carry) to
handle an error-free return. The error number is returned in
register hl.
Error Numbers
Following is a list of error numbers, their names in the
system source code, the standard error message available
thru perror, and a short explanation.
o
(not used)
1
EPERM
Not super user The current user
something reserved for the super-user.
2
ENOENT
No such file or directory'
The last component of a path name does not exist.
3
ESRCH
No such process
The process whose number was given to signal does not exist,
or is already dead.
4
EINTR
Interrupted system call
A slow system call (such as read or write on a tty, but
never on a disk) was interrupted by a caught signal.
-2-
was
attempting
5
EIO I/O error
A physical I/O error occurred during a read or write.
6
ENXIO
No such device or address
An I/O call was made to a non-existent device, or beyond the
limits of the device.
7
E2BIG
Arg list too long
A call to exec was made with an argument
512 bytes.
list
longer
than
8
ENOEXEC'
Exec format error
An attempt was made to execute an inappropriate file (such
as a directory' or special file), even though the user had
execute permission on the file.
9
EBADF
Bad file number
A file descriptor refers to no open file, or a read or write
request is made to a file not opened for that activity.
10
No children
ECHILD
There were no chi,ld processes to wait for.
11
EAGAIN
No more processes
Fork found the system process table temporarily full.
12
ENOMEM
Not enough core
During an exec or break, the program asked for more core
than the system could supply. This is not a temporary
condition: the maximum program size is a system parameter.
13
EACCES
Permission denied
The user attempted a file access forbidden by the file's
permission bits.
14
ESYS System error
The system has detected an "impossible" error, caused by
corrupted disk, memory, or a system bug, but not yet severe
enough to warrant a panic stop. This should be reported.
15
ENOTBLK
Block device requiredA plain file or a directory was given where a
was required, (in mount, for example).
16
block
device
EBUSY
Device busy
An attempt was made
to mount a device that was already
mounted, to unmount a device on which there was an open file
or a current directory, or to open a one-user-only device
that is already busy.
-3-
17
File exists
EEXIST
The new file name passed to link or mknod is already taken.
18
Cross-device link
EXDEV
A link to a file on another device was attempted.
19
No such device
ENODEV
An attempt was made to open a non-existent device.
20
ENOTDIR
Not a di'rectory
A non-directory
was specified where a directory
required, as an intermediate component in a path name,
example, or as an argument to cbdir
was
for
21
Is a directory
EISDIR
An attempt was made to write on a directory.
22
EINVAL
Invalid argument
An invalid argument was given to a system call: currently,
unmounting a non-mounted device, mentioning an unknown
signal in signal, or invoking a non-existing system call.
Ordinarily, the latter case generates a fatal signal; the
error is returned only if the signal is caught or ignored.
23
File table overflow
ENFILE
The system's table of open files is temporarily full.
24
EMFILE
Too many open files
Only 16 files can be open per process
25
ENOTTY
Not a typewriter
The file mentioned to stty or gtty is not a typewriter or
other character-device.
26
Text file busy
ETXTBSY
Not currently used.
27
File too big
EFBIG
The user attempted to extend a file beyond the maximum
of 2"24 bytes.
size
28
ENOSPC
No space left on device
The disk's free space has been exhausted.
29
Illegal seek
ESPIPE
A seek was issued to a pipe.
30
EROFS
Read-only file system
An attempt was made to write to a device mounted read-only.
-4-
31
EMLINK
Too many links
The program attempted to make a 256th link to a file.
32
Broken pipe
EPIPE
The program wrote on a pipe that had no reader. Ordinarily
this generates a fatal signal; the error is returned if the
signal is caught or ignored.
-5-
access (2)
3/18/81
access (2)
NAME
access - test file access permissions
c
access(n~me,
mode)
char *name;
int mode;
FUNCTION
Permission to access the named file, in the specified
mode, is tested. The test is based on 'the real user and
group IDs, rather than the effective IDs, so that a
set-user-id program may test the permissions of its
invoker. Mode is the ~ of any of the following:
.4
2
1
read
w.rite
execute
RETURNS
Access returns a 0 if permission is granted, -1 if not.
ASSEMBLER
(access = 33)
sys; access; name; mode
RETURNS
Access returns with the error bit clear if
the
permissions are granted, or with the error bit set if
they are not.
'-1-
alarm (2)
3/19/82
alarm (2)
NAME
alarm - set the alarm clock
C
alarm(seconds)
FUNCTION
This call sets the "alarm clock", which will send an
al~rm
signal to the calling process after the given
number of seconds ( see signal (2) ) e. Meanwhile, the
process continues to run.
An argument of 0 turns the alarm clock off.
See also pause' (2) and 8leep(2)e
RETURNS
If an alarm was previously set but not yet triggered,
alarm returns the number of seconds remaining until the
old alarm. Otherwise it returns O.
ASSEMBLER
alarm = 27)
(seconds in hI)
SY8; alarm
RETURNS
The time remaining on any old alarm is returned in
There is no error return.
-1-
hI.
break (2)
3/18/82
break (2)
NAME
break, brk, sbrk - change core allocation
c
char
char
*
*
brk(addr)
sbrk(addr)
FUNCTION
Brk sets the system's idea of the lowest memory
location not used by the program (called the "break")
to addr (which may be rounded up to suit memory
management hardware). The old break is returned.
Locations greater than or equal to the break and less
than the stack pointer are not in the address space of
the program. "These locations may be overwri tten by the
system, and may cause memory faults if accessed. The
system will refuse to set the break above the stack
pointer, but a program is free to move its stack
pointer below the break.
Sbrk adds incr more bytes to the program's data space
and returns a pointer to the start of the new area.
When a program begins execution via exec (2), its break
is set to the top of its program and data storage
areas. Thus, only programs that must
dynamically
allocate data space need to use these calls.
RETURNS
The old break is returned on success. A -1 is returned
if the request would require more memory than the
system limit, or if it would move the break across the
stack pointer.
ASSEMBLER
(break = 17)
sys; break; addr
RETURNS
Only success or failure is returned,
setting the carry flag, respectively.
-1-
by
clearing
or
chdir (2)
chdir (2)
3/19/82
NAME
chdir - change working directory
C
chdir(dirname)
char *dirname;
FUNCTION
The working directory of the current process is changed
to the given directory. The 'user must have search
(execute) permission on the directory~
RETURNS
A 0 is returned on success, a -Ion failure.
ASSEMBLER
(chdir = 12)
sys; chdir; dirname
RETURNS
The carry
failure.
flag
is
cleared
-1-
on
success,
or
set
on
chmod (2)
chmod (2)
3/18/82
NAME
chmod - change mode of file
C
chmod(name, mode)
char *name;
FUNCTION
The mode of the file is set as indicated. Only the
owner of a file, or the super-user, may change the
mode. Modes are constructed by DRing together some
combination of the following (octal) values:
4000
2000
1000
0400
0200
0100
0070
0007
Set user id on execution
Set group id on execution
Currently ignored
Read by owner
Write by owner
Execute (or search directory) by owner
Read, write, execute (search) by group
Read, write, execute (search) by others
When a file with the set-user-id flag is executed, the
effective user ID of the process is set to the owner of
the file. (In this way, for instance, a spelling
program could use a secret dictionary.)
For security reasons, whenever a file
writing, its set-id flags are cleared.
is
opened
for
RETURNS
A 0 indicates success, a -1 indicates failure.
ASSEMBLER
(chmod = 15)
sys; chmod; name; mode
RETURNS
The carry
failure.
flag
is
cleared
-1-
on
success,
or
set on
3/18/82
chown (2)
chov.TI1 (2)
NAME
chown - change owner and group of a file
c
chown(name, owner)
char *name;
FUNCTION
The owner of the file is changed to the low byte of
"owner", and the group is changed to the high byte.
Only the super~user may execute this call.
RETURNS
A 0 indicates success, a -1 indicates failure.
ASSEMBLER
(chown = 16)
8Y8; chown; name; owner
RETURNS
The carry
failure.
flag
is
cleared
-1-
on
success,
or
set
on
3/18/82
close (2)
close (2)
NAME
close - close a file
C
close(descriptor)
FUNCTION
Given a f~le descriptor previously returned by open)
creat, or pipe) close closes the associated file. A
close of all files is automatic o.n exit, but since
processes are limited to 16 simultaneously open files,
close () may be necessary for programs that deal with
many files.
RETURNS
A 0 indicates success, a -1 indicates failure.
ASSEMBLER
(close = 6)
(file descriptor in hI)
sys; close
RETURNS
The carry
failure.
flag
is
cleared
-1-
on
success,
or
set
on
creat (2)
creat (2)
3/18/82
NAME
creat - create a new file (or truncate an old one)
C
creat(name, mode)
char *name;
FUNCTION
If the file does not exist, and if the parent directory
is writable, it is created with the given mode. If the
file does exist and is writable, it is' truncated to 0
length, and its mode and owner remain unchanged. In
either case, the file is opened for writing only, and a
file descriptor is returned.
See chmod (2) for the construction of modes.
the file is opened for writing, even if the
does not allow writing. This can be used as
mechanism, in that another program will not
create the same file.
Creat is subject to the limit
process.
of
16
open
Note that
given mode
a locking
be able to
files
per
RETURNS
Create) returns a file descriptor (a small, positive
number) on success, or a -Ion failure.
ASSEMBLER
(creat = 8)
sys; creat; name; mode
(file descriptor in hI)
RETURNS
The carry flag is cleared on success, or set on
failure. If successful, a file descriptor is returned
in hI.
-1-
csw (2)
3/19/82
NAME
c~w
-
csw - read the console switches
C
getcsw( )
FUNCTION
The setting of the console switches is returned.
RETURNS
The .setting of the console switches is returned.
ASSEMBLER
(csw = 38)
sys; csw
(switch setting in hI)
RETURNS
The switch setting is returned in hI.
-1-
(2)
3/19/82
dup (2)
dup (2)
NAME
dup - duplicate a file descriptor
c
dup(descriptor)
FUNCTION
Dup takes a file descriptor previously returned by
open, creat, or pipe and allocates a new descriptor
synonymous with the original. Subsequent reads or
writes with the new descriptor will· have exactly the
same effect as the same call with the old descriptor.
Since the algorithm that allocates file descriptors
returns the lowest available value, combinations of dup
and close can be used to move file descriptors in a
general way. This is used mostly for manipulating the
standard input (file descriptor 0) and the standard
output (file descriptor 1).
Dup is subject to the
descriptors per process.
limit
of
16
active
file
RETURNS
Dup()
returns
a
file
successful, or a -1 if not.
ASSEMBLER
(dup
(old
sys;
(new
descriptor
(positive)
if
= 41)
descriptor in hI)
dup
descriptor in hI)
RETURNS
On success, the carry flag is cleared and the new
descriptor is returned in regist~r hI. On failure, the
carry flag is set.
-1-
exec (2)
3/19/82
exec (2)
NAME
exec - execute a program
C
execv(name, argv)
char *name;
char *argv [ ] ;
execl(name, argO, argl, ••• , argn, 0)
char *name, *argO, *arg1, ••• , *argn;
FUNCTION
Exec overlays the calling core image with the named
file, then transfers to the beginning of the new core
image. There can be no return from a successful exec:
the calling core image is lost.
Exec does not create a new process - the same process
continues with th~ new core image. Previously opened
files remain open (so standard input and output are
preserved), and ignored signals remain ignored.- Ca\.lght
signals, however, are reset to their default behavior.
Each
process has "real" user and group IDs and
"effective" user and group IDs. The real IDs identify
the user; the effective IDs determine the access
privileges. If a file does not have "set-user-id" or
"s"et-group-id" mode [see chmod, (2)], then exec sets
all IDs, real and effective, to
the
individual
executing the file. If the file does have either mode,
exec sets the corresponding effective ID to the owner
of the executed file. The real IDs remain unchanged.
This allows a user to write a program that takes
advantage of his own access privileges (rather than its
invoker's privileges).
In order to be executed, a file must have one of the
execute permission bits set, even for the super-user.
The system expects one of two file formats. If the
first byte is hex 99, then the first 16 bytes are taken
to be a header with the following structure
-1-
3/19/82
exec (2)
exec (2)
struct header
{
char
ident,
conf;
unsigned tablsize,
textsize,
datasize,
bss size,
heapsize,
textoff,
dataoff;
};
/*
/*
/*
/*
/*
/*
/*
/*
/*
hex 99 */
not used by exec */
not used by exec */
bytes in text segment */
bytes in data segment */
bytes in bss segment */
minimum stack + heap */
text segment offset */
data segment offset */
(This header structure is produced by Whitesmith's
compilers.) The rest of the file is assumed to contain
textsize bytes of text, followed by datasize bytes of
data. Text is loaded at address textoff, data is loaded
at
address
dataoff, and bss space is allocated
following the data. The break is set at the highest
location in the text or data + bss segments.
If the first byte of the file is not hex 99, then the
file is taken to be pure object code origined at
address 256 (100 hex). The brake is set to the file
size.
In any case, the program must meet the maximum-size
- restriction (currently 65024 bytes), and it must keep a
"halt" instruction (the system-call trap) at address 8.
(This is supplied by the system, unless the text offset
is <= 8.)
C offers two different interfaces to exec. Execl is
useful when a known file is being executed with known
arguments. The arguments are all string pointers. Any
number of arguments may be given, but the last must be
a O.
When the number of arguments is not known in advance,
execv is handy. Pointers to the argument strings are
collected into a list, a null pointer is appended to
mark the end of the list, and execv is called with the
address of the list.
Currently, the total number of bytes in the argument
strings (including the terminating nulls) is limited to
512.
It is conventional to repeat the name of the file being
executed as the first argument, so that programs can
use the name with which they are invoked.
-2-
3/19/82
exec (2)
exec (2)
When a C program is executed, it begins as follows:
main(argc t argv)
int argc;
char **argv;
where argc is the argument count t andargv is a list of
pointers
to
the
argument
strings
themselves.
Conventionally, argc is at least 1 and argv[O] is the
program'name. As delivered by the system, argv[argc] ==
-1 t s'o that argv cannot be used directly in an.other
execv until argv[argc] is set to O.
RETURNS
Any return is an error return. In that case, the
calling image ·is not lost and can continue. Possible
errors include: the file cannot be found, is not an
ordinary file, is not executable, is too big, or the
argument list is too long.
ASSEMBLER
(exec = 11)
sys; exec; name; argv
-3-
exec (2)
3/19/82
exec (2)
Argv is the address of a list of string pointers. The
last pointer must be O. When the file starts execution,
core is set up as follows:
(top of user core)
argn:
string\O
argO:
string\O
-1
argn
...
sp -)
argO
argc
RETURNS
If exec returns at
indicate an error.
all,
-4-
the
carry
flag is set to
3/19/82
exit (2)
exit (2)
NAME
exit - terminate this process
C
exit(status)
FUNCTION
Exit closes all open files, terminates the calling
process, and notifies the parent process (if it is
executing a wait). The low byte of status is available
to the par~nt (via wait).
RETURNS
This call can never return.
ASSEMBLER
(exit = 1)
(status in hI)
sys; exit
RETURNS
None.
-1-
3/19/82
fork (2)
fork (2)
NAME
fork - create a new process
c
fork()
FUNCTION
Fork is the only way to create a new process. The
calling process splits into a "parent" and a' "child".
The child's core image is a ,copy of the parent's, open
files are shared, and signals remain unchanged. Fork()
returns a zero to the child process, while it returns a
non-zero number to the parent. This is the process ID
of the child, and is used by wait (2) and kill (2).
RETURNS
Fork() returns a zero to the child, and the non-zero
process ID of the child to the parent. A return of -1
(not just negative) indicates a temporary lack of
process space.
ASSEMBLER
(fork = 2)
sys; fork
(child return)
(+ 3 bytes)
(parent return) (child id in hI)
RETURNS
The child process returns to the location immediately
following the fork. The parent skips three bytes before
returning, and receives the child ID in hI. If a new
process cannot be created, the carry flag is set on
return to the parent (and the child return never
happens).
-1-
3/19/82
fstat (2)
fstat (2)
NAME
fstat - get the status of an open file
C
fstat(descriptor, buf)
struct stat *buf;
FUNCTION
Fstat is identical to stat, except that it operates on
open fil~s (v-ia the file descriptor) rather than on
files given by name. This is often used to examine the
status of the standard input and output, whose names
are usually unknown. Buf is the address of a 36 byte
buffer, into which the following information is placed:
struct stat
{
char
int
char
int
long
minor,
major;
inumber,
flags;
nlinks,
uid,
gid,
sizeD;
sizel,
sddr[8] ;
actime,
mod time;
/*
/*
/*
/*
/*
/*
/*
/*
/*
/*
/*
/*
minor device *1
major device */
inode number *1
see below */
number of links *1
user id of owner */
group id of owner *1
high byte of size */
low word of size *1
block numbers */
time of last access *1
" last modification *1
};
The flags are as follows (values in octal):
100000
060000
000000
040000
020000
060000
010000
004000
002000
001000
000400
000200
000100
000070
000007
inode is allocated
2-bit file type
plain file
directory
character-special file
block-speci~l file
large file
set user-id on execution
set group-id on execution
currently ignored
read (owner)
write (owner)
execute or search directory (owner)
read, write, execute (group)
read, write, execute (others)
-1-
fstat (2)
3/19/82
fstat (2)
RETURNS
A 0 indicates success, a -1 indicates failure (bad file
descriptor).
ASSEMBLER
(fstat = 28)
(file descriptor in hI)
sys; fstat; buf
RETURNS
The carry flag is cleared on success, or set on
failure. On success, the status is placed in the
36-byte area pointed at by buf.
-2-
getpid (2)
3/19/82
getpid (2)
NAME
getpid - get process ID
C
getpid()
FUNCTION
Getpid returns the process ID of th~ current process.
This is the same ID that is used by the fork t kiII t and
wait system calls.
RETURNS
Getpid returns the process ID.
ASSEMBLER
(getpid = 20)
sys; getpid
(id in hI)
RETURNS
Getpid returns the process ID in hl.
-1-
getuid (2)
getuid (2)
3/25/82
NAME
getuid - get user IDs
C
getuid()
FUNCTION
Getuid returns the real user IDs of the current
process. The real group ID is in the high byte of the
returned word. The real user ID is in the low byte.
(The real IDs identify .the individual, while the
effective IDs determine his current access privileges.
See the exec and chmod system calls for a discussion.)
RETURNS
Getuid returns the real user IDs:
high byte = group ID, low byte = user ID.
ASSEMBLER
(getuid = 24)
sys; getuid
(IDs in hI)
RETURNS
Getuid returns the real process IDs:
high byte = group ID, low byte = user
-1-
ID~
3/19/82
gtty (2)
gtty (2)
NAME
gtty - get typewriter status
C
gtty(descriptor, vec)
struct
{
char
int
ispeed,
ospeed,
erase',
kill;
mode;
/* input speed */
/* output speed */
1* erase character */
/* kill character */
/* see below */
}
*vec;
FUNCTION
Gtty gets the status of the terminal associated with
the file descriptor, and writes the status into the
6-byte structure pointed at by vec. (This structure is
the same as that passed by stty. ) Actually, this call
may be made to any character device, but devices that
do not like it may return an error.
Ispeed and ospeed are one of:
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
1200 baud
50 baud
75 baud
110 baud
134.5 baud
150 baud
200 baud
300 baud
600 baud
1200 baud
1800 baud
2400 baud
4800 baud
9600 baud
19200 baud
1200 baud
The next two characters specify the erase and kill
characters, respectively. (The defaults are AH and AX).
-1-
3/19/82
gtty (2)
gtty (2)
The mode specifies what services are performed by
system on input and output. Currently, these are:
0200
0040
0020
0010
0002
the:
Use the RS-232 clear-to-send line
Raw input
Cr -) If mapping
Echo input
Expand tabs
In raw mode, all characters are passed immediately to
the program without waiting for a full line to be
typed, there is no erase or kill processing, and there
is no recognition of any special control characters. In
cooked mode, the following control characters are
recognized:
"D
end-of-file (when typed alone on a line)
send a quit signal to this tty's processes
DEL send an interrupt signal to same
""B send a background signal to same
ESC freeze the output from this tty
""s same as ESC
A\
Note that even while the tty is in raw mode, the other
modes still have an effect.
In cr-)lf mode, input crs are turned into
output crs or lfs are turned into cr-lfs.
lfs,
and
In echo mode, input is echoed immediately. If the mode
is also taw, it is echoed exactly as typed; otherwise)
the special control characters are not echoed, the kill
character is echoed as itself plus a newline, and the
erase character is echoed as backspace-space-backspace.
In expand-tabs mode, tabs are output as the number of
spaces needed to bring the cursor to the next O-mod-8
column·.
RETURNS
A 0 indicates success, a -1 indicates failure. On
success, the status is placed in the 6-byte structure
pointed at by vec.
-2-
3/19/82
gtty (2)
gtty (2)
ASSEMBLER
(gtty = 32)
(file descriptor in hl)
sys; gtty; vec
RETURNS
The carry flag is cleared on success, or set on
failure. On success, the status is placed in the 6-byte
area pointed at by vec.
-3-
3/19/82
indir (2)
indir (2)
NAME
indir - indirect system call
ASSEMBLER
(indir = 0)
sys; indir; syscall
FUNCTION
The system call at the location syscall is executed.
Execution resumes after the indir call.
The main purpose of indir is to allow programs to
construct system calls in their data segments, avoiding
modifications to their code.
The system call at syscall must begin with the "sys"
byte. An indir executed indirectly is a no-ope
RETURNS
The returns depend on the indirectly executed call.
-1-
3/19/82
kill (2)
kill (2)
NAME
kill - signal a process
C
kill(pid, sig)
FUNCTION
Kill sends the signal, sig, to the process with the
given ID. The usual effect is to kill the process - see
signal (2) for a discussion and a list of signals.
The sending and receiving processes must have the same
effective
user
IDs, or the sender must be the
super-user.
If the given process ID is 0, then the signal is sent
to all other processes with the same controlling tty.
A process can never kill itself.
RETURNS
A
° iridicates
success, a -1 indicates failure.
ASSEMBLER
(kill = 37)
(process ID in hI)
sys; kill; sig
RETURNS
The carry
failure.
flag
is
cleared
-1-
on
success,
or
set on
link (2)
3/19/82
link (2)
NAME
link - link to a file
C
link(old, new)
char *old, *new;
FUNCTION
A link to "old" is created, with the name "new". Either
name may be an arbitrary pathname.
"New" must not already exist, its directory must be
writable, and it must be on the same device as "old".
"Old" must not be a directory (unless the user is the
super-user), and must not have more than 254 links.
RETURNS
A 0 indicates success, a -1 indicates failure.
ASSEMBLER
(link = 9)
sys; link; old; new
RETURNS
The carry
failure.
flag
is
cleared
-1-
on
success,
or
set on
mknod (2)
3/19/82
mknod (2)
NAME
mknod - make a directory or special file
c
mknod(name, mode, addr) char *name;
FUNCTION
creates a new file. Unlike creat, it may be used
to create directories and special files; it does not
truncate or open files.
~nod
The mode of the new file (including the file type bits)
is taken from the mode argument, and the first address
is taken from addr. For directories, this address
should be 0, while for special files it should be the
device number.
This call 'is restricted to the super-user.
RETURNS
A
° indicates
success, a -1 indicates failure.
ASSEMBLER
(mknod = 14)
sys; mknod; name; mode; addr
RETURNS
The carry
failure.
flag
is
cleared
-1-
on
success,
or
set on
mount (2)
mount (2)
3/19/82
NAME
mount - mount a file system
c
mount(device, on, ronly)
char *device, *on;
FUNCTION
Mount informs the system that the given block device
contains a file system. ,Subsequent references to the
file "on" will refer to the root directory of the new
file system. The o1'd contents of "on". are inaccessible
until the device is unmounted.
If ronly is non-zero, the system will not allow writing
on the device. If the device is physically write
protected, it should still be mounted read-only to
prevent the system from trying to update access times.
This call is restricted to the super-user. There is a
limit to the number of devices that can be mounted
concurrently.
RETURNS
A 0 indicates success, a -1 indicates failure.
ASSEMBLER
(mount = 21)
sys; mount; device; on; ronly
RETURNS
The carry
failure.
flag
is
cleared
-1-
on
success,
or
set
on
nice (2)
7/19/82
nice (2)
NAME
nice - set process priority
C
nice(arg)
FUNCTION
The "nice" of a process is the opposite of its
intuitive "priority" -- the "ni~er" it is, the less cpu
ti'me it hogs. This systen entry sets the nice of the
calling process to the given arg~ment. Nice values
range from -128 to 127; the normal value is O. Only the
super-user can set a negative nice (== high priority).
Long running background programs Bhould be run at a
positive nice as a favor to other users.
A process' nice is passed to its children via the
system call.
fork
RETURNS
A 0 indicates success, a -1 indicates failure.
ASSEMBLER
(nice = 34)
(nice value in hI)
sys; nice;
RETURNS
The carry
failure.
flag
is
cleared
-1-
on
success,
or
set on
open (2)
3/19/82
open (2)
NAME
open - open a file for reading or writing
c
open(name, mode)
char *name;
FUNCTION
The named file is opened for
reading
writing
both
(mode "0) t
(mode 1), or
(mode 2).
The returned file descriptor should be
subsequent calls to read, write t and close.
There ,is
a
saved
for
limit of 16 open files per process.
RETURNS
A non-negative return indicates success, a -1 indicates
failure.
On
success,
a
file descriptor (small
non-negative number) is returned.
ASSEMBLER
(open = 5)
sys; open; name; mode
(file descriptor in hI)
RETURNS
The carry flag is cleared on success t or set on
failure. On success, a file descriptor is returned in
hI.
-1-
pipe (2)
pipe (2)
3/19/82
NAME
pipe - create an inter-process channel
c
pipe(descriptor)
int descriptor[2];
(read descriptor = descriptor[O])
(WTit~ descriptor = descriptor[l])
FUNCTION
Pipe returns two file descriptors tha~ can be used to
communicate between processes created by subsequent
fork calls.
When
the
pipe
is
written
using
descriptor[1], up to 4096 bytes of data will be
buffered before the writing process is suspended. A
read using descriptor[O] will pick up the data.
Read calls on an empty pipe with no writers will return
an end-of-file (i.e., 0 bytes read). Write calls under
similar conditions will generate a signal.
RETURNS
A 0 indicates success, a -1 indicates failure.
ASSEMBLER
(pipe = 42)
sys; pipe
(read descriptor in hI)
(write descriptor in de)
RETURNS
The carry
failure.
flag
is
cleared
-1-
on
success,
or
set
on
read (2)
3/19/82
read (2)
NAME
read - read a file
c
read(descriptor, buffer, nbytes)
char buffer[];
FUNCTION
A file descriptor is a word returned from a successful
open, creat, dup, or pipe call. Buffer is a memory
loca tion where at mo's t nbytes of da ~a will be placed.
The number of bytes actually read is returned. This may
well be less than nbytes; a read on a terminal, for
example, will return at most one line. If the value 0
is returned, then the file has been exhausted.
RETURNS
A-I indicates an error. A return of 0 indicates
end-of-file. Any other value indicates a successful
read of that many bytes.
ASSEMBLER
(read = 3)
(file descriptor in hI)
sys; read; buffer; nbytes
(number of bytes read in hI)
RETURNS
The carry
failure.
flag
is
cleared
-1-
on
success,
or
set
on
seek (2)
seek (2)
3/19/82
NAME
seek - move read/write pointer
C
seek(descriptor, offset, fr0t:n)
FUNCTION
Each oyen file has an associated read/write pointer.
Seek moves this pointer as follows:
If from is 0, the pointer is set to ,offset.
If from is 1, the pointer
location plus offset.
is
set
to
its
current
If from is 2, the pointer is set to the size of the
file plus offset.
If from is 3, 4, or 5, the meaning is the same as for
0, 1, or 2, except that offset is multiplied by 512.
°
If from is
or 3, offset
Otherwise it is unsigned.
is
treated
as
signed.
IN SUMMARY:
Byte Block
seeks seeks'
°2
1
3
4
5
Motion is relative to
Beginning of file (unsigned)
Curr~nt location (signed)
End of file (signed)
Seeks are not allowed on pipes, but are allowed on
character devices, although most such devices ignore
them. Seeking far past the end of a file and writing
will create a "hole" in the file that occupies no
space. Reading the hole will allocate zero-filled
space.
RETURNS
A 0 indicates success, a -1 indicates failure.
-1-
setuid (2)
setuid (2)
3/19/82
NAME
setuid - set process user IDs
C
setuid(uid)
FUNCTION
This call sets the real group and user IDs and the
effective group and user IDs. The group IDs are set to
the high byte of the argument, and the user IDs are set
to the low byte. This call can be used to set the
effective IDs to the real IDs. Only the super-user is
permitted to change the real IDs.
RETURNS
A 0 indicates success, a -1 indicates failure.
ASSEMBLER
(setuid = 23)
(uid in hl)
sys; setuid;
RETURNS
The carry
failure.
flag
is
cleared
-1-
on
success~
or
set on
signal (2)
3/19/82
signal (2)
NAME
-signal - set disposition of signals
c
signal(sig, func)
int (*func)();
FUNCTION
A signal is a means of notifying a process of some
external event. A signal can be sent from the system
(in response to an attempt to execute an illegal
instruction, for example), from a terminal (to abdrt a
process), or at the request of another process (via the
kill system
call).
Normally,
a
signal
causes
termination of the receiving process, but this call
allows the process either to ignore it or to "catch" it
via an interrupt to a specified location. There are 15
signals:
1
2
3
4
5
-6
7
8
9
10
11
12
13
14
15
-- (hangup)
interrupt (caused by typing DEL)
quit (caused by typing control \) *
illegal instruction *
-- (trace trap)
background (caused by typing control b)
record available at terminal **
-- (floating point exception)
kill (cannot be caught or ignor-ed)
-- (bus error)
-- (memory fault)
bad argument to a system call *
write to a pipe with no one to read it
-- (alarm clock)
terminate (catchable kill)
* causes a core dump unless caught or ignored
**
not reset when caught
Signals marked tI __ tI are no: .currently sent by the
system. (The Unix V6 descriptions are given).
A "func" of 0 tells the system to institute the default
action for the given signal. For all signals but 6 and
7, this means process termination on receipt of the
signal. For signal 6, the default action is to put the
process into the "background" (all further signals,
except 9, will be ignored, and reads on a terminal will
return eof). For signal 7, the default action is to
ignore the signal.
-1-
signal (2)
3/19/82
signal (2)
If "func" is 1, the· sig~~l ~ill be ignored •.. Ifl'func"
is any value greater than 1, then it is taken as an
address, and receipt of the signal will cause an
interrupt to that address. Except as noted, a signal is
reset to 0 after being caught. So in general, the
catching routine must issue another signal call if it
wants to continue catching the signal.
If a signal is caught during a slow system call (read
or write to a terminal, sleep, or wait ), the call
will terminate prematurely and return an error (number
EINTR - see the Introduction).
After
a
fork,
the
child
inherits all signal
dispositions. Exec passes on all default and ignore
dispositions~
but resets all caught signals to default
action.
RETURNS
The return value is the old signal disposition. A 0
indicates success, a -1 indicates failure (signal
number out of range).
ASSEMBLER
(signal = 48)
sys; signal; sig; func;
(old value in hI)
RETURNS
The carry
failure.
flag
is
cleared
-2-
on
success,
or
set
on
3/19/82
sleep (2)
sleep (2)
NAME
sleep -
st~p
execution for an interval
C
sleep(seconds)
FUNCTION
The calling process is suspended for at least the given
number of seconds.
RETURNS
The call returns after the given number of seconds. A 0
indicates success, a -1 indicates failure. The only
caus~ of failure is an early return caused by a
caught
signal.
ASSEMBLER
sleep = 35)
(seconds in hI)
sys; sleep
RETURNS
The carry flag is cleared on success, or
failure. The only cause of failure is an early
caused by a caught signal.
-1-
set on
return
stat (2)
3/19/82
stat (2)
NAME
stat - get the status of a named file
c
stat(name, buf)
char *name;
struct stat *buf;
FUNCTION
stat is identical to fstat, except that it operates on
named files rather than open-file des~riptors. Buf is
the address of a 36 byte buffer, into which the
following information is placed:
struct stat
{
char
int
char
int
long
minor,
major;
inumber,
flags;
nlinks,
uid,
gid,
sizeD;
size1,
addr[8];
actime,
modtime;
/* minor device */
/* major device */
/* inode number */
/* see below */
/* number of links */
/* user id of owner */
/* group id of owner */
/* high byte of size */
/* low word of size */
/* block numbers */
/* time of last access */
/* " last modification */
};
The flags are as follows (values in octal):
100000
060000
000000
040000
020000
060000
010000
004000
002000
001000
000400
000200
000100
000070
000007
inode is allocated
2-bit file type
plain file
directory
character-special file
block-special file
large file
set us~r-id on execution
set group-id on execution
currently ignored
read (owner)
write (owner)
execute or search directory (owner)
read, write, execute (group)
read, write, execute (others)
It is not necessary to have read permission on the
file, but all directories leading to the file must be
searchable.
-1-
3/19/82
stat (2)
stat (2)
RETURNS
A 0 indicates success, a -1 indicates failure.
ASSEMBLER
(stat = 18)
stat; name; buf
RETURNS
The carry flag is cleared on successior set on
failure. On success, the status is placed in the
36-byte area pointed at by buf.
/
-2-
stime (2)
stime (2)
3/19/82
NAME
stime - set date and time
C
stime(time)
long * time;
FUNCTION
Stime sets the system's idea of the date and time. The
argument is the number of seconds since 0:00 GMT,
January 1, 1970. Only the super-use~ may make this
call.
RETURNS
indicates
super-user).
A 0
success,
a
-1 indicates failure (not
ASSEMBLER
(stime = 25)
(time in hI-de: hI = high word, de
sys; stime
RETURNS
The carry
failure.
flag
is
cleared
-1-
on
low word)
success,
or
set
on
stty (2)
stty (2)
3/19/82
NAME
stty - set typewriter status
C
stty(descriptor, vec)
struct
{
char
int
/* input speed */
/* output speed */
/* erase character */
/* kill character */
/* see Qelow */
ispeed,
ospeed,
erase,
kill;
mode;
}
*vec;
FUNCTION
Stty sets the status of the terminal associated with
the file descriptor. The status is taken from a 6-byte
structure pointed at by vec. This structure is the same
as that obtained by gtty. Actually, this call may be
made to any character device, but devices that do not
like it may return an error.
Ispeed and ospeed are one of:
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
1200
50
75
110
134.5
150
200
300
600
1200
1800
2400
4800
9600
19200
1200
baud
baud
baud
baud
baud
baud
baud
baud
baud
baud
baud
baud
baud
baud
baud
baud
The next two characters
characters, respectively.
specify
the erase and kill
The mode specifies what services are performed by
system on input and output. Currently, these are:
-1-
the
stty (2)
stty (2)
3/19/82
0200
0040·
0020
0010
0002
Use the RS-232 clear-to-send line
Raw input
Cr -) If mapping
Echo input
Expand tabs
In raw mode, all characters are passed immediately to
the program without waiting for a full line to be
typed, there is no erase or kill processing, and there
is no recognition of any special control characters. In
cooked mode, the following control characters are
recognized:
AD
end-of-file (when typed alone 'on a line)
A\ send a quit signal to this tty's processes
DEL send an interrupt signal to same
AB send a background signal to same
ESC freeze the output from this tty
AS same as ESC
Note that even while the tty is in raw mode, the other
modes still have an effect.
In cr-)lf mode, input crs are turned into
output crs or lfs arc turned into cr-lfs.
lfs,
and
In echo mode, input is echoed immediately. If the mode
is also raw, it is echoed exactly as typed; otherwise,
the special control characters are not echoed, the kill
character is echoed as itself plus a newline, and the
erase character is echoed as backspace-space-backspace.
In expand-tabs mode, tabs are output as the number of
spaces needed to bring the cursor to the ne~t O-mod-8
column.
RETURNS
A 0 indicates success, a
-1 indicates failure (file
descriptor does not refer to a character device).
ASSEMBLER
(stty = 31)
(file descriptor in hI)
sys; stty; vec
RETURNS
The carry
failure.
flag
is
cleared
-2-
on
success,
or
set on
sync (2)
3/19/82
sync (2)
NAME
sync - update the disks
c
sync()
FUNCTION
Sync causes all information in core memory that should
be on disk to be written out. This includes modified
super-blocks, modified inodes, and delayed block I/O.
RETURNS
No information is returned. Sync always succeeds.
ASSEMBLER
(sync = 36)
sys; sync
RETURNS
No error indication is returned.
-1-
time (2)
3/19/82
time (2)
NAME
time - get date and time
c
time(tp)
long *tp;
FUNCTION
Tjme fills the long value pointed to
with the
1970.
number
of
by the argument
seconds since 0:00 GMT January 1
RETURNS
The user-supplied long integer is filled in. There
no error conditions.
are
ASSEMBLER
(time = 13)
sys; time
(time in hI-de)
RETURNS
The time is returned with the high order word in hI and
the
low
order word in de. There are no error
conditions.
-1-
umount (2)
3/19/82
umount (2)
NAME
umount - dismount a file system
C
umount(device)
char *device;
FUNCTION
Umount tells the system that the given spec'ial file
should no longer be treated as a file system. The file
on which the device was mounted reveres to its ordinary
interpretation.
Umount will return an error if there
active files on the mounted system.
are
still
any
This call is restricted to the super-user.
RETURNS
A 0 indicates success), a -1 indicates failure.
ASSEMBLER
(umount = 22)
sys; umount; device
RETURNS
The carry
failure.
flag
is
cleared
-1-
on
success)
or
set on
3/19/82
unlink (2)
unlink (2)
NAME
unlink - remove a directory entry
c
unlink(name)
char *name;
FUNCTION
Unlink removes the indicated entry from its directory.
If this was the last link to the file, the file is
removed· and its space is freed. If the file was open in
any process, this removal is delayed until the file is
closed, even though its last directory entry has
disappeared.
In order to unlink a file, a user must have write
permission on its directory. Write permission is not
required on the file itself. Only the super-user can
unlink a directory.
RETURNS
A 0 indicates success, a -1 indicates failure.
ASSEMBLER
(unlink = 10)
8YS; unlink; name
RETURNS
The carry
failure.
flag
is
cleared
-1-
on
success,
or
set on
wait (2)
3/19/82
wait (2)
NAME
wait - wait for a process to terminate
C
wait(pstat)
int *pstat;
FUNCTION
This call waits for the termination of any of the
caller's children. If any child has died since the last
wait, return is immediate. If there are no children, an
error is returned. If there are 'several children,
several wait calls are necessary to learn of all the
deaths.
Wait returns the process ID of the terminated child,
and
fills in the user-supplied 'integer with the
termination status. In the ,case of a normal termination
via exit, the low byte of the status is 0, and the
high byte is is the low byte of the child's exit
argument. In the case of a signal-caused termination,
the low byte of the status is the signal number, and
the high byte is the child's I register.
If a parent process terminates without waiting for its'
children, the initialization process (process id = 1)
inherits the children.
RETURNS
A positive number indicates
success, a -1 indicates
failure (no children). On success, the pointed-to
status is filled in with the child's termination
status, and the child's process ID is returned.
ASSEMBLER
(wait = 7)
sys; wait
(process id in hI)
(status in de)
RETURNS
The carry flag is cleared on success, or set on failure
(no children). On success, the child's process ID is
returned in hI, and its termination status is returned
in de.
-1-
3/19/82
'write (2)
write (2)
NAME .
write - write to a file
c
write(descriptor, buf, nbytes)
char *buf;
FUNCTION
This call writes nbytes from the indicated buffer to
the given open file. The number of bytes actually
wri tten is returned. Unlike the read call, .this number
should be the same as requested; otherwise, an error is
indicated.
RETURNS
A -1 indicates an error (bad descriptor or physical 10
error). Otherwise, the value nbytes is returned.
ASSEMBLER
(write = 4)
(descriptor in hI)
sys; write; buf; nbytes
RETURNS
The carry flag is cleared on success, or set on
failure. The number of characters actually written is
returned in hI.
-1-
Micronix Operating System
reference manual
MORROW.
CONTENTS OF REFERENCE SECTION 3:
alloc
ctime
fclose
ferror
floor
fopen
fread
fseek
getpwent
gets
perror
popen
SUBROUTINES
printf
putc
puts
scanf
setbuf
stdio
system
ttyname
The Subroutines are part of the libraries included with Whitesmith's C and Pascal. If you haven't purchased C, you won't have
any of these subroutines •
. Subroutines with "(3s)" in their page headings are contained in
the standard I/O library (/lib/libS.a).
There is more information about the libraries contained in the
file /lib/readme.
3/22/82
alloc (3)
alloc (3)
·SUBROUTlNE(S)
alloe~·
'free, realloe, ealloe - main memory allocator
C
char *alloe(size)
unsigned size;
free(ptr)
ehar *ptr;
char *realloc(ptr, size)
ehar *ptr;
unsigned size;
char *calloe(nelem, elsize)
unsigned nelem, elsize;
FUNCTIONS
The routines alloc and free provide an easy-to-use
memory allocation package. The alloc routine returns a
pointer to a block of at least size bytes long, which
begins on a word boundary.
The argument to free is a pointer to a bloGk allocated
previously by alloc. This block is available for
further allocation; its contents are left undisturbed.
Alloc allocates the first large reach of free space it
finds in its circular search from the last allocated or
freed block, uniting neighboring free blocks as it
searches. If no additional space is free, alloc calls
sbrk (~ee section 2) for more system memory.
Block sizes pointed to by ptr are changed by realloe to
size bytes. It may also return a pointer to a block, if
the block is removed. The values of the new and old
block sizes determine the changes in block contents;
the contents remain unchanged up to the lesser value of
the old and new sizes.
Alloe contains a valuable search function which may be
used to do storage compaction. Realloc works if ptr
points to a block that has been freed since the last
call of alloc, realloc or calloc. Compounding sequences
of free, alloc and realloc thereby augments alloe's
search strategy for storage compaction.
Allocation of space for an array of nelem elements of
elsize size is done by calloc. Each of these routines
returns a pointer to a space aligned for any type of
storage.
-1-
alloc (3)
3/22/82
alloc (3)
. ERRORS
Note that chaos results if space assigned by alloc
overrun, or if a random number is given to free.
is
A NULL pointer. (0) is returned by alloc) realloc and
calloc if no memory is available, or if a corrupt arena
is detected that was caused by storage outside the
bounds of a block •. If user wishes to recompile the'
alloc routine to rigidly check the arena during 'every
transaction, he/she is referred to the source code.
NOTES
The block pointed to by ptr may be destroyed if realloc
returns a O.
-2-
ctime (3)
ctime (3)
3/22/82
'SUBROUTINE(S)
ctime, localtime, gmtime, aset·ime, timezone - convert
time and date to ASCII
C
ehar *etime(cloek)
long *clock
#include
struet tm *loealtime(eloek)
long *cloek;
struct tm *gmtime(cloek)
long *elock;
char *asetime(tm)
struct tm *tm;·
char *timezone(zonetdst)
FUNCTION
Ctime converts a time pointed to by clock [as returned
by time (2)] into ASCII. It returns a pointer to a
26-character string in the following form:
Wed Mar 10 12:12:59 1982\n\O
All fields have constant width.
Loealtime and gmtime return pointers
containing the broken-down time.
Loealtime corrects for the
savings time, if necessary.
time
zone
to
structures
and daylight
Gmtime converts to Greenwich Me9n Time - the time
Micronix uses.
that
Asetime converts broken-down time to ASCII and returns
a 26-character string.
The include file structure declaration follows:
-1-
ctime (3)
3/22/82
ctime (3)
struct tm { 1* see ctime(3) */
. int'
.. -tm-' see;
int
tm min;
int
tm-hour
int
tm=mday;
int
tm_mon;
int
tm year;
int
tm-wday;
int
tmJday;
int
tm_isdst;
} ;The time is given using the following elements:
-
24 hour clock
day of month, 1-31 days per month
month of year, numbered 0-11
day of the week, numbered 0-6
date of the year, beginning 1900 day of the year 0-365
non-zero flag indicates daylight savings
j
The program checks the system to determine if time zone
and/or
daylight
savings
time
adjustments
are
appropriate whenever the local time is called for.
(Adjustments for changes in these conversions in 1974
and 1975 are included.)
Timezone returns the time zone, measured in minutes
westward from Greenwich, associated with its first
argument. If the second argument is 0, the standard
name is used. A non-zero flag indicates daylight
savings time.
A table is built into the routine. If the required name
does not appear on this table, the difference from GMT
is produced. In Afghanistan, for example:
timezone(-60*4+30), 0)
would be appropriate because it is eastward
+4:30. The string GMT+4:30 is produced.
of
G}IT
ERRORS
The return values point to static data whose content is
overwritten by each call.
ALSO READ
time (2)
-2-
fclose (3s)
3/22/82
fclose (3s)
'SUBROUTINE(S)
fclds·e, fflush - close oi- flush" a stream
c
#include
fclose{stream) .
FILE *stream;
fflush{stream)
FILE *stream;
FUNCTION
Fclose causes any buffers for the named stream to be
emptied and the file to be closed. Buffers allocated by
the standard I/O system are freed. This function is
performed automatically'by calling exit (2).
Fflush causes any buffered data for the named output
stream to be written to that file. The stream file
remains open.
ERRORS
These
routines
return an EOF if stream is not
associated with an output file, or if buffered data
cannot be transferred to that file.
ALSO READ
close (2), fopen (3), setbuf (3)
-1-
ferror (3s)
ferror (3s)
3/22/82
"SUBROUTINE(S)
feof,' ferror,
inquiries
clearerr,
fileno
stre-ant
stat;us
C
#include
feof(stream)
FILE *stream;
"ferror(stream)
FILE *stream
clearerr(stream)
FILE *stream
fileno(streaTll)
FILE *stream
FUNCTION
The following functions are implemented as
cannot be redeclared:
macros
and
Feof returns a non-zero when an end of file is read on
the named input stream; otherwise a zero is returried.
Ferror returns a non-zero when an error occurs whiie
reading or writing the named stream. Error must be
cleared by clearerr or the error indication "lasts until
the stream is closed. A zero is returned if no error
occurs.
Fileno returns an integer file descriptor associated
with stream [see open (2)].
ALSO READ
fopen (3), open (2)
-1-
floor (3m)
floor (3m)
3/22/82
·SUBROUTINE(S)
fabs, floor, ceil
ceiling functions
absolute
value
and
floor
and
c
double floor(x)
double X;
double ceil(x)
double X;
double fabs(x)
double X;
FUNCTION
Fabs returns the absolute value Ixl.
Floor returns the largest integer not greater than x.
Ceil returns the smallest integer not less than x.
ALSO READ
abs (3)
-1-
fopen (3s)
fopen (3s)
3/22/82
'SUBROUTINE(S)
fopen, freopen, fdopen - open a stream
C
Hinclude
FILE *fopen(filename, type)
char *filename, *type;
FILE freopen(filename, type, stream)
char *filename, *type;
FILE *stream;
FILE *fdopen(fildes, type)
char *type;
FUNCTION
Fopen opens the file specif~ed by "filename" and
associates it with a stream. It returns a pointer to be
used to identify the stream in subsequent operations.
Type is a character containing
values:
one
of "the
following
a - append; begin new writing, or begin at end
of current writing.
r - open for reading
w - create for writing
Freopen substitutes the named file in place of an open
stream; it returns the original value of stream. The
original value of stream is closed. This routine may
also be used to attach preopened constant names
stdin, stdout, stderr, - to specified files.
Fdopen associates a stream with a file descriptor
obtained from creat, dup, open or pipe (see section 2).
The type of the stream must agree with the mode of the
open file.
-1-
fopen (3s)
3/22/82
fopen (3s)
"NOTES
If filename cannot be
return the NULL pointer.
ALSO READ
open (2), fclose (3)
-2-
accessed,
fopen
and freopen
fread (3s)
fread (3s)
3/22/82
-SUBROUTINE ( S)
fread, fwrite - buffered binary I/O
C
#include
fread(ptr, sizeof(*ptr), nitems, stream)
FILE *stream;
fwrite(ptr, sizeof(*ptr), nitems, stream)
FILE *stream;
DESCRIPTION
Fread reads nitems of *ptr data from the named input
stream into a block beginning at ptr. The return is the
number of items actually read.
The standard output is line buffered if stream is
stdin; any partial output line is flushed before any
call to read (see section 2) to satisfy the fread call.
Fwrite appends nitems (maximum) of data to the named output stream. Data is of the type *ptr beginning at
ptr. It returns-the actual number of items written.
DIAGNOSTICS
A 0 is returned by fread and fwrite upon error or at
end of file.
ALSO READ
read (2)t write (2), fopen (3), getc
puts (3)t printf (3) and scanf (3).
-1-
(3),
putc
(3)t
fseek (3s)
3/22/82
fseek (3s)
'SUBROUTINE(S)
f.seek) . ftelJ.::, ·rew-ind - repos'ition a stream
C
#include
fseek(stream, offset, ptrname)
FILE *stream;
long offset;
long ftell(stream)
FILE *stream;
rewind(stream)
FUNCTION
Fseek sets the position of the next input or output
operation on stream. This new position is at the signed
distance, which is offset bytes from the beginning of
the file, the current position, or at the end of the
file, determined by whether ptrname has a value of 0, 1
or 2. This routine also undoes any effects of the unget
routine.
Ftell returns the current value of the offset relative
to the beginning of the file associated with the named
stream. This routine provides the only foolproof way to
obtain an offset for fseek.
Rewind(stream) = fseek(stream, 01, 0).
ERRORS
A -1 is returned by fseek for improper seeks.
ALSO READ
Iseek (2), fopen (3)
-1-
3/22/82
getpwent (3)
getpwent (3)
-SUBROUTINE(S)
getpwent, getpwuid, getpWhllnr;" -setpweht, end-pwent password file entry
-get
C
#include
struct passwd *getpwent()
struct passwd *getpwuid(uid)
int uid;
struct passwd *getpwnam(name)
char *name;
int setpwent()
int endpwent()
DESCRIPTIONS
Each of the "get" routines - getpwent, getpwuid and
getpwnam - each return a pointer to an object with the
following structure:
struct passwd
{
char
*name
*passwd,
unsigned char uid, gid;
char
*person, *dir, *shell;
}
Each pointer contains the broken-out fields of a line
in the password file.
Two fields, pw_quota and pw_comment, are unused. All
the other fields have meanings which are described in
passwd (5).
Routine Functions:
getpwent - reads the next line in
will open the file, if necessary.
the
file;
it
setpwent - rewinds the file
endpwent - closes the file
getpwuid - searches from the beginning of the file
until a matching user ID is found, or until an end
of file is encountered.
-1-
3/22/82
getpwent (3)
getpwent (3)
getpwnam - searches from the beginning of the file
until a matching name Is found, or until an-end 6f
file is encountered.
ERRORS
A zero (NULL pointer) is returned upon an error or at
end of file.
NOTES
All information to be saved should be copied
is contained only in a temporary area.
FILES
/etc/passwd
ALSO READ
getlogin (3), passwd (5)
-2-
since
it
·3/22/82
gets (3s)
gets (3 s)
SUBROUTINE(S)
gets, fgets - get a string from a stream
C
#include
char *gets(s)
char *s;
char *fgets(s, n, stream)
FILE *stream;.
FUNCTION
Gets reads a string into s from the standard input
stream, stdin. A newline character terminates the
string. This character is replaced in s by a NULL
character; gets returns its argument.
Fgets reads n-1 characters (or up to a
newline
character) from the stream into the s string. A NULL
character follows the last character read into s; fgets
returns its first argument.
ERRORS
Both gets and fgets return the constant pointer
upon an error or at end of file.
(NULL)
NOTES
To maintain backward compatibility, fgets maintains a
newline, gets deletes a newline.
ALSO READ
puts (3), getc (3), scanf (3), fread (3), ferror (3)
-1-
perror (3)
3/23/82
perror (3)
SUBROUTINE(S)
perror - system error messages
C
perror(s)
char *s;
FUNCTION
Perror displays error messages on the error file. These
messages describe the last error encountered during a C
program system call. The s argument string is printed,
followed by a colon, the message and a newline. The
argument string defines the name of the program in
which the error occurred. The message is taken from
errno (see Introduction to Section 2), which is set
when errors have occurred but have not been cleared.
ALSO READ
Intro (2)
-1-
popen (3)
popen (3)
3/23/82
SUBROUTINE(S)
popen, pclose - initiates I/O to/from a process
C
# include
-FILE *popen(command, type)
char *command, *type;
pclose(stream)
FILE *stream;
FUNCTION
The arguments to popen are pointers to null-terminated
strings. These strings contain: 1) a shell command line
and 2) an I/O mode, either "r" for reading or "w" for
writing. A pipe is created between the calling process
and the command to be executed. The value returned is a
stream pointer that may be used to write to the
standard input of the command or to read from its
standard output.
Streams opened by popen are closed by pclose. Pclose
waits for the associated process to terminate, then
returns the exit status of the command.
Since open files are shared, the type "r" command can
be used as an input filter, the type "w" as an output
filter.
ERRORS
Popen returns a 0 (NULL pointer) if the shell cannot be
accessed, or if files or processes cannot be created.
Pclose returns -1 if stream is not
command opened by popen.
associated
with
a
NOTES
Filter input may be badly positioned if user attempts
buffered reading before opening an input filter.
Similar problems with an output filter may be prevented
by flushing the buffer, i.e., using fflush. [See fclose
(3).]
READ ALSO
pipe (2), fopen(3), fclose (3), system (3), wait (2)
-1-
3/22/82
printf (3s)
printf (3s)
SUBROUTINE(S)
printf~·
fprlntf, spi-intf - formatted output conversion
C
# include (stdio.h>
printf(format [, arg] ••• )
char *format;
fprintf(stream, format [, arg] ••• )
FILE *stream;
char *format;
sprintf(s, format [, arg ] ••• )
char *s, format;
FUNCTION
Printf places output on stdout stream.
the
standard
output
Fprintf places output on stream - the named output.
Sprintf places output in the s string. This string is
followed by a "\0" character.
These functions convert t format and
print
their
arguments under the control of the first argument. This
first argument will be a character string containing 1)
plain characters that are copied to the output stream t
and
2)
conversion
specifications
which
enable
conversion and printing of the next printf argument.
The conversion specifications are introduced by the %
character. The options listed below may follow this
character:
A minus sign (-) specifying left adjustment of the
converted value in the indicated field.
A string of digits . specifying
field
width.
Converted values with fewer characters than the
indicated field width may be blank-padded to make
up the difference, unless the field width begins
with a 0, in which case it will be zero-padded.
A period (.) may separate the field width from
the
next string of digits.
additional digit string may be added specifying
a precision t or the number of digits that will
appear after the decimal point. This is used for -e
and -f conversions, or to specify the maximum
An
-1-
printf (3s)
3/22/82
printf (3s)
number of characters to be printed from a string.
[An asterisk (*) may indicate field width or
argument
preclslon, in which case an integer
indicates the field width or precision.]
A 1 may be specified with d, 0, x, or u to indicate
correspondence with a long integ-er argument. The
same thing may be accomplished with a capitalized
conversion code.
Any character may be given that specifies the type
of conversion to be executed.
The conversion
below:
characters
are
dox
Integer arg is converted
hexadecimal notation.
listed
to
and
decimal,
described
octal or
f
Float or double arg is converted
notation in the following format:
to
decimal
[-]ddd.ddd
The preclsl0n specification determines the amount
of "d"s. A precision of 0 results in no digits;
default is six digits.
e
Float or
forma t:
double arg is converted in the following
[-]d.ddde+dd
One digit before and one number after the decimal
point
equal
the
precision specification. By
default, six digits are produced.
g
Float or double arg is printed in one of the
formats listed above, depending upon which one
specifies full precision in the least amount of
space.
-2-
printf (3s)
3/22/82
printf (3s)
c
Characn~ra~g
'printed"; NULL characters are
ignored·~
s
Character arg is defined as a character pointer;
string characters are printed up to
a
NULL
character, or if specified, up to pOint indicated
by the precision specification.
%
Only the % is printed; arguments are not converted.
NOTES
Small or non-existent fields do not cause truncation.
Fields are padded when the specified field exceeds the
actual width.
Fields larger than 128 characters will fail.
Putc (3) prints the characters generated by printf.
ALSO READ
putc (3), scanf (3), ecvt (3)
-3-
putc (3s)
putc (3 s)
3/23/82
PROGRAM(S)
puts, putehar, fputc, putw - put character or word on a
stream
C
Hinclude
int putc(c, stream)
char c;
FILE *stream;
putchar(c)
fputc(c, stream)
FILE *streaJD.;
putw(w stream)
FILE *stream;
FUNCTIONS
Putc appends c (character) to stream, the named output;
it returns the character written.
Putchar(c) is the same as putc(c, stdout).
Fputc acts the same as putc but is- a function rather
than a macro. It can be used to save object text.
Putw appends w (word) to output stream and returns the
word written. It does not assume or cause special
alignment in the file.
Stdout (standard stream) is only buffered if the output
refers to something other than a terminal (default).
Setbuf (3) changes the default.
Stderr (also a
standard
stream)
is
unbuffered
unconditionally (default). Freopen [see fopen (3)]
causes it to become buffered; again, setbuf changes the
default.
Unbuffered output streams appear on the destination
file or terminal as soon as they are written. Buffered
output streams save up characters and write them as a
block. Blocks may be forced out prematurely with fflush
[see fclose (3)].
ERRORS
These functions
error.
return
-1-
the end of file constant upon
putc (3s)
putc (3s)
3/23/82
Ferror (3) should be used to detect putw errors.
Errors may occur some time after the
putc.
initial
call
to
NOTES
Since putc is implemented as a macro, it treats a
stream argument improperly. Specifically,
putc(c, *f-H-)j
does not work sensibly.
ALSO READ
fopen (3), fclose (3), getc (3), puts (3), printf
fread (3)
-2-
(3),
puts (3 s)
3/24/82
puts (3s)
SUBROUTINE(S)
puts, fputs - put a string on a stream
c
#include
puts(s)
char *s;
fputs(s, stream)
char *s;
FILE *stream;
FUNCTION
Puts copies s (null-terminated string) to stdout, the
standard output stream. It also appends a newline
character.
Fputs copies s to the named output, stream.
Neither of
character.
these
routines
copies
the terminal NULL
NOTES
To maintain backward compatibility,
newline, fputs does not.
puts
appends
a
ALSO READ
fopen (3), gets (3), putc (3), printf (3), ferror (3),
fwrite in fread (3)
-1-
3/24/82
scanf (3s)
scanf (3s)
SUBROUTINE(S)
scanf, fseanf, sBeanf - formatted input conversion
C
#include
scanf(format [" pointer] ••• )
char *format;
fseanf(stream,
FILE *streamj
char *formatj
fo~at
[, pointer] ••• )
sscanf(s, format [, pointer] ••• )
char *s , *format
,
'
o
FUNCTION
Scanf reads from stdin, the standard input stream.
Fscanf reads from the named input, stream.
Sscanf reads from the s character string.
Each of these functions read and interpret characters
according to a format, then store the results in its
argument A control string format and a set of -pointer
arguments indicating where the converted input is
stored are arguments expected by these routines. These
are described below.
0
Blanks, tabs or newlines,
white space in the input.
which
match optional
Any ordinary character besides % that must
the next character of the input stream.
match
Optional conversion specifications, which consist
of an assignment suppressing character (*), maximum
field width number, a conversion character and the
% character.
The
control
string
usually
contains conversion
specifications that direct interpretation of the next
input
field.
Unless
assignment
suppression was
indicated (u~ing the * character), the result is placed
in the variable pointed to by the
corresponding
argument.
An input field is a string of non-space characters. The
field extends to the next inappropriate character, or
until the field width (if specified) is exhausted.
-1-
scanf (3s)
3/24/82
scanf (3s)
The itrterpre-t'atioll -0-£ -the -'input field ',is irrdiGated ~by
the
conversion
character.
Corresponding
pointer
arguments are usually of a restricted type. A list and
description of legal conversion characters follows:
%
A
single
percent
assignment is done.
sign
(%)
is
expected.
No
d
Decimal integer is expected. Corresponding argument
should be integer pointer.
o
Octal integer expect~d. Corresponding
should be integer pointer.
argument
x
Hexadecimal
integer
expected.
argument should be integer pointer.
Corresponding
s
Character string expected. Corresponding argument
should be a character pointer pointing to an array
of characters. Array must be large enough to accept
string and terminating "\0" character that will be
added. A space character or newline terminates the
input field.
c
Character ex~ected. Corresponding argument should
be a character pointer. The ndrmal skip-over-space
characters are suppressed. Use "%ls" to read the
next non-space character.
Corresponding argument should refer to a character
array and indicate number of characters read if a
field width is given.
e, f
Floating point number is expected. Next field is
converted and stored through the corresponding
argument which should be a pointer to a float.
The
format for floating point numbers is an
optionally signed string of-digits that may contain
a decimal point followed by an optional exponent
field consisting of E (or e), followed by an
optionally signed integer.
-2-
scanf (3s)
scanf (3s)
3/24/82
. Left, br-acketindiea-tes a s'tring not to be delimited
by space characters. The string is defined by
characters followed by a right bracket. A as the
first character after the left bracket defines the
input field as all characters in the set of
characters following the
sign. Absence of this
sign means the input field is all the characters
within the brackets. Corresponding argument must
point to a character array.
A
A
The conversion characters d, 0 ~nd x may be either
capitalized or preceded by an 1 to indicate that apointer to long rather than int is in the argument
list. If these are preceded by h, indicates a pOinter
to short rather than int.
The
e
and f conversion characters may also
capitalized or preceded by 1 to indicate a pointer
double rather than float.
be
to
Scanf returns the number of input items successfully
matched and assigned. This may also be used to decide
how many items were actually found. The constant end of
file is returned upon end of input. This is different
from 0, which may be interpreted to mean no conversion
was done. If conversion was intended, it was frustrated
by an inappropriate character in the input. As an
example:
int i; float x; char name[50];
scanf("%d%f%s", &i, &x, name);
with the input
25 54.32E-l McCleary
assigns to i the value 25, x the value
contains "mccleary\O". Another example:
5.432.
Name
int i; float X; char name[50];
scanf("%2d%f%*d%[1234567890]", &i, &x, name
with the input
56789 0123 56a72
assigns 56 to i, 789.0 to x, skips "0123" and places
the string "56\0" in name. The next call to getchar
will return "a".
-3-
scanf (3s)
3/24/82
scanf (3s)
ERRORS
The success of matches' and' sUI>pr-escs-ed a-ssi.gnments can
be determined only indirectly.
NOTES
In cases of missing or illegal data, scanf -returns
of file on end of input.
en~
ALSO READ
atof (3), getc (3), printf (3)
-4-
an
3/24/82
setbuf (3s)
SUBROUTINE(S)
setbuf - assign
buff~ring
setbuf (3s)
to a
stre~~
C
#include
setbuf(stream, buf)
FILE *stream;
char *buf;
FUNCTION
Setbuf is used after a stream is opened, but before it
is read or written to cause the buf character array to
be used instead of an automaticalIy allocated buffer.
If buf is
unbuffered.
NULL (constant pointer), I/O is completely
Size of array is determined by a the constant,
An example:
BUFSIZ.
char buf[BUFSIZ];
A buffer is obtained from alloc (3) upon the first getc
or putc on the file. One exception is when the standard
output is directed to a terminal, in which case it is
line buffered. Normally, output streams directed to
terminals and stderr (standard error stream) are not
buffered.
When standard output is line buffered, it is flushed by
read (2) each time data is read from the standard
input.
ERRORS
By default,
buffered.
the
standard error stream should be line
ALSO READ
fopen (3), getc (3), putc (3), alloc (3)
-1-
stdio (3s)
stdio (3 s)
3/22/82
SUBROUTINES
stdio -standard buffered" I/O package _,
C
#include
FILE *stdinjo
FILE *stdout;
FILE *stderrj"
FUNCTION
This section describes
two
levels
of
buffered
input/outpui utilities: 1) in-line macro~ designated by
(3),
and 2) higher level standard I/O utilities
~esignated by (3s) or (3m).
The in-line macros, getc
quickly.
and
putc
handle
characters
Routines such as gets, fgets, printf, fprintf, fwrite,
fread, puts and scanf and fscanf use the in-line
macros; both levels may be freely intermixed.
Files with this type of associated buffering are called
streams and are declared to be a pointer to a defined
type FILE. Fopen (3) has the ability to
create
descrip~ive
data for streams. It returns a pointer to
designate the stream in all further transactions.
Normally, there are three open streams with constant
pointers declared in the include file associated with a
standard open file:
stdin - standard input file
stdout - standard output file
stderr - standard error file
A constant "pointer" (NULL 0) designates no stream.
An integer constant (end .of 'file, or EOF -1) is
returned upon error by any integer functions that deal
with streams or upon end of file.
Routines that use the I/O package must have the header
file with the pertinent macro definitions «stdio.h».
The include file declares all functions and constants
described in the sections designated by (3s); they need
no further declaration.
-1-
stdio (3s)
stdio (3s)
3/22/82
The following
macros:
constants
and
functions
are
used as
feof ferror fileno getc getchar putc
It is dangerous to redeclare these names.
ERRORS
The EOF value is consistently returned, indicating that
a FILE pointer has not been initialized with fopen.
This means that input or output has been attempted on
an output or input stream, or that a FILE pointer
designates corrupt FILE data.
This use of the standard library has been changed to
line buffer output to a terminal by default. It
attempts to flush the output whenever a read (see
Section 2) from the standard input is necessary. In
most cases, this makes the utility more efficient. The
actions themselves should be transparent unless it is
used with programs which use standard I/O routines and
read (2) to read from the standard input.
When large amounts of computation are done after
outputting part of a line to a terminal, it is
necessary to fflush (3) the standard output before
continuing on so that the output appears.
ALSO READ
close (2), open (2), read (2), write (2)
-2-
system (3)
system (3)
3/24/82
SUBROUTINE(S)
system - issue a shell command
C
system(string)
char *string;
FUNCTION
System causes string to be given to sh (see shell Section 1) as input just as if the string had been
typed as a command at a terminal. Current process wait~
until the shell has completed then returns the exit
status of the shell.
ERRORS
An exit status of 127 means
executed.
ALSO READ
popen (3), exec (2), wait (2)
-1-
the
shell
could
not
be
ttyname (3)
ttyname (3)
3/24/82
SUBROUTINE(S)
ttyname, isatty, ttyslot ... find name of a terminal
C
char *ttyname(fildes)
isatty(fildes)
ttyslot()
FUNCTION
Ttyname returns a pointer. to the null-terminated path
name of the terminal associated with fildes, the file
descriptor.
Isatty returns a 1 if the file descriptor is associated
with a terminal; a 0 is returned if it isn't.
Ttyslot returns the number of the entry in the ttys
file (see Section 5) for the control terminal of the
current process.
ERRORS
Ttyname
returns a 0 (NULL pointer) if the file
descriptor does not describe a terminal that exists in
the "/dev" directory.
Ttyslot returns a
inaccessible, or if
terminal.
o if the "/etc/ttys" directory is
it
can't
determine
the
control
NOTES
Return values point to
overwritten by each call.
FILES
/dev/*
/etc/ttys
ALSO READ
??ioctl (2), ttys (5)
-1-
static data whose content is
ttyname (3)
ttyname (3)
3/24/82
SUBROUTINE(S)
ttyname, isatty, ttyslot - find name of a terminal
C
char *ttyname(fildes)
isatty(fildes)
ttyslot()
FUNCTION
Ttyname returns a pointer to the null-terminated path
name of the terminal associated with fildes, the file
descriptor.
Isatty returns a 1 if the file descriptor is associated
with a terminal; a 0 is returned if it isn't.
Ttyslot returns the number of the entry in the ttys
file (see Section 5) for the control" terminal of the
current process.
ERRORS
Ttyname
returns a 0 (NULL pointer) if the file
descriptor does not describe a terminal that exists in
the "/dev" directory.
Ttyslot retur~s a
in'access"ible " or if
terminal.
Q
if~the""j.etc/ttys"
it
can't
determine
directory is
the control
NOTES
Return values point to
overwritten by each call.
FILES
/dev/*
/etc/ttys
ALSO READ
stty (2), ttys (5)
-1-
static data whose content is
Micronix Operating System
reference manual
MORROW.
CONTENTS OF REFERENCE SECTION 4:
cables
djdma
djmem
hdca
hddma
10
mem
multio
network
DEVICES
null
ports
printers
cables (4)
cables (4)
5/10/83
cables
network
cables
for
modems, terminals, printers, and the
DESCRIPTION
This document tells you how to build cables to con~ect the
Decision to various devices. The presen,tation is rather
technical. If you don't want to build one of these cables
yourself, you may purchase it from y,?ur d~aler or from
Morrow, or y~ur dealer may be able to build it for you from
these specifications.
The first three serial ports on the, Decision use the
Wunderbus I/O motherboard, which
(unlike
the
MULTI 0
expansion board) has no prov1s10ns for configuring the
RS-232 connections via jumpers. Thus the cables must do this
configuration internally. Also, the Wunderbus has an artwork
error which assigns pin 5 as Carrier-Detect (RLSD) and pin 8
as Clear-to-Send (CTS). The cables detailed below take this
into account.
Four serial cables and two parallel cables
~re
discussed:
1. Decision to serial printer or terminal
2. Decision to Decision (network)
3. Decision to modem
4. MULTIO to modem
5.
Decision
to
Centronics-compatible
parallel
printer
6. Decision to Diablo-compatible parallel printer
In general, the serial cables require two DB-25P male
connectors (ITT Cannon or AMP) with shielded shells on both
ends, and should be made with 22 ~guage ..shielded wire. The
RS-232 standard specifies a maximum length of 25 feet
(although much longer cables have been known to work). The
parallel cables can be made with 50 conductor flat cable.
They both have a 50 pin female flat cable connector (Ansley
609-5000M)~ on
the computer end. Cable 6 has the same
connector on the the printer end, while cable 5 uses a 36
pin female ribbon connector (Amphenol 57-40360).
-1-
cables (4)
cables (4)
5/10/83
DECISION TO SERIAL PRINTER OR TERMINAL
The 'cable required to comunicate with a terminal or printer
can be constructed so that it will work with both the
Decision and the, MULTIO board. This assumes that the
hardware handshaking on the printer is via pin 20. (Most
printers support this. One exception is the NEe Spinwriter,
which uses 'pin 19 instead.)
The Decision's serial ports cannot be jumpered. On the
MULTI 0 , the appropriate serial port should be jumpered as
follows:
I
I ABC D _E G
I I -I II' I I
I -H I J K L N
J
The cable requires 22 guage shielded 8 conductor wire. The
pinout for both the MULTIO and the Decision is the same:
--------------------------DECISION
DB-25P connector
1
2
3
7
I I I I
I I I I
1
2
3
7
568
\1/
20
I
/1\
20
I
568
DB-25P connector
PRINTER or TERMINAL
-------------------~-------
Note: For most terminals, only pins 2, 3, and 7 need be
connected. The cable descr~bed here has the advantages of
working interchangablly with printers and terminals, and of
higher rel~ability at high baud rates.
-2-
cables (4)
cables (4)
5/10/83
NETWORK
The Micronix network uses the serial ports on the Decision
or the MULTIO. Since the first priority in designing this
network was low cost, a simple unshielded 3. conductor cable
is specified. (The network does extensive error checking, so
noise on the cable will only slow it down.) The MULTIO
should be jumpered as for #1 above. The cable should be
constructed as follows:
Decision or MULTIO
DB-25P connector
2 3 7
I I I
3
2
7
DB-25P connector
Decision or MULTIO
DECISION TO MODEM
This requires 22 guage shielded 8 conductor wire:
DECISION
DB-25P connector
1
23567
'8
20
I I I I I I I I
1
3
2
8
6
7
5
DB-25P connector
MODEM
-3-
20
cables (4)
5/10/83
cables (4)
MULTIO TO MODEM
(Note: this discussion assumes that the serial ports on the
MULTIO have been brought out to female D connectors on the
back of' the computer with special c~bles installed at the
factory. If this has not beeD, done, you can order these
"MULTIO serial cables" from Morrow.)
Jumper
the
appropriate
as follows:
commun~cations
A C D E F
I
MULTIO
serial
port
22
guage
G H
K L M N I
The cable from the computer to the modem requires
shielded 8 conductor wire:
--------------------------I
I
to MULTIO
DB-25P connector
2
3
5
6
7
8
20
I I I I I I I I
1
modem
I I I I I I
B J
1
for
2
3
5
6
7
8
DB-25P connector
MODEM
20
---------------------------
-4-
I
I
I
I
I
I
I
cpbles (4)
cables (4)
5/10/83
DECISION TO PARALLEL CENTRONICS
This cable also works with the MULTIO expansion board, since
its parallel port is identical with the Decision's. This is
the most complex cable. It is available by special order
from Morrow. Its pinout is:
.
.
------------------------------------------------------
DECISION
pin
flat
cable connector
50
I
I
I
I 2 3 12 13 21 24 26 27 28 33 36 37 39 40 42 43 45
I I I I I I I I I I I I I I I I I I
I 16 12 32 31 1 36 10 11 13 5 3 2 4 6 7 8 9
I
36 pin female ribbon connector
I
CENTRONICS-COMPATIBLE PRINTER
. I
or, sorted the other way:
DECISION
50 pin flat cable connector
21 37 36 39 33 40 42 43 45 26 27 3
28 2
13 12 24
I
,. I
I
1
I
2
I
I
3 4
I
5
I
6
I
7
I
8
I
9
I
I.
I
I
I
10 11 12 13 16 31 32 36
36 pin female ribbon connector
CENTRONICS-COMPATIBLE PRINTER
DECISION TO PARALLEL DIABLO
This cable also works-with the MULTIO expansion board, since
its parallel port is identical with the Decision's. All you
need is a simple straight-through 50 conductor cable with
50-pin flat cable female connectors on both ends. It is the
same cable that Morrow uses for its disk drives. If you need
to build the cable, only 17 conductors are actually needed:
DECISION
50 pin flat cable connector
2
I
2
3
1
3
12 13 21 24 26 27 28 33 36 37 39 40 42 43 45
I
I
I
I
I
I
I I I I I II I I
12 13 21 24 26 27 28 33 36 37 39 40 42 43 45
50 pin flat cable connector
DIABLO-COMPATIBLE PRINTER
------------------------------------------------------
-5-
djdma (4)
9/27/82
djdma (4)
NAME
djdma - Morrow Designs Disk Jockey Direct
Memory Access floppy disk controller
DESCRIPTION
The Morrow Designs DJDMA is an 8-100 floppy disk drive
controller. This document describes the Micronix driver
for the DJDMA. All access to the DJDMA is handled by
the driver.
The DJDMA provides access to up to eight 8 inch and/or
5 1/4 inch floppy disk drives (limited to four of each
type). At present, there may be only one controller
board per system.
Currently, only IBM format 8" floppies and
hard sectored 5 1/4" floppies are supported.
10
hole,
Diskettes used with Micronix must be formatted.
The following formats are supported. They are listed
with the number of blocks per disk (a block is 512
bytes).
'8" , - 128 byte sectors, single-sided, 487 blocks
8" , . 128 byte sectors, double-sided, 975 blocks
8" ,
256 byte sectors, single-sided, 975 blocks
256 byte sectors, double-sided, 1950 blocks
8" ,
-8" ,
512 byte sectors, single-sided, 1125 blocks
512 byte sectors, double-sided, 2250 blocks
8" ,
8" , 1024 byte sectors, single-sided, 1200 blocks
8" , 1024 byte sectors, double-sided, ~400 blocks
5 1/4",
5 1/4",
5 1/4",
256 byte sectors, single-sided, 35 track,
512 byte sectors, single-sided, 35 track,
512 byte sectors, double-sided, 35 track,
160 blocks
330 blocks
660 blocks
5 1/4",
5 1/4" ,
512 byte sectors, single-sided, 40 track,
512 byte sectors, double-sided, 40 track,
380 blocks
760 blocks
5 1/4",
5 1/4",
512 byte sectors, single-sided, 80 track, 780 blocks
512 byte sectors, double-sided, 80 track, 1560 blocks
Note that because of reserved tracks (usually the first
two), the available space is reduced slightly.
All 8 inch formats are standard 77 track.
While you gain approximately 7% in additional capacity
with 1024 byte sectors on an 8 inch floppy diskette,
the loss in transfer speed is considerable.
-1-
djdma (4)
9/27/82
djdma (4)
The optimum choice for Micronix floppy diskettes is
512-bytes, single or double sided,' unless
space
considerations dictate otherwise.
The
other
formats
compatibility.
are
included
for
backward
Alternate sectoring is optional and available
by
selecting the appropriate minor device number from the
table below.
Bit 4 of ,the
sectoring'.
minor
device
number
selects
alternate
(Alternate ,sectoring is recommended because it doubles
the reading speed, but does not make much difference in
writing speed.)
Note that alternate and non-alternate sectored media
are incompatible (i.e., the sectors appear scrambled).
The far utility (see Section 1) can read a CP/M
formatted diskette under either alternate or straight
sectoring, however.
The sector arrangement schemes fall into
even and-odd sector per track values.
classes
for
The sectors are numbered
0,2,4,6,8,10,12,14,1,3,5,7,9,11,13,15
for a 15 sector per track disk (for instance).
and
0, 2, 4, 6, 1, 3, 5, 7
for
an~
sector per track disk.
The major and minor device numbers listed below are
used in conjunction with the mknod program.
See mknod
manual.
in
section
1
of
the
Micronix
reference
The major device number corresponding to the DJDMA is
currently 2.
The minor device numbers have the following meanings:
-2-
djdma (4)
djdma (4)
9/27/82
minor
meaning
0
1
2
3
8"
8"
8"
8"
4
5
5 1/4" 5 1/4" 5 1/4" 5 1/4" -
6
7
-
drive
drive
drive
drive
8
9
10
11
8"
8"
8"
8"
12,
13
14
15
5 1/4" 5 1/4" 5 1/4" 5 1/4" -
-
0
1
2
3
drive
drive
drive
drive
drive
drive
drive
drive
0
1
2
3
o with alternate sectoring
1 with alternate sectoring
2 with alternate sectoring
3 with alternate sectoring
drive o with alternate
drive, 1 with alternate
drive 2 wit:h alternate
drive 3 with alternate
sectoring
,sectoring
sectoring
sectoring
Note that there are 96-trac.k !> 1/4" drives and 48-track
5 1/4" drives. For example, if you have only 48 track
drives, you cannot read 96-track diskettes.
There are five different sets ,of delay constants
available for stepping delay and head set~le delay. The
delay numbers for step time and head settle time were
taken
from real-world drive descriptions 'and are
intended to be appropriate for the drive types listed
below.
If you are using a drive not listeg below, you should
select the one$ most closely suited to the types of
drives you are using.
Refer to the following table:
settle
minor
8
3
8
15
16
5
20
40
15
20
10
seek
0
0
16
32
-3-
type
SA 800
SA 850
Tandon
SA 200
SA 400
(8" drives)
(5 1/4" drives)
djdma (4)
9/27/82
djdma (4)
The column entitled "seek" gives the seek time in
milliseconds per track. "settle" is the disk drive head
settle time in milliseconds. "minor" is the minor
device addend, and "type" gives manuf.acturers drive
types. "SA" stands for Shugart Associates.
To select apart·i.cular drive type. add in
listed in the "mi,;nor" column of this table.
the
value
If you are fam.iliar with binary notatio,n, the drive
type is encoded in bits 4 and 5 of, the minor device
number.
EXAMPLES
For a SA800 drive "~" with alternating sectoring the
minor device number would be 8.
For a SA850 drive "A",with alternC;l,ting
minor device number would be 24.
sectoring
the
For a SA200 drive "A" with ~lternating sectoring. the
minor device number would be 28.
To create an' appropriate spe'cial file for an
1/4" drive), the command would be:
SA200
(5
mknod /dev/mfa ·b 2 28
SEE ALSO
mknod (1), fa r (1)
Disk
Jockey
/ Direct Memory
Controller Technical Manual
-4-
Access
Floppy
Disk
. djmem (4)
4/18/82
djmem (4)
NAME
djmem
- Morrow Designs DJDMAfloppy controller memory ,device
DESCRIPTION
The djmem device provides access to the memory internal
to the DJDMA floppy' controller and to the funcions
"sense status" and "execute controller routine". The
djdma memory device was. originally implemented to allow
floppy
diskette fo~atting under Mlcronix. It is
conceivable that it may be put to other uses.
The djdma memory device driver ignores the minor device
number. That is to say you may access only on djdma
controller and there is only one way to access it.
The djdma and djmem drivers are mutually exclusive. If
you attempt to use one while the other is in use you
will get the 'error return "File or Device Busy".
A read on the djmem device transfers data from the
djdma contoller's memory ito the user's memory.
A write transfers from user memory to controler memory.
Seek may be used
controller memory.
The only
inclusive
manual.
to
position
the
pointer
into
safe locations to write are Oxl030 to Ox127f
according to the djdma tech.
reference
Note that the "Ox"
indicates base 16.
preceding
the preceding numbers
At most 1024 bytes may be transferred in a single
read/write call. Larger byte counts cause an "invalid
argument" error.
So_ far
the
straightforward.
implementation
has
been
very
In order to pull off formatting a couple extra extended
features are needed. These are implemented via the
system calls stty() and gtty().
Gtty on the device caused a "sense status"
be performed and the results returned.
command
to
Stty causes an "execute controller memory" command to
be performed.
Gtty returns 4 bytes of meaningful status. Stty returns
one byte of status.
-1-
'djmem (4)
4/18/82
djmem (4)
Gtty and Stty are called by passing a pointer to a
6-byte structure in user memory. The user process ,fills
out the first 2 bytes of memory, Gtty or Stty fill out
the remaining 4 bytes.
For gtty the first 2 byte word represents the device
number on which to perform the status operation.
For stty the first 2 byte quantity is the address in
conroller memory to execute.
The user familiar with C will find the following
structure declarations illuminating. Note that these
declarations are available in /include/dj.h.
struct djstat
{
int drive;
char status [4];
};
struct djexec
{
char *address;
char status [4];
};
For gtty the drives are numbered as follows:
There are 8 possible drives. Four 5
inch.
inch
and
four
8
The 8 inch drives are numbered 0-3. The 5 inch drives
are numbered 4-7.
The meanings of the 4 status bytes returned
described in the djdma technical reference manual.
are
The single status byte returned by the stty call has
whatever meaning the controller routine called ascribes
to it.
Note that the stty call is potentially dangerous. It is
easily capable of dropping the whole system because
through it you can do anything the conroller can do,
which includes reading or writing any portion of
memory.
This is also a security breach.
It is recommended then that the file /dev/djmem be
highly restricted and write locked.
-2-
djmem (4)
4/18/82
'djmem (4)
SEE ALSO
djdma(4), formatdj(l) intro(2), chmod(l),
Techincal Reference Manual.
-3-
Is(l)
DJDMA
hdca (4)
hdca (4)
8/6/82
DEVICE
HDCA - Morrow Designs' Winchester disk
controlle~
FUNCTION
The HDCA controls up to four 8 inch Winchester disk
drives. Micronix currently supports 3 drive sizes:
m10
m20
m26
10 megabytes
20 megabytes
26 megabytes
The device names (in the /dev directory) for these
disks depend on their position on the HDCA daisy-chain.
Drive A is called "hda", drive B is called "hdb", etc.
The major/minor device numbers are:
1/0
hda
1/1
hdb
1/2
hdc·
1/3
hdd
Unlike the HDDMA drives, Micronix can automatically
detect the size of the HDCA drives, so there is no need
to indicate the drive size in the device name or
number.
Micronix does not support a disk formatting program, so
each drive must be ,formatted under CP/M. A sector skew
of 6 is recommended, but is not critical. Since these
drives are soft-sectored, there is npcompatibility
problem with different skews.
-1-
hddma (4)
hddma (4)
8/6/82
DEVICE
HDDMA - Morrow Designs' dma hard disk controller
FUNCTION
The HDDMA ~ontrols up to four S 1/4 inch Winchester
disk drives. Micronixcurrently supports 3 drive sizes:
mS
ml0
m16
S megabytes
10 megabytes
16 megabytes
The device names (in the /dev directory) for these'
disks
depend
on
their
position
on the HDDMA
daisy-chain. An mS attached as drive' A is called·"mSa",
an m16 attached as drive D is called "in16d", et'c. The
major /minor device numbers' are as follows:
3/0,
3/1
3/2
3/3
m5a
m5b
m5c
m5d
3/8
3/9
3/10
3/11
3/4 ml0a
3/5 ml0b'
3/6 mldc
3/7mlOd
m16a
m16b
m16c
m16d
Micronix does not support a disk formatting program, so
each drive inust be formatted under CP/M. A sect'or skew
of 6 is recommended, but is not critical. Since these
drives are soft-sectored, there is 116 compatibility
problem with different skews.
If you ever have to explore the surface of one of these
drives without the intervention of Micronix, you should
know that Micronix logically "rolls" the tracks by
(number of tracks) / 2. Thus on an mS, which has IS3
tracks, logical track 0 is physical track 76. The
reason for this is that most Micronix systems have only
one hard disk, which must serve as both the root device
and the swap device. When Micronix sees that rootdev -'swapdev, it uses the space above the file system as
swap space. Thus, the logical disk looks like:
ilist
file space
swap space
1-------1-----------------------------1------------1
while the physical disk looks like:
file space
swap space
ilist
file space
------------1------------1-------1----------------In a busy system, the disk heads spend most of their
time over the swap space and the ilist, so this gives a
performance advantage.
-1-
io (1)
7/19/82
NAME
io -
zao
'io (1)
I/O space device
DESCRIPTION
Under
a
multi-user operating system, it is not
acceptable to allow user programs to ~xecute certain
instructions
in
an
unregulated
way.
The
Z80
instructions "in" and "out" fall into this category. It
is, however, desirable to be able to perform these
operations in special circumstances.
The "io" device allows users to access the,Z80 I/O
ports through the file system. Reading from the device
causes
the
results
of "in" inst,ructions to be
transferred to the'user's memory space.
Writing to the device causes "out" instructions to
executed using the data in the user's memory space.
be
Seeking
on the device sets the I/O address for
subsequent reading/~nputting or writing/outputting.
There are two classes of I/O device. One allows access
to all of I/O space. The other allows access only to a
single port.
Note that it would be extremely easy to crash the
system
through this avenue, and it is therefore
recommended that the "/dev/io"
file
be
heavily
protected, perhaps mode o and owned by root.
Examples are in order:
To input a value from port 10:
f
= open (II/dev/io", 0);
seek (f, 10, 0);
read (f, &data, 1);
The operation of the I/O device is dependent on the
minor device number of the special file associated with
it.
All 256 possible minor device numbers (0
meaning.
255)
have
When accessed through minor device zero, it is possible
to select which I/O ports you access. This is the
meaning of a seek on the io device file. For example,
seeking to location 87 will cause subsequent reads and
writes to the file to be interpreted as references to
-1-
10 (1)
io (1)
7/19/82
10 port 87.
Unlike other devices, the file offset does not progress
with reads and writes. It may only be changed by
seeking. It was thought that this arrangement was more
in th~ spirit of I/O space accesses than the more
Micronix-like alternative.
Non-zero minor device numbers limit access to that one
I/O port whose address is the same as the minor device
number. It is therefore possible to have I/O space
select~vely
protected, while giving any user access to
some certain' port.
For example, if you wanted to allow free access to
ports 77 and 78 by any user on the system, you would
issue the following commands:
mknod /dev/?-'o77 c "3 77
mknod /dev/i078 c 3 77
chmod a=rwx /dev/io77 /dev/i078
If the minor device
simply ignored.
number
FILES
/dev/io - the device file
-2-
is
not
zero,
seeks
are
6/25/82
mem (4)
mem (4)
DEVICE
mem - core memory device
DESCRIPTION
This device reads and writes kernel memory (addresses 0
to FFFF). One must be exceed'ingly careful in protecting
this device, since there are several hardware registers
in this address range that will crash the system upon
being read.
-1-
multio (4)
multio (4)
12/2/82
NAME .
multio - Morrow Designs MULT/IO board interface
DESCRIPTION
The Micronix MULT/IO,interface supports all features of
the MULT/IO and Wunderbuss I/O boards. It will run
unchanged in rack mount or table top models of the
Decision I.
Serial ports and both Diablo and Centronics style
parallel parallel protocols are supported. A cable
adapter (available from Morrow Designs) is required to
use the. MULT/IO with· a Centronics style parallel
interface.
The
MULT/IO
board
has
three ACEs (Asyncronous
Communication Elements) and 1 parallel port for I/O
device connection. The ACEs communicate via standard
RS232 serial interface. The parallel port is a standard
Diablo (50-pin daisy-wheel) interface.
Each MULT/IO board must have its I/O port addresses set
by means of switches on the circuit board. For proper
operation, the base I/O address must be 48 (hex) for
the first MULT/IO board.
In a Micronix system in which there are possibly many
MULT/IO boards, the boards form a series. In the
Decision I Table Top model, the
Wunderbuss
I/O
motherboard functions as the first of the series.
Micronix expects to find the Mult/IO boards
(or
Wunderbuss) as I/O (hex) locations 48, 58, 68, 78. The
current incarnation of the Micronix Mult I/O drivers
supports at most 4 Mult I/O boards (or 1 Wunderbus I/O
and 3 Mult I/O boards).
In the following we talk about "minor device numbers".
Use_"mknod" to create a new
particular minor device number.
Use "Is -1" to
existing files.
view
the
special
minor
Minor device numbers 0-3 refer to
addresses at I/O location 48 hex.
file
device
the
with
a
numbers of
Mult/IO
board
Minor device numbers 4-7 refer to the Mult/IO board
addresses at location 58 hex, and so on with 68, 78.
The first minor device number of each group of four
refers to the parallel printer on that board. Minor
device numbers 0, 4, 8, etc. refer to
parallel
-1-
multio (4)
multio (4)
12/2/82
printers.
If the 16's bit is set in the minor device .number, then
the port will be treated asa Centronics rather than
Diablo parallel interface. Minor device numbers 16, 20,
24, and 28 refer to Centronics 'parallel ports on the
four MULT/IO boards.
You may mix Diablo and Centronics style parallel
interfaces in the same system. It is possible to run
Centronics interface printer(s) and Diablo interface
printer(s) concurrently.
Sending data to the Mult I/O is fairly straightforward
except for the case of the Diablo parallel interface.
Here the parallel data' path is wider than one byte. In
order to pass data to the driver through a byte stream,
a special format was developed.
A conversion filter is provided which is capable of
encoding an ordinary text file into a form suitable for
the driver.
Bytes sent to the
following format:
parallel
printer device have the
Each byte is stand-alone and has a
itself.
meaning
all
by
Bit-O is the least significant bit and bit-7 is the
most significant bit in this discussion.
There are two types of information one can send
the printer, motion commands and print commands.
to
If bit-7 is clear, the the byte is taken to mean a
character to be printed. Otherwise, if bit-7 is set,
the byte indicates a motion command.
If bit-6 is set, the byte indicates vertical motion.
If bit-5 is set, the byte indicates backwards motion
(up or left).
Bits 0 - 4 (the low order 5 bits) are
the magnitude of motion desired.
taken
to
be
The unit of motion is 1/120" for horizontal motion and
1/48" for vertical motion.
If you want to move farther than 31
must send a series of motion bytes.
-2-
increments,
you
multio (4)
multio (4)
12/2/82
These
once.
are
accumulated and optimized L then sent all at -
Note that this scheme allows elaborate high-level
interface. Even several different interfaces, each with
its own set of escape sequences or what have you, all
translate to common Mu1t/IO parallel printer motion and
print byte formats.
SEE ALSO
diablo (1)- - Diablo parallel high level conversion.
tty (4) -
the tty interface.
~scription
mknod (1) - Make a new special file.
Is (1)
numbers).
List
files
(including
-3-
major/minor
device
network (4)
4/19/83
network (4)
network - the Miconix network
DESCRIPTION
Micronix allows any number of Decisions to be interconnected in any
pattern with simple. low cost hardware. Files can be copied from any
source to any destination on the network (see cp in section 1). and
any user may send mail to any other user (see mail in section 1).
This is all done with ordinary serial I/O ports and 3-conductor
unshielded cables. Error checking is extensive. so that ca,bles may be
cut and patched, and machines may be crashed and restarted. all with
good assurance that all files will arrive intact. There is a penalty
for this generality and low cost. however. The transfer rate is slow
(about 40-50 bytes per second). But since all network activity is in
the background, users need not wait idly for file transfers to
finish.
Two-machine network
Let's begin by describing the simplest network: two machines with one
cable between them. First, you muSt choose names for the two
machines. These names are arbitrary; the only requirement is that
each machine on the network must have a unique name. The names should
also be short and easy to type. In this case, let's call them "sales"
and "doc".
Next, you must buy or build a cable long enough to connect them. (See
cables in section 4.) Then you must choose a free serial port on each
machine (see ports in section 4). Let's"say that you have choosen
ttyD on doc, and ttyF,on sales. The cable can be plugged in at this
point -- either end to either machine.
Now you must edit three files on each machine. These files are:
/etc/ttys
/etc/netmap
/etc/rc
The /etc/ttys file tells which 10 ports on the local machine are
connected to the network. The /etc/netmap file gives the layout of
the network. The /etc/rc file contains commands that are run every
time the system goes multi-user. In this case, we will insert a
command to start the "network daemon" (the background process that
runs the network).
Miconix comes with WordStar (a screen editor) and edit (a line
editor). You may use either to edit these files. Instructions for
using edit on the ttys file are contained in the ttys document in
section 5.
-1-
network (4)
network (4)
4/19/83
Here is what you must do to each file on each machine:
machine
action
file
doc
letc/ttys
Find the line that begins with ttyD.
Change it to read as follows:
ttyD . 1200 net-sales
doc.
/etc/netmap
Chang,e (or create)' this file to read:
doc
sales
doc
/etc/rc
Add the following lines:
echo Starting network
netdaemon
sales
/etc/ttys
Find the line that begins with ttyF.
Change it to read as follows:
ttyF 1200 net-doc
sales
/etc/netmap
Change (or create) this file to read:
sales
doc
sales
/etc/rc
Add the following lines:
echo Starting network
netdaemon
You will have to bring the system down (with the down command) aneJ
then start it up again befo.'re these changes take effect • You c'an test
the network by typing the following command from the doc machine:
% cp /etc/ttys sales%/tmp
The /etc/ttys file should appear on the sales machine in the /tmp
directory. See cp and mail in section 1 for more information on using
the network.
Three-machine network
Now suppose we want to connect a
network.
thir~
machine named "admin"
to
the
The new machine can be .connected to any of the existing. machines. It
is only necessary to connect it to one of them, but connecting to
more than one might speed up the network by providing a more direct
path between machines. For example, you could connect the new machine
as follows:
sales -------- doc
admin
This requires a total of 6 10 ports, 2 on each machine. But
-2-
messages
network (4)
will be sent di~ectly
connect this way:
4/19/83
between
network (4)
any pair of machines. Or you could
sales -------- doc -------- admin
This network uses only 4 ports: 1 on sales t 2 on doc t and 1 on admin.
The disadvantage is that messages between sales and admin have to go
through doc. This will be done aut~maticallYt but it takes longer.
Since the emphasis'in the design of this network is low cost t the 4
port alternative is recommended. (But if you have no other use for
the ports t go ahead and use all 6.)
Let's assume that you are going to use the straight-line connection
(the 4 port alternative). First t you must choose a free serial port
on doc t say ttyE t and one on admint say ttyC. Connect these ports
with a network cable, and change the configuration files as follows:
/etc/netmap
/ etc/rc
/ etc/ttys
-----------
-------
sales
d-oc admin
no change
---------
no change
doc
doc
admin sales
no change
ttyE 1200 net-admin
admin
admin
doc sales
netdaemon
ttyC 1200 net-doc
sales
General networks
The only restriction on the shape of the network is a physical one: a
seperate serial port is required at each end of ea~h cable.
Otherwise, the network can be a straight line, a start a ring, or any
pattern. The rules to follow in setting up the 3 configuration files
are as follows:
- /etc/ttys -- Find the lines corresponding to each network port on the
local machine. Put the word 1200 on each line, and in addition, put
the word net-name, where "name" is the name of the machine to which
that port is connected.
/etc/rc -- Put the command netdaemon in the file. It should be alone
on a line. It should appear only once, no matter how many network
ports there are on the machine. Optionally, it can be preceeded by an
anouncement to remind the operator the network is being started •
./etc/netmap
The name of the local machine should appear alone on
the first line. Each succeeding line should begin with the name of a
machine that is directly connected to the local machine. If there are
additional machines on the network, their names should appear (in any
order) following the name of the direct connection through which they
can be reached. If there are several ways to reach an "indirect"
machine, only one connection should be given: the one that leads to
the machine via the shortest route.
-3-
network (4)
network (4)
4/19/83
For example, let's look at several different networks, and a possible
netmap file for the "doc" machine in each network.
Line
Ring
sales -- doc -- admin -- support
doc
I
I
admin
Star
sales
support
doc
sales
admin support
support
sales ---- doc ---- admin
I
I
support
Star
doc
sales
admin
doc ---- sales --- admin
doc
sales
admin
support
doc
sales admin support
support
Dipper
doc
admin --- support
I
----- sales
SEE ALSO
cp (l)t mail (1), cables (4), ports (4)
-4-
doc
sales
admin support
6/25/82
null (4)
null (4)
NAME
null - the null device
DESCRIPTION
The
null
device
has the <;,urious property that
everything written to it is completely ignored and
thrown away. Reading from this device yields an end of
file every time.
The m~no.r device numb~r is ignored. The major, device
number is zero in th~ current implementation.
This device may seem to be of limited usefulness, but
don't get rid of it~ th~ shell uses it to set up the
standard input of background processes.
EXAMPLE
cat file
> /dev/null
To read a file but discard the. results.
-1-
ports (4)
3/23/83
ports (4)
ports - how to identify the 10 ports on the Decision
DESCRIPTION
The back of the Decision I has at least three "serial"
ports and at least one "parallel" port. The serial
ports' look like thin sideways D's. They are called 25
pin female D connectors. (~ere is a smaller 15 pin
female D connector that is not used.)
'The
parallel ports are 50 pin "flat cable" male'
The same kind of connector may also be used
for disk drives, so you must look inside the computer
to tell which is which. The connector is a parallel
port if its cable goes to the "bus board'" (on the
tabletop
model) or 'to a MULTI 0 board. It 'is a
disk-drive port if its cable goes to a disk controller.
(If you're not sure how to recognize a bus board,
MULTIO board, or disk controller, you should ask your
dealer for, assistance.)
connector~.
Once you have identified the serial ports and parallel
ports, you should make sure that they are labeled. Here
is a stylized picture of the back of a basic tabletop
Decision I with the ports labeled:
I ************************* I
I ************************* I
pprO
\ ************* /
\ *********** /
\ ************* /
\ *********** /
\ ************* /
\ *********** /
ttyC
ttyB
ttyA
The back of a rack-mount Decision looks slightly
different, but the important thing is that on both
models, the first serial port, called ttyA, is the
right-most one (when looking at the computer from the
back).
If you add a MULTIO board, its serial ports should be
labeled as follows. Make sure that the board is plugged
into the bus (with the component side of the board
facing the the front of the computer), and that three
flat cables are connecting the board to three D
connectors at the back of the computer. (If you don't
know how to do this, or if you aren't sure which MULTIO
is the second one, you should ask your dealer for
help.) Stand in back of the computer and look at the
MULTIO. The three small connectors along the top of the
-1-
ports (4)
3/23/83
ports (4)
MULTIO are the serial "jacks"; the large one is the
parallel jack. The D connector attached
to
the
right-most (as seen from the back) serial jack should
be labeled ttyD. The one attached to the middle serial
jack should be labeled ttyE, and the D connector
attached to the left-most (as seen from the back)
serial jack should be labeled ttyF.
If you have a third or fourth MULTIO, then its serial
ports should be labeled correspondingly as ttyG, ttyH,
ttyI, and ttyJ, -ttyK, ttyL.
The parallel ports attached to the second, third, and
fourth MULTIOs should be labeled pprl, ppr2, and ppr3.
(Remember that the first one was called pprO.)
NAMES
Under Micronix, the twelve possible serial ports are
consistently refered to as ttyA through ttyL. (Some of
the documentation that comes with the Decision I
hardware refers to ttyA as the "console" or as "serial
port 1", ttyB as "serial port 2", etc.) Names for the
parallel ports are a little more involved. If pprO is
connected to a parallel daisy-wheel printer, it is
called "diabO". If it is connected via a special cable
(available from Morrow) to a Centronics type printer,
it is called "centO".
10 board
references to
serial ports
first
ttyA ttyB ttyC
diabO or centO
second
ttyD ttyE ttyF
diabl or centl
third
ttyG ttyH ttyI
-diab2 or cent2
fourth
ttyJ ttyK ttyL
diab3 or cent3
references to
parallel port
-------------
These names are arbitrary, by the way: they are not
built into any program. But they are built into three
other places:
1. They appear in the /dev directory as names
device files;
for
2. They appear in the /etc/ttys file in reference
to these devices;
3. Finally, the curious program /bin/diablo (q.v.)
may be linked to a name that matches a device name
in /dev. If so, it will write to a parallel diablo
printer attached to that device.
-2-
ports (4)
3/23/83
ports (4)
If you want to change ··any of these names, make sure
change all three occurrances.
to
SEE ALSO
1pr (1), diablo (1), mu1tio (4), cables (4), printers
(4), terminals (4), ttys (5)
-3-
printers (4)
4/4/83
printers (4)
NAME
printers - interfacing printers to Micronix
INTRODUCTION
This document explains what kinds of printers are
supported by Micronix. how to plug them in. and how to
test them. This is not a stand-alone document. however.
You will have to refer to several others as you read.
This will be easiest to do with the printed version of
the Micronix Reference Manual. If you-are reading this
at your terminal. you can switch to another document by
hitting DELETE or RUBOUT to get out of this one. and
then typing the command "help" ~ollowed by the new
document name. The related documents are:
ttys (5)
The document "configuration" in Sect~on _ 5 (type the
command "help configuration") explains how to configure
"Micronix for additional printers, automatic access from
upm (the Micronix CP/M emulator), different baud rates,
and hardware handshaking.
lpr (1)
The document "lpr" in Section 1 (type the cOnunand "help
lpr") explains how to use the Micronix spooling program
called lpF. This allows several users to print files
without conflict.
upm (1)
The document "upm" in Section 1 (type the ..command "help
upm") explains (amoung many other things) how to use
printers from the Micronix CP/M emulator.
cables (4)
The document "cables" in Section 4 (type the command
"help cables") explains how to build cables for various
devices, including printers.
ports (4)
The document "ports" in Section 4 (type the command
"help ports") explains how to identify the various I/O
connectors on the Decision.
PRINTER INTERFACES
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 type
of "handshaking" used by your printer. This is the
method it uses to stop the flow of characters from the
-1-
4/4/83
printers (4)
computer when it
interfaces are:
gets
1. Serial (or
handshaking,
printers (4)
behind.
"RS-232")
2. Serial printers
handshaking,
with
3.
Parallel printers
interfaces, and
Parallel
4.
interfaces.
printers
The
four
types
of
printers with hardware
software
with
with
("XON
XOFF n )
Centronics-standard
Diablo-standard
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 typ~s, or are unsure of which
type you are using, read 'on.
Serial pri~ters use either software handshaking or
hardware handshaking. Software handshaking means that
when the printer's buffer is full it sends a i'byte" to
the computer to temporarily
stop
the
flow
of
characters. The printer sends a different byte when it
is readY,to receive again~ The' byte that Micron:lx
recognizes for stopping transmission is X-OFF. Other
aliases for X-OFF are control-S, DC3 and 13 _hex. The
byte that restarts output is X-ON, also known as
control-Q, DCl and 11 hex. If your printer uses X-ON
and X-OFF, then you can skip ahead to the section
PLUGGING IN YOUR PRINTER. 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
the printer cable to start and stop output from the
computer. When the printer wants to stop transmission,
it lowers the voltage on this wire. To continue
transmission,
the
voltage
is
raised
again.
Unfortunately, there is no real standard for which wire
the printer should use. Hardware handshaking between a
printer and the Decision will probably require a
special cable.
If your printer requires hardware handshaking, you will
have to do two things: (1) read the document "cables"
in Section 4, and then make or purchase a suitable
cable, and (2) read the document "configuration" in
Section 4, and then tell Micronix that your printer
needs hardware handshaking.
-2-
printers (4)
4/4/83
printers (4)
. Parallel printers also require special cables (which
you can either make or purchase from Morrow). Please
read the "cables ll document, then return to the next:;:
section and follow instructions for parallel printers.
PLUGGING IN YOUR PRINTER
In the discussion that follows, we will assume that you
are going to plug a serial printer into the port called
"ttyC", and/or a parallel printer into the port called
"pprO". If you don't know how to find these ports,
please read the document called "ports". If you want to
use other ports., you will have to tell Micronix which
ports you are using. The document II configuration" tells
how to do this.
The serial printer can only be plugged in one way, so
you don't have to worry about which way to orient the
connector. However, the 50 pin .parallel connector is
not "keyed": that is, it is quite possible to plug it
in upside down. 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 printer. Plug the parallel
cable int·o the- Decision with the red stripe, and., pin 1,
toward the le·ft.
TESTING YOUR PRINTER
Plug in your printer, turn it ON, and make sure that it
is ON-LINE and set to "1200 baud". (These settings are
usually governed by switches on the printer. Sometimes
the switches are on the inside, especially the baud
rate switches.) If you can't set your printer to 1200
baud, you will have to change Micronix to transmit at
whatever
rate is acceptable. The document called
"configuration". explains how to do this.
For serial printers plugged into ttyC, type the command
echo A ) /dev/ttyC
There are two differ!!nt test commands for parallel
printers. The difference between them is the way the
device is named. For parallel daisy-wheel printers
plugged into pprO, type
echo A ) /dev/diabO
and
for Centronic style parallel printers plugged into
-3-
printers (4)
printers (41
4/4/83
pprO, use
echo A
> /dev/centO
Did you get an "A" on your printer? If not, remember
that interfacing printers IS non-trivial. First, rule
out the trivial problems by checking to see if:
1. the printer is turned on (and plugged in),
2. the printer is set to ON-LINE,
3. there is paper in it (many printers won't print
unless "they can sense a piece of paper in them) ,
and
4. the
correct
cable
is
plugged in at both ends at the
connector~
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' may be some wire~
scrambled in your cable, or your serial printer may be
set to the wrorig baud rate.
If none of these su~estions helps, your cable is
suspect. Home built cables should "be rechecked' and
store bought cables checked for flaws. RS-232 cables,
whether home-made or purchased, can be checked by using
them to replace the cable connecting your terminal.
Parallel cables can be-checked for continuity.
-4-
Micronix Operating System
reference manual
MORROW.
COBTDTS OF RKFEItENCE SECTION 5:
ascii
banner
core
directory
dtab
filesystem
group
motd
mtab
passwd
rc
signon
FILES
terminals
ttys
utmp
wtmp
ascii (5)
ascii (5)
10/20/82
NAME
american
ascii
interchange
standard
code
for
information
SYNOPSIS
cat /usr/pub/ascii
DESCRIPTION
The file /usr/pub/ascii serves as a cross reference
guide for conversion between ascii character names and
numeric values. Values are given in base 16 and base 8.
The file contains:
00
08
10
18
20
28
30
38
40
48
50
58
60
68
70
78
1000
1010
1020
1030
1040
1050
1060
1070
1100
1110
1120
1130
1140
1150
1160
1170
nul
bs
dIe
can
sp
(
0
8
@
H
P
X
"
h
P
x
01
09
11
19
21
29
31
39
41
49
51
59
61
69
71
79
nullOOl
bs 1011
dlel021
canl031
sp 1041
( 1051
o 1061
8 -1071
@ 1101
H 1111
P 1121
X 1131
" 1141
h 1151
p 1161
x 1171
sohl
ht I
dc 11
em I
02
Oa
12
la
22
I
) I 2a
1 I 32
9 I 3a
AI 42
I I 4a
Q I 52
Y I 5a
a I 62
i I 6a
q I 72
y
7a
stxl
nl I
dc21
subl
,
" I
* I
2 I
I
B I
J I
R I
Z I
b I
j I
r I
z I
soh
ht
dcl
em
002
012
022
032
! 042
) 052
1 062
. 9 072
A 102
112
I
Q 122
Y 132
a 142
i 152
q 162
y 172
03
Ob
13
1b
23
2b
33
3b
43
4b
53
5b
63
6b
73
7b
stxl003
nl 1013
dc21023
subl033
" 1043
* 1053
2 1063
1073
B 1103
J 1113
R 1123
Z 1133
b 1143
j 1153
r 1163
z 1173
04
Oc
14
1c
24
2c
I
I 34
I 3c
I 44
I 4c
I 54
I 5c
I 64
6c
I 74
1 7c
etxl
vt I
dc31
escl
II I
+
3
;
C
K
S
[
c
k
s
{
,
etxl004
vt 1014
dc31024
esc1034
/I 1044
+ 1054
3 1064
, 1074
C \104
K 1114
S 1124
[ 1134
c 1144
k 1154
5 1164
{ 1174
-1-
.
eot I
np I
dC41
fs
$ I
05
Od
15
Id
25
2d
35
3d
45
4d
55
5d
65
6d
75
7d
enq
cr
nak
gs
005
015
025
035
045
, 055
4 065
< 075
D 105
L 115
T 125
\ 135
d 145
1 155
t 165
I 175
enq
cr
nak
gs
, I
4 I
<,
D I
,
L
T
I
I
d I
1 I
t I
I I
\
eot
np
dc4
fs
$
%
-
5
E
M
U
]
e
m
u
}
%
-
5
=
E
M
U
]
e
m
u
}
06
Oe
16
Ie
26
2e
36
3e
46
4e
56
5e
66
6e
76
7e
006
016
026
036
046
056
066
076
106
116
126
136
146
156
166
1
1176
ackl
so I
synl
rs ,
07
Of
17
If
& I 27
I 2f
6 I 37
> I 3f
F I 47
N I 4f
V 1 57
"I 5f
f I 67
n 1 6f
v I 77
- I 7f
bell
si 1
etbl
us I
ackl007
50 1017
synl027
r5 037
& 047
057
6 067
> 077
F 107
N 117
V 127
137
f 147
n 157
v 167
177
bell
si I
etbl
us I
' 1
A
-
' I
/ I
7 ~
I
I
0 I
WI
?
G
-,
g 1
o ,
wi
dell
/ I
7 1
?
I
G
0
1
I
wi
_I
g 1
o I
wi
dell
banner (5)
3/15/82
banner (5)
NAME
banner - the log-in banner
FUNCTION
The banner file is printed on each terminal just prior
to the Name: prompt for the user login name. This file
is inessential to system operation. It may be edited to
the user's preference, or deleted.
FILES
/etc/banner - banner file.
-1-
core (5),
3/17/82
core (5)
NAME
core - core dump file
FUNCTION
A core file is produced by the system as a result of
certain fatal signals; the offending program is then
terminated. The file produced is named '''core'' in the
current directory of the dUmped program at the time of
the fatal signal. The format of the core dump file is
as follows:
The first 65,536 bytes are simply a "snapshot" of the
program as it appeared in memory at the critical
instant. Following this "memory image" is certain other
pertinertt information, mostly the contents ~f the Z80's
registers:
Task:
Mask:
pc:
SP:
Micronix task number
The MPZ80 permission mode
Program counter
Stack pointer
Registers:
af
bc
de
hl
zir
zix
ziy
zaf
zbc
zde
zhl
This section assumes
processor.
previous
-1-
knowledge
of
the
Z80
device (5)
3/17/82
device (5)
NAME
device - printer spooler device description file
FUNCTION
The line printer·. spooler prograIJl searches for and
follows the directives found in this file. The file is
entered free-form, that is, order and spac~ng of
specifiers given within this file are unimportant.
The following is a list of specifiers that may appear:
A baQd rate given a~ a decimal number. Example baud
rates: 9600, 1200, 300, 110, etc. All the standard
baud rates are supported. The default baud rate is
9600.
An
indication to use hardware handshaking, i.e., to
transmit only when the
clear-to-send
pin
is
asserted. The indicator is simply the word "shake".
By default, clear-t9-send is ignored.
The name of the device to which to send the spooled
files for printing. This must be the full path name
of a character special file. Examples: . /dev/ttyA,
/dev/ttyB, /dev/ttyC, /dev/pprA, /dev/ttyD, etc.
Default is /d~v/lp.
FILES
/usr/spool/*/device
EXAMPLE
A complete typical "device" file follows:
/dev/ttyc 1200
-1-
directory (5)
3/15/82
directory (5)
NAME
directory - the format of directories.
FUNCTION
Micronix uses ~he standard UNIX version 6 directory
format. A directory behaves like an ordinary file
except that a user may write into a file, but cannot
write into a directory.
A directory is distinguished from a file by a bit in
the flag word of its i-node entry. Directory entries
are 16 bytes long. The first word is the i-number of
the file, represented by the entry if non-zero.
If
th~
first word is zero, the entry is empty.
Bytes 2 through 15 of the entry
represent
the
14-character file name, null padded on the right. These
bytes are not cleared for empty slots.
By convention, the first two entries in each directory
are for "." and " •• ". The first is an entry for the
directory
itself.
The second is for the parent
directory •
. The meaning of tI • • " is modified for the root directory
of the master file system and for the root directories
of removable file systems. In the first case, there is
no parent, and in the second, the system does not
permit off-device references. In both cases " II has
the same meaning as " "
ALSO READ
filesystem (5)
-1-
dtab (5)
4/14/82
dtab (5)
dtab - the dump table
FUNCTION
lriformation on. the times of a dump are kept 'in the file
t1/~tcldt,ab.t1
This is a non-ASCII file presently used
only by td (1). Each entry in dtab is eight bytes long
and takes the form:
sJ:ruct dtab
{
. int
long
device,
inode;
date;
};
There is an entry in dtab for each directory that has
been dumped by td. Device is the major/minor device
number of the directory in question (major device
number in the high byte, minor in the low byte). Inode
is the inode number of the directory. Date is the time
of the last recorded dump of the directory in question
expressed as a 4-byte quantity representing the number
of seconds: elapsed since Jan. 1 J 1970 at midnight.
FILES
/inc1ude/dtab.h
ALSO READ
td (1)
-1-
filesystem (5)
3/15/82
filesystem (5)
NAME
filesystem - format of UNIX version 6 file systems
FUNCTION
Every file system storage volume, (hard or floppy disk)
has a common format for certain vital information.
Every such volume is divided into a certain number of
256 word (512 byte) blocks. Block 0 is unused.
Block 1 is the super block. Starting from its first
word, the format of a super-block is as follows.
struct
{
unsigned
iSize,
fsize,
nfree,
free [100],
ninode,
inode [100],
char
flock,
ilock,
fmod;
long
time;
};
Isize is the number of blocks devoted to the i-list
which starts just after the super-block, in block 2.
Fsize is the first block not potentially available for
allocation to a file. These numbers are used by the
system
to check for a bad block number. If an
impossible block number is allocated from the free
list, or is freed, a ~iqgnostic is written on the
on-line console. Moreover, the free array is cleared to
prevent further allocation from a presumably corrupted
free list.
The free list for each volume is maintained as follows.
The
free
array
contains,
in
free[l],
••• ,
free[nfree-l], up to 99 numbers of free blocks. Free[O]
is the block number of the head of a chain of blocks
constituting the free list. The first word in each
free-chain block is the number (up to
100)
of
free-block numbers listed in the next 100 words of the
chain member. The first of these 100 blocks is the link
to the next member of the chain.
-1-
filesystem (5)
3/15/82
filesystem (5)
To allocate a block: decrement nfree and the
is free[nfree].
n~w
block
If the new block number is 0, there are no blocks left
and an error is given.
If nfree becomes U, read in the block named by the new
block number, replace nfree by its first word, and copy
the block number in the next 100 words into the free
array.
To free a block, check if nfree is 100; if so, copy
nfree and the free array into it, write it out, and set
nfree to O.
In any event, set nfree[nfree] to the freed blocks's
number and increment nfree.
Ninode is the number of free i-numbers in the inode
array. To allocate an i-node: If ninode is greater than
0, decrement it and return inode[ninode].
If ninode = 0, read the i-list and place the number of
all free inodes (up to 100) into the inode array, then
try again. To free an i-node, provided ninode is less
than 100, place its number into 'inode[ninode] and
increment ninode.
If n~node is already 100, do not bother to enter the
freed i-node into any table. This list of i-nodes is
used only to speed up the allocation process; the
information as to whether the inode is really free or
not is maintained in the inode itself.
Flock and ilock are flags maintained in the core copy
of the file system while it is mounted; their values on
disk are immaterial. The value of fmod on disk is
likewise immaterial; it is used as a flag to indicate
that the super-block has changed 'and snould be copied
to ~he disk during the next periodic update of file
system information.
Time is the last time the super-block of the file
system was changed and is a long representation of the
number of seconds that have elapsed since midnight
January 1st 1970 (GMT). During a reboot, the time of
the super-block for the root file system is used to set
the system's idea of the time.
I-numbers begin at 1 and the storage for i-nodes begins
in block 2. Also, i-nodes are 32 bytes long, so 16 of
them fit into a block. Therefore, i-node i is located
in block (i + 31) / 16, and begins 32 * «i + 31) (mod
16» bytes form its start. I-node 1 is reserved for the
-2-
filesystem (5)
filesystem (5)
3/15/82
root' directory of the file system, but nb other
i-number has a built-in meaning. Each i-node represents
one file. The format of an i-node is as follows.
struct
{
int
char
flags;
nlinks,
uid,
gid,
sizeO;
int
.size1,
addr[8],
long
actime,
modtime;
} ;'
The flags are as follows:
100000
060000
000000
040000
020000
060000
010000
004000
002000
000400
000200
000100
000070
000007
i-node is .allocated
2-bit file type:
plain file
directory
character-type special file
block-type special file
large file
set user-ID on execution
ignored
read permission for owner
write permission for owner
execute permission for owner
read, write, execute permission for group
read, write, execute permission for others
Special files are recognized by
i-number.
their
flags,
not
by
A block-type special file is one which can potentially
be mounted as a file system, a character-type special
file
cannot,
though
it
is
not
necessarily
character-oriented. For special files the high byte of
the first address word specifies the type of device and
the low byte specifies one of several devices of that
type. The device type numbers of block and character
special files overlap.
The address words of ordinary files and directories
contain the number of the blocks in the file (if it is
small) or the number of indirect blocks (if the file is
-3-
filesystem (5)
3/15/82
filesystem (5)
larg~). Byte number N, of a,file is,accessed as follows:
N is divided by 512 to find its logical block number,
use b as an example, in, the file. If the file is small
(flag 010000 is 0), b must be less than 8, and the
physical block number is addr[bl.
If the file is 'large, b is divided by 256 to yield i.
If i is less than 7, then addr[i] is the physical block
number of the indirect block. The remainder from the
division yields the word in the indLrect block which
contains the number of the blQck for the sought byte.
If i is equal to 7, the file has become extra large and
is the address of a first indirect bloc~. Each
word in this block is the number of a second level
indirect block;, each word in the second-level indirect
blocks points to a' data block. Notice that large files'
are not marked by any mode bit, but by having addr[7]
non-zero. Even though this scheme allows for more than
33,554,432 (256 X 256 X 512) bytes per file, the length
of files is stored in 24 bits. In practice, a file can
be at most 16,777,216 bytes long.
'
addr[71
For block b in a file, to exist, it is not necessary
that all blocks less than b exist. A zero block number
in either address words of the i-I}ode, or in an
indirect block, indicates that the corresponding block
has never been allocated. This type of missing block
reads as if it contained all zero words.
SEE ALSO
icheck (1), dcheck (1), fsck (1)
-4-
group (5)
3/15/82
group (5)
NAME
group - the group file
FUNCTION
Each user name is associated with a group number.
Associated with each file is a user ID number (the
owner of the file) and a group ID number (the group of
the file). These numbers are used in
permission
determinations.
The relationship between group numbers and names is
established by the group file. The format of the group
file is as follows:
Each line of the file defines one group name.
The group name is followed by a colon, then followed
by the encrypted group password, if one exists. This
is followed by a colon, which is followed by the
group number (in decimal), followed by a colon,
followed by the group comment field which ~ay
contain anything you desire, or nothing at all.
Here is a sample group file:
sales: :4:
stock: : 5:
Normally group 0 is reserved for the super-user only.
The newuser program makes additions to this file.
SEE ALSO
passwd(5)
-1-
3/15/82
motd (5)
motd (5)
motd - message of the day
FUNCTION
The message of the day file is printed on each users'
terminal after the proper login sequence is completed.
The contents of this file are inessential to system
operation.
This
file is intended to be updated
frequently by the system administrator. It may be used
to inform the users of changing system conditions or
upcoming events. This file may be deleted from the
system if the user so wishes.
SEE ALSO
banner (5), signon (5)
-1-
mtab (5)
3/15/82
mtab (5)
NAME
mtab - mounted file system table
FUNCTION
Mtab resides in. the / etc directory and contains a table
.of devices "mounted" by the mount command. The umount
command removes entries.
Each entry is 64 bytes long. The first 32 bytes are the
null padded name of the place where the special file is
mounted; the second 32 are the null padded name of the
special file. The special file has all its directories
stripped awaYt that is, everything through the last '/'
is thrown away.
This table is present only so people can look at it. It
does not matter to mount if there are duplicate
entries, nor to umount if a name cannot be found.
FILES
etc/mtab
SEE ALSO
mount (l)t umount (2)
-1-
passwd (5)
3/15/82
passwd (5)
NAME
passwd - password file
FUNCTION
The name passwd has become a misnomer, but is commonly
found in UNIX documentation and we hesitate to change
it here.
Passwd contains the following informatlon:
name ,(login name, no upper case letters)
,encrypted password
numerical user ID
numerical group ID
comment
home directory
command interpreter program name
This is an ASCII file. Each field within each user's
entry is separated from the next by a colon. Each user
is separated from the next by a newline. The encrypted
passwords are kept in a separate file, the contents of
the password entry are immaterial. This file resides in
the "/etc" directory.
The first entry of the password file contains an entry
for the super-user account. The name of this account is
tradi tionally "root," but may be renamed to anything
the user wishes.
EXAMPLE
root::O:O:super:/:/bin/sh
sally::10:1:sally:/a/sally:/bin/sh
FILES
/etc/passwd
SEE ALSO
login (5), passwd (5), group (5)
-1-
3/16/82
rc (5)
rc (5)
NAME
rc - multi-user start-up file
FUNCTION
The
init
(initialization) program looks for the
"/etc/rc" file . just before entering the multi-user
mode. If such a file is found, and is readable, it is
run as a shell script. That is, each of the commands in
the file is executed as if from the keyboard~
Typically, it is used to clean out the temporary
directory, remove locked files, start up daemons, etc.
The user may place whatever he desires in the file.
FILES
/etc/rc
-1-
signon (5)
3/15/82
signon (5)
NAME
signon - file for the signon prompt
FUNCTION
The signon file,is printed on the system console each
time Micronix is booted. The contents of this file is
inessent;ial to system operation. It is merely there to
display system-oriented information. It may be edited
to suit the user, or del~ted from the system.
FILES
/etc/signon
-1-
terminals (5)
terminals (5)
10/13/83
NAME
terminals - the terminal capabilities file
FUNCTION
The terminals file, always located in the /etc directorYt
contains the list of terminals and their capabilities. The
information in this file is used by upm for terminal
emulation. The information here is also available to other
programs that make use of the features of intelligent
terminals, such aS t cursor addressing~ clear screen, erase
to end of screen, etc.
The terminals file is broken into descriptions of terminals
by the terminal name lines, which always begin at the
leftmost margin (column 1). The first word on the line is
the "terminal abbreviation", which should be short and
mnemonic. This should be followed by the full name of the
terminal, which is free-form. This full name will appear
automatically
in the terminal menus presented by the
reconfiguration program. See recon (1).
The lines that follow each terminal name line define the
characters that the terminal uses for control of special
effects (c'ursor movement, clearscreen t highlighting, etc.).
Terminals ca.n be .divided into three categories according to
their capabilities.. Grouping terminals into these three
"levels" allows the use of only, at most, three different
versions of terminal-configured software. The first level of
te~inals,. the
simplest level, is defined .by terminal.s
having .the following capabilities:
LEVEL 1
Keyword
Description
cursor
home
up
down
right
left
clear
string of characters
home the cursor *
character(s) to move
character(s) to move
character(s) to move
character(s) to move
clear the screen and
*
to move cursor
the cursor up *
the cursor down *
the cursor right *
the cursor left *
home cursor
(Optional, since most programs actually do not use.)
The keywords are used one per line, preceded by white-space
(tabs or spaces) that distinguish the keywords from terminal
names. The characters that complete the keyword definition
follow, separated by more whitespace. A newline terminates
each definition. The keywords that defi·ne the next two
levels are:
-1-
terminals (5)
terminals (5)
10/13/83
LEVEL 2
, Keyword
Description
ceos
high
low'
*
clear to end of screen
begin highlighting *
return to normal intensity
*
(Optional, since most programs actually do not use.)
LEVEL 3
ins line
inschar
delline
de1char
*
insert
insert
de1:ete
delete
a
a
a
a
line
character in a line
line
chara'cter *
*
(Optional, since most programs actually do not use.)
The keywords must be spelled exactly as shown here, and must
always be in lower case. When adding a terminal to the
terminals file, try to define as many capabilities as
possible. If you are deciding what level your terminal fits,
your terminal must fulfill ALL of the categories in the
lower levels before you can cons~der it as fitting in a
higher 1evel. Three other keywords may optionally be used:
like, init and exit. The characters following init may be
'sent by a program to initfa1ize a terminal; those following
exit may be sent just before a program terminates.
The like keyword is used to include a previously defined
terminal's keywords and their definitions for the terminal
currently being defined. Differences between'a terminal and
one that it is "like" are adjusted by redefining keywords.
You can only use three levels of like-ness, that is, the
terminal you are describing can be "like" a previously
defined terminal that is "like" another terminal, that is
"like" some fully described terminal. The like keyword
should be the first keyword used in a description; if you
use it last, the keywords you were trying to redefined will
be overWritten by the definition of the "like" terminal.
The keywords are followed by the characters that define'
them, separated by spaces. There
are
a
number
of
abbreviations and operators that are used with the keyword
definitions. The abbreviations that are recognized are:
ABBREVIATIONS RECOGNIZED
bs
cr
esc
ff
n1
backspace
carriag~
return
escape
formfeed
newline
-2-
terminals (5)
10/13/83
terminals (5)
nullO-byte
sp
space
tb
tab
vt
vertical tab
col
ascii
"
"
"
"
"
"
+,
numbers
other
all other single characters are
sent literally
These abbreviations provide a way of including
readable
characters, as opposed to using their
equivalents in keyword definitions.
human
octal
Several operators are also provided 'for keyword definitions.
These operators modify the characters that follow them, or
are
used
to "include the row and column in cursor
definitions.
OPERATORS
row + n
Send the line number plus an offset n
as a single byte. The first row on the
screen is row O. Most terminals use
row -+ 32.
col + n
Send the column number plus an offset n
as a single byte. The first column on the
screen is column O. Most terminals use
column + 32.
row ascii
Send, the row number as a series of ascii
digits (wit'h leading zeros supressed).
Used by ANSI-standard terminals.
col ascii
Send the column number as a series of ascii
digits (with leading zeros supressed).
Used by ANSI-standard terminals.
Send the following characters literally with
no conversion. Eg, '0 is the same as 48 or
x30 (see x below).
Convert the character that follows to the
corresponding control code
xnn
Interpret the number nn that follows
-3-
terminals (5)
10/13/83
terminals (5)
as hexadecimal. (Any number of digits.
Converts to one byte.)
Onnn
Interpret the number nnn that follows
as octal. (Any. number of digits.
Converts to one byte.)
The row and col operators must always be followed by a plus
sign and an offset (which may be zero), or by the word
ascii. (Each of these must be separated by a .space.) into
their ascii values (between 48 and 57). The caret (A)
indicates control keys, for example, AU represents
a
backspace. If you prefer to use hexadecimal or octal
notation, use x or 0 to ind'icate the type of conversion
desired. Numbers ~re converted to'a single byte (value 0 to
255). Strings or characters preceeded by a single quote (')
are sent literally. For example, 0123 sends a sends the byte
with the· octal value 123 (this is the letter S), while '0 '1
'2 '3 sends the fourascil bytes 0, 1, 2, and 3.
EXAMPLE
mo,r20
Morrow 20
like
prot03
cursor esc = col + 32 row + 32
clear
AZ
This example'; defines a terminal, abbreviated as mor20, as
being "like" the prot03 definition, then goes on to redefine
the cursor and clear keywords. The sequence of characters
used to move the cursor is: an escape, an "=", the column
number_ added to 32, and the row number added to 32. The
character that clears the screen is a Control-Z.
If you need to create an entry for a terminal not in the
terminals file, use the list of keywords for the three
levels and find the character(s) used by your terminal for
as many keywords as possible. These characters are usually
buried in a table in your terminal's manual describing
control-sequences or special characters. You should always
be able to find all the control sequences necessary for a
level 1 terminal at a minimum. Th~ names of the various
func tions ,
for example, home or highlight, will vary
unpredictably from manual to manual.
NOTE
The shorter the terminals files is, the quicker it may be
searched for matching terminal types. You may wish to rename
(mv) the terminals file, and keep an edited version with
just the terminals you
normally
use
in
the
file
/etc/terminals.
-4-
terminals (5)
10/13/83
FILES
Jete/terminals
SEE ALSO
upm (1)
-5-
terminals (5)
ttys (5)
10/18/83
ttys (5)
NAME
/etc/ttys - Micronix terminal and printer configuration
SUMMARY
(This is a technical summary. Explanatory examples follow.)
The letc/ttys file specifies the Micronix terminal and printer
configuration. It is a humanly-readable text file consisting of
lines
with whitespace-seperated words. Word order is not
significant.
The first word on each line is the nam~ of a "character special"
d~vice file (one of the files in the /dev directory). The rest of
the words on the line apply to that device. The following words
are meaningful:
1.
Any valid baud ·rate: 50, 75, 110, 134, 150, 200, 300, 600,
1200, 1800, 2400, 4800, 9600, or 19200. The system will set
the baud rate as requested. This is done by the init process
(a) when the system is powered up, (b) each time a user logs
off, (c) each time the /etc/ttys file is changed (but only
to devices that are not currehtly logged in). See init,
login, and update in section 1 for more information.
2.
The word "shake". This refers to RS-232 Clear-to-Send
handshaking. The system will use this type of handshaking
only if requested (since some devices do not support it).
XON-XOFF (software) handshaking is done by default. The init
process
sets
or
resets
this
mode under the same
circumstances as in #1 above. (See printers in section 4 for
more information on handshaking.)
3.
The word "login". When the system goes multi-user, a login
process will be created for each device designated as a
"login" terminal (see init in section 1).
4.
The word "term=" followed by a terminal mnemonic. upm reads
the ttys file and provides terminal emulation for the model
of terminal named after the word "term=". The terminal named
is matched against an entry in the /etc/terminals file, for
the purpose of translating generic control codes into the
exact codes expected by the terminal. (See terainals in
section 5).
5.
The word "lpr", or the name of any link to lpr (such as
"dpr", "xpr", etc). When the lpr ("line printer") program is
invoked, it first looks to see what name it was called by.
It then reads the ttys file looking for its name. If found,
it uses the device on the same line as its printer. Thus,
several printers can be supported simply by keeping several
copies of the lpr program under different names (see lpr in
section 1).
6.
The
word "1st". When upm (the CP/M emulator) is invoked, it
-1-
ttys (5)
10/18/83
ttys (5)
reads the ttys file looking for the word "lsttl. If found, it
uses the corresponding device as its LST: device (ie, its
printer), unless it is told otherwise (by a command line
argument, a command in the .upm file, or a command given in
interactive mode). See upm in section 1.
7.
A word beginning with "net-tl. The rest of the word is taken
to be' the network name of the machine to which that port is
connected (not the local machine, but the machine at the
other end of the cable). See network in section 4.
DON'TS
Don't use a login port for 'anything else. Don't
or a baud rate 'for a parallel port (the
"diab's").
specify "shake"
"cent's" and the
Don't specify one of the "diab's" as the 1st device. (It takes a
lot of code to drive the Diablo-type parallel printers, and this
was left out of upm to save space.) If you want to use diabO as
the upm 1st device, then you should do the following. Change to
the Ibin directory arid make a link called tldiabO" to the "diablo"
program. Then change to your home-directory and put "lst:ldiabO"
in your .upm file.
EXAMPLES
The file letc/ttys (that is, the file found by starting in the
root ditectory I, proceeding to the subdirettory etc, then to the
file.ttys) tells the system about its terminals and printers.
More
specifically,
it tells which of the Decision's lID
connectors are attached to terminals, which are attached to
printers, and what should be done with each of them.
The easiest
file:
ttyA
ttyB
ttyC
ttyD
ttyF
ttyG
ttyH
ttyI
ttyJ
ttyK
ttyL
centO
cent1
cent2
cent3
diabO
diab1
9600
9600
1200
1200
1200
1200
xpr
way
to
understand
login term=tvi925
login term=mor20
shake lpr
net-sales
net-admin
login
1st
-2-
it is to look at a sample ttys
ttys (5)
10/18/83
ttys (5)
di.ab2
diab3
The first word on each line is the name of one of the I/O
connectors on the back of the Decision, and also the name of the
corresponding "character device" file in the /dev directory. By
co~vention, the terminal that is attached to the I/O connector is
also called by the same name. (So when you see '_'ttyA", you may'
bave.to infer from the context which of these three things we are
talking about": the device file, the I/O connector, or the
termInal itself.)
This example says that ttyA should be run at 9600 baud, and that
it is a login terminal. When upm is invoked, it will send the
correct control codes for a Televideo 925 (term=tvi925) to the
terminal connected to ttyA, and use software configured for a
ADM-31. The same is. true for ttyB, except that upm will use
co,ntrol codes for the Morrow MD20 terminal.
should be
(See printers
The "lpr" says
progr~m (so i~
~tyC
run at 1200 baud, and needs hardware hands~aking.
in section 4 for more information on handshaking.)
that ttyC will be used by the lpr ("line printer")
is presumably a printer).
TtyD and ttyE are network ports. Both run at 1200 baud. TtyD is
connected to the machine named "sales", while ttyE is connected
to "admin".
TtyF is a login device running at 1200 baud (so it is probably a
modem). There isn't a "term=" entry on this line, so upm will not
provide terminal emulation for ttyF.
The only other device that is is currently attached to the system
is a Centronics-type printer called "xpr". It is attached to
parallel port 0, and thus to the device named "centO". (If it
were a Diablo-type parallel printer, it would appear on the line
with "diabO"). The "1st" means that the CP/M emulator upm will
use this device as its LST: device (its printer),. unless told
othe~wise by a later command.
CHANGING THE TTYS FILE
The recon program is used to recon-figure the ttys file. The
recon program understands all the rules for using or modifying
the ttys file, and will also interpret the /etc/terminals file
for you.
Since this is an ordinary text file, it can also be changed with
your favorite text editor. If you use WordStar, open the file in
"non-document" mode. Here is a sample session with the Micronix
line editor "edit".
Let's say that we want to change the "1st" device from centO to
ttyC. First log in as "root" (since only the super-user is
-3-
ttys (5)
10/18/83
ttys (5)
allowed to change the ttys file). In the lines below, the 'u'
the super-user shell prompt, and the ':' is edit's prompt.
/I cd Jete
/I edit ttys
"ttys" [reading] 19 lines
:/centO
centO xpr 1st
:c
centO xpr
centO xpr
:/ttyC
ttyC 1200 shake lpr
:c
ttyC 1200 shake lpr 1st
ttyC 1200 shake lpr 1st
:w
" ttys" [writing] 19 lines
:q
II
is
Change directory to /etc.
Edit the ttys file.
The editor prints this.
Look for the line containing centO.
The editor prints it.
Change the line.
You type the new line.
The editor prints the new line.
Look for the line containing ttyC.
The editor prints it.
Change the line.
You type the new line. ,
The editor prints the new line.
Write out the updated file.
The editor prints this.
Quit the editor.
(There are faster ways to use edit, but 'these are the easiest to
explain.)
SEE ALSO init (1), login (l)t lpr (1), recon (1), stty (1), update
(l)t upm (l)t network (4), printers (4), ports (4), cables (4).
-4-
utmp (5)
3/15/82
utmp (5)
NAME
utmp - user information
FUNCTION
This file offers information on who is currently using
Micronix. The "file is binary. Each entry is described
in the structure illustrated below:
"
struct utmp "
{
char
l;ine[8]~
name[8] ;
long
time;
1* typewriter name *1
1* login name */
/* login time */
};
SEE ALSO
-1-
3/15/82
wtmp (5)
wtmp (5)
NAME
wtmp - user login history
FUNCTION
This file records all logins and logouts. Its format is
like ut.p (5) with these exceptions: A null user name
indicates
a logout on the associated typewriter.
Furthermore, the typewriter name - indicates the system
was rebooted at the indicated time; the adjacent pair
of entries with typewriter names I and } indicate the
system-maintained time just before and just after a
date co~and changed the systems' idea of the time.
Wtmp is maintained by login (1) and, init (1). Neither
of these programs creates the file, so if is is
removed, record-keeping is turned off.
FILES
/usr/adm/wtmp
/include/utmp.h
SEE ALSO
utmp (5), login (1), init (1), who (1)
-1-
Micronix Operating System
reference manual
MORROW.
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