CS GRIND

CSC Notes Chapter 2 Operating-System Structures

Chapter Objectives

  • To describe the services and operating system provides to users, processes, and other systems.
  • To discuss the various ways of structuring an OS.
  • To ex explain how operating systems are installed and customised and how they boot.

Operating-System Services

Services for Users:

Services for System

User Operating-System Interface

Command Interpreter

GUI

System Calls

System calls provide an interface to the services made available by an operating system.

Three of most common APIs for applications to use system calls:

Benefits from using API calls instead of direct system calls:

Handle parameters passed to the OS:

When parameters are more than registers, we have 2 ways:

native in Java

Though Java is designed to run on platform-neutral systems, it is still able to make system call instead of being limited by JVM. This mechanism is called Java Native Interface(JNI). It, via declared native methods, can invoke C/C++ codes to invoke system calls. When the native method is used, the Java program is no longer considered as portable.

Types of System Calls

6 categories(roughly)

Process Control

File Management

Device Management

Information Maintenance

Communication

There are two common models of interprocess communication: the message-passing model and the shared-memory model.

System Programs

Hardware->OS->System Programs->Application Programs

Operating-System Design and Implementation

Design Goals

Mechanisms and Plicies

Implementation

As is true in other systems, major performance improvements in operating systems are more likely to be the result of better data structures and algorithms than of excellent assembly-language code. In addition, although operating systems are large, only a small amount of the code is critical to high performance; the memory manager and the CPU scheduler are probably the most critical routines. After the system is written and is working correctly, bottleneck routines can be identified and can be replaced with assembly-language equivalents. (Bottlenecks are discussed further later in this chapter.)

Operating-System Structure

Simple Structure

Layered Approach

A system can be made modular in many ways. One method is the layered approach, in which the operating system is broken into a number of layers (levels). The bottom layer (layer 0) is the hardware; the highest (layer N) is the user interface.

Advantages:

Difficulty

Microkernels

Modularize the massive kernel into smaller one by moving nonessential components into user-level programs.

The main function of the microkernel is to provide a communication facility between the client program and the various services that are also running in user space.

Modules

Perhaps the best current methodology for operating-system design involves using object-oriented programming techniques to create a modular kernel.

Structure:
Kernel with additional, dynamically loadable modules.

Virtual Machines

Abstracted layered structure that produce the illusion that the virtual machines have their own processors and memory.

Pros:

Implementation

The virtual machine runs in user mode on the physical machine. In the mean while, the virtual machine itself must have (virtual) kernel mode and (virtual) user mode.

Java

We refer to it as a technology rather than just a programming language because it provides more than a conventional programming language. Java technology consists of two essential components:

  • Programming-language specification
  • Virtual-machine specification

The Java Programming Language

The Java Virtual Machine

The Java Development Kit

Java Operating Systems

Operating-System Debugging

Failure Analysis

Performance Tuning

DTrace