computer system structure 1 © 2000 franz kurfess course overview introduction computer system...

39
Computer System Structure Computer System Structure 1 © 2000 Franz Kurfess Course Overview Introduction Computer System Structures Operating System Structures Processes Process Synchronization Deadlocks CPU Scheduling Memory Management Virtual Memory File Management Security Networking Distributed Systems Case Studies Conclusions

Post on 22-Dec-2015

219 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Computer System Structure 1 © 2000 Franz Kurfess Course Overview  Introduction  Computer System Structures  Operating System Structures  Processes

Computer System Structure Computer System Structure 11 © 2000 Franz Kurfess

Course OverviewCourse Overview Introduction Computer System

Structures Operating System

Structures Processes Process Synchronization Deadlocks CPU Scheduling

Memory Management Virtual Memory File Management Security Networking Distributed Systems Case Studies Conclusions

Page 2: Computer System Structure 1 © 2000 Franz Kurfess Course Overview  Introduction  Computer System Structures  Operating System Structures  Processes

Computer System Structure Computer System Structure 22 © 2000 Franz Kurfess

Computer System Structure Chapter Overview

Computer System Structure Chapter Overview

Motivation Objectives Computer Architecture Hardware Structure Program Execution Handling of Input/Output

(I/O) Interrupts

Storage Structure DMA Caching Protection Booting Computer System

Examples Important Concepts and

Terms Chapter Summary

Page 3: Computer System Structure 1 © 2000 Franz Kurfess Course Overview  Introduction  Computer System Structures  Operating System Structures  Processes

Computer System Structure Computer System Structure 33 © 2000 Franz Kurfess

MotivationMotivation

Page 4: Computer System Structure 1 © 2000 Franz Kurfess Course Overview  Introduction  Computer System Structures  Operating System Structures  Processes

Computer System Structure Computer System Structure 44 © 2000 Franz Kurfess

ObjectivesObjectives know the essential components of a computer system, and how they

function understand the interaction between these components see the differences in the architectures of various types of computer

systems PC, workstation, mainframe, supercomputer

understand the interaction between hardware and the execution of programs

computer system hardware is the basis for the execution of programs, and thus for the accomplishment of tasks with a computer

the structure of a computer system is a key factor in its usability, flexibility, and performance

OS concepts are intricately interwoven with the underlying computer system structure

Page 5: Computer System Structure 1 © 2000 Franz Kurfess Course Overview  Introduction  Computer System Structures  Operating System Structures  Processes

Computer System Structure Computer System Structure 55 © 2000 Franz Kurfess

Computer ArchitectureComputer Architecture

overall design of a computer system main emphasis on hardware

individual components interconnection structure

Page 6: Computer System Structure 1 © 2000 Franz Kurfess Course Overview  Introduction  Computer System Structures  Operating System Structures  Processes

Computer System Structure Computer System Structure 66 © 2000 Franz Kurfess

Von Neumann ArchitectureVon Neumann Architecture

four main components central processing unit (CPU) main memory I/O devices interconnection structures (bus)

basis for almost all computer systems

Page 7: Computer System Structure 1 © 2000 Franz Kurfess Course Overview  Introduction  Computer System Structures  Operating System Structures  Processes

Computer System Structure Computer System Structure 77 © 2000 Franz Kurfess

Hardware ArchitectureHardware Architecture

[David Jones]

CPUMain Memory

I/O Devices

System Bus

Control Unit

Reg

iste

rs

Arithmetic LogicUnit

(ALU)

Controllers

Page 8: Computer System Structure 1 © 2000 Franz Kurfess Course Overview  Introduction  Computer System Structures  Operating System Structures  Processes

Computer System Structure Computer System Structure 88 © 2000 Franz Kurfess

Computer System OperationComputer System Operation

the CPU executes machine instructions according to the program specified in the executable

the CPU can access information directly only if it is kept in main memory

CPU and I/O devices operate concurrently device controllers interface with the I/O devices

one controller may handle several devices of the same type controllers have local buffers

