Computer System Overview OPERATING SYSTEM TOP-LEVEL COMPONENTS. Simplified view: Operating Systems. Slide 1. Slide /S2. Slide 2.

Similar documents
Computer System Overview

Computer System Overview. Chapter 1

Computer System Overview

Computer Systems Overview

Chapter 1 Computer System Overview

Q.1 Explain Computer s Basic Elements

Computer System Overview

Chapter 1 Computer System Overview

B.H.GARDI COLLEGE OF MASTER OF COMPUTER APPLICATION

GUJARAT TECHNOLOGICAL UNIVERSITY MASTER OF COMPUTER APPLICATION SEMESTER: III

Last class: Today: Course administration OS definition, some history. Background on Computer Architecture

CSC 553 Operating Systems

Misc. Third Generation Batch Multiprogramming. Fourth Generation Time Sharing. Last Time Evolution of OSs

Operating Systems: Internals and Design Principles, 7/E William Stallings. Chapter 1 Computer System Overview

CPU Structure and Function

Input / Output. School of Computer Science G51CSA

Chapter 1 Computer System Overview

Introduction to Operating. Chapter Chapter

What Operating Systems Do An operating system is a program hardware that manages the computer provides a basis for application programs acts as an int

OS And Hardware. Computer Hardware Review PROCESSORS. CPU Registers. CPU Registers 02/04/2013

Computer Organization ECE514. Chapter 5 Input/Output (9hrs)

Introduction to Operating Systems. Chapter Chapter

Part One provides a background and context for the remainder of this book.

Chapter 3. Top Level View of Computer Function and Interconnection. Yonsei University

Introduction to Operating Systems. Chapter Chapter

UNIT- 5. Chapter 12 Processor Structure and Function

Today: Computer System Overview (Stallings, chapter ) Next: Operating System Overview (Stallings, chapter ,

Architecture and OS. To do. q Architecture impact on OS q OS impact on architecture q Next time: OS components and structure

Summary of Computer Architecture

Unit 1. Chapter 3 Top Level View of Computer Function and Interconnection

C02: Interrupts and I/O

I/O. Fall Tore Larsen. Including slides from Pål Halvorsen, Tore Larsen, Kai Li, and Andrew S. Tanenbaum)

I/O. Fall Tore Larsen. Including slides from Pål Halvorsen, Tore Larsen, Kai Li, and Andrew S. Tanenbaum)

Running Applications

Computer Organization

CPU Structure and Function. Chapter 12, William Stallings Computer Organization and Architecture 7 th Edition

William Stallings Computer Organization and Architecture. Chapter 11 CPU Structure and Function

Architectural Support for Operating Systems

Top-Level View of Computer Organization

Part I Overview Chapter 1: Introduction

Last 2 Classes: Introduction to Operating Systems & C++ tutorial. Today: OS and Computer Architecture

Advanced Parallel Architecture Lesson 3. Annalisa Massini /2015

CMSC 313 Lecture 26 DigSim Assignment 3 Cache Memory Virtual Memory + Cache Memory I/O Architecture

Advanced Memory Organizations

Computer-System Architecture (cont.) Symmetrically Constructed Clusters (cont.) Advantages: 1. Greater computational power by running applications

Common Computer-System and OS Structures

5 Computer Organization

MICROPROCESSOR MEMORY ORGANIZATION

ECE331: Hardware Organization and Design

CS 134. Operating Systems. April 8, 2013 Lecture 20. Input/Output. Instructor: Neil Rhodes. Monday, April 7, 14

Computer Organization

Operating System: an Overview. Lucia Dwi Krisnawati, MA

Processing Unit CS206T

CPU Structure and Function

Chapter 3 - Top Level View of Computer Function

Input/Output Problems. External Devices. Input/Output Module. I/O Steps. I/O Module Function Computer Architecture

Computer Architecture and Organization (CS-507)

Computer Systems. Binary Representation. Binary Representation. Logical Computation: Boolean Algebra

Computer and Hardware Architecture I. Benny Thörnberg Associate Professor in Electronics

