Minix 1.5 Reference ManualMissing only the standard man pages and source code chapters (both found on the disks).
MINIX 1.5 REFERENCE MANUAL ANDREW S. T ANENBAUM FRANS MEULENBROEKS RA YMOND MICHIELS JOST MULER JOSEPH PICKERT STEVEN REIZ JOHAN W. STEVENSON PRENTICE HALL, ENGLEWOOD CLIFFS, NEW JERSEY 07632 1991 by PRENTICE-HALL, INC A Division of Simon & Schuster Engle\\ood Cliffs, N.J. 07632 All rights reserved. 10 9 8 7 6 5 4 3 2 I Printed in the United States of America CONTENTS 1 INTRODUCTION 1.1 HISTORY OF UNIX I 1.2 HISTORY OF MI NI X 3 1.3 STRUCTURE OF THIS MANUAL 5 iii 1 2 INSTALLING MINIX ON THE IBM PC, XT. AT, 36, AND PS/2 6 2.1 MINIX HARDWARE REQUIREMENTS 6 2.2 HOW TO START MINIX 7 2.3 HOW TO INSTALL MI NI X ON A HARD DISK 10 2.4 TESTING MINIX 20 2.5 TROUBLESHOOTING 22 3 INSTALLING MINI X ON THE ATARI ST 3.1 THE MINIX-ST DISTRIJUTION 25 3.2 NATIONAL KEYBOARDS 26 3.3 BOOTING MINIX-ST 27 3.4 INCREASING THE SIZE OF YOUR RAM DISK 30 3.5 ADAPING PROGRAMS TO USE EXTRA RAM 31 3.6 USING SINGLE-SIDED DlSKEIES 32 3.7 USING A HARD DISK 33 24 iv CONTENTS 3.8 USING A MEGA ST 40 3.9 USING A DISK CONTROLLER BASED CLOCK 40 3.10 BOOT PROEDURE OPTIONS 41 3.11 UNPACKING THE SOURCES 42 3.12 THE TOS TOOLS 43 3.13 TROUBLESHOOTING 45 4 INSTALLING MINIX ON THE COMMODORE AMIGA 4.1 MI NI X HARDWARE REQUIREMENTS 51 4.2 HOW TO START MINI X 52 4.3 A MORE DETAILED LOOK 54 4.4 TROUBLESHOOTING 58 5 INSTALLING MINIX ON THE APPLE MACINTOSH 5.1 MACMINIX HARDWARE REQUIREMENTS 59 5.2 THE MACMINIX DISTRIBUTION 59 5.3 NATIONAL KEYBOARDS 60 5.4 BOOTING MACMINIX 60 5.5 INCREASING THE SIZE OF YOUR RAM DISK 63 5.6 ADAPING PROGRAMS TO USE EXTRA RAM 6 5.7 USING A HARD DISK 65 5.8 UNPACKING TH SOURCES 69 5.9 THE MENUS 70 5.10 SETTING CONFIGURATION OPTIONS 71 5.11 MACINTOSH SYSTEM CALLS 72 5.12 RUNNING MACMI NI X WITH MULTIFINDER 72 5.13 TROUBLESHOOTING 73 51 59 CONTENTS 6 USING MINIX 6.1 MAJOR COMPONENTS OF MI NI X 74 6.2 PROCESSES AND FILES IN MI NI X 79 6.3 A TOUR THROUGH THE MI NI X FILE SYSTEM 84 6.4 HELPFUL HINTS 88 6.5 SYSTEM ADMINISTRATION 93 7 RECOMPILING MINIX 7.1 REBUILDING MINIX ON AN IBM PC 97 7.2 REBUILDING MINIX ON AN ATARI ST 103 7.3 REBUILDING MI NI X ON A COMMODORE AMIGA 109 7.4 REBUILDING MI NI X ON AN APPLE MACINTOSH 109 8 MANUAL PAGES 9 EXTENDED MANUAL PAGES 9.1 ASLD-ASSEMBLER-LOADER [IBM] 189 9.2 BAWK-BASIC AWK 198 9.3 DE-DISK EDITOR 202 9.4 DIS88-DISASSEMBLER FOR THE 8088 [IBM] 207 9.5 ELLE-FULL-SCREEN EDITOR 208 9.6 ELVIS-A CLONE OF THE BERKELEY VI EDITOR 216 9.7 IC-INTEGER CALCULATOR 236 9.8 INDENT-INDENT AND FORMAT C PROGRAMS 239 9.9 KERMIT-A FILE TRANSFER PROGRAM 243 9.10 M4-MACRO PROCESSOR 246 9.11 MDB-MI NI X DEBUGGER  249 9.12 MINED-A SI MPLE SCREEN EDITOR 253 9.13 NROFF-A TEXT PROCESSOR 257 v 74 97 1 15 189 vi CONTENTS 9.14 PATCH-A PROGRAM FOR APPLYING DlFF LISTINGS TO UPDATE FILE '66 9.15 ZMODEM-FILE TRANSFER PROGRAM 269 10 SYSTEM CALLS 10.1 I NTRODUCTION TO SYSTEM CALLS 274 10.2 LIST OF MI NI X SYSTEM CALLS 275 11 NETWORKING I J.J INTRODUCTION 277 11.2 OBJECTS 279 1 1 .3 OVERVIEW OF TRANSACTIONS 281 11.4 SYNTAX AND SEMANTICS OF TRANSACTION PRIMITIVES 282 11.5 SERVER STRUCTURE 286 11.6 CLIENT STRUCTURE 287 11.7 SIGNAL HANDLING 287 11.8 I MPLEMENTATION OF TRANSACTIONS I N MI NI X 288 11.9 COMPILING THE SYSTEM 289 11.10 HOW TO INSTALL AMOEBA 289 11.1 I NETWORKING UTILITIES 290 11.12 REMOTE SHELL 290 I J.J 3 SHERVERS 292 I J.J 4 MASTERS 292 I J.J 5 FILE TRANSFER 293 I J.J 6 REMOTE PIPES 293 11.17 THE ETHER NET INTERFACE 293 A MINI X SOURCE CODE LISTING B CROSS REFERENCE MAP 274 277 296 637 COI,DITS vii NOTE The only pieces of MINI X software not included in this package are the C compiler sources. These were made using the Amsterdam Compiler Kit (see Communications of the ACM, Sepl. 1 983, pp. 654-660), which has also been used to make compilers for many other languages and machines. The compiler sOl/rees can b ordered from the following companies: In North and South America: UniPress Software 2025 Lincoln Highway Edison, NJ 0881 7 U. S. A. Telephone: (20 I ) 985-8000 FAX: (201 ) 287-4929 In Europe and elsewhere Transmediair Utrecht BY Melkweg 3 3721 RG Bilthoven Holland Telephone: +3 1 30 28 1 820 FAX: +31 30292294 In addition, these companies also have a Pascal compiler for MINIX 1INTRODUCTION Every computer needs an operating system to manage its memory, control its I/O devices, implement its fle system and provide an interface to its users. Many operating systems exist, such as MS-DOS, OS/, and UNIX. This manual describs yet another operating system called MINIX. Although MINIX is entirely new, it was inspired by UNIX, and has many features in common with UNIX. For this reason it is fning that we begin this introduction with a brief history of UNIX, and its ancestors. This will be followed by an equally brief history of MINIX. Finally, the chapter concludes with a summary of the rest of the manual. LL HISTORY OF UNIX Prior to 1 950, all computers were personal computers. At least in the sense that only one person could use a computer at a time. Only research laboratories owned computers in those days. The usual method of operation was for the programmer to sign up for an hour of machine time on a sign-up sheet posted on the bulletin board. When his time came, the programmer chased everybody else out of the machine room and went to work. During the 1 950s, batch systems were invented. With a batch system, the programmers punched their programs onto 80-column cards, and deposited them in a tray in the computer room. Every half hour or so, the computer oprator would go I 2 INTRODUCTION CHAP. I to the tray, pick up a batch of jobs, and read them in. The printed output was brought back later for the programmers 10 collect at their leisure. While the batch system made more efficient use of the computer, it was not wildly popular with programmers, who often lost hOllrs due 10 a single typing error that caused their compilations 10 fail. In the early 1960s, researchers at Dartmouth College and M. I.T. devised timesharing systems, in which many users could log into the same computer at once from remote terminals. The Danmouth project led to the development of BASIC; the M.LT. project was the great grandfather of MINIX. The M.LT. system, called CTSS (Compatible Time Sharing System) because it was more-or-Iess compatible with the batch system then in use at M.I.T., was a success beyond the wildest expctations of its designers. They quickly decided to build a new and much more powerful timesharing system on what was then one of the largest computers in the world, the GE 645, a machine about as fast as a modem PC/AT. This project, called MULTICS (MUL Tiplexed Information and Computing Service) was a joint effon of M.LT., General Electric (then a computer vendor), and AT &T Bell Labs. To make a long story short, the project was so ambitious that the system was diffcult to program. Bell Labs eventually pulled out and GE sold its computer business to Honeywell. M.LT. and Honeywell went on to complete MULTICS, and it ran al many installations for 25 years. In a way, it continues to live, since OS/ has many ideas and features taken straight from MULTICS Meanwhile, one of the Bell Labs researchers who had worked on MULTICS, Ken Thompson, was hunting around for something interesting to do next. He spied an old PDP-7 minicomputer at Bell Labs that nobody was using, and decided to implement a stripped down version MULTICS on his own on this tiny minicomputer. The system he produced, while clearly not full MULTICS, did work and supported one user (Thompson). One of the other people at the Labs, Brian Kernighan, somewhat jokingly called it UNICS (UNiplexed Information and Computing Service). Bell Labs management was so impressed that they bought Thompson a more modem minicomputer, a PDP-I I , to continue his work. The initial implementation was in PDP-7 assembly code. When this had to be completely rewrinen for the PDP- I I , it bcame clear that it would b much bener to write the system in a high level language to make it portable. At this point, another Bell Labs Researcher, Dennis Ritchie, designed and implemented a new language called C in which the two of them rewrote the system, whose splling had now changed to UNIX. In 1974, Ritchie and Thompson wrote a now-classic paper about UNIX that attracted a great deal of attention. Many universities asked them if they could have a copy of the system, including all the source code. AT &T agreed. Within a few years, UNIX had become established as the de facto standard in hundreds of university departments around the world. The source code was widely available, and often studied in university courses. International meetings were organized, in SEC. 1. 1 HISTORY OF UNIX 3 which speakers would get up and describe how they had modifed some system routine to be a bit fancier. UNIX had by now bcome something of a cult item, with numerous fanatically devoted followers. As UNIX kept spreading, AT &T began to see how valuable it was and began restricting access to the source code of new versions, starting with th