SunOS Minix:

a to ol for use in

Op erating System Lab oratories

Paul Ashton

Daniel Ayers

Peter Smith

Technical Rep ort COSC 05/93

Department of

University of Canterbury, Private Bag 4800

Christchurch, New Zealand

SunOS Minix: a to ol for use in Op erating System Lab oratories

Paul Ashton, Daniel Ayers and Peter Smith

Department of Computer Science

University of Canterbury

Christchurch, New Zealand

email: [email protected]

Abstract

Lab oratory work is an essential part of the learning exp erience in many areas of Com-

puter Science, and this is particularly true in the area of op erating systems. To sup-

p ort lab oratory work in op erating systems, wehave created SunOS Minix, a version of

the Minix op erating system that runs as a pro cess under Sun SunOS. To date,

pro jects for two advanced classes on op erating systems haveinvolved extensivework with

the SunOS Minix source co de. Also, we are in the pro cess of developing a novel graphical

monitoring and control interface that will make SunOS Minix a p owerful to ol for use in

intro ductory op erating system lab oratories.

1 Intro duction

Lab oratories have an imp ortant role in Computer Science education [19]. Lab oratory pro jects

are used extensively in teaching of op erating systems, with many op erating system lab ora-

tories describ ed in the literature see, for example, [1]{[18]. In intro ductory lab oratories,

investigation, using readily available monitoring to ols, of an existing op erating system may

b e sucient. In more advanced lab oratories, students often delve deep er and either create

some or all of an op erating system, or read and p erhaps change the source co de of an existing

op erating system.

A reason for the high level of interest in op erating system lab oratories is that many dicul-

ties must b e overcome in designing and implementing them. Providing a realistic op erating

system environment in which students can read and write source co de is a considerable chal-

lenge. Diculties include: obtaining op erating system source co de; providing suitable real

or simulated machines; and helping students come to terms with large and complex systems,

particularly with the concurrent execution that o ccurs within an op erating system.

Use of a small op erating system created for use in teaching of op erating systems has a

numb er of advantages:

1. Source co de is much easier to obtain.

2. The relatively small size of the op erating system compared to a pro duction op erating

system means that students nd the source co de much more accessible.

3. A high degree of realism can b e obtained b ecause students are dealing with an actual

op erating system. 1

We decided to use Minix [18], a widely used \teaching" op erating system, as the basis for

several op erating system lab oratories. As Minix was not available for our main computing

environment, a network of Suns running SunOS, we created SunOS Minix, a version in which

each copy of Minix runs in the environment of a SunOS pro cess. Each of our Suns can supp ort

many instances of SunOS Minix, each of which isamulti-user op erating system that provides

preemptivemultitasking for a considerable range of system utilities, as well as user-written

programs. SunOS Minix has b een in use for twoyears as the basis for op erating system

lab oratories in an advanced op erating system course.

Currently, our intro ductory op erating system lab oratories consist of several exp eriments

p erformed under SunOS. Many of these could b e much b etter supp orted by SunOS Minix. To

this end, we are in the pro cess of designing and implementing a sophisticated SunOS Minix

monitoring and control interface that is for the most part implemented outside SunOS Minix.

The fact that SunOS Minix is hosted byapowerful general-purp ose op erating system raises

the p ossibility of providing suchaninterface. This novel interface will provide a student with

a wide range of information on the b ehaviour of a running version of SunOS Minix and will

give the student the ability to control the execution of SunOS Minix by for example enabling

various breakp oints. The initial version of the interface will include amongst other things:

the ability to start and stop SunOS Minix at will and at various prede ned breakp oints; a

continuously up dated view of the pro cess tree; message passing traces and animations; and

the ability to browse through the op erating system data structures using a hyp ertext style of

interface.

The remainder of the pap er is structured as follows. Approaches to op erating system

lab oratories taken by others are summarised in Section 2. Minix is intro duced in Section

3, and SunOS Minix is describ ed in Section 4. An overview of two pro jects that have b een

based on SunOS Minix is given in Section 5. The design of a novel monitoring and control

interface for SunOS Minix is outlined in Section 6. Finally, a summary is presented and some

conclusions are drawn in Section 7.

2 Background

A wide range of op erating system lab oratories has b een describ ed in the literature. We classify

these lab oratories in twoways: by the typ e of pro jects undertaken, and by the typ e of the

op erating system exp erimented with.

We classify pro jects into three categories:

1. Non-source co de pro jects|those that do not involve reading or writing op erating system

co de.

2. Op erating system mo di cation pro jects|those that involve reading and p erhaps mo d-

i cation of source co de for an existing op erating system.

3. Op erating system creation pro jects|those that involve writing all or some of an op er-

ating system from scratch.

The typ e of op erating system exp erimented with gives some indication of how close the

system is to b eing a \real" op erating system. At one extreme are queueing mo dels, in which

very high level abstractions of b oth the op erating system and its workload are used. At the 2

other extreme are pro duction op erating systems that are pro cessing real workloads. Wenow

describ e several categories of op erating system used in lab oratories, and for eachwe describ e

the typ es of pro ject that can b e set:

 Total simulation of op erating system op eration. Simulators of this typ e can b e used

in non-source co de pro jects. Since there is little or no op erating system co de, such

simulators cannot b e used in op erating system mo di cation or op erating system creation

pro jects.

In [15], Sta ord describ es a collection of ten simulation programs intended to provide

insightinto the tradeo s involved in various design decisions. Information from each

simulation is recorded in detail in a text le, and can also b e presented in various graphs.

The simulations include investigation of several CPU p olicies and of various

disk request scheduling p olicies.

In GRAPHOS [2], animation is used to show in detail the op eration of several op erating

system comp onents. Animations are drawn from the areas of concurrent pro cesses,

pro cessor scheduling and .

 Op erating systems running directly on the bare hardware. Pro duction op erating sys-

tems can b e used as the basis for op erating system pro jects. A non-source co de pro ject

for a pro duction op erating system could involve using monitoring to ols to investigate the

internal op eration of the system by observing the pro cess hierarchy and the contents

of various tables, for example, or might require the student to write programs that

use various op erating system facilities by making appropriate system calls. A lab ora-

tory describ ed in [12]involves investigation of Unix pro cesses by using standard SunOS

monitoring to ols.

While pro duction op erating systems often provide a reasonable environment for non-

source co de pro jects, they are usually less well suited to op erating system mo di cation

pro jects and op erating system creation pro jects are out of the question!. The ma jor

reasons for this are the diculty of getting the source co de for pro duction op erating

systems cost and copyright problems and their complexity.Shub observed that \work-

station op erating systems seem to b e to o complex for undergraduates to exp eriment with

in a rst course in op erating systems" [14].

Because of these problems, several \teaching" op erating systems have b een develop ed,

including Minix [18] and [5]. These op erating systems provide all of the imp ortant

op erating system services, but have b een kept as small and simple as p ossible to enable

students to gain an understanding of the entire system. These op erating systems can

b e used for non-source co de and op erating system mo di cation pro jects, with op erating

system mo di cation pro jects rep orted on most frequently in the literature [1], [3], [7],

[8].

Some op erating system creation pro jects involve implementing a very small op erating

system directly on the hardware see, for example, [9] and [13].

 Partial simulation of op erating system and/or hardware op eration. The degree of sim-

ulation varies considerably.At one extreme are systems in which students are asked to

write mo dules that conform to given interfaces, and that p erform in relative isolation 3

functions such as memory allo cation and pro cess scheduling. These mo dules are invoked

by a controller based on a simulated workload see [11], for example.

At the other extreme are fully edged op erating systems designed to run on a simulated

machine rather than on an actual machine. Some of these systems come with consider-

able amounts of application software, although most are driven by simulated workloads.

Examples include VXinu [16], and systems such as those describ ed in [6], designed to

run under a VM/370 virtual machine. Such systems can also b e run directly on 370

series hardware.

Non-source co de, op erating system mo di cation and op erating system creation pro jects

can b e done in these \partially simulated" environments.

For several years wehave b een using non-source co de pro jects based on pro duction op-

erating systems|initially PRIMOS and more recently SunOS. Twoyears ago, we decided

that wewould also like to give students at an advanced level the opp ortunitytowork with

op erating system source co de. In cho osing an op erating system, we had to decide:

1. On the typ e of pro jects that would b e undertaken. Both op erating system mo di cation

and op erating system creation pro jects have b een describ ed in the literature, with b oth

approaches apparently successful. To date, there is no conclusive evidence as to which

is the b etter approach [8], if indeed one is substantially b etter than the other.

2. On the typ e of op erating system that would b e used. Although running an op erating

system directly on the hardware provides the most realism, some problems exist with this

approach. One is that students must have a dedicated machine while they are running

their copy of the op erating system. A second is that there is very little scop e for the

typ e of supp ort to ols  and monitors for example that can b e constructed

for partially simulated environments. Donaldson describ es a batch op erating system

develop ed for use in a VM/370 environment[6], and comments that a great b ene t of

using that environment is the availabilityofpowerful debugging to ols that can b e used

to debug op erating systems that run on top of VM.

We decided to use op erating system mo di cation pro jects based on Minix. Our main

departmental computing system is a network of Sun workstations. Because students use

three large servers, and it is infeasible to set op erating system lab oratories that involve use

of the bare hardware, we created SunOS Minix. This gave us a hosted implementation of a

complete time-sharing op erating system, with full source co de and an extensive set of user

commands, including shells, editors, and le utilities. We are aware of few similar systems:

 APCsimulator exists that allows Minix for the IBM PC to b e run under VAX Unix

[18]. We tried a version of this simulator that had b een p orted to the Sun, but found

execution to b e extremely slow.

 VXinuisaversion of Xinu that runs as a Unix pro cess [16]. VXinuwas develop ed inde-

p endently during the p erio d in which SunOS Minix was written. A detailed comparison

with SunOS Minix is not p ossible at this p oint b ecause all do cumentation on VXinuis

written in Japanese. 4

 Nachos is a very small instructional op erating system that runs as a Unix pro cess [4].

Its functionality is limited in many areas b ecause of a desire to keep the amountof

co de to a minimum and b ecause a set of pro jects used with Nachos requires students to

implement or reimplement substantial comp onents of Nachos. Nachos do es, however,

include some features basic network supp ort for instance that are seldom found in

other instructional op erating systems.

Nachos do es not come with any user-mo de programs, although students can write their

own. All user-mo de executables are interpreted, although the op erating system runs in

native mo de.

3 Minix

Because SunOS Minix is a p ort of Minix, we will giveanoverview of Minix b efore going on

to describ e SunOS Minix. Minix was designed sp eci cally for use in teaching of op erating

systems [18]. To this end:

 Minix has b een kept relatively small and simple.

 Extensive do cumentation of the internals of the original version of Minix is available

in [17]. Although the currentversion of Minix di ers in manyways from the original

version, [17] still givesavery go o d overview.

 The source co de of Minix is inexp ensive and, once a copy has b een purchased bya

teaching institution, can b e freely copied within that institution.

Although Minix is small, it is nevertheless a preemptive, multitasking op erating system,

capable of supp orting several users simultaneously. Minix comes with a substantial number

of system utilities, including shells, editors, compilers and libraries, and le utilities. Indeed,

the Minix op erating system and utilities are maintained under Minix.

Externally, Minix is very similar to Unix Version 7. Nearly all of the Unix Version 7

system calls are supp orted, most of the system utilities are provided, and a compiler and a

version of make are included. Version 7 was chosen as a base b ecause it is p ossible to construct

an op erating system that, while it supp orts the Version 7 system calls, is small enough to b e

understo o d by students. A b ene t of basing Minix on Version 7 is that most students are

already familiar with Unix.

Internally, Minix is highly mo dular, consisting of several system pro cesses organised into

anumb er of indep endent programs. System pro cesses communicate with each other and with

user pro cesses through message passing. The Version 7 kernel, on the other hand, is a single

program. There are no system pro cesses in Version 7; instead user pro cesses enter and leave

the kernel through system calls and returns.

The internal structure of Minix is shown in Figure 1. Layers 1 to 3 comprise the Minix

op erating system, with applications running in Layer 4. The op erating system co de is linked

into three totally separate programs|mm the memory manager, fs the le system, and

kernel layers 1 and 2. Pro cesses in layer 2 and handlers in layer 1 can commu-

nicate by message passing or shared memory; all other communication is through message

passing. 5 Layer

4 init ....

3 memory manager

2 idle clocksystem diskprinter terminal memory

1 interrupt handlers

Figure 1: Internal structure of Minix

Layer 1 implements communicating sequential pro cesses, thus allowing the remainder of

Minix to b e implemented as a set of communicating sequential pro cesses. Layer 1 is a group of

interrupt handlers, with its own stack space within kernel. Device are converted

into messages to the appropriate pro cess in layer 2.

Layer 2 contains device driver pro cesses. Some pro cesses disk, clock, terminal, printer

interface with actual devices. system provides an interface b etween kernel and the layer 3

pro cesses. memory is a pseudo-device that implements ram disks and provides access to kernel

address space and to physical memory.

Layer 3 contains the memory manager and the le server. Every \" made by

a user pro cess in layer4isconverted into a message to one or other of these pro cesses. Layer

4 contains a Unix-like pro cess hierarchy ro oted at pro cess 1 init.

This layered structure provides students with a highly mo dular system to study, and

isolates hardware-dep endentcodeinlayers 1 and 2.

One limitation of Minix needs comment. Memory management is not particularly sophis-

ticated. When a program is executed, it is allo cated a xed amount of memory as sp eci ed

in the header of the executable le for its entire execution. Also, neither swapping or paging

is provided.

The original version of Minix was available from Prentice-Hall for the IBM PC, XT, and

AT. The version of Minix currently available from Prentice-Hall 1.5 is available for the same

machines plus the , the Atari ST, the Sun SparcStation and the . Minix on

the Macintosh is hosted under MacOS; all other versions run directly on the hardware.

4 SunOS Minix

In SunOS Minix, each instance of the Minix op erating system runs as a SunOS pro cess|

that is, the virtual machine on which SunOS Minix runs is the SunOS pro cess abstraction.

The pro cessor time available for SunOS Minix is that fraction of the CPU time given to the

SunOS pro cess. Each SunOS Minix disk partition is stored as a SunOS le. Clo ckinterrupts

are SunOS signals generated by SunOS at regular intervals the default is every 50ms. The

SunOS Minix console is the terminal connected to the SunOS pro cess. Thus when SunOS

Minix is started from a terminal session, the interface it presents to the user is exactly the 6

same as the user would exp erience had they just b o oted say PC Minix.

Our starting p ointwas Macintosh Minix and our initial p ort was to Suns with the SPARC

architecture running SunOS 4.1.1. An overview of the changes made in creating SunOS Minix

is given b elow.

 Bo otstrapping. A small SunOS program minix is resp onsible for pro cessing a con-

guration le, allo cating memory for SunOS Minix, loading and relo cating the SunOS

Minix \image" and then jumping to the startup co de within the SunOS Minix kernel

prop er. The con guration le sp eci es one or more SunOS Minix disk device ! SunOS

le mappings, as well as the amount of memory to allo cate for SunOS Minix. minix

allo cates the requested amount of memory in the data segment of the SunOS pro cess,

and loads the image, consisting of kernel, mm, fs and init, at the b eginning of the

area allo cated.

 Layer 1. Layer 1 required several mo di cations. Context switching co de had to b e

written in SPARC assembler. Handlers for the SunOS Minix \interrupts" SunOS

signals had to b e written. SIGIO indicates that terminal input is available, SIGALRM

indicates that a clo ck tick has o ccurred, and SIGUSR1 is used to force execution into

kernel when a SunOS Minix pro cess makes one of the three Minix system calls send

a message, receive a message, send a message and wait for a reply.

 Layer 2. The disk and terminal device drivers were changed to p erform reads and writes

by reading from and writing to SunOS le descriptors. The idle pro cess was changed

to cause the SunOS pro cess to wait for a signal instead of busy waiting.

 Layer 3. The memory manager had to b e mo di ed so as to b e able to relo cate SunOS

Minix executables. Relo cation during loading is required b ecause the virtual address

of the b eginning of a SunOS Minix program is not known until run-time relo cation is

unnecessary in PC Minix b ecause of the availability of base registers.

 Compilation. All compilation of the op erating system and utilities is done under

SunOS. Appropriate compilation ags are used to ensure that relo cation information

remains in executable les. Image les are created under SunOS by concatenating

kernel, mm, fs and init.For all other SunOS Minix programs, the SunOS executable

is converted to SunOS Minix format, then can b e read into SunOS Minix using the

SunOS Minix sunread command.

 Multiple logins. A single instance of SunOS Minix can havemultiple users logged into

it. The SunOS mlogin command op ens a connection through a Unix domain so cket

to a currently running instance of SunOS Minix. Up on connection, the user can log

into SunOS Minix in the usual way.

The most dicult parts of the p ort to SunOS were implementing context switching b e-

tween SunOS Minix pro cesses and implementing relo cation.

SunOS Minix has proved to b e a go o d environment for doing op erating system pro jects.

Avery high degree of realism has b een achieved, despite the fact that SunOS Minix is running

on top of SunOS. SunOS Minix is a preemptivemultitasking system that can supp ort multiple

users running a wide variety of SunOS Minix applications. No dedicated hardware is required,

and anynumb er of instances of SunOS Minix can b e run on a single Sun at the same time as 7

each other and any other workload. SunOS Minix lesystems can b e shared in a read-only

fashion so, for example, only one copy is needed of the lesystem containing the binaries of

the system utilities.

A drawback of SunOS Minix is that some of the device drivers, the disk device driver

in particular, are much simpler than their counterparts in systems running directly on the

hardware. Emulation of these devices could, however, b e made more realistic. Also, SunOS

Minix could b e enhanced to allowswapping and demand paging.

SunOS Minix has b een available for over a year, and has b een installed in several sites.

The currentversion 2.0 supp orts Sun 3s as well as Sun 4s under SunOS 4.1.x and Solaris

2.x, and is available as a set of patches to Minix 1.5 for the Macintosh or PC via anonymous

2 00.tar z in the unix directory of csc.canterbury.ac.nz. ftp in the le smx

5 Pro jects based on SunOS Minix

SunOS Minix has b een used in two op erating system mo di cation pro jects in an advanced

op erating system course. In 1992, students were asked to implement . In

version 1 of SunOS Minix, all of the memory in which SunOS Minix ran was readable, writable

and executable at all times, so any pro cess could corrupt its own executable co de as well as

the address spaces of all other pro cesses. Ideally, when a SunOS Minix pro cess is executing

it should not have write access to its co de, and should have no access outside its own address

space. The students were asked to implement this typ e of memory protection in SunOS

Minix by making use of the SunOS mprotect system call, whichchanges the protection of

one or more pages in the address space of a SunOS pro cess. The pro ject entailed making the

following changes:

1. The context switching co de had to b e changed to disable access to the address space

of the pro cess b eing switched from, and to enable access to the address space of the

pro cess b eing switched to. Because kernel is resp onsible for changing protection, access

to kernel could not, however, b e totally disabled. The stack used by the interrupt

handlers had to b e writable, co de executed prior to enabling access to kernel and after

disabling access to kernel had to b e readable and executable, and data containing

details of the address space of the executing pro cess had to b e readable. Nevertheless,

kernel cannot b e corrupted by a pro cess executing outside it b ecause the only area of

kernel that remains writable is the interrupt stack, and nothing is stored there when

execution is outside kernel.

2. In several places in SunOS Minix, it had b een assumed that kernel could access directly

the address space of any pro cess. With memory protection enabled this was no longer

true, so calls to change protection had to b e placed around such accesses. These calls

were necessary in the kernel library functions for copying, in handling the message

passing system calls, in p erforming disk reads and writes, and in the memory manager

where relo cation is p erformed.

Feedback from students indicated that they found this pro ject to b e challenging but very

rewarding. The abilitytowork with the source co de help ed to disp el for them the mystique

surrounding the source co de of an op erating system. Also, students discovered the diculty

of debugging op erating system co de. For this pro ject, there were places in kernel from which

they could not call printf b ecause they had disabled access to it! 8

In 1993, the pro ject set was rather di erent. The students were required to audit SunOS

Minix and do cument all p otential race conditions, and how they are avoided if at all. The

only multi-threaded program in SunOS Minix is kernel, in which the interrupt handlers

and device drivers execute, so the student's attention was fo cussed on kernel. Because one

device driver cannot preempt another, race conditions can only o ccur when an interrupt

handler interrupts a device driver or another . A ma jor goal of the pro ject

was to improve understanding of concurrency.

SunOS Minix has proved to b e a go o d environment for op erating system mo di cation

pro jects. Access to the environment has not b een a problem b ecause students don't need

any dedicated hardware. The ability to share the larger SunOS Minix le systems in a

read-only fashion has help ed to keep disk space requirements down 1Mb of SunOS disk p er

student allows students to run SunOS Minix. Finally, SunOS Minix has proved a very robust

environment.

6 The SunOS Minix control and monitoring interface

Students in a rst course on op erating systems do not have the background to deal with

pro jects involving mo di cation or creation of an op erating system. In our currentintro-

ductory lab oratories for op erating systems, students p erform a numb er of exp eriments that

involveinvestigation of the op eration of SunOS. Pro cess management, pro cess synchronisa-

tion, memory management and le management are among the areas covered. Software used

in the lab oratories includes standard SunOS monitoring to ols including ps, top, trace, and

pstat, a lo cally written monitor asdump, which prints details of the address space of a

pro cess, and small programs that use various op erating system services by making system

calls.

While wehave b een reasonably happy with the lab oratories, there are a numb er of di-

culties in basing them on a pro duction op erating system:

 Not having the op erating system source co de makes it dicult for the instructor to nd

out what is happ ening within the op erating system and to create new monitoring to ols

designed to illustrate asp ects of op erating system op eration that are p o orly illustrated

by the standard to ols.

 Students are not able to stop and then restart the op erating system, making it imp ossible

to get a consistent snapshot of the state of the op erating system.

 Students have no ability to in uence op erating system p olicies. It is imp ossible, for

example, for a student to select the pro cess to run next whenever a

o ccurs.

 Because students are using the main departmental computers, security risks exist for

some typ es of monitoring.

To substantially improve supp ort for intro ductory op erating system lab oratories, wehave

designed and are in the pro cess of implementing a monitoring and control interface for SunOS

Minix. The interface is an X-windows application running under SunOS. When using the

interface, a student has on their screen many windows that are related to the execution of

an instance of SunOS Minix. The student can enter SunOS Minix commands into anyofthe 9

SunOS Minix terminal sessions and sees instantly how the op erating system is dealing with

them. Windows that may b e on the student's screen include:

 The terminal session for the SunOS Minix console.

 Additional SunOS Minix terminal sessions.

 The control panel. The control panel allows the user to sp ecify the p oints at which

SunOS Minix should b e susp ended. Possible p oints include: the sending or receiving of

some message, the o ccurrence of an interrupt, and the creation of a new pro cess. The

control panel also allows the user to resume execution of SunOS Minix, and to start up

monitors.

 Displays from monitors. A wide variety of displays can b e envisaged that help to

reinforce basic concepts. Some included in the current design are:

{ A tree representation of all or part of the pro cess hierarchy that is up dated in

real-time as the pro cess hierarchychanges.

{ Ahyp ertext browser for data structures within kernel, mm and fs and on SunOS

Minix disk partitions. The browser allows access to amongst other things the

pro cess tables, op en le tables, system queues including the ready list, various

bu ers, and the le bu er cache enabling comparisons b etween the cache and

what is on disk.

{ Traces and animations of the message passing that o ccurs b etween the various

SunOS Minix pro cesses.

{ A graphical presentation of how the state of one or more pro cesses varies over time.

A Gantt chart is one way in which this information can b e rep orted.

{ The ability to select the pro cess to run whenever a new pro cess is dispatched

therebyoverriding the scheduler.

Displays can b e driven from data owing directly from an executing instance of SunOS

Minix or from a playback of what o ccurred in a previous session. During playback b oth

displays from monitors and Minix terminal sessions can b e played back. Also, many

instances of the same monitor can b e connected to a single instance of SunOS Minix

or a playback, allowing for example an instructor to broadcast to many students

displays of what is happ ening in an instance of SunOS Minix that the instructor is

controlling.

The goal of this environmentistoprovide a system that can b e used in intro ductory

op erating system lab oratories. Development of monitors will b e driven by this goal.

This novel monitoring and control interface app ears to have tremendous p otential for

use in intro ductory op erating system lab oratories. This typ e of interface is p ossible b ecause

SunOS Minix is hosted under an op erating system like SunOS, allowing the execution of

SunOS Minix to b e controlled and extensively monitored by the interface.

Considerable scop e exists for extending the interface so as to b etter supp ort op erating

system mo di cation pro jects. Two such extensions are a hyp ertext browser for the op erating

system source such as that describ ed in [10] and a source level able to deal with 10

the multiple system pro cesses present in SunOS Minix. Even without such enhancements,

students who have done intro ductory lab oratories using the monitoring and control interface

to SunOS Minix will b e much b etter prepared to deal with the source co de in subsequent

op erating system mo di cation pro jects.

7 Summary

Wehave created SunOS Minix Minix hosted under SunOS so that our students can read

and change the source co de of an op erating system. The environment provided is realistic,

as Minix is a multi-user op erating system that provides preemptivemultitasking and comes

with a wide range of application software.

Several b ene ts are gained by hosting Minix under SunOS. In particular, students do

not need dedicated hardware, with one Sun capable of supp orting many instances of SunOS

Minix. Also, extensive monitoring and control software can b e implemented under the host

environment SunOS, as is discussed further b elow. Finally, it is instructive for students to

grapple with the concept of one op erating system running on top of another.

A disadvantage in using a hosted op erating system is that the device drivers are not very

realistic. Nevertheless, interrupts for the clo ck and terminal devices do o ccur in SunOS Minix,

so the imp ortant issues of race conditions and interrupt handling still arise. Mo di cation of

SunOS Minix to make the device drivers more realistic is one p ossible future pro ject.

Over the last twoyears, SunOS Minix has b een successfully used in an advanced op erating

systems course to give students hands-on exp erience with the source co de of a real op erating

system. SunOS Minix has b een robust and easy to administer. SunOS Minix has b een

released to the outside world and is in use in several other institutions.

Work is pro ceeding on an innovative graphical monitoring and control interface for SunOS

Minix. The initial version will concentrate on providing supp ort for intro ductory lab oratories.

Many monitors can b e envisaged, with pro cess tree display, data structure browsing, message

monitoring and animation, and pro cess state display all included in the current design. Scop e

exists for more advanced versions of the interface that provide high levels of supp ort for

pro jects where the SunOS Minix source is read and mo di ed. Suchversions would likely

include a source co de browser and a source level debugger capable of handling the multi-

pro cess nature of SunOS Minix.

The currentversion of SunOS Minix is a go o d environment for lab oratories that require

students to b ecome familiar with and change the source co de of an op erating system. SunOS

Minix is unusual in that it is a multi-user time sharing op erating system complete with

applications that is hosted by another multi-user time sharing op erating system SunOS.

This allows multiple instances of SunOS Minix to run indep endently and simultaneously on

a single Sun. The monitoring and control interface under development has the p otential to

result in an excellent to ol for use in intro ductory lab oratories. Wehave found no references

to similar interfaces in the literature. Further development of the interface will provide much

improved supp ort for advanced lab oratories.

References

[1] G. Aguirre, M. Errecalde, R. Guerrero, C. Kavka, G. Leguizamon, M. Printista, and 11

R. Gallard. Exp eriencing Minix as a didactical aid for op erating systems courses. Oper-

ating Systems Review, 253:32{39, July 1991.

[2] Daniel A. Canas. ~ GRAPHOS: A graphic op erating system. SIGCSE Bul letin, 191:201{

205, February 1987.

[3] Stephen W. Chapp elow, Steven F. Ackerman, and Stephen J. Hartley. Design and imple-

mentation of a swapp er for the MINIX op erating system. SIGCSE Bul letin, 224:55{59,

Decemb er 1990.

[4] Wayne A. Christopher, Steven J. Pro ctor, and Thomas E. Anderson. The Nachos in-

structional op erating system. In Proceedings of the 1993 Winter USENIX Conference,

pages 479{488, January 1993.

[5] Douglas Comer. Design: The XINU Approach. Prentice-Hall, Engle-

wo o d Cli s, NJ, 1984.

[6] John L. Donaldson. Teaching op erating systems in a virtual machine environment.

SIGCSE Bul letin, 191:206{211, February 1987.

[7] R. Guerrero, L. Leguizamon, and R. Gallard. Implementation and evaluation of alter-

native pro cess schedulers in MINIX. Operating Systems Review, 271:79{100, January

1993.

[8] Stephen J. Hartley. More exp erience with MINIX in an op erating systems lab. Computer

Science Education, to app ear.

[9] Larry Hughes. Teaching op erating systems using Turb o C. SIGCSE Bul letin, 241:181{

186, February 1992.

[10] William R. Hutchison, Je ry H. Tischer, Charles A. Johnson, Dan A. Dargel, and

Brian A. Rudolph. A source co de navigation to ol for the XINU op erating system.

SIGCSE Bul letin, 231:304{308, March 1991.

[11] Michael Kifer and Scott A. Smolka. OSP: An environment for op erating systems pro jects.

Operating Systems Review, 264:90{100, Octob er 1992.

[12] John Penny and Paul Ashton. Lab oratory-style teaching of computer science. SIGCSE

Bul letin, 221:192{196,February 1990.

[13] Margaret M. Reek. An undergraduate op erating systems lab oratory course. SIGCSE

Bul letin, 221:171{175,February 1990.

[14] Charles M. Shub. Should undergraduates explore internals of workstation op erating

systems. SIGCSE Bul letin, 221:111{115, February 1990.

[15] Gary J. Sta ord. An op erating system simulator for the Apple Macintosh. Technical

Rep ort 91/06, UniversityofWollongong, Department of Computer Science, December

1991.

[16] Yoshikatsu Tada. A virtual op erating system `VXinu'|its implementation and problems.

Transactions of the Institute of Electronics, Information and Communication Engineers,

J75-D-I1:10{18, January 1992. 12

[17] Andrew S. Tanenbaum. Operating Systems: Design and Implementation. Prentice-Hall,

Englewo o d Cli s, NJ, 1987.

[18] Andrew S. Tanenbaum. A UNIX clone with source co de for op erating systems courses.

Operating Systems Review, 211:20{29, January 1987.

[19] A. B. Tucker et al. A summary of computing curricula 1991. Communications of the

ACM, 346:68{84, June 1991. 13