data are moved between main memory and the buffers of device controllers

Page 9: Computer System Structure 1 © 2000 Franz Kurfess Course Overview  Introduction  Computer System Structures  Operating System Structures  Processes

Computer System Structure Computer System Structure 99 © 2000 Franz Kurfess

CPU RegistersCPU Registers

registers are used for information that must be immediately accessible to the CPU

they are integrated on the same chip important registers are

program counter (PC) instruction register status registers stack pointer registers for data

Page 10: Computer System Structure 1 © 2000 Franz Kurfess Course Overview  Introduction  Computer System Structures  Operating System Structures  Processes

Computer System Structure Computer System Structure 1010 © 2000 Franz Kurfess

Program ExecutionProgram Execution

one machine instruction is executed after the other as specified in the executable (program)

if I/O operations are required, the program under execution is temporarily suspended, and the CPU switches to another program

interrupts are used to signal important events; they disrupt the flow of execution temporarily

Page 11: Computer System Structure 1 © 2000 Franz Kurfess Course Overview  Introduction  Computer System Structures  Operating System Structures  Processes

Computer System Structure Computer System Structure 1111 © 2000 Franz Kurfess

InterruptsInterrupts

interrupts signal the occurrence of important events in the computer system

the purpose of an interrupt is to transfer control from the current task to the OS

a software-generated interrupt is also called a trap the address of the interrupted instruction must be

preserved together with the status of the system

Page 12: Computer System Structure 1 © 2000 Franz Kurfess Course Overview  Introduction  Computer System Structures  Operating System Structures  Processes

Computer System Structure Computer System Structure 1212 © 2000 Franz Kurfess

Interrupt HandlingInterrupt Handling

the state of the system (mainly the CPU) is preserved by storing registers (program counter, status word, stack pointer,

data registers) additional information about the current program and its

state

different types of interrupts are handled by specific interrupt service routines

the addresses of the service routines are identified through the interrupt vector

Page 13: Computer System Structure 1 © 2000 Franz Kurfess Course Overview  Introduction  Computer System Structures  Operating System Structures  Processes

Computer System Structure Computer System Structure 1313 © 2000 Franz Kurfess

Simple Interrupt HandlingSimple Interrupt Handling

Interrupt occurs. CPU finishes current instruction.

CPU signals receipt of Interrupt.CPU pushes PSW, PC onto stack.

interrupt is processed.

CPU loads new PC value. May be a single value all the time might vary.

OS saves remainder of process information.

OS restores process state information.

Pops old PSW, PC values off the stack.

Hardware

Software

[David Jones]

Page 14: Computer System Structure 1 © 2000 Franz Kurfess Course Overview  Introduction  Computer System Structures  Operating System Structures  Processes

Computer System Structure Computer System Structure 1414 © 2000 Franz Kurfess

Handling of Input/Output (I/O)Handling of Input/Output (I/O)

I/O is initiated by a request from a user program, or by the OS

the request is handled by the OS via system calls I/O operations typically take much longer than the

execution of an instruction e.g. milliseconds (ms) for hard disk access vs.

nanoseconds (ns) for CPU instructions buffers in device controllers are used to diminish the

impact on the CPU

Page 15: Computer System Structure 1 © 2000 Franz Kurfess Course Overview  Introduction  Computer System Structures  Operating System Structures  Processes

Computer System Structure Computer System Structure 1515 © 2000 Franz Kurfess

Synchronous I/OSynchronous I/O

control returns to the CPU only after I/O is finished CPU is idle during that time only one outstanding I/O request

Page 16: Computer System Structure 1 © 2000 Franz Kurfess Course Overview  Introduction  Computer System Structures  Operating System Structures  Processes

Computer System Structure Computer System Structure 1616 © 2000 Franz Kurfess

Asynchronous I/OAsynchronous I/O

after the initiation of I/O, the CPU continues the execution without waiting

better resource utilization CPU is not idle simultaneous I/O activities involving different devices

more complex

