Practical Session 11 Computer Architecture and Assembly Language Input &Output (I/O)

Slides:



Advertisements
Similar presentations
I/O Organization popo.
Advertisements

Categories of I/O Devices
Accessing I/O Devices Processor Memory BUS I/O Device 1 I/O Device 2.
Input and Output CS 215 Lecture #20.
CS-334: Computer Architecture
FIU Chapter 7: Input/Output Jerome Crooks Panyawat Chiamprasert
Avishai Wool lecture Introduction to Systems Programming Lecture 8 Input-Output.
Device Management.
Practical Session No. 10 Input &Output (I/O). I/O Devices Input/output (I/O) devices provide the means to interact with the “outside world”. An I/O device.
1 COSC 3P92 Cosc 3P92 Week 11 Lecture slides Violence is the last refuge of the incompetent. Isaac Asimov, Salvor Hardin in "Foundation"
Group 7 Jhonathan Briceño Reginal Etienne Christian Kruger Felix Martinez Dane Minott Immer S Rivera Ander Sahonero.
INPUT-OUTPUT ORGANIZATION
INPUT/OUTPUT ARCHITECTURE By Truc Truong. Input Devices Keyboard Keyboard Mouse Mouse Scanner Scanner CD-Rom CD-Rom Game Controller Game Controller.
Input / Output CS 537 – Introduction to Operating Systems.
Input/Output. Input/Output Problems Wide variety of peripherals —Delivering different amounts of data —At different speeds —In different formats All slower.
The computer system’s I/O architecture is its interface to the outside world. This architecture provides a systematic means of controlling interaction.
Chapter 8 Input/Output l I/O basics l Keyboard input l Monitor output l Interrupt driven I/O l DMA.
Chapter 7 Input/Output Luisa Botero Santiago Del Portillo Ivan Vega.
ITEC 1011 Introduction to Information Technologies 7. Input / Output Chapt. 8.
Chapter 10: Input / Output Devices Dr Mohamed Menacer Taibah University
1 Computer System Overview Chapter 1. 2 n An Operating System makes the computing power available to users by controlling the hardware n Let us review.
Input and Output Computer Organization and Assembly Language: Module 9.
Cpr E 308 Input/Output Recall: OS must abstract out all the details of specific I/O devices Today –Block and Character Devices –Hardware Issues – Programmed.
Input/ Output By Mohit Sehgal. What is Input/Output of a Computer? Connection with Machine Every machine has I/O (Like a function) In computing, input/output,
Input/Output. I/O Initiation & Control  Transfer of data between circuitry external to the microprocessor and the microprocessor itself.  Transfer of.
Spring EE 437 Lillevik 437s06-l8 University of Portland School of Engineering Advanced Computer Architecture Lecture 8 Project 3: memory agent Programmed.
1. Introduction 2. Methods for I/O Operations 3. Buses 4. Liquid Crystal Displays 5. Other Types of Displays 6. Graphics Adapters 7. Optical Discs 10/01/20151Input/Output.
Contact Information Office: 225 Neville Hall Office Hours: Monday and Wednesday 12:00-1:00 and by appointment.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems Principles of I/0 hardware.
2007 Oct 18SYSC2001* - Dept. Systems and Computer Engineering, Carleton University Fall SYSC2001-Ch7.ppt 1 Chapter 7 Input/Output 7.1 External Devices.
(More) Interfacing concepts. Introduction Overview of I/O operations Programmed I/O – Standard I/O – Memory Mapped I/O Device synchronization Readings:
2009 Sep 10SYSC Dept. Systems and Computer Engineering, Carleton University F09. SYSC2001-Ch7.ppt 1 Chapter 7 Input/Output 7.1 External Devices 7.2.
Dr Mohamed Menacer College of Computer Science and Engineering Taibah University CE-321: Computer.
Practical Session 11 Computer Architecture and Assembly Language Input &Output (I/O)
Accessing I/O Devices Processor Memory BUS I/O Device 1 I/O Device 2.
Computer System Internal components - The processor - Main memory - I / O controllers - Buses External components (peripherals). These include: - keyboard.
Input-Output Organization
CH10 Input/Output DDDData Transfer EEEExternal Devices IIII/O Modules PPPProgrammed I/O IIIInterrupt-Driven I/O DDDDirect Memory.
Fall 2000M.B. Ibáñez Lecture 25 I/O Systems. Fall 2000M.B. Ibáñez Categories of I/O Devices Human readable –used to communicate with the user –video display.
L/O/G/O Input Output Chapter 4 CS.216 Computer Architecture and Organization.
The computer system’s I/O architecture is its interface to the outside world. This architecture provides a systematic means of controlling interaction.
SET 21 OPERATING SYSTEM USE OF ASSEMBLY LANGUAGE.
1 Lecture 1: Computer System Structures We go over the aspects of computer architecture relevant to OS design  overview  input and output (I/O) organization.
Input/Output Problems Wide variety of peripherals —Delivering different amounts of data —At different speeds —In different formats All slower than CPU.
IT3002 Computer Architecture
Processor Memory Processor-memory bus I/O Device Bus Adapter I/O Device I/O Device Bus Adapter I/O Device I/O Device Expansion bus I/O Bus.
TANNENBAUM: 5, BIC & SHAW, SILBERSCHATZ: 12 INPUT/OUTPUT DEVICE DRIVERS.
Input Output Techniques Programmed Interrupt driven Direct Memory Access (DMA)
بسم الله الرحمن الرحيم MEMORY AND I/O.
I/O: Input-Output By: Tommy Zeng. What is I/O? I/O – short for “Input – Output” How a computer interacts with its users Input – gets information from.
1 Device Controller I/O units typically consist of A mechanical component: the device itself An electronic component: the device controller or adapter.
Practical Session 12 Input &Output (I/O). I/O Device Input / Output (I/O) devices Input / Output (I/O) devices provide the means to interact with the.
Computer Organization and Design
Computer System Structures
I/O SYSTEMS MANAGEMENT Krishna Kumar Ahirwar ( )
Operating Systems (CS 340 D)
Input/Output.
1 Input-Output Organization Computer Organization Computer Architectures Lab Peripheral Devices Input-Output Interface Asynchronous Data Transfer Modes.
I/O system.
CS 286 Computer Organization and Architecture
Computer Architecture
Computer Architecture and Assembly Language
Chapter 5 Input/Output Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved
Chapter 13: I/O Systems “The two main jobs of a computer are I/O and [CPU] processing. In many cases, the main job is I/O, and the [CPU] processing is.
Presentation transcript:

