Personal Computer News


Uniplus

 
Published in Personal Computer News #067

Unix for the Beeb, tried and tested by Richard King.

Fire Up The Beeb

Unix for the BBC, tried and tested by Richard King

The BBC Micro is among the first to benefit from microcomputer's new-found interest in Unix. Until recently, the high cost of this powerful mainframe operating system restricted it to commercial use. But a change in pricing policy has enabled Torch to implement it on the BBC. The Torch version, Uniplus, runs on Unicorn, a system based around the MC68000 processor with Winchester hard disk, and 5.25" floppy drive.

As reviewed, the Unicorn isn't a standalone system. It requires a BBC Model B as a kind of high-speed terminal, to which the Unicorn is connected by three separate channels.

What makes it a Unix machine is a card carrying a 68000 processor; the rest is actually a Torch Winchester disk pack.

The 68000 card can be plugged into any Torch computer to give the same system from an operational point of view.

Superficially Uniplus differs little from real Unix and underneath not enough. If you forget that the processor is next to you, instead of in the basement, it feels like Unix on a VAX. It responds at about the same speed, and at times I couldn't believe a 68000 was in there.

For instance, when I activated so-called concurrent processes which all produce screen output, I was forced to conclude that process-swapping was a more apt description.

The program in question runs two programs as sub-processes: one draws raindrops which splash on landing and the other makes worms wriggle.

The term concurrent usually means tiny slices of time (100ths of secondds) being allocated to each of the active processes so that they appear to run smoothly, even if only more slowly.

Uniplus, it would appear, uses larger slices - more like 10ths of seconds. So you get a few raindrops which then freeze, the worms move a bit and stop, then the rain resumes.

Otherwise, Uniplus is an excellent implementation. It's complete, has the tools associated with a full system, and several more exotic ones.

Documentation

Documentation has as much massed and close-spaced test as anyone could want, but remains usable. Accurate and comprehensive, with a standard format, it was written, manipulated, formatted, indexed and set on Unix.

Installation

Connecting the Unicorn to a BBC involves three ribbon-cables which plug into the Tube, 1MHz bus and disk port. As with most of the BBC filing systems, a ROM must be fitted, in socket 5. Then you can power-on (Unicorn first) and the system should boot.

Apparently this can take quite a while. According to the documentation the next stage is to partition the hard-disk before loading up as much of the system as you require from floppy disk. This may or may not be the whole lot, depending on whether you want to keep part of the Winchester for use with other operating systems such as CPN, but Unix must have at least 4Mb of space, and really prefers 8Mb or more. If this isn't available, you may have to leave out inessentials.

The physical design of the Unicorn in its most obtrusive feature and its least likeable. Part of the problem lies in the shape of the case, which is taller than usual for a desk-standing item, particularly one without a screen. Since it's attached to the BBC by a 12" cable, you find it standing so close you can't even push it back to clear the edge of the keyboard, so your hand keeps banging into it.

C Language

C is among the newer generation of high-level languages. It was developed in the early '70s and descended from Martin Richards' BCPL language via the experimental language B.

One of its first important uses was in rewriting the Unix operating system. This had originally been composed in machine code, but apart from the low-level drivers, is not almost completely written in C.

C and Unix are almost inexticable linked, and whether the language is available on a huge mainframe or a small micro, the essential features of Unix are duplicated or simulated.

These include the library of subroutines which, though not formally part of the language, are always in any serious implementation. They provide, among other functions, a standardised means of handling the various input and output facilities of the system.

About half these subroutines are coded in C, particularly the advanced input and output formatting routines printf() and scanf() and their alternates, fprint(), sprintf(), fscanf() and sscanf(), with the others such as the string-handling, floating-point and trigonometry functions written directly in machine code for reasons of speed.

In fact, the only formal definition of C is a smallish book by Brian Kernighan and Dennis Ritchie, and is the final definition and sole arbiter of its use.

In this respect, the Unicorn scores highly - unlike other versions of C, which are cut-down or re-written-to-fit, this is the real thing, complete with all the bits and pieces you read about in the Unix-for-beginners-and-experts books.

Tagging along for the ride are all the bits of the compilers - prepocessor, passes 1 and 2, assemblers, linker-editor and so on, as well as the usual tools for finding, listing and changing files such as sort, unique and grep (Get Replicated Pattern).