5 Computer Organization

19: I/O. Mark Handley. Direct Memory Access (DMA)

Operating System: Chap13 I/O Systems. National Tsing-Hua University 2016, Fall Semester

CS330: Operating System and Lab. (Spring 2006) I/O Systems

Generic Model of I/O Module Interface to CPU and Memory Interface to one or more peripherals

(Advanced) Computer Organization & Architechture. Prof. Dr. Hasan Hüseyin BALIK (3 rd Week)

Chapter Seven Morgan Kaufmann Publishers

I/O Management and Disk Scheduling. Chapter 11

Advanced Parallel Architecture Lesson 3. Annalisa Massini /2015

CSCI-375 Operating Systems

7/20/2008. What Operating Systems Do Computer-System Organization

CS370 Operating Systems

William Stallings Computer Organization and Architecture 10 th Edition Pearson Education, Inc., Hoboken, NJ. All rights reserved.

CHETTINAD COLLEGE OF ENGINEERING AND TECHNOLOGY COMPUTER ARCHITECURE- III YEAR EEE-6 TH SEMESTER 16 MARKS QUESTION BANK UNIT-1

CMSC 313 COMPUTER ORGANIZATION & ASSEMBLY LANGUAGE PROGRAMMING LECTURE 09, SPRING 2013

I/O Management Intro. Chapter 5

Operating Systems CMPSCI 377 Spring Mark Corner University of Massachusetts Amherst

QUESTION BANK UNIT-I. 4. With a neat diagram explain Von Neumann computer architecture

CPU issues address (and data for write) Memory returns data (or acknowledgment for write)

Designing Computers. The Von Neumann Architecture. The Von Neumann Architecture. The Von Neumann Architecture

The Von Neumann Architecture. Designing Computers. The Von Neumann Architecture. CMPUT101 Introduction to Computing - Spring 2001

I/O Devices. I/O Management Intro. Sample Data Rates. I/O Device Handling. Categories of I/O Devices (by usage)

Input Output (IO) Management

CMPUT101 Introduction to Computing - Summer 2002

Chapter 12. CPU Structure and Function. Yonsei University

Today: I/O Systems. Architecture of I/O Systems

Organisasi Sistem Komputer

William Stallings Computer Organization and Architecture

Characteristics. Microprocessor Design & Organisation HCA2102. Unit of Transfer. Location. Memory Hierarchy Diagram

I/O Systems. Jo, Heeseung

Interrupt/Timer/DMA 1

Operating System Control Structures

I/O Design, I/O Subsystem, I/O-Handler Device Driver, Buffering, Disks, RAID January WT 2008/09

Computer & Microprocessor Architecture HCA103

Operating system Dr. Shroouq J.

Module 5 - CPU Design

Operating Systems: Internals and Design Principles. Chapter 1 Computer System Overview Seventh Edition By William Stallings

2 MARKS Q&A 1 KNREDDY UNIT-I

UC Santa Barbara. Operating Systems. Christopher Kruegel Department of Computer Science UC Santa Barbara

Computer-System Organization (cont.)

Author : Dalbir Singh, Computer Science Deptt. CPU Structure and Functions. 1. Processor Organization

Transcription:

BASIC ELEMENTS Simplified view: Processor Slide 1 Computer System Overview Operating Systems Slide 3 Main Memory referred to as real memory or primary memory volatile modules 2004/S2 secondary memory devices communications equipment terminals System bus communication among processors, memory, and modules OPERATING SYSTEM Provides an abstraction layer over the concrete hardware TOP-LEVEL COMPONENTS Slide 2 Allocation of resources Processor Memory devices Slide 4 Monitor Keyboard Floppy disk drive Hard disk drive Optimisation of resource utilisation Protection and Security CPU Memory Video controller Keyboard controller Floppy disk controller Hard disk controller Understanding operating systems therefore requires some basic understanding of computer systems Bus BASIC ELEMENTS 1 EXAMPLE: LARGE PENTIUM SYSTEM 2