Practical Session 11 Computer Architecture and Assembly Language Input &Output (I/O)

Operating system CPU-Memory-I/O Architecture Input / Output (I/O) devices Input / Output (I/O) devices are used to interact with “outside world” mouse, screen, disks, printer … CPU I/O module / I/O driver I/O device I/O controller

I/O Controller Example: character output Check status register of I/O controller e.g. busy, idle, offline Put data into data in register Put command into command register e.g. “send the character in data register to printer” Data in Data out I/O Controller has 3 internal registers Typically I/O Controller has 3 internal registers: – Data register – Status register – Command register

Programmed I/O Software controls I/O operations – slow  – busy CPU wait  – simple Interrupt-driven I/O Device includes a signal to interrupt CPU Device includes a signal to interrupt CPU (interrupt is produced by hardware) When an interrupt occurs (and is accepted), a special routine executes to service the interrupt – no CPU busy wait Direct memory access (DMA) Direct memory access (DMA) I/O CPU transfer information to DMA controller (DMAC) location of data on device location of data in memory size of block to transfer direction of transfer When device is ready, DMAC takes control of the system buses DMA Controller

5 to DMA module controller controller I/O controller controller to DMA module controller I/O controller

I/O Ports I/O port is the address of I/O controller register Two kinds of mapping: Isolated I/O – separate address spaces – special commands for I/O 64 KB x86 provides 64 KB of isolated I/O address space in instruction is used to read data from I/O port: in register, port address (direct address) in register, DX (indirect address) out instruction is used to write data to I/O port: out port address, register (direct address) out DX, register (indirect address) register must be AL, AX, or EAX Two address spaces mov byte [0x60], ‘a’ Example: 0x60 ‘a’ mov AL, ‘a’ out 0x60, AL RAM 0x60 ‘a’ I/O controller data out register is not physical memory I/O ports is not physical memory, it is virtual mapping of I/O controllers’ registers and to their addresses I/O controlleraddress Screen device0x60 …… I/O ports mapping table

I/O Ports I/O port is the address of I/O controller register Two kinds of mapping: Memory mapped I/O – no special commands for I/O – use regular memory read/write commands mov byte [0x60], ‘a’ Example: 0x60 RAM 0x60 ‘a’ Screen device I/O controller data out register I/O controlleraddress Screen device0x60 …… mov byte [0x80], ‘b’ 0x80 ‘b’ I/O ports mapping table

Example – How to Write a Simple Keyboard Driver Use PA input port register at address 60h – PA7 = 0 if a key is pressed – PA7 = 1 if a key is released – PA0–PA6 = key scan code Use busy wait loop – wait until a key is pressed (i.e. until PA7 = 0) – read scan code of the key – wait until a key is released (i.e. until PA7 = 1) Pressing ESC key terminates the program PA0PA1PA2PA3PA4PA5PA6PA7

section.data ESC_KEY EQU 0x1B ; ASCII code for ESC key KB_DATA EQU 0x60 ; port PA section.text global _start _start: key_down_loop: ; loop until a key is pressed i.e., until PA7 = 0 in AL, KB_DATA; read keyboard status & scan code test AL, 0x80 ; PA7 = 0? (0x80= b ) jnz key_down_loop ; if not, loop back and AL,0x7F ; (0x7F= b ) – isolate scan code..translate scan code to ASCII code in AL.. cmp AL, ESC_KEY ; ESC key - terminate program je done key_up_loop:; loop until a key is released i.e., until PA7 = 1 in AL, KB_DATA ; read keyboard status & scan code test AL, 0x80; PA7 = 1? (0x80= b ) jz key_up_loop ; if not, loop back (busy wait) jmp key_down_loop done:..exit program.. Example – How to Write a Simple Keyboard Driver TEST instruction performs a bitwise AND on two operands. The flags SF, ZF, PF are modified while the result of AND is discarded.