Heavy-duty system-building tools like Lex - The LEXical program generator - yacc (Yet Another Compiler Compiler) and scores (literally) of others, together with sccs and its attendants are keeping everything in order and make sure you have or can get some idea of what program or file is where and in what state.

C is a compiled language, which means that the process of converting a program into running code is fairly time-consuming, and has none of the immediacy of Basic or other purely interpreted languages. However, a kind of interpreted C is available in the c-shell, which is invoked by typing csh at the keyboard.

Deliberately designed to look and work in much the same way as the compiled language, it's close enough to consider as a dialect with most of the expected operators, data- and control-structures. It isn't an exact duplicate, so though you get the advantage of being able to hammer in some code, type its name to make it run, and quickly see some results, you can't then compile it. The stuff needs considerable massage before being acceptable to the compiler.

If you don't like C or have some reason to use another language, that's easy too, since Fortran and RM-Cobol are also available, and if you want to use those, but prefer to use a more C-like syntax, you can have m4 (another pre-processor) change it all around for you.

At its simplest, it can be used to give more expressive names to such symbolic constants as TRUE and FALSE, which use usually 1 and 0, as well as letting the programmer replace complex statements with purely arbitrary symbols, thus making programs more readable. Used really creatively, it can even do most of the work of converting from one language to another. So real Unix is in a different league to the normal micro OS.

MC68000

Of all the different 16-bit processors, both real and pseudo, the Motorola MC68000 appears to be the most popular, and its use in the Unicorn will spread its familiarity.

Its popularity is partly due to a strong resemblance in electrical terms to the MC6800m and earlier Motorola CPU which is still widely used in the likes of intelligent controllers.

This makes the more capable 68000 simple to interface, and provides plenty of readymade hardware support such as I/O boards with 6821 PIA chips, VDUs with 6845 CRTCs, clocks using the 6840 Programmable Timer and disk-controllers using the 6843 FDC, as well as others.

One other advantage of the 68000 liked by computer designers is the width of the separate data- and address-busses. Each bit has its own pin, too - they are multiplexed as on the 8086 and 8088 or Z8000.

This means the processor can run as fast as the rest of the system will permit, and in general, that means fast.

From the programmer's point of view, however, the 68000 has many advantages over most 16-bit processors, because of the symmetry of its registers and the rich instruction set, which add up to an elegance the others generally don't share.

All of this makes it easier to implement and run a fully-featured Unix system such as the Unicorn.

A distinction is made between the address and data registers, though they are exactly the same size, and in most respects are operated upon in the same way by the same instructions. As a result, it may often be necessary to move data from an A-register to a D-register, fiddle with it as data, then move it back to the A-register again. It would have been easier if Motorola had allowed any register to be used as either data or an address.

Also, redundancies in the instruction-set result from what might be called addressing mode cross-over. This phenomenon arises because the addressing-modes are so varied that sometimes one means exactly the same as another, despite having been arrived at by different instructions.

In general, however, the MC68000 provides a fast and acceptably efficient CPU, which is becoming more and more widely used.

In the past year it has been used in Apple's Lisa and Macintosh, Sinclair's QL and many multi-user business machines.

It allows designers to provide features which would have cost tens of thousands of pounds only a couple of years ago, and looks set to become as popular in the next generation of machines as the Z80 and 6502 were in the current generation.

Verdict

If you do a lot of highly-interactive keyboard work, using a spreadsheet or writing, then the Unicorn probably isn't ideal, mostly because the response times aren't all that wonderful. It's all right as long as you don't have background processes running, but if you do, you'll find the frequent short pauses fatiguing.

However, if your work is amenable to batch-processing, then it might well prove cost-effective. The text-editing, formatting and typesetting features of the system are ideal for this kind of work.

The main question is whether the applications software, the greatest strength of CP/M, can be transferred, translated or duplicated under Unix. If this happens, then Unix must offer the richest combination of features and facilities of any OS. As it stands, the Unicorn has to be the biggest and most impressive add-on for the BBC Micro yet.

Overall, Uniplus is a complete, accurate and up-to-date implementation of this highly-capable operating system, which should provide experienced users with all the space, precision and flexibility they would expect on an 11/70.

Specifications

Price: £2,895 excl VAT
Processor: MC 68000
ROM: 8K + 16K in the BBC
RAM: 256K
Operating System: Unix
Software: Unix Pack - Program development pack containing C-compiler etc; text processing pack
Distributor: Torch Computers, Abberley House, Shelford, Cambridge CB2 56Q

Richard King