1. Computer System Structure and Components



Similar documents
Computer-System Architecture

Operating Systems. Lecture 03. February 11, 2013

Lesson Objectives. To provide a grand tour of the major operating systems components To provide coverage of basic computer system organization

Chapter 2: Computer-System Structures. Computer System Operation Storage Structure Storage Hierarchy Hardware Protection General System Architecture

Lecture 1 Operating System Overview

Chapter 1 Computer System Overview

Chapter 1: Introduction. Chapter 1: Introduction. Operating System Concepts, 7th Edition. Objectives

CSC 2405: Computer Systems II

Operating Systems Overview

Have both hardware and software. Want to hide the details from the programmer (user).

Operating Systems 4 th Class

Computer Organization & Architecture Lecture #19

Introduction. What is an Operating System?

COMPUTER HARDWARE. Input- Output and Communication Memory Systems

Chapter 11 I/O Management and Disk Scheduling

COS 318: Operating Systems. I/O Device and Drivers. Input and Output. Definitions and General Method. Revisit Hardware

Computer Systems Structure Input/Output

Chapter 2 Basic Structure of Computers. Jin-Fu Li Department of Electrical Engineering National Central University Jungli, Taiwan

Central Processing Unit

Input / Output and I/O Strategies

INPUT/OUTPUT ORGANIZATION

CS161: Operating Systems

Operating Systems Prof. Ashok K Agrawala

CS 6290 I/O and Storage. Milos Prvulovic

Input/output (I/O) I/O devices. Performance aspects. CS/COE1541: Intro. to Computer Architecture. Input/output subsystem.

I/O Device and Drivers

ADVANCED PROCESSOR ARCHITECTURES AND MEMORY ORGANISATION Lesson-17: Memory organisation, and types of memory

Virtual vs Physical Addresses

Storage. The text highlighted in green in these slides contain external hyperlinks. 1 / 14

I/O. Input/Output. Types of devices. Interface. Computer hardware

Computer Performance. Topic 3. Contents. Prerequisite knowledge Before studying this topic you should be able to:

Linux Process Scheduling Policy

Devices and Device Controllers

The PC Boot Process - Windows XP.

Chapter Introduction. Storage and Other I/O Topics. p. 570( 頁 585) Fig I/O devices can be characterized by. I/O bus connections

Chapter 2: OS Overview

Chapter 13. PIC Family Microcontroller

SYSTEM ecos Embedded Configurable Operating System

Chapter 3: Operating-System Structures. System Components Operating System Services System Calls System Programs System Structure Virtual Machines

Programming Interface. for. Bus Master IDE Controller. Revision 1.0

OPERATING SYSTEMS STRUCTURES

Microprocessor & Assembly Language

Intel DPDK Boosts Server Appliance Performance White Paper

Introduction to Operating Systems. Perspective of the Computer. System Software. Indiana University Chen Yu

Review from last time. CS 537 Lecture 3 OS Structure. OS structure. What you should learn from this lecture

Introduction. System Calls

CPS104 Computer Organization and Programming Lecture 18: Input-Output. Robert Wagner

Operating System Tutorial

Chapter 11: Input/Output Organisation. Lesson 06: Programmed IO

Lecture 6: Interrupts. CSC 469H1F Fall 2006 Angela Demke Brown

Introduction Disks RAID Tertiary storage. Mass Storage. CMSC 412, University of Maryland. Guest lecturer: David Hovemeyer.

How To Understand And Understand An Operating System In C Programming

2-Serial/1-Parallel Port PCI Adapter RC303 User Manual

Keil C51 Cross Compiler

A+ Guide to Managing and Maintaining Your PC, 7e. Chapter 1 Introducing Hardware

Process Description and Control william stallings, maurizio pizzonia - sistemi operativi

Chapter 3 Operating-System Structures

Chapter 1: Introduction. Operating System Concepts 9 th Edit9on

COMPUTER ARCHITECTURE. Input/Output

The Real-Time Operating System ucos-ii

Chapter 02: Computer Organization. Lesson 04: Functional units and components in a computer organization Part 3 Bus Structures

