itfn 3601 operating systems computer hardware review os concepts overview

41
ITFN 3601 Operating Systems Computer Hardware Review OS Concepts Overview

Upload: abigail-harrington

Post on 02-Jan-2016

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ITFN 3601 Operating Systems Computer Hardware Review OS Concepts Overview

ITFN 3601 Operating Systems

Computer Hardware Review

OS Concepts Overview

Page 2: ITFN 3601 Operating Systems Computer Hardware Review OS Concepts Overview

Agenda

OS Introduction

Flavors of OS Hardware Review OS Concepts Overview System Calls Various OS Approaches

Page 3: ITFN 3601 Operating Systems Computer Hardware Review OS Concepts Overview

So What is an OS?

And Ya’ Can’t Say

“Operating System”

Page 4: ITFN 3601 Operating Systems Computer Hardware Review OS Concepts Overview

OS PlacementApplications (Word, IE, Games, etc.)

Low-level apps (compilers, interpreters, editors)

Operating System

Machine Language (Binary)

Microarchitecture (processor-level)

Physical Devices (Hardware)

Use

rM

achi

ne

Page 5: ITFN 3601 Operating Systems Computer Hardware Review OS Concepts Overview

OS Defined

Abstract InterfaceService provider for hardwareAbstracts the details of the machineProvides an API (system calls) to user

Resource ManagerMultiple users, multiple resourcesOrderly, controlled allocation of resourcesFairness, protection, space-time, etc.

Page 6: ITFN 3601 Operating Systems Computer Hardware Review OS Concepts Overview

History of Operating Systems

Machine-centric Human-centric

Vacuum Tubes (1945-1955)All programming done in machine languageNo OS,Usage done by the same people who built the

machine

Page 7: ITFN 3601 Operating Systems Computer Hardware Review OS Concepts Overview

History of OS (cont)

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

Page 8: ITFN 3601 Operating Systems Computer Hardware Review OS Concepts Overview

History of OS (cont)

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)UNIX

Page 9: ITFN 3601 Operating Systems Computer Hardware Review OS Concepts Overview

History of OS (cont)

Personal Computing (1980-present)LSI chipsCheap memory, disk space, processing, etc.DOS, Windows, Mac OS, XDistributed computingPDA/embedded-devices

Page 10: ITFN 3601 Operating Systems Computer Hardware Review OS Concepts Overview

Flavors of OS

Mainframe Server Multiprocessor Personal Computer Real-Time Embedded Smart Card

Page 11: ITFN 3601 Operating Systems Computer Hardware Review OS Concepts Overview

Mainframe OS

High-end I/O capacity1000+ disksGigabytes of data

High-end web servers B2B (business to business) E-commerce High-speed VR/FMV Rendering Many small, simultaneous jobs

Page 12: ITFN 3601 Operating Systems Computer Hardware Review OS Concepts Overview

Server OS

Large personal computers (kahuna, zidane, etc.) Print, file servers for small businesses Web servers Can load balance these to increase performance UNIX, Linux, Win2000 Server OS

Page 13: ITFN 3601 Operating Systems Computer Hardware Review OS Concepts Overview

Multiprocessor OS

Connect multiple computers together Share/distribute jobs among multiple

machines/processors Specialized protocols for managing communication Win2000 Advanced Server

Page 14: ITFN 3601 Operating Systems Computer Hardware Review OS Concepts Overview

Personal Computer OS

Focus on single user, multiple jobs What you’re running on your machine Windows XP/Vista, Win2003/2008 Pro, Linux

Page 15: ITFN 3601 Operating Systems Computer Hardware Review OS Concepts Overview

Real-Time OS

Time dominates these machines’ specs Data collection from production lines, factory

machinery Hard real-time: time critical in all instances Soft real-time:

OK to drop occasionally

Page 16: ITFN 3601 Operating Systems Computer Hardware Review OS Concepts Overview

Embedded OS

Personal Digital Assistants TVs, microwaves, mobile phones Very small OS, embedded on chip PalmOS, WinCE

Page 17: ITFN 3601 Operating Systems Computer Hardware Review OS Concepts Overview

Smart Card OS

Credit card sized devices Specialized OS for specialized purposes E-payment cards (e-cash cards) Some JVM coming into play

Page 18: ITFN 3601 Operating Systems Computer Hardware Review OS Concepts Overview

Hardware Review

CPU

Memory

DisplayController

KeyboardController

FloppyController

Hard DiskController

Display

Keyboard

Floppy

Hard Disk

Bus

Page 19: ITFN 3601 Operating Systems Computer Hardware Review OS Concepts Overview

