36
Operating Systems: History, Hardware & Concepts Ch 1.3 -1.5 Tuesday, January 16, 2007

Operating Systems: History, Hardware & Concepts Ch 1.3 -1.5 Tuesday, January 16, 2007

Embed Size (px)

Citation preview

Page 1: Operating Systems: History, Hardware & Concepts Ch 1.3 -1.5 Tuesday, January 16, 2007

Operating Systems:History, Hardware & Concepts

Ch 1.3 -1.5

Tuesday, January 16, 2007

Page 2: Operating Systems: History, Hardware & Concepts Ch 1.3 -1.5 Tuesday, January 16, 2007

Today’s Schedule

Sec 1.2 - Complete History Pages Sec 1.4 - Hardware Review Sec 1.5 - O/S Concepts

Page 3: Operating Systems: History, Hardware & Concepts Ch 1.3 -1.5 Tuesday, January 16, 2007

History of Operating Systems

Machine-centric Human-centric

1st Generation – Vacuum Tubes (1945-1955)All programming done in machine languageNo OSUsage done by the same people who built the

machine

Page 4: Operating Systems: History, Hardware & Concepts Ch 1.3 -1.5 Tuesday, January 16, 2007

Second Generation

Transistors & Batch (1955-1965)University, government, & big-businessMainframes & operators in dedicated roomsPunch cardsDeck readers Input/Output binsBatch processing onto tape

Page 5: Operating Systems: History, Hardware & Concepts Ch 1.3 -1.5 Tuesday, January 16, 2007

Third Generation

Integrated Circuits (1965-1980)Software-compatible product linesBirth of the modern notion of the OSMulti-purpose machine w/ software (OS)

intermediaryMultiprogramming (multiple programs/jobs sharing

resources)Spooling and TimesharingUNIX

Page 6: Operating Systems: History, Hardware & Concepts Ch 1.3 -1.5 Tuesday, January 16, 2007

Fourth Generation

Personal Computing (1980-present)LSI chips (Large Scale Integration)Cheap memory, disk space, processing, etc.DOS, Windows, Mac OS & XDistributed computingPDA/embedded-devices

Page 7: Operating Systems: History, Hardware & Concepts Ch 1.3 -1.5 Tuesday, January 16, 2007

Computer Hardware Review

Components of a simple personal computer

Monitor

Bus

Page 8: Operating Systems: History, Hardware & Concepts Ch 1.3 -1.5 Tuesday, January 16, 2007

Computer Hardware Review

(a) A three-stage pipeline(b) A superscalar CPU

Page 9: Operating Systems: History, Hardware & Concepts Ch 1.3 -1.5 Tuesday, January 16, 2007

Processors

Brain of the computer Fetch, decode, execute cycle Registers Program Counter (PC) Stack Pointer (SP) Pipelining improves performance, but complexities

of “rolling back” appear Kernel vs. User Mode (enables establishing

limitations of instruction set available)

Page 10: Operating Systems: History, Hardware & Concepts Ch 1.3 -1.5 Tuesday, January 16, 2007

Memory TradeoffSpeed vs. Capacity

Typical memory hierarchynumbers shown are rough approximations

Page 11: Operating Systems: History, Hardware & Concepts Ch 1.3 -1.5 Tuesday, January 16, 2007

Computer Memory

•The CPU is often referred to as the brain of the computer. This is where all the actual computing is done.

•The chipset supports the CPU. It usually contains several "controllers" which govern how information travels between the processor and other components in the system. Some systems have more than one chipset.

Page 12: Operating Systems: History, Hardware & Concepts Ch 1.3 -1.5 Tuesday, January 16, 2007

Computer Memory

•The memory controller is part of the chipset, and this controller establishes the information flow between memory and the CPU.

•A bus is a data path in a computer, consisting of various parallel wires to which the CPU, memory, and all input/output devices are connected.

•The memory bus runs from the memory controller to the computer's memory sockets

Page 13: Operating Systems: History, Hardware & Concepts Ch 1.3 -1.5 Tuesday, January 16, 2007

Computer Memory•Memory speed is sometimes measured in Megahertz (MHz), or in terms of access time - the actual time required to deliver data - measured in nanoseconds (ns).

•A computer's system clock resides on the motherboard. It sends out a signal to all other computer components in rhythm, like a metronome.

•Cache memory is a relatively small amount (normally less than 1MB) of high speed memory that resides very close to the CPU. Cache memory is designed to supply the CPU with the most frequently requested data and instructions.

Page 14: Operating Systems: History, Hardware & Concepts Ch 1.3 -1.5 Tuesday, January 16, 2007

Memory Allocation

We need a protective and fair way of allocating and resizing memory blocks for processes/jobs

Two sections of memoryCode (typically static)Data (volatile)

OS

Program Code

User 1 Data

User 2 Data

Limit

Base

Limit

Base

Limit

Base

Page 15: Operating Systems: History, Hardware & Concepts Ch 1.3 -1.5 Tuesday, January 16, 2007

Multiple Processes in Memory

One base-limit pair and two base-limit pairsProtection and Relocation problems solved!

Page 16: Operating Systems: History, Hardware & Concepts Ch 1.3 -1.5 Tuesday, January 16, 2007

Memory Management Unit (MMU)

Device that checks and maps memory addresses

Virtual Address – address generated by the program

Physical Address – address actually used in memory

Page 17: Operating Systems: History, Hardware & Concepts Ch 1.3 -1.5 Tuesday, January 16, 2007

I/O Devices

Typically consist of two parts:ControllerDevice

Controller manages & presents the API of the device to the OS