Page 17: Computer System Structure 1 © 2000 Franz Kurfess Course Overview  Introduction  Computer System Structures  Operating System Structures  Processes

Computer System Structure Computer System Structure 1717 © 2000 Franz Kurfess

Storage StructureStorage Structure main memory

directly accessible by the CPU

secondary storage not directly accessible by the CPU immediately available in the computer system large storage capacity non-volatile medium

tertiary storage permanent/long-term storage large storage capacity may not be immediately available

Page 18: Computer System Structure 1 © 2000 Franz Kurfess Course Overview  Introduction  Computer System Structures  Operating System Structures  Processes

Computer System Structure Computer System Structure 1818 © 2000 Franz Kurfess

Storage HierarchyStorage Hierarchy

storage devices can be categorized according to the following criteria access speed capacity cost volatility

faster storage devices can be used as caches for slower ones

Page 19: Computer System Structure 1 © 2000 Franz Kurfess Course Overview  Introduction  Computer System Structures  Operating System Structures  Processes

Computer System Structure Computer System Structure 1919 © 2000 Franz Kurfess

Hierarchy of Storage DevicesHierarchy of Storage DevicesRegisters

Cache

Main Memory

Electronic Disk

Magnetic Disk

Optical Disk

Magnetic Tape

Page 20: Computer System Structure 1 © 2000 Franz Kurfess Course Overview  Introduction  Computer System Structures  Operating System Structures  Processes

Computer System Structure Computer System Structure 2020 © 2000 Franz Kurfess

Storage Device CharacteristicsStorage Device CharacteristicsStorageDevice

AccessSpeed

Capacity Cost Volatility

Registers nanoseconds Kbytes veryhigh

high

Cache tens ofnanoseconds

Mbytes $100 perMbyte

high

MainMemory

50-70nanoseconds

tens orhundreds of

Mbytes

$10 perMbyte

high

ElectronicDisk

100-200nanoseconds

hundreds ofMbytes

$1 perMbyte

medium(battery)

MagneticDisk

5-15milliseconds

tens of Gbytes $100 perGbyte

low

OpticalDisk

100milliseconds

hundreds ofGbytes

$10 perGbyte

low

TapeDrive

milliseconds toseconds

hundreds ofGbytes to

TBytes

$1 perGbyte

low

Page 21: Computer System Structure 1 © 2000 Franz Kurfess Course Overview  Introduction  Computer System Structures  Operating System Structures  Processes

Computer System Structure Computer System Structure 2121 © 2000 Franz Kurfess

Direct Memory Access (DMA)Direct Memory Access (DMA)

data are transferred between peripheral devices and main memory without involvement of the CPU performed by memory management unit and device

controller

CPU initiates the transfer of data blocks device controller signals the end of the transfer via an

interrupt only one interrupt per block, instead of one per word

Page 22: Computer System Structure 1 © 2000 Franz Kurfess Course Overview  Introduction  Computer System Structures  Operating System Structures  Processes

Computer System Structure Computer System Structure 2222 © 2000 Franz Kurfess

CachingCaching

frequently or recently used information is stored in quickly accessible memory

caches occur at different places in the computer system between CPU and main memory between main memory and peripheral devices (e. g. hard

disk) in device controllers; in this case, another term is buffers for specific applications (e.g. Web browsers)

Page 23: Computer System Structure 1 © 2000 Franz Kurfess Course Overview  Introduction  Computer System Structures  Operating System Structures  Processes

Computer System Structure Computer System Structure 2323 © 2000 Franz Kurfess

ProtectionProtection

dual-mode operation CPU protection memory protection I/O protection

Page 24: Computer System Structure 1 © 2000 Franz Kurfess Course Overview  Introduction  Computer System Structures  Operating System Structures  Processes

Computer System Structure Computer System Structure 2424 © 2000 Franz Kurfess

Dual-Mode OperationDual-Mode Operation

the system operates in at least two different modes user mode

“regular” execution of user programs limited access to instructions and resources

