1B11 Operating Systems. Input/Output and Devices



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

CS 3530 Operating Systems. L02 OS Intro Part 1 Dr. Ken Hoganson

Chapter 11 I/O Management and Disk Scheduling

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

Computer Organization & Architecture Lecture #19

Chapter 6, The Operating System Machine Level

Obj: Sec 1.0, to describe the relationship between hardware and software HW: Read p.2 9. Do Now: Name 3 parts of the computer.

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

Devices and Device Controllers

I/O Device and Drivers

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

1. Computer System Structure and Components

Chapter 3. Operating Systems

Operating Systems. Lecture 03. February 11, 2013

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

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

NCH Software Warp Speed PC Tune-up Software

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

Avaya Remote Feature Activation (RFA) User Guide

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

Introduction. What is an Operating System?

Operating Systems 4 th Class

OPERATING SYSTEMS STRUCTURES

Operating Systems. Notice that, before you can run programs that you write in JavaScript, you need to jump through a few hoops first

Chapter 1 Computer System Overview

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

Chapter 3: JavaScript in Action Page 1 of 10. How to practice reading and writing JavaScript on a Web page

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

Operating Systems: Basic Concepts and History

How To Understand And Understand An Operating System In C Programming

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

OPERATING SYSTEM SERVICES

Advanced ColdFusion 4.0 Application Development Server Clustering Using Bright Tiger

CS 377: Operating Systems. Outline. A review of what you ve learned, and how it applies to a real operating system. Lecture 25 - Linux Case Study

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

Example of Standard API

CSC 2405: Computer Systems II

Operating System Structures

Chapter 11 I/O Management and Disk Scheduling

Teach yourself Android application development - Part I: Creating Android products

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

Computer-System Architecture

(Cat. No SI) Product Data

Input / Output and I/O Strategies

Device Management Functions

Operating System Tutorial

WINMAG Graphics Management System

The Real-Time Operating System ucos-ii

CS161: Operating Systems

lesson 1 An Overview of the Computer System

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

LSN 10 Linux Overview

Overview and History of Operating Systems

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

Computer Systems Structure Input/Output

CS5460: Operating Systems. Lecture: Virtualization 2. Anton Burtsev March, 2013

Operating Systems OBJECTIVES 7.1 DEFINITION. Chapter 7. Note:

13 Managing Devices. Your computer is an assembly of many components from different manufacturers. LESSON OBJECTIVES

Introduction to XSL. Max Froumentin - W3C

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

Chapter 10 Case Study 1: LINUX

Computer Architecture Prof. Mainak Chaudhuri Department of Computer Science and Engineering Indian Institute of Technology, Kanpur

Storage and File Systems. Chester Rebeiro IIT Madras

Lecture 5. User-Mode Linux. Jeff Dike. November 7, Operating Systems Practical. OSP Lecture 5, UML 1/33

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

Operating System Software

System Virtual Machines

Operating System Fundamentals Robert Power & Robert Ford

Machine Architecture and Number Systems. Major Computer Components. Schematic Diagram of a Computer. The CPU. The Bus. Main Memory.

3.3 SOFTWARE RISK MANAGEMENT (SRM)

OSes. Arvind Seshadri Mark Luk Ning Qu Adrian Perrig SOSP2007. CyLab of CMU. SecVisor: A Tiny Hypervisor to Provide

Operating System Organization. Purpose of an OS

Fall Lecture 1. Operating Systems: Configuration & Use CIS345. Introduction to Operating Systems. Mostafa Z. Ali. mzali@just.edu.

SYSTEM ecos Embedded Configurable Operating System

Lecture 7 Datalink Ethernet, Home. Datalink Layer Architectures

Technology in Action. Alan Evans Kendall Martin Mary Anne Poatsy. Eleventh Edition. Copyright 2015 Pearson Education, Inc.

A virtual terminal program for data transfer between a Data General MicroNOVA laboratory computer and a DECsystem-l0 timesharing system

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

CSE 120 Principles of Operating Systems. Modules, Interfaces, Structure

Exceptions in MIPS. know the exception mechanism in MIPS be able to write a simple exception handler for a MIPS machine

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

Lecture 25 Symbian OS

1/5/2013. Technology in Action

Operating Systems. and Windows

Hypervisor: Requirement Document (Version 3)

Block diagram of typical laptop/desktop

Chapter 2: OS Overview

In some states, however, the couple must live apart for a period of months or years before they can obtain a no fault divorce.

1 PERSONAL COMPUTERS

Computer Organization

Operating system Dr. Shroouq J.

KVM: Kernel-based Virtualization Driver

Linux Kernel Architecture

CPS221 Lecture: Operating System Structure; Virtual Machines

Primary Memory. Input Units CPU (Central Processing Unit)

SNMP Reference Guide for Avaya Communication Manager

BIOS Update Release Notes

BIOS Update Release Notes

Reprise: what an operating system does. How applications use the operating system

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

Transcription:

University Coege London 1B11 Operating Systems Input/Output and s Prof. Steve R Wibur s.wibur@cs.uc.ac.uk Lecture Objectives How do the bits of the I/O story fit together? What is a device driver? 1B11-5 1999 Side 2 12/06/99 1

