B·Y·T·E U.K.

• • • • • • • • • • • • • • • • •• • •• • ••• • • . •• . . : .. . ..\ . .. • ••••• • ••••• • •• • • • • • • • • • •• • • • • • • • • • • • •• • • • • • • • • • • • • • • Tripos�Tfze Roots of AmigaDOS

Meta com co question that must be puzzling write one. Subsequently, Tripos was born. many people in U.S. computer The Tripos operating system was based is the British circles is, "What is Metacomco?" on a multitasking kernel developed as a When Commodore announced its spec­ doctoral thesis project at Cambridge in company tacularA Am iga computer. much of the U.S. 197 6. ("Tripos" was the name given to the press failed to point out (and possibly did three-legged stools that students sat on in behind not know) that the advanced operating the old days when taking their examinations system AmigaDOS was in fact written by a and has since become the colloquial name AmigaDOS small British software house called for the Cambridge final examinations.) King. Metacomco. (For more information on the then working at Bath University, took the . see "The Amiga Personal Com­ kernel written for a DEC PDP-II and made DICK POUNTAIN puter" by Gregg Williams. Jon Edwards. and it into a full 32-bit multitasking operating BY Phillip Robinson, August 1985 BYTE. page system for the Sage microcomputer (which 83.) was new at that time). Triposis BCPlrbased Metacomco is based in Bristol. England. in the same way that is tag">C-based. and a city that is beginning to rivai Cambridge it has many innovative features that I will as our potential computing capital (it also discuss. houses TDI-Pinnacle. INMOS. and others). Metacomco had also purchased the rights Metacomco was founded in 1981 by Derek to Cambridge LISP. a powerful LISP inter­ Budge and Bill Meakin and now employs preter/compiler originally developed for the · about 2 5 people. mainly programmers and IBM. 3 70 and then ported to the 68000 at other technical staff. Cambridge. Metacomco produced versions The company's first product was a por­ for the ill-fated CP/M 68K and then for table BASIC interpreter written in BCPL. the Tripos. Reduce 3. a symbolic math system forerunner of C. which is taught and used written in LISP. was added to produce a extensively at Cambridge University. This in­ Sage-based workstation. that was sold to terpreter was ported to the 8086 processor research institutions in various countries. and shortly afterward was sold to Digital Customers included SORD in Japan and Research Inc.. which still markets its descen­ Bristol neighbor JNMOS. who used BCPL1 dant as Personal BASIC. This U.S. link for the first stage of bootstrapping its became very important to Metacomco, for Occam compiler onto the 68000, using the royalties provided a steady source of Sage computers running Tripos. income during the crucial early years and In 19'84. Tim King joined Metacomco full­ helped the company establish an office in time as Research Director. and Sinclair California. which kept Metacomco in touch Research launched the OL. Initially. the OL with the U.S. computer scene. lacked a serious software-development en­ In 198 3 Dr. Tim King, a Cambridge com­ vironment and Metacomco was able to puter scientist was engaged by the com­ quickly port its development tools. in­ pany as a consultant and Metacomco's em­ cluding the BCPL compiler, to it. The com­ phasis switched to the 68000 processor, pany has since extended the range to in­ with which King had been working since the clude an ISO (International Organization for first samples came out in 1981. The com­ Standardization)-validated Pascal computer. pany produced a series of development · and it markets these products directly, tools, also written in BCPL. including a full­ rather than via the manufacturer. largely by Dick Pountain is a technical author screen editor. a macro assembler. and a mail order. and software consultant living in l.Dndon. England. He can be linking loader. At that time there was no November 1984 is the crucial date in the contacted c/o BYTE. POB 372. clearly established standard operating sys­ AmigaDOS story. Metacomco visited Amiga Hancock, NH 03449. tem for the 68000, so the next step was to (continued)

FEBRUARY 1986 BYTE 321 • An RS-232 Break-Out-Box at a Fraction of the Cost. BYTE U.K.

