Home page of Holt Software Associates  | Home page of the Turing Programming Language, the fastest way to teach programming concepts  | Home page of Holt Software's Java products  | Home page of Ready to Program with Java(tm) Technology, a Java development environment designed for education  | Information about Holt Software's courses for teachers  | Information about how to contact Holt Software  | Information about how students can purchase Holt Software's books and software  | Information about how schools and bookstores can purchase Holt Software's books and software

Holt Software Books    [Graphical Version]  |  [Printer Friendly Version]

[Cover of Book]

Mini Tunis Book


Book Information

Title: Mini Tunis Book
Authors: R.C. Holt and D.A. Penny
ISBN: 0-921598-23-8
Publisher: Holt Software Associates Inc.
Binding: 8.5"x11" cerlox bound
Pages: 388 pgs
Price: Contact Holt Software 1-800-361-8324
Ordering Information: Contact Holt Software 1-800-361-8324
Program Examples: Contact Holt Software for obtaining example programs from this book.
Solutions Manual: Not Available

Book Description

This is a set of notes been used to accompany a standard text on operating systems (Peterson and Silberschatz is used at Toronto). These notes include a complete but simplified operating system called MiniTunis written in Object Oriented Turing in a highly structured fashion. This operating system, which runs as a program under OOT, runs concurrent shells and user programs, and is the basis for student projects.

Preface to the Mini Tunis Book

The purpose of this book is to provide a clear understanding of the structure of operating systems. It is commonly-used along with a text on operating system principles, such as the Silberschatz/Peterson text [Addison-Wesley].

This book presents the structure of a model Unix-like operating system called Mini Tunis. Students experiment with this system, for example, by replacing its memory manager with one that does paging. This hands-on experimentation, in the form of student projects, provides a deeper understanding of the function of operating systems than is possible with only readings and written assignments.

With Mini Tunis' clear structure, students immediately learn the essential organization of an operating system. Mini Tunis is written in a language, Object Oriented Turing (OOT), that supports information hiding, so the modular structure is obvious and is mechanically enforced.

Although it is not strictly necessary, it is recommended that Mini Tunis be studied by actually running and modifying it using the OOT system. Within the OOT system, Mini Tunis is run "on top of" Unix, as a regular Unix job. To support this, OOT provides a "turbo" programming environment in which a program such as Mini Tunis can be "bread boarded". Student experiments in changing the operating system require only a few seconds of compilation with OOT's high speed compiler and integrated linker. The OOT environment supports a CASE tool that presents the structure of the system diagrammatically, further enhancing the learning experience.

In a one semester course on operating systems, Mini Tunis can be used as follows. In the first part of the course, concurrent programming is introduced. A good way to do this is through short programming assignments that use OOT's concurrency features (fork, monitors, wait and signal). The next assignment could be to modify Mini Tunis' shell to implement pipes using temporary files. At this point, the student should have a good understanding of the basic system calls of Unix-like systems and their role in supporting systems programs such as the shell. The next assignment can be to make a simple modification to the actual Mini Tunis operating system, such as adding a new system call, for example, the SetUID system call. Depending on the nature of the course, one or two more ambitious assignments for modifying the system would follow, such as replacing the memory manager with one that does paging.

Mini Tunis has the following characteristics. It supports the fundamental system calls of Unix-like systems, including Fork, Exec, Exit, Wait, Create, Open, Read, Write, Seek, Close and Unlink. With these it is straightforward to write simplified but realistic versions of common systems programs such as a shell. Mini Tunis comes with a fundamental set of systems programs: a shell, cat, echo, ls, rm, etc. These systems programs are written in a subset of OOT called Mini Turing. A Mini Turing compiler, which comes with Mini Tunis, translates these programs to pseudo code. This pseudo code is considered to be the machine language of the machine on which Mini Tunis is running. When it comes time for Mini Tunis to actually run a user program, it invokes an interpeter for this pseudo code, thereby executing the user's program. Students can write their own user programs and their own systems programs using the Mini Turing compiler.

Mini Tunis is a multithreaded operating system meaning that it uses concurrency internally. For example, inside Mini Tunis, a separate thread manages the file requests for each user. It does this in a high-level fashion, using the concurrency features of OOT. Mini Tunis itself is executed directly and not via the user's pseudo code interpreter.

Mini Tunis has evolved from two decades of model operating systems used at the University of Toronto. The system, created by David Penny, takes its name from Tunis (Toronto Unix-like System), a Unix-compatible operating system written in Turing Plus. Mini Tunis has been used in classes since 1987. It was translated from the Turing Plus language to OOT in summer 1991 and has has been used in that form since then. It is not uncommon to hear a student say he/she learned as much from the Mini Tunis experiments as from the rest of the course on operating systems.

This book is based on chapters in the text Concurrent Euclid, the Unix System and Tunis [Holt, Addison-Wesley 1983]. An earlier draft of this book has been used in classes at the University of Toronto and elsewhere since 1988. The original inspiration for a model operating system comes from Alan Shaw in his course in operating system at Cornell University in 1969, taught using PL/I. This evolved to a project at the University of Toronto using various concurrent languages including TOPPS and Concurrent Euclid. The present model system was developed by David Penny under Turing Plus and has since been ported to Object Oriented Turing.

