Upload
kelley-murphy
View
222
Download
0
Embed Size (px)
DESCRIPTION
Flavors of OS Mainframe Server Multiprocessor Personal Computer Real-Time Embedded Smart Card
Citation preview
ITFN 2601Introduction to Operating
Systems
Lecture 2Computer Hardware Review
OS Concepts Overview
Agenda
Flavors of OSHardware ReviewOS Concepts OverviewSystem CallsVarious OS Approaches
Flavors of OS
MainframeServerMultiprocessorPersonal ComputerReal-TimeEmbeddedSmart Card
Mainframe OS
High-end I/O capacity1000+ disksGigabytes of data
High-end web serversB2B (business to business) E-commerceHigh-speed VR/FMV RenderingMany small, simultaneous jobs
Server OS
Large personal computers (kahuna, zidane, etc.)
Print, file servers for small businessesWeb serversCan load balance these to increase
performanceUNIX, Linux, Win2000 Server OS
Multiprocessor OS
Connect multiple computers togetherShare/distribute jobs among multiple
machines/processorsSpecialized protocols for managing
communicationWin2000 Advanced Server
Personal Computer OS
Focus on single user, multiple jobsWhat you’re running on your machineWin9x, Win2000 Pro, Linux
Real-Time OS
Time dominates these machines’ specsData collection from production lines,
factory machineryHard real-time: time critical in all
instancesSoft real-time:
OK to drop occasionally
Embedded OS
Personal Digital AssistantsTVs, microwaves, mobile phonesVery small OS, embedded on chipPalmOS, WinCE
Smart Card OS
Credit card sized devicesSpecialized OS for specialized purposesE-payment cards (e-cash cards)Some JVM coming into play
Hardware Review
CPU
Memory
DisplayController
KeyboardController
FloppyController
Hard DiskController
Display
Keyboard
Floppy
Hard Disk
Bus
Hardware Review
ProcessorsMemoryI/O DevicesBus
ProcessorsBrain 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)
MemoryTrade off of speed vs. cost/size
Registers (on processor)Cache (processor)Cache (mainboard)Main MemoryDiskOther Network Cache/MachinesTapeSp
eed
decr
ease
s
Cos
t inc
reas
es
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
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
LimitBase
LimitBase
Limit
Base
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.
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
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.
Invoking Device ActionsBusy 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
BusCommunication “highway” for all data to travel uponMultiple buses exist in modern machines
Cache (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)
OS Concepts
ProcessesDeadlockMemory ManagementI/OFilesSecurity
ProcessesDefined 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
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
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
Input/Output
All OS must manage I/O devices
Two categories:Device independentDevice dependant (device drivers)
Files
System callsCreate, remove, read, write, etc.
Directories & subdirectoriesCreate, remove, rename, move, etc.
Security
Allocate permissionsDirectoriesFiles
Example UNIX policies to consider:Read, Write, ExecuteUser, Group, World
System Calls
Services that the OS provides to the userSet of API that user-level programs may
invoke
Flavors of System CallsUNIXWin32
UNIX System Calls
pid = fork() creates child processexit() terminates processfd = open(file, …) opens files = mkdir(name, mode) creates directorys = chmod(name, mode) sets file/dir
permissionss = kill(pid, signal) sends signal to process
Win32 System Calls
CreateProcess(…) creates new processExitProcess(…) terminates processCreateFile(…) opens fileCreateDirectory(…) creates directory
Approaches to OS
Monolithic
Virtual Machines
Client-Server (microkernel)
Monolithic OS Architecture
OS written as a set of procedures
Each procedure has well-defined interface (parameters)
Very little structure or information hiding
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)
Client-Server OS Architecture
Implement as much as possible in user-level modules
The OS is as small as possibleIt only serves to translate and message
pass OS-level calls to service processes
SummaryVarious levels of OS complexities/sizes exist
(mainframe to smart cards)Important to know your hardware
Processors, memory, I/O, busesImportant topics in OS forthcoming
Processes, deadlock, mem mgmt, files, etc.System calls provide an API to user-level
programsVaried OS architecture approaches
Monolithic, VM, client-server
FIN