OSP: An Environment for Operating System Projects
Welcome to OSP, an Operating System Project. OSP is a collection of modules that together implement a modern-day operating system. Each module performs a basic operating system service such as device scheduling, cpu scheduling, interrupt handling, file management, memory management, process management, resource management, and interprocess communication.OSP is a simulated system--there is a special module, called SIMCORE, that provides the illusion of a computer system with a dynamically evolving collection of user processes to be multi-programmed. All the other modules of OSP are built to respond appropriately to the simulator-generated events that drive the operating system.Over the course of the semester, you will be given several assignments, each of which normally consists of implementing one of the OSP modules1. You will also be given instructions on how to compile and link your module with the rest of OSP. The end result win be a new and complete operating system, which you can now run in the simulated environment provided by SIMCORE.SIMCORE offers a number of different ways in which you can interact with OSP during simulation. When simulation commences, you will be prompted for the simulation parameters. SIMCORE uses these parameters to decide whether the system should be I/O-bound or cpu-bound, how often to generate requests for various system resources, how long the simulation should last, etc.At any point during simulation, you can request a snapshot: SIMCORE will display various tables that convey the current state of the system, e.g., the state of memory, device queues, event queues, the ready queue, open file tables, and more. You can also change the simulation parameters during a snapshot break. By systematically modifying the simulation parameters, you can test your system under a wide variety of conditions. This enables you to reach a high level of confidence in the correctness of your OSP implementation, and to evaluate its performance characteristics. SIMCORE also has a trace facility for tracking the occurrences of individual events, such as process creation, requests to read a file, requests to send messages, and device interrupts.In order to prevent corruption of the system state, SIMCORE monitors all events in the system, keeping its own copy of the system state. Whenever it detects an unanticipated and fatal error in the behavior of a module, execution is terminated, and an informative error message is printed. If SIMCORE deems the error to be non-fatal, it issues a warning and continues. Between the snapshot breaks, trace facility, and diagnostic capabilities, SIMCORE offers you an extensive environment in which to monitor and debug your programs.This book is organized as follows. Chapter 1 constitutes the OSP programmer's manual and reference guide. Section 1.2 presents the overall architecture of OSP, and the OSP modules are described in detail in the remaining sections. Included in each of the latter sections is a brief discussion of the general concepts of operating system design as they relate to the module in question. Each of these sections also defines the procedures that are imported and exported by the module.Chapter 2 is a user's guide that explains how to compile and run your programs, the meaning of the statistics and error messages generated by OSP, and how to submit your assignments. For ease of reference, a glossary of OSP data structures and data types is also included.To get the big picture of OSP, we suggest that you first read Chapter 2 and then Sections 1.1 to 1.4 of Chapter 1. The remaining sections of Chapter 1 should be dipped into when a particular module has been assigned as a project, or when you simply would like to understand a module in greater detail.OSP was developed at SUNY, Stony Brook, and borrowed several important ideas from an earlier project headed by Art Bernstein. We would like to gratefully acknowledge the contributions of Kit Lo, Nathan Tam, and Andrew Moncrieffe who implemented the first version of OSP. Subsequent enhancements are due to Jusuf Anwar, Lawrence Kwok, and Sankar Raman. Many people have used preliminary versions of OSP in their classes and have given us valuable feedback. In particular, we would like to thank Amr El Abbadi, Michael Fischer, Larry Hall, Bruce Parker, Mark Roth, and Gene Stark.   1Sometimes you will be asked to implement some support modules as well; for example, the device interrupt handler when implementing the device scheduler.   0201548879P04062001