Hardware Review

Processors Memory I/O Devices Bus

Page 20: ITFN 3601 Operating Systems Computer Hardware Review OS Concepts Overview

Processors

Brain of the computerFetch, decode, execute cycleRegistersProgram Counter (PC)Stack Pointer (SP)Pipelining improves performance, but

complexities of “rolling back” appearKernel vs. User Mode (enables establishing

limitations of instruction set available)

Page 21: ITFN 3601 Operating Systems Computer Hardware Review OS Concepts Overview

Memory

Trade off of speed vs. cost/size

Registers (on processor)Cache (processor)Cache (mainboard)Main MemoryDiskOther Network Cache/MachinesTape

Spe

ed d

ecre

ases

Cos

t inc

reas

es

Page 22: ITFN 3601 Operating Systems Computer Hardware Review OS Concepts Overview

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 23: ITFN 3601 Operating Systems Computer Hardware Review OS Concepts Overview

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 24: ITFN 3601 Operating Systems Computer Hardware Review OS Concepts Overview

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 processorAdds complexity

DMA – Direct Memory AccessBypasses the use of the processorAllows the device to write directly to memory once

the “rules of the road” are established

Page 25: ITFN 3601 Operating Systems Computer Hardware Review OS Concepts Overview

Bus

Communication “highway” for all data to travel upon

Multiple buses exist in modern machinesCache (fastest)Local (on mainboard –other busses connect to it)MemoryPCI (successor of ISA - high-speed I/O)SCSI (high-speed scanners & disks)USB (slow peripherals)IDE (disks, etc.)ISA (slowest – legacy)

Page 26: ITFN 3601 Operating Systems Computer Hardware Review OS Concepts Overview

OS Concepts

Processes Deadlock Memory Management I/O Files Security

                        

Page 27: ITFN 3601 Operating Systems Computer Hardware Review OS Concepts Overview

Processes

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

Instructions (code segment)SP, PC, registers, file handlesData segment

Processes can spawn subprocesses & threadsThe OS must ensure fairness & protection,

timeslicing & managing multiple processes at a time

Page 28: ITFN 3601 Operating Systems Computer Hardware Review OS Concepts Overview

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 29: ITFN 3601 Operating Systems Computer Hardware Review OS Concepts Overview

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 30: ITFN 3601 Operating Systems Computer Hardware Review OS Concepts Overview

Input/Output

All OS must manage I/O devices

Two categories:Device independentDevice dependant (device drivers)

Page 31: ITFN 3601 Operating Systems Computer Hardware Review OS Concepts Overview

Files

System callsCreate, remove, read, write, etc.

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

Page 32: ITFN 3601 Operating Systems Computer Hardware Review OS Concepts Overview

Security

Allocate permissionsDirectoriesFiles

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

Page 33: ITFN 3601 Operating Systems Computer Hardware Review OS Concepts Overview

System Calls

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

Flavors of System CallsUNIXWin32

Page 34: ITFN 3601 Operating Systems Computer Hardware Review OS Concepts Overview

UNIX System Calls

pid = 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 35: ITFN 3601 Operating Systems Computer Hardware Review OS Concepts Overview

Win32 System Calls

CreateProcess(…) creates new process

ExitProcess(…) terminates process

CreateFile(…) opens file

CreateDirectory(…) creates directory

Page 36: ITFN 3601 Operating Systems Computer Hardware Review OS Concepts Overview

Approaches to OS

Monolithic

Virtual Machines

Client-Server (microkernel)

Page 37: ITFN 3601 Operating Systems Computer Hardware Review OS Concepts Overview

Monolithic OS Architecture

OS written as a set of procedures

Each procedure has well-defined interface (parameters)

Very little structure or information hiding

Page 38: ITFN 3601 Operating Systems Computer Hardware Review OS Concepts Overview

Virtual Machine OS Architecture

Replicate the hardware within software

Trap OS calls and translate/handle themBreaks down if you make direct I/O callsSlow

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

Page 39: ITFN 3601 Operating Systems Computer Hardware Review OS Concepts Overview

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 40: ITFN 3601 Operating Systems Computer Hardware Review OS Concepts Overview

Summary

Various levels of OS complexities/sizes exist (mainframe to smart cards)

Important to know your hardwareProcessors, memory, I/O, buses

Important topics in OS forthcomingProcesses, deadlock, mem mgmt, files, etc.

System calls provide an API to user-level programs

Varied OS architecture approachesMonolithic, VM, client-server

Page 41: ITFN 3601 Operating Systems Computer Hardware Review OS Concepts Overview

FIN