EXAMPLE: LARGE PENTIUM SYSTEM Cache bus Local bus Memory bus PROCESSOR REGISTERS Slide 5 Level 2 cache CPU PCI bridge PCI bus Main memory Slide 7 Data and address registers Hold operands of most native machine instructions Enable programmer to minimize main-memory references by optimizing register use user-visible SCSI Mouse USB Key- board ISA bridge IDE disk ISA bus Graphics adaptor Mon- itor Available PCI slot Control and status registers Used by processor to control operating of the processor Used by operating-system routines to control the execution of programs Sometimes not accessible by user (architecture dependent) Modem Sound card Printer Available ISA slot PROCESSOR USER-VISIBLE REGISTERS Slide 6 Fetches intructions from memory, decodes and executes them Set of instructions is processor specific Instructions include: load value from memory into register combine operands from registers or memory branch All CPU s have registers to store key variables and temporary results information related to control program execution Slide 8 May be referenced by machine language instructions Available to all programs - application programs and system programs Types of registers Data Address Index Segment pointer Stack pointer Many architectures do not distinguish different types PROCESSOR REGISTERS 3 CONTROL AND STATUS REGISTERS 4

CONTROL AND STATUS REGISTERS Counter (PC) INSTRUCTION FETCH AND EXECUTE counter (PC) holds address of the instruction to be fetched next Slide 9 Contains the address of an instruction to be fetched Instruction Register (IR) Contains the instruction most recently fetched Slide 11 The processor fetches the instruction from memory counter is incremented after each fetch Overlapped on modern architectures (pipelining) Processor Status Word (PSW) Fetch Cycle Execute Cycle condition codes interrupt enable/disable supervisor/user mode START Fetch Next Instruction Execute Instruction HALT INSTRUCTION REGISTER Slide 10 CONTROL AND STATUS REGISTERS Condition Codes or Flags Bits set by the processor hardware as a result of operations Can be accessed by a program but not altered Examples positive/negative result zero overflow Slide 12 Fetched instruction is placed in the instruction register Types of instructions Processor-memory transfer data between processor and memory Processor- data transferred to or from a peripheral device Data processing arithmetic or logic operation on data Control alter sequence of execution INSTRUCTION FETCH AND EXECUTE 5 INTERACTION BETWEEN PROCESSOR AND DEVICES 6

INTERRUPT CYCLE ➀ Fetch next instruction Slide 13 INTERACTION BETWEEN PROCESSOR AND DEVICES CPU much faster than devices - waiting for operation to finish is inefficient - not feasible for mouse, keyboard Slide 15 ➁ Execute instruction ➂ Check for interrupt ➃ If no interrupts, fetch the next instruction ➄ If an interrupt is pending, divert to the interrupt handler Fetch Cycle Execute Cycle Cycle module sends an interrupt to CPU to signal completion s normal sequence of execution s are also used to signal other events START Fetch Next Instruction s Disabled Execute Instruction s Enabled Check for ; Process HALT CLASSES OF INTERRUPTS Asynchronous (external) events Slide 14 Timer Hardware failure Synchronous interrupts or program exceptions caused by program execution: arithmetic overflow division by zero execute illegal instruction reference outside user s memory space Slide 16 INTERRUPT HANDLER A program that determines nature of the interrupt and performs whatever actions are needed Control is transferred to this program by the hardware Generally part of the operating system INTERRUPT CYCLE 7 CONTROL FLOW WITH AND WITHOUT INTERRUPTS 8

CONTROL FLOW WITH AND WITHOUT INTERRUPTS User User User 1 4 Command 1 4 Command 1 4 Command MULTIPLE INTERRUPTS Slide 17 2 3 5 END 2a 2b 3a 3b * * Handler 5 END 2 3 Handler 5 END Slide 19 Sequential Order: Disable interrupts so processor can complete task s remain pending until the processor enables interrupts After interrupt handler routine completes, the processor checks for additional interrupts (a) No interrupts (b) s; short wait (c) s; long wait MULTIPLE INTERRUPTS User Handler X Slide 18 X occurs CPU disables all interrupts (only those with lower priority) handler may enable interrupts Y occurs Sequential or nested interrupt handling (a) Sequential interrupt processing User Handler X Handler Y Handler Y Slide 20 Priorities: MULTIPLE INTERRUPTS Higher priority interrupts cause lower-priority interrupts to wait Causes a lower-priority interrupt handler to be interrupted Example: when input arrives from communication line, it needs to be absorbed quickly to make room for more input (b) Nested interrupt processing MULTIPLE INTERRUPTS 9 MEMORY 10