The software that “talks” to the controller is called a device driver

Page 18: Operating Systems: History, Hardware & Concepts Ch 1.3 -1.5 Tuesday, January 16, 2007

Invoking Device Actions

Busy wait – execute a kernel-level system call and wait (ties up the processor )

Ask the device to generate an interrupt (signal that it’s done or failed) Doesn’t tie up the processor Adds complexity

DMA – Direct Memory Access Bypasses the use of the processor Allows the device to write directly to memory once the

“rules of the road” are established

Page 19: Operating Systems: History, Hardware & Concepts Ch 1.3 -1.5 Tuesday, January 16, 2007

I/O Devices

(a) Steps in starting an I/O device and getting interrupt

(b) How the CPU is interrupted

(a) (b)

Page 20: Operating Systems: History, Hardware & Concepts Ch 1.3 -1.5 Tuesday, January 16, 2007

Bus

Communication “highway” for all data to travel upon Multiple buses exist in modern machines

Cache (fastest) Local (on mainboard –other busses connect to it) Memory PCI (successor of ISA - high-speed I/O) SCSI (high-speed scanners & disks) USB (slow peripherals) IDE (disks, etc.) ISA (slowest – legacy)

Page 21: Operating Systems: History, Hardware & Concepts Ch 1.3 -1.5 Tuesday, January 16, 2007

Buses in PC

Structure of a large Pentium system

Page 22: Operating Systems: History, Hardware & Concepts Ch 1.3 -1.5 Tuesday, January 16, 2007

OS Concepts

Processes Deadlock Memory Management I/O Files Security

                        

Page 23: Operating Systems: History, Hardware & Concepts Ch 1.3 -1.5 Tuesday, January 16, 2007

Processes

Defined as a “program in execution” AKA a “job” Contain

Instructions (code segment) SP, PC, registers, file handles Data segment

Processes can spawn subprocesses & threads The OS must ensure fairness & protection,

timeslicing & managing multiple processes at a time

Page 24: Operating Systems: History, Hardware & Concepts Ch 1.3 -1.5 Tuesday, January 16, 2007

Deadlock

Two or more processes “stalemated” because they can’t make progress

Process AHas resource 1

Waiting on resource 2

Process BHas resource 2

Waiting on resource 1

Page 25: Operating Systems: History, Hardware & Concepts Ch 1.3 -1.5 Tuesday, January 16, 2007

Memory Management

Providing protection of one process’ memory section from another process (security)

Providing a fair allocation of memory to multiple processes

Swapping memory to disk as needed

Page 26: Operating Systems: History, Hardware & Concepts Ch 1.3 -1.5 Tuesday, January 16, 2007

Input/Output

All OS must manage I/O devices

Two categories:Device independentDevice dependent (device drivers)

Page 27: Operating Systems: History, Hardware & Concepts Ch 1.3 -1.5 Tuesday, January 16, 2007

Files

System callsCreate, remove, read, write, etc.

Directories & subdirectoriesCreate, remove, rename, move, etc.

Page 28: Operating Systems: History, Hardware & Concepts Ch 1.3 -1.5 Tuesday, January 16, 2007

Security

Allocate permissionsDirectoriesFiles

Example UNIX policies to consider:Read, Write, ExecuteUser, Group, World

Page 29: Operating Systems: History, Hardware & Concepts Ch 1.3 -1.5 Tuesday, January 16, 2007

System Calls

Services that the OS provides to the user Set of API that user-level programs may

invoke

Flavors of System CallsUNIXWin32

Page 30: Operating Systems: History, Hardware & Concepts Ch 1.3 -1.5 Tuesday, January 16, 2007

UNIX System Callspid = fork() creates child process

exit() terminates process

fd = open(file, …) opens file

s = mkdir(name, mode) creates directory

s = chmod(name, mode) sets file/dir permissions

s = kill(pid, signal) sends signal to process

Page 31: Operating Systems: History, Hardware & Concepts Ch 1.3 -1.5 Tuesday, January 16, 2007

Win32 System Calls

CreateProcess(…) creates new process

ExitProcess(…) terminates process

CreateFile(…) opens file

CreateDirectory(…) creates directory

Page 32: Operating Systems: History, Hardware & Concepts Ch 1.3 -1.5 Tuesday, January 16, 2007

Approaches to OS

Monolithic

Virtual Machines

Client-Server (microkernel)

Page 33: Operating Systems: History, Hardware & Concepts Ch 1.3 -1.5 Tuesday, January 16, 2007

Monolithic OS Architecture

OS written as a set of procedures

Each procedure has well-defined interface (parameters)

Very little structure or information hiding

Page 34: Operating Systems: History, Hardware & Concepts Ch 1.3 -1.5 Tuesday, January 16, 2007

Virtual Machine OS Architecture

Replicate the hardware within software

Trap OS calls and translate/handle them Breaks down if you make direct I/O calls Slow

Other approach: JVM (define an alternate instruction set and translate to various OS)

Page 35: Operating Systems: History, Hardware & Concepts Ch 1.3 -1.5 Tuesday, January 16, 2007

Client-Server OS Architecture

Implement as much as possible in user-level modules

The OS is as small as possible It only serves to translate and message

pass OS-level calls to service processes

Page 36: Operating Systems: History, Hardware & Concepts Ch 1.3 -1.5 Tuesday, January 16, 2007

Thursday, January 18

Complete Reading Chapter 1 Sections 1.1 – 1.5Sections 1.9 – 1.11

Quiz on Chapter 1, above sections Homework #1 due on

Wed, Jan 17 11:30 pm