The top software developers are more productive than
average software developers not by a factor of 10X or
100X or even 1000X but by 10,000X.
Nathan Myhrvold
Introduction
OS ~ government
easier to define an OS what they do than what they are
types
| job 1 |
| job 2 |
| job 3 |
used in mobile phones, intelligent toys, hand held devices
multitasking -- allow serveral processes coexist
process table -- stores information about each process
each occurence of a process is called an instance
MS-DOS
| before loading a process | after loaded a process | ||||||||
|
|
UNIX
|
to start a new process, the shell executes a fork
system call, loaded via exec
exit when finished |
process tree -- parent process, child process
I/O-bound process -- spends more time on I/O than on computation
CPU-bound process -- more computation, infrequent I/O request
scheduler -- a special process that controls how processor time is divided among other tasks that are currently running
MS Windows 3.1
controlled with messages and message loops
directory, root directory
file descriptor
0 standard input 1 standard output 2 standard errorpipes ( psuedo files ) -- for process communications
|
|
|
||||||
cat file1 file2 file3 | sort > /dev/lp
provide the interface between a process and the operating system
these calls are generally available as assembly language, C, Pascal
copy file1 file2
DOS was successful because it provides a lot of system calls
Different types:
Consider a processes consisting of only two elements: a memory space (a subsection of the OS memory space) and a set of registers (including PC and stack pointer). We disallow any memory accesses for space outside this range. What we have is a fully functional program, capable of doing any type of computations as long as it is self-contained.

system calls are used to create processes ( submit jobs ) ( by exec() )
MS-DOS
| process A ( parent ) |
→ | DOS Shell ( COMMAND.COM ) |
→ | process B ( child ) |
( process A exit ) |
or
| process A ( parent ) |
→ | process B ( child ) |
( process A exit ) |
UNIX
~ software interrupt
file system calls
some OS provide many more calls
I/O device
files ~ virtual device
DOS, UNIX merge file-device
time
date
network -- hostname
MS-DOS
| Application Program | |||||||
↓
|
↓ ↓ ↓ | ||||||
| ROM BIOS Device Drivers | |||||||
This TRAP instruction switches the computer from user mode to kernel mode, and transfers control to the operating system.
Early versions of UNIX
System calls ( services ) provided by OS are requested
by putting the parameters in a well-defined places such
as registers or stacks.
kenel call ( supervisor call ), switch from user mode to kenel mode ( supervisor mode ) and transfer control to OS
The monolithic system that is described above began with no structure and ended with an organised structure. That structure, can in fact be layered. This introduces a hierarchy of layers, where each layer is constructed above the one below.

OS → hierarchy layers
broken down into smaller pieces ( modules )
flexible, has modularity, easier to debug, first layer can be debugged without any concern with the rest of the system
Technische Hogeshool Eindhoven ( THE )
by E.W. Dijkstra ( 1968 ) and his students
6 layers
| 5 | operator |
| 4 | user program |
| 3 | I/O management |
| 2 | operator-process communication |
| 1 | memory management |
| 0 |
allocation of CPU for processes and multiprogramming |
The MULTICS operating system was based on such a structure. However, MULTICS was conceptually based on a series of concentric rings as shwon below. The inner-rings have more privileges than the outer-rings.

The Unix operating system is also a layered structure:

less efficient
MS-DOS → OS/2, user cannot access hardware directly
further extend layered structures
IBM OS/360, spent 50 million dollars but abondened later
IBM VM/370, virtual machine concept
by using CPU scheduling, and virtual memory techniques, an OS can create an illusion of multiple processes, each executing on its own memory and CPU ( virtual machine )
difficult to implement



objected-oriented, architectural, distributed, multithreaded programming languate

a Java program consists of one or more classes
each class ~ architectural byte code
runs on Java Virtual Machine ( JVM )
JVM consists of a class loader