MEMORY Slide 21 Sould be fast abundant cheap Unfortunately, that s not the reality... Solution: combination of fast & expensive and slow & cheap memory Slide 23 Decreasing cost per bit Increasing capacity Increasing access time GOING DOWN THE HIERARCHY Decreasing frequency of access of the memory by the processor Locality of reference is essential! MEMORY HIERARCHY DISK CACHE Typical access time Typical capacity A portion of main memory used as a buffer to temporarily to hold data for the disk Slide 22 1 nsec 2 nsec 10 nsec 10 msec 100 sec Registers Cache Main memory Magnetic disk Magnetic tape <1 KB 1 MB 64-512 MB 5-50 GB 20-100 GB Slide 24 Disk writes are clustered Some data written out may be referenced again. The data are retrieved rapidly from the software cache instead of slowly from disk Mostly transparent to operating system GOING DOWN THE HIERARCHY 11 CACHE MEMORY 12

Word Transfer CACHE MEMORY Block Transfer Cache size CACHE DESIGN small caches have a significant impact on performance Slide 25 CPU Cache Contains a portion of main memory Processor first checks cache Main Memory If not found in cache, the block of memory containing the needed information is moved to the cache replacing some other data Slide 27 Line size (block size) the unit of data exchanged between cache and main memory hit means the information was found in the cache larger line size higher hit rate until probability of using newly fetched data becomes less than the probability of reusing data that has been moved out of cache CACHE/MAIN MEMORY SYSTEM CACHE DESIGN Slide 26 Line Number Tag Block 0 1 2 C 1 Block Length (K Words) (a) Cache Memory address 0 1 2 3 2 n 1 Word Length (b) Main memory Block (K words) Block Slide 28 Mapping function determines which cache location the data will occupy Replacement algorithm determines which line to replace Least-Recently-Used (LRU) algorithm Write policy When the memory write operation takes place Can occur every time line is updated (write-through policy) Can occur only when line is replaced (write-back policy) Minimizes memory operations Leaves memory in an obsolete state CACHE DESIGN 13 INTERACTION BETWEEN DEVICES AND PROCESSOR 14

Issue Read command to module CPU Do something else INTERACTION BETWEEN DEVICES AND PROCESSOR Controller (chip or set of chips) provides a simple interface to OS INTERRUPT-DRIVEN Read status of module CPU Slide 29 - often, embedded OS running on the controller Software that communicates with controller is called device driver Most drivers run in kernel mode To put new driver into kernel, system may have to - be relinked - be rebooted - dynamically load new driver Slide 31 Processor is interrupted when module ready to exchange data Processor is free to do other work No needless waiting Consumes a lot of processor time because every word read or written passes through the processor No Ready Check status Read word from Module Write word into memory Done? Error condition CPU CPU memory Yes Next instruction (b) -driven Issue Read command to module CPU Slide 30 PROGRAMMED (POLLING) module performs the action, not the processor Sets appropriate bits in the status register No interrupts occur Processor checks status until operation is complete Wastes CPU cycles No Read status of module Not ready Ready Check status Read word from Module Write word into memory Done? CPU Error condition CPU CPU memory Slide 32 DIRECT MEMORY ACCESS Transfers a block of data directly to or from memory An interrupt is sent when the task is complete The processor is only involved at the beginning and end of the transfer Issue Read block command to module Read status of DMA module Next instruction CPU DMA Do something else DMA CPU Yes Next instruction (a) med INTERRUPT-DRIVEN 15 DIRECT MEMORY ACCESS 16