Definition

Top-down: hardware abstraction layer

Turn hardware into something that applications can use. “standard library” “OS as virtual machine”

  1. eg. printf(“hello world”), shows up on screen, App issue system calls to use OS abstractions

  2. eg. each app doesn’t have to write a graphics driver.

  3. eg. consistent interface: support for scsi/ide/flash disks

Bottom-up: resource manager/coordinator

Manage your computer’s resources. Resource = CPU, Memory, disk, device, bandwidth…

  1. sharing/multiplexing more than 1 app.

  2. protect, who gets what when.

  3. performance: fair and efficient.

OS abstraction: Process

A key OS abstraction: the applications you use are
built of processes.

Processes are protected from each other

In computing, a virtual address space (VAS) or address space is the set of ranges of virtual addresses that an operating system makes available to a process.

This provides several benefits, one of which is, if each process is given a separate address space, security through process isolation.

int fork(void) 

create a copy of the invoking process

int execv (const char* prog, const char* argv[]) 

replace current process with a new one

int wait(int *status) 

wait for a child to exit

process communication: pipe

int pipe(int fds[2])
  1. Creates a one way communication channel

  2. fds[2] is used to return two file descriptors

  3. Bytes written to fds[1] will be read from fds[0]

Kernel: most interesting part of OS

Unix System Architecture:

{<1>}

virtual machine

Export a fake hardware interface so that
multiple OS can run on top.

{<2>}

batch processing

ordered, bad but high utilization

spooling

The most common spooling application is print spooling. In print spooling, documents are loaded into a buffer (usually an area on a disk), and then the printer pulls them off the buffer at its own rate.

Because the documents are in a buffer where they can be accessed by the printer, you can perform other operations on the computer while the printing takes place in the background.

Multiprogramming

Several programs are run at the same time on a uniprocessor. Since there is only one processor , there can be no true simultaneous execution of different programs. Instead, the operating system executes part of one program, then part of another.

OS chooses which to run.

Ref: http://www.cs.columbia.edu/~junfeng/13fa-w4118/lectures/l02-os-intro.pdf