Journal Articles

CVu Journal Vol 1, #2 - Dec 1987
Browse in : All > Journals > CVu > 012 (9)

Note: when you create a new publication type, the articles module will automatically use the templates user-display-[publicationtype].xt and user-summary-[publicationtype].xt. If those templates do not exist when you try to preview or display a new article, you'll get this warning :-) Please place your own templates in themes/yourtheme/modules/articles . The templates will get the extension .xt there.

Title: Mirage

Author: Martin Moene

Date: 20 June 2010 08:53:00 +01:00 or Sun, 20 June 2010 08:53:00 +01:00

Summary: A versatile operating system for Motorola systems

Body: 

A Multi-User, Real-Time and Multi-Tasking
Operating System For The 680x0!
Atari ST Version
Reviewed By Phil J Stubbington

Introduction

Considering its parentage, it is hardly surprising that C is so widely used in systems software. In the writing of an operating system, it is estimated that more than 70% could, and often is, written in C. However, no C compiler will ever produce code as efficient (in terms of size and speed) as a competent assembly language programmer.

In 1980, Swifte (pronounced Swifty) Computer Systems, a UK software house, started developing Mirage for what was then the new 68000 processor from Motorola Inc. Since then we have seen the 68010, 68020 and just beginning to appear is the 68030, all offering improvements over the previous version, whileretaining a high degree of code compatibility. The decision to write Mirage purely in assembly language has obviously paid off. Today, Mirage can be found in hundreds of commercial and educational sites throughout the world.

First Impressions

The version of Mirage I shall be looking at here is for the Atari ST (any model, although a mono monitor is essential). The main differences between this and any other version are the price (œ99 plus VAT) and the form it takes (Mirage is often provided on disc, but comes in ROM cartridge form for the ST). All versions of Mirage are largely object code compatible, and the disk formats are similar.

Mirage for the ST consists of an 128k ROM cartridge, a single-sided disk, and a user's manual. Once the cartridge is pushed into place (preferably with the machine off!) and with the boot disk in place, a warm-boot can be performed. Although the Mirage disk format is unlike GEMDOS (the ST's native operating system), the first 19 blocks are left untouched, so that you can format a disk under GEMDOS (perhaps using one of the improved formatters, giving you 800k+ rather than 720k) and/or use some of these blocks for a bootstrap loader. The Mirage support disk contains a loader to transfer execution to the cartridge. By doing so, Mirage actually uses less memory than the ST usually does, as TOS (the collective name for GEMDOS, GEM, etc.), hasn't had a chance to initialise.

Mirage defaults to a single-user system, so you can start to use it without having to login in the conventional multi-user way. From here you have access to all the facilities of Mirage. In addition to the shell, kernel and filing system, as much of Mirage as possible has been packed into the ROM cartridge. Terminal, device and I/O board drivers and some of the more common utilities are included. This leaves more RAM for what you want to do, as well as alleviating the problem of errant programs corrupting the OS (the ST has minimal memory protection).

The Shell