system mode execution of OS programs access to privileged instructions and resources

requires hardware support interrupt or system call initiate a switch to system

mode OS initiates switch to user mode

Page 25: Computer System Structure 1 © 2000 Franz Kurfess Course Overview  Introduction  Computer System Structures  Operating System Structures  Processes

Computer System Structure Computer System Structure 2525 © 2000 Franz Kurfess

CPU ProtectionCPU Protection

privileged instructions are only executed in system mode

timer is used to generate an interrupt after a certain time period decremented with every clock tick interrupt when it becomes 0 calculation of the current time used for time sharing

mode bit indicates status (user or system mode)

Page 26: Computer System Structure 1 © 2000 Franz Kurfess Course Overview  Introduction  Computer System Structures  Operating System Structures  Processes

Computer System Structure Computer System Structure 2626 © 2000 Franz Kurfess

Memory ProtectionMemory Protection

processes are allowed to access only their own memory ranges

OS range must be protected from user ranges memory protection is often implemented through

base and limit registers

Page 27: Computer System Structure 1 © 2000 Franz Kurfess Course Overview  Introduction  Computer System Structures  Operating System Structures  Processes

Computer System Structure Computer System Structure 2727 © 2000 Franz Kurfess

OperatingSystem

Process 5

Process 2

Process 1

Process 4

0

232,000

398,000

493,000

640,000

824,000

Memory ProtectionMemory Protection simple version, with base and limit register

1,024,000

limit register

147,000

493,000

base register

range Process 3Process 3

Page 28: Computer System Structure 1 © 2000 Franz Kurfess Course Overview  Introduction  Computer System Structures  Operating System Structures  Processes

Computer System Structure Computer System Structure 2828 © 2000 Franz Kurfess

I/O ProtectionI/O Protection

I/O instructions are privileged problem: How does a user perform I/O operations? solution: I/O requests from the user are handled by

the OS through system calls direct access to I/O devices would enable access to

sensitive information and programs

Page 29: Computer System Structure 1 © 2000 Franz Kurfess Course Overview  Introduction  Computer System Structures  Operating System Structures  Processes

Computer System Structure Computer System Structure 2929 © 2000 Franz Kurfess

Booting Booting

after powering on a computer system, its main memory is empty: how can the execution of programs be started?

a small part of the operating system (BIOS, kernel) is stored in non-volatile ROM

the CPU starts the execution of that memory section by default

more parts of the OS are loaded from secondary storage (hard disk)

after the essential parts of the OS have been installed, the execution of user programs can begin

Page 30: Computer System Structure 1 © 2000 Franz Kurfess Course Overview  Introduction  Computer System Structures  Operating System Structures  Processes

Computer System Structure Computer System Structure 3030 © 2000 Franz Kurfess

Computer System ExamplesComputer System Examples

Personal Computers IBM PC compatibles, Apple Macintosh

Workstations SUN Sparcstation, DEC Alpha, Silicon Graphics

Mainframes IBM 360 Family

Supercomputers Cray

Page 31: Computer System Structure 1 © 2000 Franz Kurfess Course Overview  Introduction  Computer System Structures  Operating System Structures  Processes

Computer System Structure Computer System Structure 3131 © 2000 Franz Kurfess

Characteristics of Computer SystemsCharacteristics of Computer Systems

usage processing power main memory size secondary storage space user interface

Page 32: Computer System Structure 1 © 2000 Franz Kurfess Course Overview  Introduction  Computer System Structures  Operating System Structures  Processes

Computer System Structure Computer System Structure 3232 © 2000 Franz Kurfess

Personal ComputersPersonal Computers

individual users limited multitasking

general-purpose applications word processing, spreadsheet, presentation, graphics,

data base, etc.

Pentium-class microprocessors tens of MBytes main memory GBytes of secondary storage space graphical user interface

resolution 800x600, hundreds of colors

Page 33: Computer System Structure 1 © 2000 Franz Kurfess Course Overview  Introduction  Computer System Structures  Operating System Structures  Processes

