Contact us Heritage collections Image license terms
HOME ACL ACD ICF SUS DCS G&A STARLINK Literature
Further reading □ OverviewProgress May 1981 - May 1982PERQ Locations September 1982Recognition of SUS Request December 19821. Support of Perqs and Suns2. PERQ User Notes3. Kent Software Tools4. Guide PNX 5.05. PERQ Software6. Mixing Modules8. User ForumPerq3A
C&A INF CCD CISD Archives Contact us Heritage archives Image license terms

Search

   
ACDSingle User SystemsPERQ PapersInternal
ACDSingle User SystemsPERQ PapersInternal
ACL ACD C&A INF CCD CISD Archives
Further reading

Overview
Progress May 1981 - May 1982
PERQ Locations September 1982
Recognition of SUS Request December 1982
1. Support of Perqs and Suns
2. PERQ User Notes
3. Kent Software Tools
4. Guide PNX 5.0
5. PERQ Software
6. Mixing Modules
8. User Forum
Perq3A

PNX 5.0: A Guide to Unix on the PERQ 2

Trudy Watson

16 January 1986

Common Base Programme: PERQ User Note 4
  1. Introduction
  2. Unix Terminology
  3. Floppy disc basics
  4. The keyboard
  5. Moving from POS
  6. Moving from an older PNX
  7. Ready to start installation
  8. Installing PNX 5
  9. Using PNX
  10. System management
  11. Using new floppies
  12. File system consistency checks
  13. Other disc errors
  14. Backing up
  15. Copying whole floppies
  16. Warnings from ICL
  17. Booting problems
  18. Some known problems or differences
  19. Further reading

1. INTRODUCTION

This document brings together information held in the three Unix manuals and the ICL Guide to PNX (number RI0251/01, published October 1985). In addition. aspects of the hardware and software that will be unknown to users new to Unix. the Perq, or floppy discs are introduced. It relates to version 5.02 of PNX (intended for the Perq 2) and replaces User Note 15. This document should be carefully read through before using a Perq for the first time. Note that the quotation marks surrounding commands, such as "sync", given in the body of the text are not meant to be typed when issuing the command. When examples are given of a command or output which is longer than one line the subsequent lines are right justified to indicate that they follow straight on. The initial indentation of an example has no significance. Comments on where further help could be given are welcomed.

2. UNIX TERMINOLOGY

This section introduces some terms in context by following through a sample use of the Perq.

When you switch on the Perq it bootstraps the system: this involves reading a pre-defined selection of blocks of 512 bytes from disc into memory. Normally. this would be from the Winchester hard disc but if a special boot floppy is in the floppy drive it will be tried instead. If the floppy cannot be read, or is not in the bootstrap format, the Perq boots from the hard disc.

Once loaded. the bootstrap is executed and this tries to find the file of microcode in /ucode on the disc from which the bootstrap was read. This is read into memory and moved into control store where it will implement the C machine instruction set when executed. The PNX operating system kernel is read from the file /unix into memory and begins execution. It runs two processes immediately. the swapper (process 0), and /etc/init (process 1). This second process checks the file system (with /etc/fsck. see section 12.1), and, if there are no errors. moves into multi-user mode. It forks (creates a new process which is an exact copy of itself) and runs the Unix command interpreter known as the shell which executes the commands in the file /etc/rc. These commands do things like removing temporary files left in the directories /tmp and /usr/tmp. One command (tekload) copies instructions to the small Z80 micro so that it can control slow peripheral devices like the tablet. Another command sets the date and time from the hardware clock /dev/z80clk. When this has been done further commands in /etc/rc start off processes that may continue indefinitely. /etc/update is one of these. Its sole purpose is to ensure that any disc blocks buffered in memory are written to the disc occasionally. /etc/cron looks in the file /usr/lib/crontab every minute and issues more commands at the times described therein. An example is the at command processor, /usr/lib/atrun which is started every five minutes.

Once all these background processes have been started /etc/init forks again to run /etc/getty on the console. It prints out the first "login:" prompt. If you type in a user name getty changes to run /bin/login which finds the entry for the user name in /etc/passwd and extracts from it your encrypted password. It prompts you for the password. and if it is given correctly it uses the other information in the file entry to set up your HOME directory in the file system tree and the program to start executing for you. Normally. the latter is not given and the shell is assumed. The login process checks in the directory /usr/spool/mail to see if there is any mail for you, and converts itself into the shell. This program now reads the file .profile if there is one in your HOME directory, and executes any commands in it. It writes out the "$" prompt and waits for you to type in commands.

When you have finished using the Perq and want to power it off you give the "shutdown" command and this sends a signal to process 1, the /etc/init that started all this. It notices the signal and forces all the processes other than itself and 0 to stop. When they have done so it starts again by writing "single user mode" and forks to run login. At this point the disc has been brought up to date and there is no activity in progress so it is safe to power off the machine.

3. FLOPPY DISC BASICS

Each floppy consists of a disc coated with magnetic material permanently enclosed within a square plastic case. Part of the surface is exposed through a long slit and should not be touched. Always keep the disc inside its protective paper sleeve when not in the drive. A small hole in the disc allows light through an index hole in the cover once every revolution. The index hole is slightly offset from the centreline of the cover: this is an easy way to distinguish double sided discs from single sided discs (which have a central index hole and cannot be used on the Perq).

Along the bottom edge of the disc (furthest from the label) is a small notch about 4mm wide which must be covered by an opaque material (small sticky labels are often provided with the floppy) if the disc is to be written on. When uncovered the disc is write protected. You must use the -r flag (see under 11) when mounting such a disc in PNX or the system will want to overwrite the "last referenced time" of its root, even if you do not write or change any files on it.