Corporation (which was still in the from scratch, given that these were midst of finalizing its purchase by new and unknown custom parts and Commodore) to discuss the sale of were probably only partly debugged RS-232 MuHi-Adapter Board: 9 LED's for signal Metacomco·s 68000 Pascal compiler at the time. The people at Metacom­ monitoring. 24 switches to open any line (except line for Amiga's new Lorraine machine. as co integrated these parts with the 1 ). 20 jumper wires allow re-wiring to any con­ figuration. 1 male and 1 female connector. Order it was then called. During these dis­ disk-file I/0 system, console-text I/0. direct! Only $59.95. All cash orders postpaid. (IL cussions it was revealed that the printer I/0. and command-line pro­ res. add 6% sales tax).We Accept MC. Visa. Free illustrated catalog of RS-232 interface and testing Amiga operating system (OS) was way cessor from Tripos to make Amiga­ equipment. Phone: 81 5-434-0846. Make checks behind schedule and causing some payable to: DOS. concern. Amiga·s stipulations for the The Amiga staff produced the icons/ Lorraine OS were that it should be windows front end called p_Q_ Box 10088, OTTAWA, IL 61350 multitasking. should support both that sits on top of AmigaDOS; we 8&8 !!!�!!:!!!!!�� synchronous and asynchronous I/0. have Metacomco to thank. though. for Inquiry 32 and that the I/0 should be stream­ insisting that an underlying CL\ based and hardware-independent. (command-line interface) be always Metacomco was already marketing available as a programmers' interface just such an operating system. Tripos. and for more experienced users. running on the 68000. Amiga agreed The relationship between Commo­ to consider Tripos as insurance, in dore-Amiga and Metacomco has now case its already-commissioned system become quite close. Metacomco's didn't work out. · Pascal. LISP. and a much-modified In February 1985 Metacomco was BASIC are all running on the Amiga. given the go-ahead. and Tripos was The BASIC story is rather complicated ported to the Lorraine in three weeks in itself. Amiga had already commis­ flat. thanks to its BCPL portability (al­ sioned Microsoft for a version of its though the kernel is written in 68000 much-delayed Macintosh BASIC to be code for efficiency). King recalls that put onto the machine. At the launch KEYBOARD PROTECTOR Remains place during keyboard use. Prevents when he demonstrated it at the end in july, however. it was Metacomco's damage fromin liquid spills, dust, ashes, etc. Fits of February. he turned from the ABASIC that was seen by the press. like a second skin, excellent feel . Available lor: IBM-PC, AT, Apple (all), Compaq, Model 100, screen to find the whole Amiga staff though certain "ambiguities" may NEC 8201, C64, Zenith 150, DEC, Kaypro and gathered around applauding; the have led people to think it was Micro­ many others, Send 529.95, check, M.O., Visa MC include exp. date. Specify computer . hardware had suddenly become a soft's. At the time of this writing, the &Dealer inquiries invited. Free brochure avail. real computer. The existing OS was language that finally got shipped with Merritt Computer Products, Inc. 2925 LBJ Fwy. #180 I Dallas, Texas 75234 dumped, and the job of turning Tripos the machine still appeared rather (214) 942-1142 into AmigaDOS began. vague. !Editor's note: We have since learned Inquiry 217 Fortunately for Metacomco. there that ABASIC. which started out as Meta­ was a remarkably close fit between cameo's, will become Microsoft's.! Meta­ Tripos's internal structure and Amiga's cameo is currently working on en­ planned software architecture. Tripos hancing ABASIC to permit procedures is conceptually organized on classic with parameters. optional line num­ 6800 Family OS lines. with a scheduler. a message­ bers. and full compilation; the present passing system. and a set of device version is structurally still at the ' drivers. Amiga's programmers already Microsoft version 5.2 level. It does. had ROM (read-only memory) rou­ however. have some astonishingly tines to do the jobs of scheduling and powerful Amiga hardware support message passing and the crucial commands. such as TRANSLAT E and device drivers for the very special NARRATE. which respectively convert custom chips, the Copper and the Slit­ an ASCII string into a phoneme string ter. which handle the graphics. anima­ and then speak it. All the power of the tion, and sound. (For more informa­ custom chips is accessible through tion on the custom chips, see the in­ high-level BASIC statements rather terview with jay Miner entitled "The than through PEEKs and POKEs. Amiga's Custom Graphics Chips" con­ ducted by Phillip Robinson. Novem­ TRIPOS/AMIGADOS ber 1985 BYTE. page 169.) The story The Triposoperating system has some might have ended right there had features that are not usually found in these drivers needed to be written (continued)

inquiry 359 BYTE U.K.