MICROPROCESSOR AND MICROCOMPUTER BASICS

Price/performance Modern Memory Hierarchy

Last Class: OS and Computer Architecture. Last Class: OS and Computer Architecture

Fastboot Techniques for x86 Architectures. Marcus Bortel Field Application Engineer QNX Software Systems

IOMMU: A Detailed view

An Introduction to the ARM 7 Architecture

Big Picture. IC220 Set #11: Storage and I/O I/O. Outline. Important but neglected

ELEC 377. Operating Systems. Week 1 Class 3

Phoenix SecureCore TM Setup Utility

Parts of a Computer. Preparation. Objectives. Standards. Materials Micron Technology Foundation, Inc. All Rights Reserved

Read this before starting!

AN LPC1700 timer triggered memory to GPIO data transfer. Document information. LPC1700, GPIO, DMA, Timer0, Sleep Mode

Microkernels, virtualization, exokernels. Tutorial 1 CSC469

Hello, and welcome to this presentation of the STM32 SDMMC controller module. It covers the main features of the controller which is used to connect

Computers. Hardware. The Central Processing Unit (CPU) CMPT 125: Lecture 1: Understanding the Computer

Last Class: OS and Computer Architecture. Last Class: OS and Computer Architecture

Operating System Overview. Otto J. Anshus

System Virtual Machines

The I2C Bus. NXP Semiconductors: UM10204 I2C-bus specification and user manual HAW - Arduino 1

Operating system Dr. Shroouq J.

Quiz for Chapter 6 Storage and Other I/O Topics 3.10

The Secrets of RS-485 Half-duplex Communication

Overview and History of Operating Systems

Linux Driver Devices. Why, When, Which, How?

Virtual Machines. COMP 3361: Operating Systems I Winter

Processes and Non-Preemptive Scheduling. Otto J. Anshus

An Implementation Of Multiprocessor Linux

AN141 SMBUS COMMUNICATION FOR SMALL FORM FACTOR DEVICE FAMILIES. 1. Introduction. 2. Overview of the SMBus Specification. 2.1.

Objectives. Chapter 2: Operating-System Structures. Operating System Services (Cont.) Operating System Services. Operating System Services (Cont.

Computer Organization and Architecture

NetStream (Integrated) Technology White Paper HUAWEI TECHNOLOGIES CO., LTD. Issue 01. Date

Operating System Structures

Chapter 16: Virtual Machines. Operating System Concepts 9 th Edition

DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING Question Bank Subject Name: EC Microprocessor & Microcontroller Year/Sem : II/IV

Transcription:

1 Computer System Structure and Components Computer System Layers Various Computer Programs OS System Calls (eg, fork, execv, write, etc) KERNEL/Behavior or CPU Device Drivers Device Controllers Devices Software Hardware Figure 1 Conceptual Layers of Computer System in more detail Hardware Components of Computer System CPU, Device Controllers, Devices, and Bus An Example of Computer System Structure Memory CPU Memory Disk Printer System Bus Figure 2 Example of a Computer System Structure 1

2 Interrupt and Trap Definition: Software or hardware mechanism used to signal the occurrence of an event (Sending an event signal to the CPU) Examples: Completion of an I/O operation, Invalid operation (eg, division by zero), Invalid memory or file access, etc Type of Interrupts Hardware interrupt: generated by hardware (eg, device, CPU timer, hardware failure such as parity error and power failure, etc) Software Interrupt: generated by software (eg, Kernel code for a system call) Traps: Software interrupt caused by an exceptional software condition or error (eg, divide by zero, incorrect use of an instruction, etc) Motivations of Interrupts Efficiency: Does not waist CPU time to poll to devices to check the status of the device Fast response of CPU: CPU can be aware of an event as soon as it occurs (no polling) Interrupt Processing 1) Event occurs and CPU is interrupted 2) CPU stops current process (job) 3) Disable interrupt 4) CPU stores the information related to the current process (eg, program counter, contents of registers, etc) 5) OS looks up the interrupt service table (interrupt vector table) and find the corresponding interrupt service routine 6) Executes the interrupt service routine 7) Resume the interrupted process 8) Enable interrupt Another polling problem: CPU needs to know who triggered an interrupt Solution 1: Polling (polling overhead) Solution 2: Each interrupt has only one generator (interrupt table and routines are augmented/duplicated) Device Status Table: Each entry indicates the status (eg, busy and idle) of the corresponding device When the status is busy, the requests are queued and processed later when the device becomes idle A device entry can have a chain of the requests for the device 2

