Computer Architecture and Assembly Language

Slides:



Advertisements
Similar presentations
Categories of I/O Devices
Advertisements

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.
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.
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.
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.
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.
© 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)
Computer System Internal components - The processor - Main memory - I / O controllers - Buses External components (peripherals). These include: - keyboard.
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.
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
Input Output Techniques Programmed Interrupt driven Direct Memory Access (DMA)
I/O Organization Competency – C6. Important facts to remember when I/O devices are to be connected to CPU There is a vast variety of I/O devices. Some.
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.
Practical Session 11 Computer Architecture and Assembly Language Input &Output (I/O)
Computer Organization and Design
Input/Output (I/O) Important OS function – control I/O
Computer Science 210 Computer Organization
Computer System Structures
Input/Output Device Drivers
I/O SYSTEMS MANAGEMENT Krishna Kumar Ahirwar ( )
Pentium I/O: I/O, I/O and off to work we go
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 Science 210 Computer Organization
CS703 - Advanced Operating Systems
Chapter 8 Input/Output I/O basics Keyboard input Monitor output
Computer Architecture
Interfacing Memory Interfacing.
Module 2: Computer-System Structures
Created by Vivi Sahfitri
Module 2: Computer-System Structures
Chapter 8 I/O.
Module 2: Computer-System Structures
Module 2: Computer-System Structures
Chapter 5 Input/Output Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights reserved
I/O subsystem Overview Peripheral Devices and IO Modules
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:

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

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

I/O Controller Typically I/O Controller has 3 internal registers: Data register Status register Command register Data in Data out 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”

Programmed I/O Software controls I/O operations slow  busy CPU wait  simple 

Interrupt-driven I/O 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) I/O DMA Controller 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

I/O Ports I/O port is the address of I/O controller register Two kinds of mapping: Two address spaces Isolated I/O separate address spaces special commands for I/O RAM 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 x86 provides 64 KB of isolated I/O address space I/O port is virtual mapping of I/O controller to address Example: RAM data out register I/O controller ‘a’ mov byte [0x60], ‘a’ 0x60 mov AL, ‘a’ out 0x60, AL ‘a’ 0x60

Screen device I/O controller 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 Example: I/O ports mapping table I/O controller address Screen device 0x60 … mov byte [0x60], ‘a’ mov byte [0x80], ‘b’ Screen device I/O controller RAM data out register 0x60 ‘a’ 0x60 ‘b’ 0x80

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 PA0 PA1 PA2 PA3 PA4 PA5 PA6 PA7

Example – How to Write a Simple Keyboard Driver 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=10000000b) jnz key_down_loop ; if not, loop back and AL,0x7F ; (0x7F=01111111b) – 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=10000000b) jz key_up_loop ; if not, loop back (busy wait) jmp key_down_loop done: ..exit program.. TEST instruction performs a bitwise AND on two operands. The flags SF, ZF, PF are modified while the result of AND is discarded. test AL, 80H ; PA7 = 0? 80H is the most significant bit, which indicates if ‘makash’ is up or down