5
microcomputer world with Lisa and VisiOn technology. The concurrent CP/M user interface is structured on similar principles but has been able to implement a more open system than any of these alternatives by providing an application-independent environment. The personal computer has evolved from being a system which is used for short intervals of time during the working day into a workstation which is continuously operative throughout the working day and is the one instrument on which all office-related activity is taking place. In essence, it provides the paperless environment as pioneered in the Xerox star system. As users go through the working day they tend to be involved with many different applications, first initiat- ing them and then suspending a particular job while a more important office activity takes place. Ideally users would like to see some of their work continued in the background while they concern themselves with matters of greater priority, The user interface of concurrent CP/M allows users to accomplish this by providing for virtual computer systems. Each computer system has its own console and keyboard. Switching between these machines is done at one keystroke; thus operators can begin word processing on one virtual screen, be interrupted and beging business model computation, then go back to the word processor later in the work session, begin a compilation on a third virtual screen and allow it to run while going back to complete the letter on the word processor. Users never have to reload their software or back out of the context Grophic I Application prog [ ~/wtuol device interface GSX DeviCe interfoce GDOS GlOS q BDOS CP/M BIOS Figure 3. Structure of the CP/M GSX graphics systems extensions of the job that they had stopped looking at on their 'real' physical console. The four or more screens that are part of the concurrent CP/M user interface can be presented as separate screens available at a keystroke or can be overlapped or coresident windows which simultaneously show work in progress on the various CP/M applications running on the system. Graphics interface for concurrent CP/M The modern personal computer typically provides graphics capabilities in its hardware. To provide a graphics interface to applications packages which may want to exploit good visual presentation, concurrent CP/M has been further developed to allow for graphics extensions which are totally machine independent. This is accomplished by modelling operating systems extensions on standards defined in the virtual device interface pioneered as part of the graphics kernelized system proposed by the International Standards Organization. The gGSX graphics systems extensions allow applica- tions packages with graphics capability to be machine independent. They can obtain graphic input from digitizing tablets, selector functions, or pointer devices such as the mouse or joystick and light pen. Graphics output can be provided to the graphics screen of the personal computer or to various graphics plotters or printers. To accomplish machine-independent graphics, the graphics system extensions are partitioned in much the same way as CP/M itself. The GSX system consists of a machine-independent and a machine-dependent subsection. The machine-independent system is known as the graphics disc operating system (GDOS), The machine-dependent system is the graphics I/O system (GIOS). The configura- tion of the GIOS is carried out by a particular personal computer manufacturer. Figure 3 shows the structure of the CP/M graphics systems extensions. Future trends in concurrency The capabilities of concurrent CP/M are established in its realtime kernel. Based on the realtime capabilities of concurrent CP/M this product can naturally evolve into a high-performance networking operating system or a distributed multiuser system. Such products will be the natural derivatives of this new generation of personal computer operating systems. vol 7 no 8 oct 1983 393

The portable UCSD p-System

Embed Size (px)

Citation preview

Page 1: The portable UCSD p-System

microcomputer world with Lisa and VisiOn technology. The concurrent CP/M user interface is structured on similar principles but has been able to implement a more open system than any of these alternatives by providing an application-independent environment. The personal computer has evolved from being a system which is used for short intervals of time during the working day into a workstation which is continuously operative throughout the working day and is the one instrument on which all office-related activity is taking place. In essence, it provides the paperless environment as pioneered in the Xerox star system. As users go through the working day they tend to be involved with many different applications, first initiat- ing them and then suspending a particular job while a more important office activity takes place. Ideally users would like to see some of their work continued in the background while they concern themselves with matters of greater priority, The user interface of concurrent CP/M allows users to accomplish this by providing for virtual computer systems. Each computer system has its own console and keyboard. Switching between these machines is done at one keystroke; thus operators can begin word processing on one virtual screen, be interrupted and beging business model computation, then go back to the word processor later in the work session, begin a compilation on a third virtual screen and allow it to run while going back to complete the letter on the word processor. Users never have to reload their software or back out of the context

Grophic I Application prog [

~/wtuol device interface

GSX

DeviCe interfoce

GDOS

GlOS

q

BDOS CP/M

BIOS

Figure 3. Structure of the CP/M GSX graphics systems extensions

of the job that they had stopped looking at on their 'real' physical console. The four or more screens that are part of the concurrent CP/M user interface can be presented as separate screens available at a keystroke or can be overlapped or coresident windows which simultaneously show work in progress on the various CP/M applications running on the system.

Graphics interface for concurrent CP/M

The modern personal computer typically provides graphics capabilities in its hardware. To provide a graphics interface to applications packages which may want to exploit good visual presentation, concurrent CP/M has been further developed to allow for graphics extensions which are totally machine independent. This is accomplished by modelling operating systems extensions on standards defined in the virtual device interface pioneered as part of the graphics kernelized system proposed by the International Standards Organization.

The gGSX graphics systems extensions allow applica- tions packages with graphics capability to be machine independent. They can obtain graphic input from digitizing tablets, selector functions, or pointer devices such as the mouse or joystick and light pen.

Graphics output can be provided to the graphics screen of the personal computer or to various graphics plotters or printers. To accomplish machine-independent graphics, the graphics system extensions are partitioned in much the same way as CP/M itself. The GSX system consists of a machine-independent and a machine-dependent subsection. The machine-independent system is known as the graphics disc operating system (GDOS), The machine-dependent system is the graphics I/O system (GIOS). The configura- tion of the GIOS is carried out by a particular personal computer manufacturer.

Figure 3 shows the structure of the CP/M graphics systems extensions.

Future trends in concurrency

The capabilities of concurrent CP/M are established in its realtime kernel. Based on the realtime capabilities of concurrent CP/M this product can naturally evolve into a high-performance networking operating system or a distributed multiuser system. Such products will be the natural derivatives of this new generation of personal computer operating systems.

vol 7 no 8 oct 1983 393

Page 2: The portable UCSD p-System

certain small portions of the operating environment, known as the basic input/output system or BIOS, and the p-machine interpreter. These are done once only, by the suppliers of the p-System, for each new machine. The benefits to the applications software developer are new markets at virtually no cost. And the end-user knows that valuable software can be taken with him/her when a machine is upgraded. Software is 'future-proofed' by the p-system.

The p-System came to the UK through several routes. One was through the universities, another through TDI Ltd. TDI is the only nonmanufacturing licensee of the p-System in the UK.

The UCSD p-System provides a comprehensive environ- ment to the end user, whatever their interest. The choice of three high level languages to write in are UCSD PASCAL, UCSD FORTRAN-77 and business BASIC, all of which compile down to p-code object programs. Hence modules written in different languages can be put together at runtime. This allows an applications developer to choose the best language for a particular type of program.

There is also a complete set of crossassemblers for the following microprocessors, Z80, Z8, 8080, PDP-11/LSI-11, 6502, 6800, 6809, 9900, 8086 and 68000. This lets a pro- grammer to write machine-dependent programs on any host machine and to assemble it into the machine code of the micro upon which the program is to run. In this way assembler code programs for Z80 micros can be written on 68000 micros.

One advantage of p-code is that i t is compact and efficient. Programs written under the p-System are therefore smaller, a particular advantage for microcom- puters. But because it has to be interpreted at run-time, there is the disadvantage that the program sometimes runs slower than an equivalent one written in machine code.

To minimise the problem, native code generators are provided which let the most frequently used portions of code, for example floating point calculations, to be selectively translated into the machine (native) code of the microprocessor. This is done by placing markers in the text in the PASCAL, FORTRAN or BASIC program where the native code generation is required.

The many language options give the UCSD p-System user f lexibil i ty in program writing. Coding can be done in high-level languages for convenience; routines which need the 'hands in the machine' approach can be written in assembler; and the number crunching can be compiled down into native code.

UCSD PASCAL has many extensions not found in standard PASCAL to which users become attached, particularly in the areas of writing large programs, string handling, concurrent programming, memory management and I/O intrinsics.

To help write large applications programs, segmentation and external units may be used. Segmentation provides for portions of code to remain on disc when the main program is loaded, and to be brought into memory only when required. Thus with careful planning very large programs can be run on machines whose memory capacity would not otherwise be adequate. External units are precompiled error-free modules which can be linked into a program at runtime. This allows the user to set up libraries of useful routines, to carry code forward from one development into others, or to store precompiled error-free portions of code while debugging other code. This last option saves compila-

tion time, as the user is not constantly recompiling clean code.

UCSD PASCAL strings can vary in length dynamically up to a length of 255 characters. Predefined routines are pro- vided for the merging and deletion of strings, the inserting of sub-strings, and the matching of patterns.

Random access for disc files is possible, through a UCSD PASCAL command permitting the repositioning of the file pointer. Files can also be created onto or deleted from the disc directory, from within programs, by extended versions of the 'standard' PASCAL I/O intrinsics.

UCSD PASCAL provides low-level I/O intrinsics which give a programmer complete control over all the peripherals, however these facilities should be used with great care.

UCSD PASCAL has many useful compile-time options. Range checking and I/O checking can be switched on or off. The compilation of certain areas of code can be made conditional, a useful feature for debugging and version control. For those users with slow terminals, the normal compiler message output can be suppressed.

Other source files can be included into the program at compile-time, as can modules from user-defined libraries. A number of useful library modules are provided by the p-System for use in user's own programs. One of these provides common screen control operations via menu selection, and contains escape sequences for different types of terminal. This frees a user from having to main- tain different versions of a program. Another module provides for file system directory operations, and an optional turtle graphics module provides basic graphics routines to the applications programmer.

One advantage of running the p-System is USUS, the USCD p-System users society. Membership of this body gives a user access to the USUS software library, about 21 volumes of useful routines. Amongst these modules can be found databases, mailing systems, games, terminal emulators, the list is endless. Any of these modules or programs can be incorporated into a user's own software. Each volume can be bought from the Society at virtually the cost price of having the disc copied. Alternatively these volumes can be copied free at any of the annual meetings onto the user's own discs.

UCSD F O R T R A N - 7 7

To those programmers who know FORTRAN well, it is almost enough to say that UCSD FORTRAN-77 is an ANSI FORTRAN-77 subset with two minor omissions and some extras from the 'full ' FORTRAN-77 set.

There is a p-System restriction that procedure names cannot be passed as parameters; and INTEGER and REAL data elements are not allocated the same amount of storage.

On the plus side, UCSD FORTRAN-77 has four compiler directives allowing the declaration of library files, compiler crossreferencing listings, the capability to call assembler routines, and to copy other source files from within the program being written. PASCAL routines can be used from within the FORTRAN program, which is highly useful for example when dealing with string handling, which PASCAL does well, and FORTRAN is no good at.

UCSD BUSINESS BASIC The BASIC compiler was written by SofTech Microsystems, and has been described as one of the nicest to use of the different BASICs around.

It is for use with the full screen editor, and indentation

vol 7 no 8 oct 1983 395

Page 3: The portable UCSD p-System

FORTRAN / progrom / ~ Screen input / editor

Error option

I--L' I F0~TRAN or BASIC compiler

opplicotions program

Figure 2. Producing programs

with optional line numbers is allowed. Huge virtual arrays can be kept on disc and accessed, as required, in total or elements thereof, from the BASIC program. This is useful for simulation or technical programs which need to keep large amounts of predefined data for tests or comparisons.

Source files can be split up into smaller units, and then compiled back into a larger program. Compiled units can also be called from other FORTRAN or PASCAL programs. There are many other minor useful features, and no serious omissions.

An operating system is not only its languages. The UCSD p-System provides many useful tools for program development. Menus and prompt lines are fundamental in the p-System, and when the user boots the system up, the following 'main command' prompt is offered. E(dit, R(un, F(ile, C(ompile, L(ink, X(ecute, A(ssem, D(ebug, ?

Typing in the appropriate letter brings up the indicated program, whilst typing in '?' brings in a second prompt line

H(alt, I(nitialise, U(ser R(estart, M(onitor.

Programs are produced within the UCSD p-System as in Figure 2.

THE EDITOR The UCSD screen editor is obtained by typing in 'E' to the main command prompt, and is generally acknowledged to be one of the most comprehensive and easily used editors there is. Many of the word processors written for the p-System are, in reality, the UCSD editor with enhancements.

Having called up the editor and specified the name of the file to be worked upon, the programmer gets the follow- ing prompt lines.

A(djust, C(opy, D(elete, F(ind, I(nsert, J (ump, K(column, M(argin, P(age, R(eplace, Q(uit, S(et, V(erify, X(change, Z(ap.

Program, or text files can be worked upon, each file having a header containing information about the editing options set for the file, which can be easily changed by the S(et command.

Good visual layout can be achieved with the Adjust (left, right or centered, or cursor-controlled movement) command. Indent mode within the file environment will reposition the cursor automatically below the first charac- ter of the preceding line.

For text files, Automatic Indent can be turned off and tab stops, paragraph margins, left and right hand margins set. The command M(argin will reformat a whole paragraph between new margins, or old ones in the case where extensive deleting has left gaps at the ends of lines. K(olumn will shift columns left or right.

Movement around the file is carried out with the cursor keys and such commands as J (ump, which can be to the beginning of the file, end of the file or preset markers. P(age moves a screenful backwards or forwards at a time.

C(opy lets the programmer retrieve code or text from the buffer, (as in cases of accidental deletes or escapes from commands); or to copy other designated files, either whole or portions thereof, into the workfile.

The UCSD Editor has one final feature which is of great help to the program developer. The direct link to and from the compilers. Ideally a programmer wants to correct a syntax error as soon as it is detected. The p-System com- piler offers the option to return direct to the editor. If this is taken, the source code is displayed on the screen with the cursor pointing to the error, and the appropriate error message at the top of the screen.

THE COMPILERS

These are available for the PASCAL, FORTRAN and BASIC languages supported by the p-System, and are initiated by typing in 'C' from the main command prompt line. To work on a particular program file, the programmer designates it as the default work file (known as SYSTEM.WK) to the system. This minimises the amount of typing done as the programmer moves between the editor and the compiler.

Whenever a syntax error is encountered by the compiler, the user is offered the options of returning directly to the editor, continuing with the compilation, or exiting altogether to the main command prompt line.

The linker

The linker is used to link assembly code routines into p-code programs. Programs which are written entirely in high level languages do not need linking.

Execution of programs Typing in 'X' to the main command prompt line causes the user to be prompted for the name of the program he/she wishes to execute. There are options available to the user to redirect program input and output.

Running programs

Because the process of compiling and executing programs is so common, an extra command R(un has been provided in the main command prompt line, which applies both commands in sequence to the current workfile. Errors in compilation cause an exit from the R(un command back to the main command prompt line.

The filer The UCSD Filer is a comprehensive collection of utilities which look after the disc systems housekeeping. The filer

396 microprocessors and microsystems

Page 4: The portable UCSD p-System

is.invoked by typing in 'F' to the main command prompt line, and responds with the following prompt lines itself

G(et, S(ave, W(hat, L(dir, R(em, C(hng, T(rans, D(ate ?

Typing in ? again produces

Q(uit, B(ad-blks, E(xt-Dir, K(rnch, M(ake, P(refix, V(ols, ?

Typing in ? yet again produces

X(amine, Z(ero, O(n/Off-line, F(lip-swaplock

The filer will respond to the choice of any one of the above options by requesting more information, often double checking it. In some cases the type-ahead buffer is not allowed so that an inexperienced user is less able to do anything destructive to his/her files (eg inadver- tently deleting files or directories).

Disc handling commands include

• Z(ero to initialize a disc, name it and allocate directory space

• L(dir which lists a directory • E(xt Dir which lists the physical layout of discs and

unused areas on the disc • K(runch which moves files up to concentrate free

space at the end of the disc • B(ad Blks which examines a disc for corrupt data • eX(amine which attempts to recover bad blocks or

labels them as BAD • P(refix which nominates one volume as the default disc

File handling commands include

• G(et a file • S(ave the file, with the option of changing its name • W(hat file is the current workfile? • M(ake a file of a particular size • C(hange the name of a file or directory • R(em to remove the file from the directory • T(rans to transfer a file from one volume to another • N(ew clears the workfile

Volume handling commands include

• V(ols which produces a listing of all the devices recognised by the system

• O(n/offline which enables the user to load or unload subsidiary volumes from a disc; up to 77 files are allowed per subsidiary volume; this enables a user to load all the files for a particular job or application with one command

The remaining commands are

• D(ate which allows the current date to be set; this is stored in the directory every time a file is saved or created

• F(lip-swaplock, which is a facility to load all the filer functions into RAM, thus releasing the systems disc device for backing up discs, and large file transfers

• Q(uit, which returns the user to the main command prompt line

The 'wildcards' option, allows bulk processing of files. For example, a user can R(emove all files beginning with a particular name, T(ransfer all text files from one disc to another etc.

E X T R A U T I L I T Y PROGRAMS

For the systems developer the p-System comes with set programs for fairly advanced programmers.

The 'debugger' provides full debugging at p-code level, displaying memory in different formats, as required.

The 'Compressor' prepares assembler programs for running under other operating systems, producing code with no p-System information in it at all.

'Patch' is a program allowing the user to edit files through the screen at byte level. Files can also be listed in a variety of formats, altered, or dumped.

The 'decoder' displays system information such as segment, unit and linker information. It will also dis- assemble p-code, that is produce an assembler listing from the original p-code files.

Finally 'X-ref' produces structural information about a program. It takes a code-file and produces logical maps for the program, and a warnings file containing potential problems.

E X T R A F E A T U R E S OF THE P-SYSTEM

The UCSD p-system is constantly being changed to make it more user-friendly and versatile. Among the latest developments is the extended memory feature which permits a user to access up to 128k bytes of RAM, thus allowing larger programs to be run faster and more effi- ciently. This is enabled at set-up time, but otherwise is user-transparent.

Print spooler is a user-executable program which sends one or more files to a printer, while the user continues normal programming, such as editing text or data entry. Print spooler will allow the user to queue up to 21 files for the printer, delete these files from the queue, display their names, halt printing of the current file, continue with the current file after a halt or skip onto the next one if so desired.

Add-on programs There are various programs which it is possible to add onto the UCSD operating system.

Xenofile lets the user to access CP/M generated files and discs from UCSD p-System programs. CP/M files can also be translated to UCSD p-System files and CP/M program output can be input to p-System programs. The reverse is also true.

D O C U M E N T A T I O N

A complete set of documentation is an integral part of the UCSD p-System software package. The manuals that come with .the system consist of

• user's manual (including the PASCAL language guide) • installation guide for adaptable systems, (Some micros

have their own user's guides such as the Sirius/Victor) • internal architecture guide • UCSD BASIC • UCSD FORTRAN • user manual supplement

USUS, the UCSD p-System Users Society, mentioned above, publishes a quarterly newsletter, and runs an electronic mail system. The newsletter contains technical material about p-System applications, benchmarks, discussions of new software products and standards. The electronic mail system is international or within the UK only. Both provide a general mail and bulletin board service, and in the UK the bulletin board is used for gossip, bug reports and their solutions, user group news, and details of new routines for the USUS Software library. Conferences are also organised by USUS, and special

vol 7 no 8 oct 1983 397

Page 5: The portable UCSD p-System

interest groups set up by users which function during the year as well as at conferences.

CONCLUSIONS The UCSD p-System has emerged from its university birthplace to compete in the harsh realities of commercial life. Its virtues of portability and user-friendliness, while making it the first choice of many, have also turned it into perhaps the most liked second-choice operating system.

Developments promised by Sof-l-ech for 1983 include a portable local area network called 'p-Net', and an advanced file system.

The success of the p-System in attracting such major manufacturers as IBM, Sage Technology, DEC, Hewlett Packard and Texas Instruments, the UCSD p-System is well set to increase its popularity and establish itself as one of the major microcomputer operating systems of the eighties and nineties.

398 microprocessors and microsystems