24
CSci 3753: Systems Gary Nutt Department of Computer Science University of Colorado

CSci 3753: Systems

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: CSci 3753: Systems

CSci 3753: Systems

Gary Nutt

Department of Computer Science

University of Colorado

Page 2: CSci 3753: Systems

Introduction

Page 3: CSci 3753: Systems

Why Study OS?

¥ Understand model of operationÐ Easier to see how to use the system

Ð Enables you to write efficient code

¥ Learn to design an OS

¥ Even so, OS is pure overhead of real work

¥ Application programs have the real value toperson who buys the computer

Page 4: CSci 3753: Systems

System Software

¥ Independent of applications, but common toall

¥ ExamplesÐ C library functions

Ð A window system

Ð A database management system

Ð Resource management functions

Page 5: CSci 3753: Systems

Purpose of an OS(What is Resource Management?)¥ Process: An executing program

¥ Resource: Anything that is needed for aprocess to runÐ Memory

Ð Space on a disk

Ð The CPU

¥ ÒAn OS creates resource abstractionsÓ

¥ ÒAn OS manages resource sharingÓ

Page 6: CSci 3753: Systems

Resource Abstractionload(block, length, device);seek(device, 236);out(device, 9)

Page 7: CSci 3753: Systems

Resource Abstractionload(block, length, device);seek(device, 236);out(device, 9)

write(char *block, int len, int device,int track, int sector) {

... load(block, length, device); seek(device, 236); out(device, 9); ...}

Page 8: CSci 3753: Systems

Resource Abstractionload(block, length, device);seek(device, 236);out(device, 9)

write(char *block, int len, int device,int track, int sector) {

... load(block, length, device); seek(device, 236); out(device, 9); ...}

write(char *block, int len, int device,int addr);

Page 9: CSci 3753: Systems

Resource Abstractionload(block, length, device);seek(device, 236);out(device, 9)

write(char *block, int len, int device,int track, int sector) {

... load(block, length, device); seek(device, 236); out(device, 9); ...}

write(char *block, int len, int device,int addr);

fprintf(fileID, Ò%dÓ, datum);

Page 10: CSci 3753: Systems

Abstract Resources

Hardware Resources

OS

OS Resources (OS Interface)

Middleware

Abstract Resources (API)

Application

User Interface

Page 11: CSci 3753: Systems

Resource Sharing

¥ Space- vs time-multiplexed sharing

¥ To control sharing, must be able to isolateresources

¥ OS usually provides mechanism to isolate,then selectively allows sharingÐ How to isolate resources

Ð How to be sure that sharing is acceptable

¥ Concurrency

Page 12: CSci 3753: Systems

Multiprogramming¥ Technique for sharing the CPU among

runnable processesÐ Process may be blocked on I/O

Ð Process may be blocked waiting for otherresource

¥ While one process is blocked, anothershould be able to run

¥ Multiprogramming OS accomplishes CPUsharing ÒautomaticallyÓ

¥ Reduced time to run all processes

Page 13: CSci 3753: Systems

How Multiprogramming Works

Process 1

Process 2

Process 3

Process 4

Space-multiplexed Memory

Time-multiplexed CPU

Page 14: CSci 3753: Systems

OS Strategies

¥ Batch processing

¥ Timesharing

¥ Personal computer & workstations

¥ Process control & real-time

¥ Network

¥ Distributed

Page 15: CSci 3753: Systems

Batch Processing

¥ Uses multiprogramming

¥ Job (file of OS commands) prepared offline

¥ Batch of jobs given to OS at one time

¥ OS processes jobs one-after-the-other

¥ No human-computer interaction

¥ OS optimizes resource utilization

¥ Batch processing (as an option) still usedtoday

Page 16: CSci 3753: Systems

Timesharing¥ Uses multiprogramming

¥ Support interactive computing model(Illusion of multiple consoles)

¥ Different scheduling & memory allocationstrategies than batch

¥ Tends to propagate processes

¥ Considerable attention to resource isolation(security & protection)

¥ Tend to optimize response time

Page 17: CSci 3753: Systems

Personal Computers

¥ CPU sharing among one personÕs processes

¥ Power of computing for personal tasksÐ Graphics

Ð Multimedia

¥ Trend toward very small OS

¥ OS focus on resource abstraction

¥ Rapidly evolved to Òpersonal multitaskingÓsystems

Page 18: CSci 3753: Systems

Process Control & Real-Time

¥ Computer is dedicated to a single purpose

¥ Classic embedded system

¥ Must respond to external stimuli in fixedtime

¥ Continuous media popularizing real-timetechniques

¥ An area of growing interest

Page 19: CSci 3753: Systems

Networks

¥ LAN (Local Area Network) evolution

¥ 3Mbps (1975) -> 10 Mbps (1980)->100Mbps (1990)

¥ High speed communication means new wayto do computingÐ Shared files

Ð Shared memory

Ð ???

Page 20: CSci 3753: Systems

Distributed OS

¥ Wave of the future

Distributed OS

App App

App

App

AppApp

Multiple Computers connected by a Network

Page 21: CSci 3753: Systems

Evolution of Modern OS

Modern OS

Batch

Timesharing

PC & Wkstation

Network OS

Real-TimeMemory Mgmt

ProtectionScheduling

FilesDevices

Memory Mgmt

ProtectionScheduling

System software

Human-Computer Interface

Client-Server Model

Protocols

Scheduling

Page 22: CSci 3753: Systems

Examples of Modern OS¥ UNIX variants -- have evolved since 1970

¥ Windows NT -- has evolved since 1989(much more modern than UNIX)

¥ Research OS -- still evolving É

¥ Book uses Linux as main example

¥ This course will use Windows NT as themain exampleÐ Lab exercises will use NT

Ð Supplementary materials will be made available

Page 23: CSci 3753: Systems

Microsoft Windows NT

¥ Heavily window-oriented

¥ Foundation behavior is windows-independentÐ We will focus on the foundationÐ Use only the ÒMS-DOS promptÓ -- cmd.exe

OS API

NT Kernel

NT User Interfaceand Graphics

NT Executive

Page 24: CSci 3753: Systems

Windows NT (cont)¥ OS API has text orientation (like UNIX)

¥ Object-oriented implementation

¥ Heavy use of threads

¥ Broad spectrum of synchronization tools

¥ Modern I/O system