1. Trang chủ
  2. » Công Nghệ Thông Tin

Lecture Operating system principles - Chapter 1 and 2: Computer system and operating system overview

54 91 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 54
Dung lượng 348,05 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

After studying this chapter, you should be able to: Describe the basic elements of a computer system and their interrelationship, eplain the steps taken by a processor to execute an instruction, discuss the evolution of operating systems for early simple batch systems to modern complex systems.

Trang 1

Chapter 1 and 2 Computer System and Operating System

Overview

– The Evolution of Operating Systems

– OS Objectives and Functions

Trang 2

Evolution of Operating Systems

• It may be easier to understand the key

requirements of an OS by considering the evolution of Operating Systems

• Stages include

– Serial Processing

– Simple Batch Systems

– Multiprogrammed Batch Systems

Trang 3

Serial Processing (late 1940s to mid-1950s)

• loading complier and source program into memory

• saving the object program

Trang 4

Simple Batch System

Trang 6

Multiprogrammed Batch Systems

• CPU is often idle

– Even with automatic job sequencing

– I/O devices are slow compared to processor

Trang 7

• Processor must wait for I/O instruction to

complete before preceding

Trang 8

• When one job needs to wait for I/O, the

processor can switch to the other job

Trang 9

Multiprogramming

Trang 10

Time Sharing Systems

• Multiple users simultaneously access the

system through terminals

Trang 11

Batch Multiprogramming

vs Time Sharing

Trang 12

Early Example: CTSS

• Compatible Time-Sharing System (CTSS)

– Developed at MIT as project MAC

• Time Slicing:

– When control was passed to a user

– User program and data loaded

– Clock generates interrupts about every 0.2

sec

Trang 13

CTSS Operation

Trang 14

– The Evolution of Operating Systems

– OS Objectives and Functions

Trang 16

Layers and Views

Trang 17

OS as Service Provider

• Program development

– e.g., editors and debuggers

• Program execution

• Access I/O devices

• Controlled access to files

• System access for shared systems

• Error detection and response

– e.g., memory error, device failure, division by zero

• Accounting for resources and performance

Trang 18

OS as Resource Manager

• A computer is a set of resources for the

movement, storage, and processing of

data.

• The OS is responsible for managing these resources.

Trang 19

OS as Resource Manager

Trang 20

– The Evolution of Operating Systems

– OS Objectives and Functions

Trang 22

Example of Program Execution

Trang 23

– The Evolution of Operating Systems

– OS Objectives and Functions

Trang 24

• Interrupt the normal sequencing of the

processor

• Provided to improve processor utilization

– Most I/O devices are slower than the

processor

– Processor must pause to wait for device

Trang 25

Flow of Control

without Interrupts

Trang 26

Interrupts and the

Instruction Cycle

Trang 27

Transfer of Control

via Interrupts

Trang 28

Instruction Cycle

with Interrupts

Trang 29

I/O Wait

Trang 30

Simple Interrupt Processing

Trang 31

Changes in Memory and

Registers for an Interrupt

Trang 32

whether they are waiting for I/O

• After an interrupt handler completes,

control may not return to the program that

Trang 33

– The Evolution of Operating Systems

– OS Objectives and Functions

Trang 34

• Faster access time, greater cost per bit

• Greater capacity, smaller cost per bit

Trang 35

The Memory Hierarchy

• Going down the

Trang 37

– The Evolution of Operating Systems

– OS Objectives and Functions

Trang 38

Cache Memory

• Processor must access memory at least

once per instruction cycle

– Processor speed faster than memory access

speed

• Exploit the principle of locality with a

small fast memory

– Data which is required soon is often close to

Trang 39

Cache Principles

• Contains copy of a portion of main memory

• Processor first checks cache

– If not found, block of memory read into cache

• Because of locality of reference, likely

future memory references are in that block

Trang 40

Cache/Main-Memory

Structure

Trang 41

Cache Read Operation

Trang 42

Cache Design Issues

• Main categories are:

Trang 43

– The unit of data exchanged between cache

and main memory

– Larger block size means more hits

– But too large reduces chance of reuse

Trang 44

– Complexity of mapping function increases

circuitry costs for searching

Trang 45

Replacement Algorithm

• Chooses which block to replace when a

new block is to be loaded into the cache.

• Ideally replacing a block that isn’t likely to

Trang 46

Write policy

• Dictates when the memory write operation takes place

• Can occur every time the block is updated

• Can occur when the block is replaced

– Minimize write operations

– Leave main memory in an obsolete state

Trang 47

– The Evolution of Operating Systems

– OS Objectives and Functions

Trang 48

I/O Techniques

• When the processor encounters an

instruction relating to I/O,

– it executes that instruction by issuing a

command to the appropriate I/O module

• Three techniques are possible for I/O

operations:

– Programmed I/O

Trang 49

• As there are no interrupts, the processor

must determine when the instruction is

complete

Trang 50

Programmed I/O Example

• Data read in a word at a

time

– Processor remains in

status-checking loop while reading

Trang 51

• The I/O module will then interrupt the

processor to request service when it is

ready to exchange data with the

processor.

Trang 52

Driven I/O

Interrupt-• Eliminates needless

waiting

– But everything passes

through processor

Trang 53

Direct Memory Access

• Performed by a separate module on the

system

• When needing to read/write, processor

issues a command to DMA module with:

– Whether a read or write is requested

– The address of the I/O device involved

– The starting location in memory to read/write

– The number of words to be read/written

Trang 54

Direct Memory Access

• I/O operation delegated to

DMA module

• Processor only involved

when beginning and

ending transfer.

• Much more efficient.

Ngày đăng: 30/01/2020, 02:42

TỪ KHÓA LIÊN QUAN