PART I BACKGROUND AND FUNDAMENTALS

Chapter 2 System Structure and Dynamic Execution

Exercises

2-1 What are modules, abstract data types and objects?

Refer not only to Section 2.1 but to related work in courses on programming language design and software engineering.

2-2 What is a process?

A program under execution by a single thread of control. (at this stage multi-threaded processes have not been introduced).

2-3 Describe how a program, comprising a number of object code files, is loaded and run by an operating system. Which operating system functions are invoked in order to create the required environment for the program to run?

You give a command to a command interpreter (or indicate the same requirement to a GUI). The object code files and libraries must be located (file management) and linked into one or more load modules. Sufficient memory must be acquired (memory management) to load the program. Some or all of the program (see later) is loaded into main memory and a process is created (process management) to execute the program.

2-4 What are the main functions of operating systems in general?

Device, network, file, memory and process management.

What functions would you expect to be present in operating systems for:

A process control computer with a sensor for monitoring, an actuator for control and a network connection for reporting to and receiving commands from a control centre?

Device (sensor and actuator), network, memory and process management.

A dedicated, network-based filing machine or "file server"?

Device (disk), network, memory and process management.

A computer dedicated to controlling the communications passing between two networks; that is, a "gateway" computer?

Network, memory and process management.

An autonomous personal computer?

Device (keyboard, screen, printer), network (?), file, memory and process management.

A single-user workstation with services available across a network?

Device (keyboard, screen), network, memory and process management.

A machine dedicated to managing and answering queries on a database?

Device (disk), network, memory and process management.

2-5 What is meant by a closed operating system structure?

All the OS functions are provided through a single system call interface. No function can be rewritten to suit a special application area. Each function is designed for every instance of the OS. Software Engineering issues are associated with maintenance of a large module which must run on a variety of hardware.

What is a microkernel?

The minimal mechanisms that are required by all instances of an OS.

Other traditional OS functions may run at user level above the microkernel.

What are the advantages and disadvantages of closed operating systems and microkernel-based systems?

See the list at the end of Section 2.5.

2-6 Relate the definitions of modules and processes to the structure of operating systems. How might modules be used? How might processes be used?

In a strict hierarchy of modules a process executing in a module at a given level may invoke only lower level modules. Is it possible to arrange the operating system functions we have encountered so far into a strict hierarchy? What are the advantages and disadvantages of a layered structure?

Section 10.2 describes the strictly layered structure of the THE operating system. Exercise 10.7 describes the layers of the Venus operating system and the solution gives another reference on layering. The advantage of strict layering is that the system may be proved correct by starting from inner layers and progressing outwards. The disadvantage is that layering imposes an arbitrary restriction on the functions available to any layer. A given layer knows about layers below it but can only respond to requests from layers above it.

2-7 List the resource types managed by your local operating system e.g. files, directories, memory, devices, processes etc. Consider how they might be implemented as objects. Give the interface operations for each object type and outline the interactions involved in using each object.

2-8 Why is a global naming scheme required for objects within an object based system? Discuss the pros and cons of naming schemes based on hierarchical names and global identifiers (e.g. of 64 bits). How can such identifiers be constructed so as to be unique?

Distinguish between access control and concurrency control when a process requests to open an object for use. Distinguish between object handles and object names. Discuss the circumstances under which an object can be closed but retained and deleted.