The standard shell under Mirage will execute a command file called AUTOBOOT.CMDF, which is a convenient way of configuring the system. In addition to the execution of external commands, the shell has a sophisticated control language. To differentiate between internal and external the period is used, so the "if" statement takes the form .IF {expression} .THEN {action}. Other statements include support for subroutines, assignments, and terminal input (either a single character or a line) and output (enable and disable, write a line, and support for the Mirage terminal control functions.

Output redirection is also supported, using the usual ">" and ">>" to create/overwrite and append to an output file. The actual format is a little strange though: to redirect the output of a program called fred you would enter ">OUT FRED" rather than the Unix equivalent "FRED >OUT" ! Input redirection is not available in the same way, although you can do something similar from within command files.

In short, the Mirage shell offers many of the facilities found in Unix shells, although it is a much "cleaner" design, and probably faster.

The Kernel

Access to the multitude of system calls available under Mirage (a brief overview is given below) is through the "TRAP" opcode of the 680x0 family. For those not familiar with the processor, the TRAP opcode, accompanied by a 4-bit (ie. 0 to 15 inclusive) immediate operand puts the processor into supervisor mode, and executes an exception routine via a vector table. This table usually sits at the start of memory (it can't be moved on the 68000) - and on the ST is the only area of protected memory.

Brief Overview Of System Calls Available Under Mirage

As well as the usual system calls found on any multi-tasking OS, Mirage has a facility known as bolt-ons, which are a convenient way of adding system calls. These can be used for a variety of applications - standard bolt-ons include disk and sector caches, printer spooler, floating point support (either in software, or via co-processors) and a record management system called TRAP (which stands for TRansaction Processor, not to be confused with the TRAP opcode mentioned earlier).

Filing System

The filing system under Mirage can best be described as bush rather than tree structured. Instead of a root directory, with branches leading from it, Mirage has a potentially infinite number of directories at the same level. This is pretty much the same approach as VM/CMS, although I feel it is better implemented in Mirage. The reason for this approach is the large overhead caused by a true hierarchical filing system.

To move from directory to directory you use the CD (or LOG) command, which functions in much the same fashion as Unix. Typing CD on its own will tell you where you are, for example SYS0::DSC0:[UTIL], and CD ALPS will change to the directory of that name (assuming it exists, of course!). To list the contents of the current directory you enter DIR (with wildcards if required) and to list the directories on a device you would use DIRS (remember you don't have a root directory, so you can't enter DIR DSC0:)

The first part of the file specification (SYS0) is mainly for use in a networking or multi-processor environment. The SYS part is the name given to the node in the network and the 0 is the Node Slave Number (NSN). The NSN is useful in systems where you have multiple processors on the same node, and is mainly a result of system security.

The next part (DSC0) is the device name and drive number. Mirage is very flexible in names given to devices (and network nodes), so although we use DSC to indicate a disc drive, we could equally have called it FLP or HRD.

UTIL is the directory name (limited to four characters), and is one of the pre-defined directories under Mirage. For example, the "H" directory is where C header files are searched for, and BOLT is where bolt-ons reside.

As with most filing systems, it is seldom necessary to specify the entire path (you have the equivalent of a home directory), so the file specification is not as complicated as it looks! Filenames are 8 characters long, with a 4 character extension (although I can't really see the extra character in the extension making a vast amount of difference!)

In addition to drivers for a variety of network protocols, and standard Mirage disks, drivers are also available for ram disks, p-Systems, reading MS/PC-DOS disks (and standard GEMDOS format disks on the ST), and ANSI compatible tapes. This is by no means an exhaustive list - I suggest you contact Sahara Software (who market Mirage) if you have particular requirements. Of interest to ST owners, Sahara intend to have a CD-ROM driver as soon as they can get their hands on a unit!

Utilities

Over 100 utilities are provided with Mirage, so naturally I don't intend telling you about all of them! All the usual file-related utilities are available: rename, copy, delete, change ownership, etc. As with output redirection, the syntax is a little unusual: instead of "rename {oldname} {newname}" you would use "rename {newname}={oldname}".

Commands exist to kill, suspend and revive processes. Mirage has a number of very useful utilities relating to processes. You can, for example, set up a background task with a virtual terminal and switch between your real and virtual terminal(s) as required. It is also possible to insert characters into the input buffer of other processes.

EDIT, a screen-oriented text editor, also comes with the package. All the usual editor facilities are provided. EDIT also allows you to invoke a compiler/interpreter based on the file extension. EDIT is, however, only able to edit one file at a time, so it isn't well suited to modular languages (C, Modula 2, etc.)

On the memory management side, Mirage allows you to load modules (programs or data) into memory, and/or share them between different processes. When you attempt to read the module, it will be read from ram, rather than disk. This is obviously quicker, as well as being more versatile than a ram disk. Incidentally, this feature also appears in OS/2.

Language Support

Most of the popular languages are available under Mirage: including Pascal, Lisp, Fortran, BASIC and of course, C. All compiled languages, with the exception of C, compile to assembler source rather than straight machine code. This is then processed by the Mirage Assembly Language Programming System (ALPS). Unsurprisingly, since Mirage was written in assembly language, ALPS is a very powerful (and fast) system, complete with linker, librarian, source code debugger and profiler.

The two major languages under Mirage are assembler and Pascal. So what about C, I hear you cry? Most languages under Mirage are written in-house, and judging by the Pascal compiler provided for this review, are very well written.

However, with C, Swifte decided to use Lattice 3.03, via Metacomco of Bristol.

The main problems with Lattice are as follows:

Attempts are being made to improve the situation with Lattice C, but it really is a great pity, considering that C is the ideal high-level language for system development, that this situation was not cleared up some time ago.

Conclusion

As I was reviewing Mirage, one thing became very apparent - a great deal of thought has gone into most aspects of its design and implementation. Obviously, being a fairly young operating system, Swifte had the chance to learn from the "mistakes" of other operating system designers. This is not to say that it hasn't faults, but both Sahara and Swifte are actively involved in the continual development of Mirage, so where possible these are being sorted out.

If you are an Atari ST owner, Mirage gives you an excellent (read _cheap_!) introduction to multi-tasking operating systems. If you have a serious application, perhaps in one of the areas I mentioned earlier, Mirage is certainly well worth a look.

Prices

For the Atari ST version, prices are as follows:

MIRAGE OS 99 POUNDS
LATTICE C 129
Swifte-Pascal 99
Swifte-Basic 99
Swifte-LISP 59
Swifte-FORTRAN-77 129
ALPS 49

All prices exclude VAT and P&P, and are correct at press time. For further details, and pricing on other systems contact:

Sahara Software Ltd.,
Unit 5-11 Bondway Business Centre,
69-71 The Bondway,
LONDON,
SW8 1SQ.
Tel.: 01-735-3806

Notes: 

More fields may be available via dynamicdata ..