s Department of Computer Science University Coege London There are ots of different devices that can be attached to a computer: o Storage magnetic, optica disk, tape, etc. o Dispay, Keyboard, Pointer (mouse,tracker) o Network Interface Card o Audio, Video o Robot arms, toaster, coffee machine, 350bhp Chryser V8 eectronic ignition engine management system Good to have a unified interface in OS 1B11-5 1999 Side 3 Drivers Software in OS to manage I/O to a device is caed a device driver s can source or sink data s may need to be controed in specific ways, e.g. rewind So an OO design for a generic device driver might incude two casses, each with a set of methods: o open(), read(), write(), cose() o contro(), hande_event() Unix (Unified Interface to everything) has simiar interface to devices fies and networks! 1B11-5 1999 Side 4 12/06/99 2

University Coege London Drivers - 2 A device driver abstracts specific device hardware into a generic mode of I/O device Resut is abstract modes of disks, tapes, screens etc. Makes it easy to port OS and appications to new hardware - device independence Internay, device driver is programmed with detais of specific device, but presents reevant abstraction at its interface 1B11-5 1999 Side 5 Drivers - 3 However, we can t be competey generic s can be cassed broady into a sma number of categories: o character (byte) devices o ] modem, keyboard, maybe mouse bock (buk) devices ] disk, net, screen Categories are an engineering trade-off to keep reasonabe efficiency and functionaity 1B11-5 1999 Side 6 12/06/99 3

University Coege London Interna to Driver Driver needs to cope with device characteristics: ] poed, DMA and interrupts ] memory mapped ] device controer commands etc So typica device driver incudes: ] initiaise device (at OS boot time) ] start output ] start input ] contro device (seek or rewind) ] shutdown device (at OS shutdown time) ] interrupt service routine for input (and output and contro) 1B11-5 1999 Side 7 The Big Picture User Space Threads Library Appication ISAM Library Fie Extra Library OS Interface System Ca Hander (TRAPs) Generic fie and I/O Hander Kerne Space Disk Driver Keyb d Driver Screen Driver Disk Driver Hardware C Disk C C C Keyb d Screen Disk 1B11-5 1999 Side 8 12/06/99 4

University Coege London Exampe - Write to Disk Simpified version! User makes system ca to write specified bock of data to disk Processor switches to kerne mode System Ca Hander invoked (TRAP) and sysca parameters checked Generic fie and I/O Hander caed (TRAP function indicates I/O) User data copied to OS buffer or ocked to prevent it being swapped out whie I/O pending (or overwritten by user if asynchronous I/O) driver start() method caed - buffer passed as argument driver adds buffer to queue of pending I/O requests o may order queue e.g. to minimise disk head movement o wi get processed in due course Return to generic I/O hander which suspends user process and resumes next ready process 1B11-5 1999 Side 9 Exampe - Write to Disk - 2 Other side of device driver When a disk transfer compete interrupt occurs (from earier transfer) interrupt service routine (ISR) removes indicates competion detais in buffer and removes bocked indicator from that Ps PCB for the scheduer to use Look on pending request Q for new work, set up DMA registers for transfer and start transfer Return from interrupt Notes: o if no new work the ISR just returns o if Q is empty when start() is caed the device driver wi start the transfer immediatey 1B11-5 1999 Side 10 12/06/99 5

University Coege London Interrupt Service Routines These are instaed by the device initiaisation code (boot time) o by adding them to the jump tabe in the generic interrupt hander for the device s interrupt eve They are caed by the device controer (C in diagram) sending an interrupt signa to the processor ISR then saves a sma part of the current context (OS or User) and jumps to the code for the hander.. Which saves any extra state, and deas with it. 1B11-5 1999 Side 11 Buffers Bock mode DMA devices need buffers (for queueing data between the device and the user) The operating system keeps and manages a poo of these bocks of memory - typicay of severa different sizes, for different cases 1B11-5 1999 Side 12 12/06/99 6

University Coege London 1 Driver I/O Request Q Procedure ca Data transfer Interrupt 3 c Generic I/O hander 2 Start() Interrupt Service Routine b Generic (first eve) Interrupt Hander Driver d a Controer 1B11-5 1999 Side 13 Notes Fie abstraction deat with by generic code (hander) abstraction deat with by device driver - maps to rea device Q is used to manage producer-consumer reationship between two haves of device driver 1B11-5 1999 Side 14 12/06/99 7

University Coege London Network s Abstract network device is provided in simiar way Generic network functions ca network device drivers Same/simiar interface whatever type of inks and devices actuay used to physicay connect computers - another abstraction!!! 1B11-5 1999 Side 15 Graphic Dispays Bitmap dispays are usuay impemented sighty differenty o dispay typicay refreshed from a bock of dua-ported cheap memory o written by the processor, and read by the CRT controer So windows systems simpy write bitmaps to this area - has the effect of updating the screen (1 scan time ater) (Character mode dispays are driven through seria interface - now virtuay obsoete) 1B11-5 1999 Side 16 12/06/99 8

University Coege London Pointers/trackers Pointing devices o interrupt with the current x/y position of the pointer o or deta-x, deta-y since ast interrupt o i.e. they provide a stream of events These may be conveyed to user process via software interrupts to give the programmer the iusion of event streams Fits thread mode very we 1B11-5 1999 Side 17 Summary abstraction is common in OS to group devices by broad cass, and provide a standard API s are accessed via a tabe - another piece of book-keeping that the OS must do For some groups of devices, further ayers of abstraction are aso provided - incuding: o fie systems, networks, dispays, etc 1B11-5 1999 Side 18 12/06/99 9