CSC 150 Chapter 6: Operating Systems
primary information resource: An Invitation to Computer Science (Java), Third Edition, G. Michael Schneider and Judith L. Gersting, Course Technology, 2007.

[ previous | schedule | next ]



Introduction

What is an operating system?

The answer to this question has led to many legal issues for Microsoft and the Justice Department (among others). Do you consider your web browser part of the Windows OS?

Here’s an interesting definition:  the one program running at all times on the computer (from AOSC)

Another AOSC definition: program that acts as intermediary between a user of a computer and the computer hardware

What does an OS do?


On the surface: the user interface

The user interface allows you to work with system resources.  Examples I could demo in the classroom (but probably won't!) are:

All are interactive, two are command-based and the rest are GUI.

Q: What kinds of things can you do from the user interface?
 

Historical review, from user interface perspective

The “prehistoric” era


Batch Operating Systems


Interactive command line operating systems


Graphical User Interface (GUI) operating system


Peeking inside:  Application Programmer Interfaces (API)

Libraries of functions and objects that application software programmer uses to interface the application with the OS.

Win32 API is used for developing Windows applications usually in C.


Unix/Linux APIs geared toward C/C++ and focus more on interfacing with OS internals


API for writing applications in Java is conceptually OS-independent.



Under the surface: Operating System Internals

Major OS functions are:


Process management

process is defined as a program in execution

a process is always in one of 5 states:
1. new (creation)
2. ready (can run but not assigned to processor)
3. running (executing)
4. waiting (waiting for external event)
5. terminated (finished execution)

Process starts in state 1, cycles among 2-3-4 and when finished jumps to 5.
Goes from 1 to 2 when loaded into main memory
Goes from 2 to 3 when dispatcher assigns to processor
Goes from 3 to 4 when external event (e.g. I/O) requested
Goes from 4 to 2 when external event completed
Goes from 3 to 2 when time slice expires
Goes from 3 to 5 when finished.

Time slicing


Scheduling


Dispatching


Have to handle possibility of deadlock

Have to gracefully handle interprocess communication


Main memory management

Ability to execute multiple processes concurrently is compromised unless instructions/data for all can reside simultaneously in memory.

Major problems that result include:

  1. Assembler produces machine code based on first instruction being in location 0.  But only one process can actually occupy location 0 at a time, the others will start at a non-zero address.
  2. Each process requires a certain amount of memory.  But the sum of memory required for all current processes may exceed physical memory capacity.
  3. When a process terminates, its memory is made available to other processes.   The total memory available may be large enough for the new process, but is available only in several small chunks.


Problem 1 is easily dealt with in hardware.  The CPU includes a relocation register, which contains the physical starting location of the currently executing machine code program.  Its contents are added to each memory fetch request before it goes into the MAR.

Problem 2 is dealt with by the use of virtual memory.  Part of the process is stored in physical memory and the rest in virtual memory (on disk).  When execution flows into an instruction in virtual memory, the process must wait while that part of the program is read into physical memory, possibly replacing parts of the program which have already executed.

Problem 3 is dealt with by organizing physical memory into small fixed size pages and allowing a process to be stored across several non-adjacent pages.

The solutions to problems 2 and 3 requires lots of OS tables and logic, but the results are worth it.
 

File (secondary storage) management

Major issues are protection and allocation/de-allocation of disk space.


I/O Device management

Major issues are:


Network management

Goal is to provide users a "single system image"

The virtual machine appears to be one physical machine but in fact is multiple machines distributed across a network.

Network communication details are hidden from user (client)

Prime examples are interactions with file, print and email servers.
 

Protection and Security

A concern at all levels of the machine, OS, and operations (people)



[ C SC 150 | Peter Sanderson | Math Sciences server  | Math Sciences home page | Otterbein ]

Last updated:
Peter Sanderson (PSanderson@otterbein.edu)