There is no hardware difference between single density and double density floppies: the information is merely packed more tightly in the same space. Double density discs are very prone to error and should not be used.

3.1 Inserting and Removing Floppies

The floppy drive is mounted vertically. The floppy discs can be inserted into the drive by first pressing in the short bar on the front of the drive. This opens the door of a slot into which you should push the floppy, long slot first, with the label on the right. Push it in against a light spring pressure until it clicks into place, and does not bounce out again when you let go. Push the door firmly across the slot until it locks into place.

When the system is reading from or writing to the floppy a red spot on the door release bar will be lit. You must not remove the floppy or power off or reboot the machine when this light is on or you may corrupt the information on the disc. The drive clunks quite audibly when the head loads, that is when it moves onto the magnetic surface to read or write. It will stay loaded for about half a second in case there are more reads and writes, so one clunk can correspond to many IO operations. To remove the disc check that the red light is not on and press inwards the short bar. The disc will spring out of the opening. Note well: when you are not using the floppy drive keep the door closed to reduce air and dust circulation through the slot. This will extend the life and reliability of the disc heads. The discs should not be left in the drive for longer than necessary as they are continuously revolving once the door is closed. Do not write with biro or pencil on labels already stuck on floppies as this may cause damage.

3.2 Writing to Floppies

When PNX has blocks of information to write to the disc it does not write them immediately, but holds them in main memory until the space allocated for them is full, or some process explicitly asks the system to purge out all these blocks. The command "sync" in PNX does this. This can mean that writes to the floppy (and similarly to the hard disc) may happen much later than they were requested. You should therefore become aware of which parts of the system will be issuing "sync"s so you know when it is safe to remove a floppy, power off or reboot the machine. If in doubt. issue a "sync" (except when using /etc/fsck to recover from corrupted file systems, when you will be warned not to "sync".

When you unmount a floppy the commands "/etc/umount" and "umountflop" will automatically issue a "sync", so you can immediately remove the disc safely. The file system consistency checking utility /etc/fsck will also issue a "sync" if necessary. The main issuer of "sync"s is the program /etc/update whose sole purpose is to issue a "sync" command every 30 seconds. This program is started off automatically when you boot the system and enter multi-user mode. On a single-user machine like the Perq it is the most important difference between single-user and multi-user mode. It is /etc/update that will cause the odd clunk of the floppy drive when you apparently last wrote to it tens of seconds ago.

3.3 Write protection

You can protect floppies from accidental human error by removing the write-permit sticky label from the small cutout in the bottom edge of the disc. The hardware will now refuse to write on the disc, but the software cannot tell the difference so you must let it know independently. With the "mountflop" command this means adding the option "-r". The PNX distribution floppies are write-protected, except for the boot floppies which need to be writeable since the system booted from them assumes this is so.

3.4 Pre-PNX 2 floppies

The layout of floppy discs changed between older versions of PNX and PNX 2. All your floppies should have been converted to the new format to avoid confusion and possible error, though the old and new can be used together on the same machine. Most of the PNX commands that use floppies assume the new format by default and to specify that an old floppy is in the drive you will usually need to add a "-o" option to these commands. The devices /dev/oldflop and /dev/oldbflop are then used instead of /dev/flop and /dev/bflop. (/dev/rawflop has been withdrawn). /dev/flop uses the whole of the disc, 1001 blocks. If you mount an old floppy as if it was in the new format, or vice versa, no damage seems to be done, though you will not be able to access any files on it.

4. THE KEYBOARD

When typing to PNX you will find most responses and commands should be in lowercase and end with RETURN.

4.1 Control Characters

The following single characters have special meaning when the control key CTRL is pressed down at the same time.

  Z   end-of-file 
  C   interrupt the executing program 
  \   quit, like interrupt 
  S   pause output until a key is pressed 
  G   bell 
  R   retype the line being input 
  I   tab to next stop (every 8 columns) 
  W   delete the last word 
  U   delete line being typed in

The OOPS key is the same as CTRL-U. In addition, DEL (also labelled REJ) will delete the previous character. This may appear to be the same as CTRL-H or BACKSPACE but it certainly isn't. SETUP is the same as CTRL-K and BREAK is the same as CTRL-SHIFf-@ (the NUL character). It does not send a break down the rs232 connection when using puftp, for example. The HELP key generates a signal rather than a character, which is usually ignored but can be trapped by a program. You can change some of these characters to ones you might be more familiar with by using the stty command in your .profile file. Nevertheless. the above characters always apply at certain times, such as during login. If you mistype a command you will probably get the message

xxx: not found

where xxx is what you typed. It may appear ok but contain non-printing characters like BACKSPACE which make it wrong. Note that abbreviated forms of PNX commands are not recognised.

When large amounts of output are being written to the screen the system will pause after every screenfull so that information is not scrolled off the top. Every time you press the RETURN key one more line will be written. Pressing any other character (the space bar is convenient) will cause a whole new screenfull to be written.

4.2 Typing Ahead

You can type ahead your input while the system is still executing a previous command. The input is echoed jumbled up with the output. If you are using the window manager each window has its own typeahead buffer which is preserved as you move about between windows. Typeahead is sometimes disabled, for example, when passwords are being entered.

4.3 PF Keys

These keys can be assigned any string up to 80 characters which will be considered as typed input when the relevant key is pressed. They can be used to save a command you use often or which is very long. For example.

setpf pf1='ls -1', pf2='umountflop
'

Note how a quoted newline is part of the second string. This means umountflop will be executed immediately the pf key is pressed, whereas ls -1 will need to have RETURN pressed, perhaps after adding on a filename.

5. MOVING FROM POS

Before you start installing PNX you should preserve any POS files on your hard disc by copying them (with the POS floppy utility) to single density floppy discs. Once you boot from the first PNX boot floppy you will lose all information on the hard disc. When PNX has been installed you can use the program /etc/fl to retrieve the POS files into the PNX file system on the hard disc. The "help" command in this program should briefly list the commands you can use to copy files to PNX. "get" followed by the POS filename and the PNX filename will copy the file exactly, and the variant "sget" should remove any carriage-return characters in the files. Use the former for binary files like fonts, and the latter for source text files. "dir" will list the names of the POS files. Note that these POS floppies do not look like PNX file systems, so they cannot be mounted, and this program is the only way you can read or write them.

6. MOVING FROM AN OLDER PNX

Follow the instructions under "Installing PNX" below, but use the command "updatepnx" instead of "makepnx".

6.1 DIFFERENCES FROM EARLIER RELEASES OF PNX

There are some other differences between PNX 2 and PNX 5 which may affect your programs.

  1. Fonts now need a record of the size in the file so do /etc/updatefont on all the fontfiles you use.
  2. The C compiler works with 32 character symbol names.
  3. The Pascal compiler has changed to fit the C compiler.
  4. The definition of rs232b in /usr/include/sys/rs232.h has changed so and programs using it must be recompiled.
  5. The file /etc/spoolgov has changed. It is advisable to edit the new one if you have any changes as the old one does not seem to work.
  6. The definition of plottable has changed in /usr/include/plot.h
  7. 'make' uses 'fort' as the default fortran compiler. If you want 'f77' you have to specify it in the makefile.
  8. Lint has changed. It works from semi-compiled libraries so if you have made up your own lint libraries you must do the following to them:
    /lib/cpp -C -Dlint yourlib | /usr/lib/lint1 -H/tmp/lintjunk$$ >yourlib.ln
    

7. READY TO START INSTALLATION

You should have the following floppies:

1 boot floppy (PNX version 5.02 8222) 
2 boot floppy (PNX version 5.02 8223) 
3 ECMA Kernel Window manager and rest of basic system 
4 ISO Kernel Window manager and rest of basic system 
5 utilities 
6 C compiler and libraries 
7 utilities 
8 utilities 
9 utilities 
10 libraries 
11 utilities 
12 utilities 
13 utilities 
14 utilities 
15 manual 
16 manual 
17 learn 
18 learn and spell 
19 demonstrations and examples 
20 PNX 5.02 update 1 
21 PNX 5,02 update 2 
22 Ups 
23 C03

The floppy titles do not describe the contents very well. Fuller details are in the PPSN (Perq Product Set Notice) which lists the set of files on each of the discs. Ordinarily, a Perq from SERC will be delivered with PNX already on it so that it is not necessary for you to load it from the floppies. Nevertheless, each machine is provided with a complete set of floppies which can be used to recover individual files that are lost through hardware, software, or human error.

There is a separate boot floppy for each of the two possible hardware configurations of Perq 2 that PNX 5 can work on, namely the 8 inch hard disk and the 5.25 inch hard disk. Only one of them can be used on a machine.

8. INSTALLING PNX 5.02

The following only needs to be done once on each machine, and should have already been done on Perqs delivered from SERC. Having installed the system. the daily start up sequence is described later under "Using PNX". Make sure you have at least 5000 free blocks on the hard disk. Otherwise the system will not be initialised properly. Use "df" to see how many free blocks you have.

Remove any floppy disc from the drive before switching on the Perq. When you power it on the screen will warm up within a few seconds. Turn the brightness control at the back of the display and you may see an uncontrolled flickering grey background with several white lines tracing across the screen. The hard disc will come up to speed within about 20 seconds when the system will be ready to start (boot).

If there is no floppy in the drive, and the hard disc has software on it, the Perq will try to boot from the hard disc. Normally, this is just what you want, but when installing PNX you must boot from the appropriate special boot floppy. If it manages to boot from the hard disc just ignore it and carry on as detailed below. The machine can be booted at any time by pressing the reset button. This is on the processor box next to the on/off switch. Do not press any keys on the keyboard whilst a boot is in progress since they can have special effects.

8.1 Booting from the PNX Boot Floppy

When you put the appropriate PNX boot floppy in the drive, and press and release the reset switch, the floppy drive will clunk a few times and after between 5 and 20 seconds the screen will be overwritten with a pattern that looks like "@" signs. The uncontrolled flicker will then recur and about a minute later you should see a clean screen with the heading (approximately)

System:      PNX 
Version:     5 
Level:       BOOT 
Microcode:   2L16.3 (or 2L16.2 for 8222) 
Bootstrap:   3.0 
User memory: 804352 (1 Mbyte) or 1893800 (2 Mbytes) 
International Computers Limited (c) 1985

The system will enter multi-user mode and the commands in /etc/rc will be executed. One of the commands will request the date with the prompt

type date in form: 4 nov 5:20 or nov 415:20 or 11040520 etc.
use two digit numbers (or field separators) in day, hours, mins order 
set the date [dd mmm hh mm] :

Reply in the format it suggests, say with "26apr1640" , and you will get

Thu Apr 26 16:40:00 GMT 1986 
are date and time correct?

Just press RETURN to confirm that the date is correct. In a few seconds the screen will be erased with a new login request:

International Computers Limited
PNX Operating System 
Version 5 
Level 2(F)
login:

Type in the identifier of the superuser, root (in lowercase). When it prompts for

password:

type in the password root, which will not be echoed on the screen. You will get a "#" prompt. If you already have a PNX system on the hard disc and are updating to PNX 5.02, this is when you type "updatepnx". This deletes some obsolete system files before copying across the new ones from the floppy. Otherwise, type in the command

makepnx

If you want to be clever, during this initial setting up of PNX you could pretend that today was some obvious datum like January 1st. When you had finished setting up the system, and reset the date to the correct value, it would be clear which files had come from this system generation, and which had been produced by you and other users subsequently.

Within a few seconds you will get the message

m/n = 2 24

Nothing will seem to happen for several minutes during which the hard disc has an empty file system built up on it. Subsequently, the floppy will start to clatter again as various files are copied from it to the hard disc. This operation should take about 21 minutes. Eventually, you should get the message

PNX CLOSED DOWN

You should now be able to boot a PNX system from the hard disc by pressing the reset switch (without any floppy disc in the drive). You should get a sequence of events similar to the first boot, only taking less time, around one minute. Following this the filesystem is checked with /etc/fsck and if all goes well it will produce the messages

/dev/hard
*Phase 1 - Check Blocks and Sizes 
*Phase 2 - Check Path names 
*Phase 3 - Check Connectivity 
*Phase 4 - Check Reference Counts 
*Phase 5 - Check Free List 
1659 files 16538 blocks 38640 free (depending on the disk space you use)

(If fsck is interrupted with control-C single-user mode will be entered. You can continue to multi-user mode with a control-Z to the "login:" prompt. You should only do this if you know the filesystem is ok.) When asked, enter the date as before and login as root again. Insert floppy disc 3 ( if you are on an ECMA Ethernet) or 4 and type the command

prime

The drive will clunk for a few minutes, and there will be several periods of apparent inactivity. When the command is complete the message "PNX CLOSED DOWN" will appear and you should reboot again, after removing the floppy disc. This time you should see the boot sequence that you will normally always get. It is as before, but there is an Option line for ISO or ECMA. After the file system check the Z80 micro is loaded with instructions for controlling devices like the tablet. The date is taken from the system clock.

8.2 Reading the Other Floppies

To copy the files from the other floppies you use the prime command again. You do not need to reboot between each floppy, just put the next numbered one in after you take the previous one out of the drive. The "#" prompt displayed when each prime has finished. Some of the later floppies may list each file name as it is copied to the hard disc. A table of the approximate time it takes to "prime" each disc is given below.

Minutes Floppy 
3         5       Rest of basic system and window manager 
5         6       commands a to e and C libraries 
2         7       commands e to p 
3         8       commands p onwards 
3         9       /usr/bin and /usr/include 
4        10       /etc and spoolers 
3        11       sccs, uucp and /usr/lib 
3        12       spy, ced, fed and /usr/lib 
3        13       /usr/lib 
3        14       troff and uucp 
4        15       manual 1 
3        16       manual 1 to 6 
4        17       learn editor eqn macros and morefiles 
2        18       learn C, /usr/dict, manual 7 and 8 
4        19       demonstrations and examples  
60       20       PNX 5.02 update (1) 
5        21       PNX 5.02 update (2) 
3        22       ups 
3        23       C03 and FTF
3                 FORTRAN 77 compiler and libraries 
3                 Pascal compiler and libraries 
3                 ERCC fort compiler (1) 
3                 ERCC fort compiler (2)
115 (approx)      total

The boot floppy takes 21 minutes to makepnx.

"prime" the numbered discs, in increasing order. There is sufficient file space to "prime" all of the discs, but the boot floppy and discs 3 to 14, 20 and 21 are essential for a reasonably complete PNX. This document assumes that you will prime floppy 20 and 21 (the PNX 5.02 updates). The discs with the on-line manual (15, 16 and 18), the learn utility (17 and 18), spell (18), the demonstrations (19), ups (22) and C03 (23) are optional.

If you are not familiar with Unix you would do well to "prime" the discs 17 and 18 so that you can use the learn command, and if you will not always have the printed Unix manuals to hand you should "prime" the three manual floppies. Note that these on-line manual pages are for standard Unix 7 and do not contain any Perq specific information, so they are of limited value. Floppy 18 is also needed if you want to use the spell program to check large text files for spelling errors.

Special actions are needed to recover any of the following files from the floppies:

/unix 
/etc/rc 
/etc/checklist

You must use floppy 3 or 4 to recover /unix, rather than the limited version of this file on the boot floppy. /etc/rc comes from copying and renaming the /etc/rc1 found on the boot floppy. Similarly, /etc/checklist comes from /etc/check1 on the boot floppy.

8.3 Changing the tablet device

The distributed system assumes you will have the larger square Summagraphics tablet with a four-button puck. As most of the Perq 2s will have the smaller rectangular Kriz tablet with three-button puck you will need to make a new special device file for it. You can check which device the system is configured for by giving the command "-ls -1 /dev/tablet". The output will be similar to

crw-r-r-- 1 root 6.136 Apr 30 11:29 /dev/tablet

The two numbers separated by a comma will be 12,0 for a three-button puck tablet and 6,136 for a four-button puck tablet. To configure for a three-button puck give the following commands when logged in as root:

rm /dev/tablet 
/etc/mknod /dev/tablet c 12 0

You should do this before using the window manager for the first time or you will get error messages referring to a non-existent device on the gpib. If you use a four-button puck on one Perq, and a three-button one on another you may find it convenient to swap over the left and middle buttons of the three-button puck so that they generate the same code as for a four-button puck. To do so put the following three lines in a file called wprofile in the directory from which you issue winit.

A1 
B0 
C2

8.4 PNX 5.02 update

"prime" the PNX 5.02 update floppies last. They try to ensure that the idiosyncrasies in PNX are smoothed out to make it closer to a standard Unix system, and adds several commands and utilities mentioned in this document. If you mount it and "cat /fd/COMMANDS" you can see that sort of things that it tries to do. Since it passes through the file system changing ownerships from root to bin it can take from 10 to 30 minutes to finish, depending on how many optional floppies have been read. If you subsequently "prime" one of the other floppies you may like to "prime" the 5.02 updates again, but in this case it will be somewhat faster.

9. USING PNX

When using the Perq regularly, the starting up sequence should be as follows. Remove any floppy disc from the drive and switch on the machine. The screen will warm up within a few seconds. Check the brightness control at the back of the display and you may see an uncontrolled flickering grey background with several white lines tracing across the screen. The hard disc will come up to speed within about 20 seconds. The machine tries to start up (boot) itself when switched on, but if it does not manage to do so automatically you can force it to boot at any time by pressing the reset button. This is on the processor box next to the on/off switch. Do not press any keys on the keyboard whilst a boot is in progress since they can have special effects.

About 5 to 20 seconds after pressing and releasing the reset button the screen will be overwritten with a pattern that looks like "@" signs. The uncontrolled flicker will then recur and about a minute later you should see a clean screen with the heading (approximately)

System:       PNX 
Version:      5 
Level:        2(F) 
Options:      ECMA (or ISO) 
Microcode:    5L16.2 
Bootstrap:    3.0 
User memory:  669696

Following this the filesystem is checked with /etc/fsck and if all goes well it will produce the messages

/dev/hard
*Phase 1 - Check Blocks and Sizes 
*Phase 2 - Check Path names 
*Phase 3 - Check Connectivity 
*Phase 4 - Check Reference Counts 
*Phase 5 - Check Free List 
nnnnn files nnnnnnn blocks nnnnn free

where n stands for a digit. See section 12.1 for what to do if fsck discovers inconsistencies in the file system. (If fsck is interrupted with control-C single-user mode will be entered. You can continue to multi-user mode with a control-Z reply to the "login:" prompt. You should only do this if you know the filesystem is ok).

The system will enter multi-user mode and the commands in /etc/rc will be executed. One of these commands loads the Z80 micro with instructions for controlling devices like the tablet. The next command requests the date from the Z80 clock. In a few seconds the screen will be erased with the login request:

International Computers Limited 
PNX Operating System 
Release 5 
Level 2(F)
login:

Type in your user name (in lowercase) and, when it prompts for

password:

type in your password, which will not be echoed on the screen. When you get the command prompt "$" you are ready to use PNX. You can logout when you want to leave the machine by entering control-Z (end-of-file) instead of a command.

If you are the last person to use the machine give the command "shutdown" instead of logging out and wait for the heading

single user mode 
login:

before removing any floppy disc and switching off. If no one is logged in, do so with the user name shutdown and this will have the same effect. (The system will re-enter multi-user mode after waiting for about 1 minute in single-user mode, or if you enter control-Z to the login prompt).

10. SYSTEM MANAGEMENT

The following suggests the sort of things that someone in charge of the Perq should be doing.

Although the Perq is a single-user machine, it will usually be used by several people, and each of them will normally have their own set of files and their own login name. This is to provide protection, privacy or merely convenience.

There are a few login names already set up with the distribution, such as root, bin, daemon, sys as well as demo and shutdown. The file /etc/passwd shows how each name is mapped to a number for internal use, with 0 reserved for root and 1 for daemon. The same file holds the encrypted password for each name, and the initial home directory within the file system that the user will be at when he logs in.

10.1 Adding a New User

To add a new user name to PNX, login as root and give the command "manage". It asks you if you want to add a new user, to which you should reply "y", whereupon you will be prompted for the name. You should use only lowercase alphabetic and numeric characters. It also asks for an initial password. You can press RETURN to opt for no password at all, but generally this is bad policy.

The command uses managex to actually edit the /etc/passwd file, and this assigns a new number (the first unused one above 9) to the name. If you "cat /usr/bin/manage" you will see how it goes on to create a directory for the user, sends him a brief message, and sets up a small .profile file. You may want to edit this set of commands to use the other fields of the password file or extend the message of welcome and so on when you know more of Unix. You could add an "stty -erase ' H'" to their .profile, for example, to make BACKSPACE replace DEL as the delete previous character code.

10.2 Removing a User

You can use "manage" to remove a user name from the password file too by replying "n" to the first question, and giving the user name to remove when asked for it. It will ask you to confirm that the user's home directory and all the files in it should be scrapped. Do not try to remove a name like root, or you will end up without a file system! To change someone's password you should login as root and give the command "passwd xxx" where xxx is the user name.

10.3 The Superuser

The login name root is known as the superuser because when logged in as it you are all powerful. All file protection is lifted and you can easily destroy the system with a few careless commands. You should therefore change the root password and limit the number of people who know it, preferably to one. Otherwise, if something peculiar happened to the system it will be hard to discover whose tampering led to it.

If you are unfamiliar with the shell it would be useful to read section 6 of the Unix Programmer's Manual volume 2A to help understand the examples given.

Note that the boot floppy has its own /etc/passwd file, so you must keep that disc secure. If you forget the root password on the hard disc system you can boot from this floppy, and login to root using the old password for root that is known by the system on this disc. Create a convenient /hd directory with "mkdir /hd", and mount the hard disc on it with "/etc/mount/dev/hard/hd". You can then edit the password file /hd/etc/passwd to set root's password to null. "sync" and reboot from the hard disc and set up a new root password.

If your machine is accessible over a network, or has a terminal connected to the rs232 port you should think about changing the permissions on "bye", "shutdown" and the floppy disc devices, for example, so that remote users cannot disrupt the person working on the console and screen. A lot of work would be needed to ensure this in any reasonable degree.

10.4 Accounting

You can get the system to keep a note of how long each user has been logged in for by creating a log file with the command ">/usr/adm/wtmp". Every time a user logs in or out an entry will made in this file, which tends to grow large very quickly. The command "ac" will summarise its contents by user name and date. You could keep some sort of limit on the size of the file by adding a command like the following to the end of /etc/re. It checks if the accounting file exists and if its size is over 50 blocks it empties it.

test -f /usr/admlwtmp && 
find /usr/adm/wtmp -size +50 -exec sh -c '>/usr/adm/wtmp' \;

10.5 File Space

Although the hard disc may seem large when you start, it will quickly become full if you do not ask users to throw away their old files. The message

no space on dev 0/0

appears when the file system on the hard disc is full. The same message with 1/1 indicates that the currently mounted floppy is full. To find the amount of free disc space on a device use the command "df". It assumes the hard disc is to looked at by default. The command "du" can be used to total the number of blocks used within a directory ("quot" is not available), and since each user has a separate directory under /usr you can try

du -s /usr/* 
df

To find the space left on a floppy (which can be mounted or not) use "df /dev/flop" (or the appropriate device name (see 3.4)).

/etc/fsck also tells you how many free blocks are left on a device, and is run every time the Perq is booted, so you should notice when space is getting tight. As mentioned later (see 14), you should copy important files onto floppies in case of file system corruption. It is best to make each user responsible for backing up his own files, and the consequences of his own laxness in doing so, by allowing each user some floppies.

10.6 Changing the date

You may find the date as set by the real time clock is wrong. To change it do "ps" to find the cron process and kill the "cron" process. Then "date yym.mddhhmm". Then restart cron. You can also use "/etc/fixtime" in the /etc/rc file to change the date each time the machine is switched on. Make sure fixtime is done before cron is started up.

10.7 Switching Off

If the Perq is used regularly through the day, it is best to power it on only once and leave it running without any users for the odd hour, rather than rebooting it four or five times a day.

When powering off the machine you have several options on how to do so, depending on the confidence you have. You should be trying to switch off when there is no reading or writing of the discs going on, and there is no output for the discs buffered in the memory. The way to guarantee this is to give the command "kill -1 1" when logged in as root. It causes PNX to go to single-user mode, stops any commands that may be still executing in the background, and flushes out the disc buffers. When you are asked to login again you can safely power off.

The "shutdown" command issues the equivalent of a "kill -1 1" from a program. When you have primed the first 5.02 update floppy anyone can give this command to get to single-user mode, ready to power off. You will also be able to login as shutdown without the need for a password, when the program will be run for you. PNX also has a command "bye". This writes out to the disc, kills all the processes, displays the message

PNX CLOSED DOWN.

It seems wise to use this command when in single-user mode and the disc heads need to be left in a suitable position for subsequent transportation.

Generally speaking, you will probably not damage the file system if power is removed when the machine has been sitting in multi-user mode waiting for a command or a login for over 30 seconds, or the command "sync" has just been issued, but nevertheless users should be exhorted to type "shutdown" and wait about 5 seconds for the login message. If PNX has crashed there is no point in rebooting the system just to shutdown and power off.

10.8 Good Habits

To force yourself into good habits you can alter /etc/rc to do some checks every time PNX is started up. Since commands in /etc/rc have their input and output connected to /dev/null and you will want the following additions to do reads and writes to the console you should first add the lines

(:
) </dev/ console >/ dev/console 2>/dev/console

to the end of the file, and then insert any of the following after the line with "(". For example, you might check that no unexpected changes have been made to the static part of the file system with something like

find 'ls/|fgrep -v 'usr 
tmp" -mtime -3 -print 
(cd /usr: find bin dict include lib man pub -mtime -3 -print)

which names those "public" files that have changed in the last three days. You could note those users who are using over 200 blocks of disc space with, for example.

du -s /usr/* |
  while read size name 
  do if test $size -gt 200 
    then echo $name has $size blocks 
     fi 
  done

Try looking for files called core which are often left in some curious places when a command crashes. The following will remove any it finds if you reply "y" to the prompt

<rm.., core >?

find /-name core ~xec ls -1 {} \; -ok rm -f {} \;

The following command will find files that everyone has permission to write on, which is usually not intended.

find /-perm -02 -exec Is -ld {} \;

11. USING NEW FLOPPIES

A brand new floppy must be formatted before it can be used. Formatting consists of writing headers on all of the disc saying "this is where sector 1 is", and so on. This is a relatively fast operation taking about 1 minute. It is sometimes worth doing even when an empty file system is to be rebuilt on an already formatted disc.

To format and put an empty file system on a floppy insert the disc in the drive (making sure it has the write-protect notch covered) and give the command "mkflop". It will write to the disc continuously for about 1 minute to do the formatting, and then will clatter away for another two minutes while it collects together a list of the free unused blocks on the disc, and initialises a table of potential file entries, This produces the messages

isize=320
m/n - 5 6

Issue a "sync" and you are now able to use the floppy with PNX. The disc will be in the new PNX 5.02 single density format. If you wanted to create an old file system format add the option "-o, to the "mkflop" command. Adding "-b" will create a boot format floppy, and "-d", will make a double density floppy (not recommended). If you do not want to reformat a disc already in the correct format give the option "-r", but this is being too fussy. If you just want to format the disc, interrupt mkflop with control-C after it has written the above message, or make a new file from /usr/bin/mkflop with all the "/etc/mkfs" preceded by ":" (this turns the commands into comments).

Any use of mkflop will overwrite any information on the floppy, and so it is usually only done once per disc.

11.1 Using a PNX File System Floppy

Thereafter, to use the floppy disc insert it in the drive and mount it with the command "mountflop". You can add "-r" to the command to show that the system is not to write on the disc. You must do this if the floppy is write protected or you will get error messages. When a floppy is mounted any files you create, copy or move under the directory /fd will be kept on the floppy disc. Adding the option "-o", will allow you to use an old style (pre PNX 2) floppy, "-b" a boot floppy, and "-ob" an old boot floppy. No special option needs to be given to distinguish a double density disc from a single density disc.

When you want to remove the disc, you must issue a "umountflop" command. You don't need to specify the floppy type again. If you are going to shutdown and reboot or power off immediately, you do not need to bother unmounting the floppy. Note, however, that this does not mean that going from multi-user to single-user will automatically unmount the floppy. The error message

Mount device busy

will occur if you try to mount something twice or if you have issued a change directory ("cd") command to the part of the file system tree that you are trying to mount or unmount. In the latter case you should say "cd /", for example, before trying again.

12. FILE SYSTEM CONSISTENCY CHECKS

The file system on the hard disc may be corrupted if the system crashes or if you power off or reboot the system without flushing out buffers to the disc. Any floppy mounted at the time may be corrupted too. The system will not, in general, notice that a file system is corrupt so you could carry on using it unaware until some major catastrophe.

If the data in a file is corrupted this cannot be detected automatically, but if the blocks describing how files are distributed on the disc are corrupted the program /etc/fsck can often find the faults and sometimes correct them. Since /etc/fsck reads and writes to the hard disc or floppy directly it should not be used on a mounted disc.

In practice this means you should not mount a floppy before using fsck on it, and you should reboot and login as root in single-user mode before using fsck on the hard disc.

12.1 Using /etc/fsck

If you give the command

/etc/fsck

the program looks in the file /etc/checklist for the names of the discs it should check. This file normally contains the string /dev/hard, so the command will check the hard disc. If it finds an inconsistency or error it will provide a terse error message and, usually. prompt you with its suggestion as to what it should do to recover from the fault. If you do not know what you are doing just reply "y" to all the prompts. You have to be pretty astute to do better than this program at patching up discs. However, you should take note of the filenames it mentions as you may find that these have had to be removed from the file system. Even old and rarely used files can be lost. Sometimes files will lose track of which directory they should be in and fsck may put them in /lost+found for you to look at and decide where they should be.

If you say "n" to the prompts from fsck the fault will remain in the file system. A "n" reply to all the prompts will means that no changes will be made to the disc. You can reply yes or no automatically to all the prompts by putting "-y" or "-n" after the /etc/fsck command. Some errors are not particularly severe, such as losing some free blocks, but you should never hesitate to run fsck at the slightest hint of something fishy happening because a minor fault could rapidly cause havoc throughout the file system.

If fsck makes any changes to the hard disc it will ask you to reboot immediately without issuing a "sync"; this is because the PNX system does not know about the changes that fsck has made to the file system, and a "sync" would cause it to overwrite some of them incorrectly.

12.2 Checking Floppy Discs

To check a floppy disc you do not need to go to single-user mode. Make sure that the floppy is not mounted (the easiest way is to unmount it and ignore any error message) and give the command

/etc/fsck /dev/flop

The PNX 5.02 update floppy will have changed /etc/fsck so that any user can use it on a floppy disc. They will not be able to use it on the hard disc because they will not have write permission on /dev/hard. It does not matter if the floppy is single or double density, but if it is a boot floppy you must use /dev/bflop instead of /dev/flop (and as appropriate for old format floppies (see 3.4)).

/etc/fsck is unable to enlarge directories, so not only should you always create a lost+found directory at the top of every file system (namely /fd/lost+found on a mounted floppy), but you should also create a dummy file in that directory and remove it immediately. This ensures that the directory has some empty slots in it. (PNX does not automatically contract directories when they get smaller).

13. OTHER DISC ERRORS

The fsck program above cures errors in the file system caused principally by the software not managing to make several changes on the disc "instantaneously". Considerably more dangerous are the errors caused by the hardware failing to write a proper block on the disc, due to power failure for example. Each block of data on the disc has a checksum kept with it which is used to give confidence that the data has not been corrupted when you try to read it back. If it has been you will get an error message like

error on Floppy Disc, Status = xxxxxx

(or "on Hard Disc") where xxxxxx is a hexadecimal number, the exact significance of which is not documented. If this recurs repeatedly when trying to read a particular block you can only recover by rewriting that block with new data, ("dd" can be used to write single blocks on the disc, if you know what should be there.)

Apart from corruption of the contents of blocks, more severe errors can cause the headers of the blocks to become unreadable. This means that the whole track or cylinder containing that block will have to be reformatted. With mkflop the only option is to reformat the whole of the disc if it is a floppy. Because of the way PNX (or Unix) scatters its files over the surface of the disc, losing a track is as bad as losing the whole disc anyway, so this is not such a limitation. If the hard disc needs reformatting the ICL engineering diagnostics will have to be used.

To provide greater confidence in the correct working of the system, when an object file is produced a checksum of its contents is added to the file. If you get the error message

xxx - checksum fail - csum=lF5CF663 , sum=1F585663

where xu is the name of a program, it means that an exact copy of the program was not loaded into memory. This message may appear spuriously, but if it recurs every time you use the same program you should recompile the object code, or copy the utility from the PNX distribution floppies again. A list of the filenames on each floppy is included in an appendix. If the same filename appears on the boot floppy and floppy 3 or 4 you must use the one from floppy 3 or 4.

Some software for maintaining a bad block list is now available, "/etc/bbadd" for adding bad blocks to the list and "/etc/bblist" to list the bad blocks, "/etc/bbswap" is for the swap area.

14. BACKING UP

You are recommended to keep a copy of everything you develop on the hard disc on a floppy, and to keep at least one copy of everything you write on a floppy on another floppy. The program cptree can be used to create a backup of your files onto a floppy, and subsequently to add or save again files that have been modified since the last backup. If the user xxx wants to save a copy of his part of the file system, namely the files in the directory /usr/xxx (probably), he should mount a blank floppy (which has been formatted and had an empty PNX file system built on it) and give the command

cptree -a -d /usr/xxx /fd/xxx

(If the user is logged in as root, he should use "-a -d -t" to preserve the original ownership of the files as they are copied.) The command will write out each file's name as it is copied. The user can then unmount the floppy and remove it. When, a day or two later, he wants to make another backup he can either use the same command again to copy all of his files or, to copy only those files modified in the last 2 days, use

cptree -a -d -M2a /usr/xxx /fd/xxx
-M2a denotes the two days, You can specify 1 day and 3 hours, for example, with -M1:3a, Note that the floppy will still have files that have been deleted since that first cptree was done, so that it is not an exact copy of the /usr/xxx sub-tree, This means that the floppy will tend to fill up, whereupon a new empty PNX file system should be built on it and a cptree of all the /usr/xxx files made again, It is wisest to make at least two full backups onto two floppies, and alternate the update cptrees between them.

15. COPYING WHOLE FLOPPIES

The cptree program is an adequate tool for copying PNX file systems between floppy disc and hard disc, To copy a special floppy such as a POS disc or a PNX boot floppy you will have to use the device /dev/flop as follows, Insert the disc in the drive (do not mount it) and give the command

cp /dev/flop /tmp/flop1

where /tmp/flop1 can be any filename in some convenient part of the file system of the hard disc, After about 2 minutes of constant reading from the floppy you will get the irrelevant message "cp: read error", If you say "ls -ls /tmp/flop1" you should see that the file is exactly 1001 blocks long, You can now replace the floppy with one that you wish to write (and which has been appropriately formatted) and give the commands

cp /tmp/flop1 /dev/flop sync

There should be no messages, and 2 minutes later, after the "sync", you can remove the floppy and the file /tmp/flop1, Double density floppies could be copied in this way, and will produce a file of 2002 blocks.

Old format floppies and boot floppies can be copied using /dev/flop too, but they will take considerably longer, about 12 minutes, because the sectors on the disc are not ordered in the optimum way.

16. WARNINGS FROM ICL

A list of known errors and restrictions for PNX 5.02 is given in section 10 of the PNX 5.02 Release Document, A list of current bugs is kept at RAL on rlvd in the files C, fortran, gks, commands, fort, pascal in the directory lusr/pub/perq/bugs.

17. BOOTING PROBLEMS

There are a set of three led displays on the front panel of the Perq 2 processor, They show the progress of booting, and can be of help in finding why the system will not start up. The boot sequence from hard disc proceeds as follows on these diagnostic digits: 000 appears as the button is pressed and moves immediately to 010 when it is released, This quickly counts up to 030 in a second or so, whi1st the screen is rewritten with a few patterns, After 7 seconds the display moves to 151 and after another 5 seconds to 255 or 256 which shows the completion of the boot.

A table of the diagnostic digit values is given in Appendix 5 of the ICL Guide to PNX.

18. SOME KNOWN PROBLEMS OR DIFFERENCES WITH UNIX

  1. Some errors will cause the system to enter the microcode debugger. This displays the prompt character "@" at the bottom of the screen. Although there are a few commands to display parts of memory the only useful one you can give is "g" followed by RETURN. This will attempt to resume the system where it left off. Try several "g"s before giving up and rebooting after successive "@"s.
  2. The commands "quot" and "units" are not available, All files from the PNX 5.02 update floppy, should not be considered as part of the ICL release. This includes "manage", "puftp", "spy 9(p)", and "lst".
  3. A later version of spy is installed by the 5.02 update floppy. The documentation from ICL does not describe this version, but a copy of the manual pages for the new version are issued in Common Base Programme User Note 14.
  4. Also from the first 5.02 update floppy, the command "lst" will recursively list all the files and sub-directories in a directory, Unlike "lstree", it will cope with very large subtrees, such as the entire PNX file system.
  5. ld does not support the -r option.
  6. For a list of known bugs see section 10 of the PPSN.

19. FURTHER READING

ICL Guide to PNX:
   Chapter 2 Setting up and using PNX 
   Chapter 3 Guide to the Window manager 
   Chapter 11 Programming under PNX 
   Appendix 2 UNIX FORTRAN 77 under PNX 
   Appendix 3 C under PNX

ICL PNX 5 Software Reference manual

UNIX manual 2A:
   Section 3 UNIX for Beginners 
   Section 6 An Introduction to the UNIX SHELL

   Common Base Programme User Note 7 

There is also a documentation guide in Appendix 1 of the ICL Guide to PNX.

⇑ Top of page
© Chilton Computing and UKRI Science and Technology Facilities Council webmaster@chilton-computing.org.uk
Our thanks to UKRI Science and Technology Facilities Council for hosting this site