Computer System Structure Computer System Structure 3333 © 2000 Franz Kurfess

WorkstationsWorkstations

individual users full multitasking

special-purpose applications (high-end) graphics, animation, scientific computing and visualization,

software development, data bases, etc. RISC microprocessors

SUN Sparc, DEC Alpha, MIPS, PowerPC hundreds of MBytes main memory tens of GBytes secondary storage space graphical user interface

resolution 1600x1200, thousands or millions of colors

Page 34: Computer System Structure 1 © 2000 Franz Kurfess Course Overview  Introduction  Computer System Structures  Operating System Structures  Processes

Computer System Structure Computer System Structure 3434 © 2000 Franz Kurfess

MainframesMainframes

multiple users full multi-user (time-sharing), multitasking

often special-purpose applications (high-end) corporate information systems, transaction processing, data

base, software development, etc.

custom-specific CPUs or multiple RISC microprocessors GBytes main memory hundreds of GBytes secondary storage space alphanumeric or graphic terminal

sometimes networked PCs are used as terminals

Page 35: Computer System Structure 1 © 2000 Franz Kurfess Course Overview  Introduction  Computer System Structures  Operating System Structures  Processes

Computer System Structure Computer System Structure 3535 © 2000 Franz Kurfess

SupercomputerSupercomputer multiple users

full multi-user (time-sharing), multitasking

special-purpose applications (high-end) computation-intensive scientific computing, simulation, modeling, animation, data

mining, etc.

custom-specific CPUs or multiple RISC microprocessors

GBytes of main memory hundreds of GBytes secondary storage space networked workstations, PCs are used for access

Page 36: Computer System Structure 1 © 2000 Franz Kurfess Course Overview  Introduction  Computer System Structures  Operating System Structures  Processes

Computer System Structure Computer System Structure 3636 © 2000 Franz Kurfess

Example SupercomputerExample Supercomputer

Accelerated Strategic Computing Initiative (ASCI) Option Red currently is the world’s fastest supercomputer (Feb. 98)

more than 1 teraFLOPS (1012 floating point operations per second)

used for computer-based modeling, simulation, and virtual prototyping

Page 37: Computer System Structure 1 © 2000 Franz Kurfess Course Overview  Introduction  Computer System Structures  Operating System Structures  Processes

Computer System Structure Computer System Structure 3737 © 2000 Franz Kurfess

ASCI RedASCI Red massively parallel

9000 Pentium Pro CPUs in 4500 computing nodes additional nodes for

I/O (file and network services) service (user interaction) system nodes (diagnostics, booting)

distributed memory 128 MByte of RAM per computing node

double two-dimensional mesh interconnection network for message passing 400 MBps in each direction

two operating systems distributed Unix on service, system, and I/O nodes microkernel-based OS Cougar for computing nodes

Page 38: Computer System Structure 1 © 2000 Franz Kurfess Course Overview  Introduction  Computer System Structures  Operating System Structures  Processes

Computer System Structure Computer System Structure 3838 © 2000 Franz Kurfess

Important Concepts and TermsImportant Concepts and Terms architecture booting cache computer system CPU CPU registers direct memory access (DMA) hardware integrated circuit interrupt main memory microprocessor multiprocessing multiprogramming multitasking

operating system process process control block (PCB) peripheral device preemptive multitasking RAM registers (CPU) ROM software state of a process task thread time-sharing transistor user interface von-Neumann architecture

Page 39: Computer System Structure 1 © 2000 Franz Kurfess Course Overview  Introduction  Computer System Structures  Operating System Structures  Processes

Computer System Structure Computer System Structure 3939 © 2000 Franz Kurfess

Chapter SummaryChapter Summary

almost all computer systems are based on the von Neumann architecture CPU, memory, I/O devices, interconnection (bus)

the performance of the computer system hardware depends on that of the individual components as well as on their interaction and cooperation

the main purpose of the computer system is the execution of programs

the same computer system can be used for a variety of tasks by running different programs