3 I/O Structure Programmed I/O 1) Application program (process) calls an I/O system call and waits for the I/O to complete driver 3) Device driver fills the registers of the device and signal start 4) The device starts the I/O and CPU checks the flag register of the device periodically (polling overhead) 5) After each unit I/O, the device sets the flag in its register 6) CPU finds the flag and moves the data to/from the main memory from/to the s buffer 7) Repeat from 2, 3, or 4) 1 to 6) until all data is transferred to/from the device CPU time is wasted (polling I/O devices) Interrupt-driven I/O 1) Application program (process) calls an I/O system call and waits for the I/O completion driver 3) Device driver fills the registers of the device and signal start 4) The device starts the I/O and CPU is free from the polling 5) After each unit I/O, the device generates an interrupt signal 6) CPU stops current process and moves the data to/from main memory from/to the s buffer 7) Repeat from 2, 3, or 4) to 6) until all data are transferred to/from the device CPU is free from the polling Thus, CPU can process another job while the device is working on 4) and 5) However, in a high-speed device, such as disk, step 4) is fast and frequently interrupts the CPU As a result, the CPU must switch to the interrupt routines very frequently to move the data in the buffer to main memory (switching overhead) Good for byte (or word)-based slower devices (eg, keyboard, serial port) Direct Memory Access (DMA) 1) Application program (process) calls an I/O system call and waits for the I/O completion driver with a destination (main memory location) 3) Device driver fills the registers in the device and signal start 4) The device starts the I/O and the CPU is free from the polling 1 Depends on the OS, device, device driver, and the device 3

5) After each unit I/O, the device (or DMA ) moves the data to/from the main memory from/to the s buffer 6) Repeat from 2, 3, or 4) and 5) until all data are transferred to/from the device 7) Device generates an interrupt signal Since the device accesses main memory frequently, CPU processes other jobs at a slower speed Good for block-based fast I/O devices (eg, disk and tape, usually block size is 512, 1K, 2K, or 4K bytes) Memory-Mapped I/O Ranges of main memory addresses are directly mapped to separate device registers So, I/O is main memory access To perform I/O, CPU reads or writes data in these specific memory locations After the read/write, the data keep flow through the system bus and duplicated in the device s registers Then, device performs I/O and the data transferred to the s registers are also duplicated in the main memory Additional memory overhead Good for very fast byte (word)-based devices (eg, video display) Capacity 4 Storage Structure Read/Write through Registers Internal Cache External Cache Main memory Electronic Disk (eg, Flash cards) Magnetic Disk (eg, Hard disk) Access speed Optical Disk (eg, CD-ROM) Figure 3 Storage-device hierarchy Coherency and Consistency problem: multiple copies of data (see Read/Write through on Figure 3) The problem is more complex in tightly-coupled systems 4

The problem is much more complex in loosely-coupled systems 5 Hardware Protection Example 1 An application program is trying to write on OS kernel code in main memory Example 2 An application program is trying to write on another program in main memory Example 3 An application runs infinite loop and hold CPU time infinitely Example 4 An application program prints indefinitely long data repeatedly Solution: Modern computer systems attack this problem by using dual-mode operation In dual-mode systems, only OS can access I/O devices, memory, and CPU in its monitor mode User s process will never be allowed to directly access system resources Application programs access these resources through system calls indirectly (cf, OS needs hardware mode bit for this solution: 8088 does not have it, after 80486 supports this bit and, as a result, Windows/NT and OS/2 support dual mode operation) OS may needs CPU timer and two additional memory registers (base and limit) 5