microcomputer operating systems. a demand for service from another in turn communicating with the disk particularly in the area of disk-file task. A debugger task also runs con­ device. which has its own track buf­ organization. and these have been in­ tinuously in the kernel. which is a fer so that whole tracks are read in at herited by AmigaDOS. Many of these great boon to the programmer. An one time. When the file task has the advanced ideas stem from TI'ipos's application's environment. greatly block. it sends a message to the ap­ origins in a computer science re­ simplifed. might look like figure I. plication that the store is now avail­ search project; there is much em­ Every peripheral device is served by able. phasis on doing things the way they its own task. All tasks run concurrently One consequence of this structure should be done. rather than kludging or. strictly speaking, pseudocurrently, is that. unlike simpler systems such as around the way the last guy did it. since there is only one central pro­ CP/M and PC-DOS. it's possible for TI'ipos is based on the concepts of cessing unit. and the application gets disk activity to occur at seemingly ran­ multiple tasks and message passing. the resources it needs by sending and dom times. without the user doing When an application task is started. receiving messages. If a program anything to provide it; this is quite it finds a number of other tasks al­ needs 200 bytes of disk storage, it spooky until you get used to it. ready running. In particular. there will might send a message to file task I The only limit on the number of _ be one for each peripheral device that requesting this. The file task has its tasks that can run is the memory avail­ it needs to talk to. though some of own cache buffer. and it will proceed able; it is not a virtual-memory sys­ these tasks sleep until awakened by to get a new block into the cache by tem. but code sharing is used to minimize the memory requirement during multiple invocations of similar tasks. Tasks can be given priorities.

FLOPPY DISKl and any task can be executed in the o background from the command line APPLICATION by typing RUN . The I I· CLI is itself a task. and multiple CL!s FLOPPY DISK2 • can be spawned if desired. FILE TASKS The message-passing interface is I I· quite similar to that in UNIX and is identical for all devices and applica­ 1 1 CONSOLE TASKS tions; it includes messages like Open. I I Close. Read. Write. and Seek.

WI NDOW WI NDOW2 FILE STRUCTURE ! ' I ! It's in the area of disk-file structure that TI'iposis truly radical. For starters. Figure I: An example of a simplified application's environment. there is no directory track on a TI'ipos disk. and indeed no directory in the usual sense of a table of filenames. In­ stead. TI'ipos uses a root block. which is placed in the center of the disk sur­ ROOT BLOCK face rather than on track 0 as is usual. The root block contains the volume name of the disk and the date of crea­ tion and last modification. Following this is a hash table. via which file or sub­ directory names get turned into block numbers. Each block so pointed to can be a directory or a file. leading to a hierarchical directory structure like that in UNIX or PC-DOS 2. In the case of hash collision (perhaps "Fred" and "Bill" both hash to the same block number). extension blocks are chained onto the pointed-to block. Figure 2: An example of hash collision. Extension blocks are chained onto the pointed­ and the collision is resolved by string to block. and the collision is resolved bid string matching. matching (see figure 2). (continued)

324 BYTE FEBRUARY 1986 • BYTE U.K.