R. C. Holt
D. A. Penny
Toronto, August 1992


Table of Contents of the Mini Tunis Book

  • Chapter 1 - Introduction 9
  • Examples of Concurrency 10
  • Operating Systems 12
  • Concurrency in Operating Systems 14
  • Multitasking in Operating Systems 15
  • Virtual Machines 18
  • Features of Operating Systems 21
  • Communication in Operating Systems 23
  • Operating Systems and Monolithic Monitors 25
  • Using a Concurrency Kernel 28
  • An Example Operating System 30
  • Processes, Processors and Procedures 31
  • Summary 31
  • Chapter 2 - Concurrent Programming 35
  • Specifying Concurrent Execution 35
  • Coroutines 37
  • Implementing Concurrent Execution 37
  • Disjoint and Overlapping Processes 39
  • Critical Sections 41
  • Mutual Exclusion By Busy Waiting 43
  • Synchronization Primitives: Semaphores 47
  • Other Synchronization Primitives 50
  • Message Passing 52
  • Blocking Send 54
  • The Rendezvous 55
  • Communicating Sequential Processes 57
  • Monitors 58
  • The Deadlock Problem 62
  • Detecting Deadlock 64
  • Chapter 3 - Object Oriented Turing Language 71
  • Background 71
  • Design Philosophy 72
  • An Example Program 74
  • Types 75
  • Control Constructs 78
  • Structured Types 79
  • Subprograms 81
  • Modules 83
  • Pointers 84
  • Dirt and Danger 85
  • Separate Compilation 87
  • Exception Handling 90
  • Classes 91
  • Inheritance 94
  • Concurrency 98
  • Re-Entrant Procedures 99
  • Mutual Exclusion 100
  • Waiting and Signaling 102
  • Details of Signaling and Waiting 103
  • Other Types of Conditions 103
  • Managing a Circular Buffer 104
  • Concurrency Kernels and Device Management 107
  • Simulation and the Pause Statement 108
  • Chapter 4 - Examples of Concurrent Programs 111
  • Dining Philosophers 111
  • Readers and Writers 117
  • Buffer Allocation For Large Messages 122
  • Clock Manager 126
  • Summary 132
  • Chapter 5 - Mini Tunis 135
  • Introduction 135
  • Systems Programming 137
  • Using Mini Tunis 144
  • System Code 146
  • Mini Tunis Structure 149
  • GLOBAL Layer 152
  • COMPUTER Layer 153
  • DEVICE Layer 158
  • FILE Layer 161
  • Inode Module 164
  • File Table Module 167
  • Directory Module 167
  • MEMORY Layer 167
  • Interface to the MEMORY Layer 169
  • Policy of the MEMORY Layer 170
  • USER Layer 172
  • Conclusion 175
  • Appendix 1 - Mini Turing Language 179
  • Manual Page for mturing 179
  • Mini Turing Language Report 180
  • Appendix 2 - System Calls 183
  • FORK 184
  • EXEC 184
  • EXIT 184
  • WAIT 185
  • CREATE 185
  • OPEN 185
  • READ 186
  • BYTEREAD 186
  • WRITE 186
  • BYTEWRITE 186
  • SEEK 187
  • CLOSE 187
  • UNLINK 187
  • UNIX 187
  • Mini Tunis Status Codes 188
  • nArgs 189
  • fetchArg 189
  • nEnvp 189
  • fetchEnvP 189
  • SYSCALL 189
  • Appendix 3 - Source Code for Systems Programs 191
  • cat 191
  • cp 193
  • echo 194
  • futil 195
  • get 198
  • init 199
  • ls 200
  • od 201
  • rm 202
  • sh 203
  • sync 208
  • Appendix 4 - Making a File System 209
  • Manual Page for mkfs 209
  • Appendix 5 - Source Code for Mini Tunis 211
  • USER Layer 211
  • mtunis (main program) 211
  • Control 212
  • User 214
  • User.RunUser 216
  • Family 224
  • State 228
  • MEMORY Layer 229
  • Memory 229
  • Memory.Frame 237
  • Memory.SharedCode 238
  • FILE Layer 240
  • File 240
  • FileTable 244
  • Directory 247
  • Inode Subsystem 250
  • Inode 250
  • InodeGlobals 255
  • InodeTable 257
  • FreeInode 259
  • FileIO 261
  • DEVICE Layer 266
  • Device 266
  • Tty 268
  • Disk 270
  • COMPUTER Layer 273
  • Computer 273
  • Computer.machine 283
  • Computer.access 288
  • Computer.interpret 290
  • GLOBAL Layer 298
  • Panic 298
  • System 299

  • [ Holt Software Home ] * [ Books (Graphical) ] * [ Books (Text) ] * [ Top of Page ] * [ Feedback ]