Subdirectories have the same struc­ means that even if a file header gets gracefully. Accordingly. Tripos keeps ture as the root block. while file completely mangled. it can be recon­ a bit map of the disk usage in mem­ headers have a filename. date. and a structed by the reading pointers in the ory-the same idea as a PC-DOS FAT table of the data-block numbers that data blocks: the individual data know (file-allocation table)-which has a bit constitute the file. The size of the their own identity (see figure 4). set for every block in use. As men­ block is fixed (512K bytes in Amiga­ Metacomco also has a "disk doctor" tioned before. each file task keeps its DOS. 1024K in Sage TI"ipos). and when program that can reconstruct a disk. own block buffer in memory. After a file header runs out of space for its both files and directories. from almost disk activity (signaled by the usual red block table. it merely chains on an ex­ any state of damage short of total light) there is a three-second time-out tension block. data loss. and it can do it automati­ period. after which the task automat­ 1b optimize speed of data access. cally. This is a very significant step ically flushes its buffers and the up­ file headers and subdirectories are forward in mass-storage security com­ dated bit map to disk. If a disk is allocated inward from the root block. pared to PC-DOS. where the corrup­ removed during the time-out period. while data blocks are allocated out­ tion of a directory track can lead to the bit map on disk will be marked as ward. so that consecutive blocks can leaps from high buildings. invalid. and when that disk is re­ be kept close together (see figure 3). The only penalties paid. as trade­ inserted. a validation task in the kernel This whole scheme has several offs for all the advantages. are that will automatically be invoked to re­ beneficial consequences. compared directory listing and file renaming are build the bit map. Only if the disk is to more conventional operating sys­ slower than in conventional systems. removed when the red light is actual­ ' tems. There are no arbitrary limits on because there is no single place to go ly on is there any chance of losing anything; files are governed only by to look for filenames; the whole tree data; Amiga and Metacomco debated the physical storage capacity of the structure needs to be traversed to find long and hard about a mechanical medium. All files are automatically the names. Metacomco is currently locking scheme similar to that on the random-access. Moreover. there is no considering caching the directory Macintosh but decided against it after distinction between binary and ASCII structure to alleviate this problem. but observing the unpopularity of the lat­ files. as files do not need to contain from my limited experience of the ter scheme (with everyone except the any special, control characters like � Z Amiga. it doesn't seem too bad any­ paper-clip industry. that is). for end-of-file. All files are the same. way; it's not much slower than an IBM TI"iposknows all about disk volumes just blocks of "stuff:' PC by the time the latter's disk-access and can find a volume in any drive or There is more. however. All the and screen-updating speeds have prompt for it to be inserted as re­ blocks that make up a file contain taken their toll. quired: no messing about with default pointers to the next block in line Given the multitasking nature of drives or logging on. It is. in fact. (enabling efficient sequential access) TI"ipos. and hence the unpredictable possible to remove a disk with a file and also a back pointer to their header times of disk accesses. measures were still open. use a new disk. then be block. The inclusion of these features necessary to manage disk changing prompted by the system to replace the first disk and continue. As in UNIX. all devices are ad­ DATA - -HEADERS , SUBDIRS dressed as files. with a device name R ooT DISK CENTER replacing the volume name that ______.....______would be used in a full-file spec. The .__ _._I _._I I __,I device CON: may have window-size Figure .3: File headers and subdirectories are allocated inward and data blocks allocated parameters attached to it. as in outward to optimize speed of data access. CON:20/20/1 00/100/Fred. which ad­ dresses an 80- by 80-character win­ dow called Fred. The serial port and printer can be addressed in a similar way.

CONCWSION The relationship between Metacomco and Commodore-Amiga seems to have been mutually beneficial. The

DATA BLOCKS Amiga got itself a mature and capable operating system that was designed · on sound. though not conservative. Figure A file header can be reconstructed by reading pointers in the data blocks. principles. Metacomco. on the other 4: (continued)

326 BYTE FEBRUARY 1986 • BYTE U.K.

Metacomco maintains I've felt for some time that there is tention. and its staff has already put insufficient user awareness of just how the assembler/editor combination complex the new-generation. post­ onto it. soon to be followed by PascC)l its strong links with Macintosh. operating systems are. The and Lattice C. An IBM PC-based de­ days of "patch it and hope" are gone velopment system. complete with both Cambridge and forever. and we are now deep into the cross-assembler. has just been an­ territory of heavyweight software nounced also. The relationship with engineering: debugging must now be Lattice arose when it was commis­ Bath universitities. considered a continuing process. and sioned to put the compiler onto the the chances of a bug-free OS at . Sinclair OL: Metacomco ended up hand. gained a stronger foothold in launch (or even a year later) are pretty marketing it. the U.S., along with the respect of remote. Commodore-Amiga is still Metacomco still maintains its -strong those in the- U.S. computer industry debating whether or not to commit links with both Cambridge and Bath who were already aware of its ex­ AmigaDOS to ROM in Macintosh style universities (King still teaches a com­ istence. (first machines are being shipped with puter science course at Bath) and Whether or not the Amiga will be a disk-based DOS) .. Tim King is solid­ pays them royalties for work such as the world-shaker that I think it ly in favor of keeping a disk-based the original TI'ipos kernel. It ex­ deserves to be must remain the great DOS for precisely these reasons. emplifies the slow but welcome trend "wait and see" question of the year. As for Metacomco's future plans. it toward fruitful collaboration between Although some teething problems are is content for the moment to remain academia and commerce that is new emerging. it's likely that they'll be less with the 68000. a processor in which to the U.K .. although it has been stan­ serious than they might have been the company's accumulated expertise dard practice on U.S. campuses since had a totally untried OS been is now paying dividends. The Atari the beginning of the microelectronics adopted. 520ST has attracted Metacomco's at- revolution. •

HARMCONEYONY ISLAND VIDEO AVE.. BROOKLYN.& COMP NYUTERS 11223 HARDISK CARDS 10M IN STOCK 699.00 2357800·VIDE084 OR 800·441 ·1 144 OR 718·627·1000 20M IN STOCK 849.00 Commodore 128 PANASONIC 1091 $249.00 $221.95 7 STAR SG10 IBM P.C. NO DRIVES 256K-1FLOPPYEPSON EQUITV PC COMPRTRBLE COMP795.00UTER . $197.95 $1259.95 256K-2FLOPPY 949.00 "PRINTER SPECIALS" 256K-20M HARDDISK-lFLOPPY 1595.00

312 Brother . NEC 2050 593 Powertype 275 535 1 Brother HR15XL NEC 3550 915 StarSG10 198 234 EPSON PRINTERS RETRIL OUR PRICE Clllzen MSPHR35 10 NEC8850 1290 StarSG 15 . 331 l.X-80 299.00 209.00 Epaon 208 Okldata192 323 Star SO 10 299 Epaon 1 500 837 l.XBO Okldat 193 463 Star S0 15 390 l.X-90(W/PIC) 379.00 219.00 223 LO Okldata 182 208 Star SR 10 425 319 DX10 . Oklmate 10 115 Star SA15 510 FX-85 499.00 329.00 DX20 819 ro 250 ar 58 10 479 185 •58 OX35 OlympalPanasonlc KXP 1091 222 StSliver Reed Exp 550 349 FX-286(200 CPS) 749.00 499.00 FX85 2239 FX Panasonlc KXP 1002 292 Silver Reed Exp 229 HP UaerJet 2652 LQ-800(PAR/SER) 795.00 569.00 Panasonlc KXP 1093 390 Sliver Reed Exp 500770 850 280 IBM Proprlnter Panasonlc KXP 3151 382 Sliver Reed Exp 400 189 335 LQ-1 500 1295.00 829.00 Jukl8100 Toshiba 1340 385 Toshiba341 739 JX-80(COLOR) 399.00 299.00 os ba351 984 T hi DX-20(DAISY WHEEL) 459.00 329.00

DSDDBOXED BRSF DISKS: 10 BX 12.95 (M IN.100ID BOBX 10.95XES)

IBM IBM MONITORS BOXED BRSF QTV PRICE ER. QT'I PRICE ER. AT Enhanced 3796 Meg Drive w/cont. 478 SSDD 500 .79 1000 .75 Amdek Green 104 ATUnenhanced 2912 208087 Chip 99 Amdek300300Amber 109 500 IBM Monitor 218 ... D5DD .85 1000 .79 80287 Chip 310 Amber 129 IBM PC No drives 1280 AST Advantages 383 Color300 152 PCXT 1629 Everex Edge 254 Color 222 XTCione 1049 Everex Magic 164 Color500600 3� BOXED MRXELL DISKS: (MIN. ID BOXES) PCIBM Drive ... DSDD 10 BX 19.95 100 BX 18.95 Color 710 390 IBM Pro Printer 380 Color 722 458 AST Six Pack 193 ATARI QUAD(AT) 10 BX 41.00 100 BX 39.00 Prlncton HX12 390 Tail Grass 25 Meg 2392 130XE 127 Prlnc on Max 12 142 Quad Board 172 XL 75 SA 12i 533 Keytronics 115 BOO1027 Printer 109 Taxan 420 359 Hercules Color 136 1050 Drive 129 10INTERNR MB W/CONTAOLERL HRRD DISKS (LOW POWER)439.00 Hercules Monochrome 277 Indus. Drive 20. APPLE 248 520 STBW 709 Parad ise Graphics 2E w/Oisk Drive 790 20 MB SEGATE W/CONTROLEA 499.00 Paradise 5 Pack 129 MODEMS Addl. Drives from 104 STB Graphics + 2 202 135 WATT POWER SUPPLY 99.00 Hayes 1200· 349 STB R10+2 172 Hayes 12008 w/Smartcom 323 STB Mono Board ... COMMODORE Hayes300 120 Tecmar Graphics Commodore64 144 THIRD PLANET WHOLESALERS 612-432-5864 Hayes 2400 562 Tecmar Captlan .,148 1541 Disk Drive 172 Micromodem 2E 123 Perayat Monocard 137 MPS 803 104 A NEW WORLD FOR YOU AND YOUR COMPUTER "Novation J-cat � Bernoull Box 1622 Monitor 169 Prometheus 1200 28-468 Taltgrass 35 Meg 3120 Indus. Drive 195 8053 BLOOMINGTON FRWY SUITE 121 � KeyTronics Keyboard 109 128 249 10 Meg Drive w/cont. 800-441-1144 Commodore1571 Drive 219 BLOOMINGTON, MN. 55420 -- 384 -- Items reflect 4% cas or check discount. Foryour protection we check lor stolen credit cards. m.ch. visa welcome. Personal checks cause 4 week delay. 328 BYTE FEBRUARY 1986 Inquiry 151 Inquiry 378 •