Real-time Systems Lab, Computer Science and Engineering, ASU Linux Input Systems (ESP – Fall 2014) Computer Science & Engineering Department Arizona State.

Slides:



Advertisements
Similar presentations
Lecture 101 Lecture 10: Kernel Modules and Device Drivers ECE 412: Microcomputer Laboratory.
Advertisements

Device Drivers. Linux Device Drivers Linux supports three types of hardware device: character, block and network –character devices: R/W without buffering.
RT_FIFO, Device driver.
INPUT-OUTPUT ORGANIZATION
USERSPACE I/O Reporter: R 張凱富.
Tutorial 3 - Linux Interrupt Handling -
Real-time Systems Lab, Computer Science and Engineering, ASU Please Standby Galileo Tech Talk at ASU Will Begin Shortly.
Chapter 13: I/O Systems Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 13: I/O Systems I/O Hardware Application I/O Interface.
1 Homework Reading –Review previous material on “interrupts” Machine Projects –MP4 Due today –Starting on MP5 (Due at start of Class 28) Labs –Continue.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 13: I/O Systems I/O Hardware Application I/O Interface Kernel I/O Subsystem.
Interrupts What is an interrupt? What does an interrupt do to the “flow of control” Interrupts used to overlap computation & I/O – Examples would be console.
I/O Hardware n Incredible variety of I/O devices n Common concepts: – Port – connection point to the computer – Bus (daisy chain or shared direct access)
04/16/2010CSCI 315 Operating Systems Design1 I/O Systems Notice: The slides for this lecture have been largely based on those accompanying an earlier edition.
I/O Systems CS 3100 I/O Hardware1. I/O Hardware Incredible variety of I/O devices Common concepts ◦Port ◦Bus (daisy chain or shared direct access) ◦Controller.
Students:Gilad Goldman Lior Kamran Supervisor:Mony Orbach Mid-Semester Presentation Spring 2005 Network Sniffer.
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Chapter 5 Input/Output I/O Hardware I/O Software Software Layers Tanenbaum, Modern Operating Systems 3 e, (c) 2008 Prentice-Hall, Inc. All rights.
I/O Systems CSCI 444/544 Operating Systems Fall 2008.
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Final presentation- Part A Avi Urman, Kobi Maltinsky Supervisor: Inna Rivkin Linux on SOPC – Embedded System Implementation.
INPUT-OUTPUT ORGANIZATION
CS-334: Computer Architecture
Hacking the Bluetooth Pairing Authentication Process Graduate Operating System Mini Project Siyuan Jiang and Haipeng Cai.
1 CS503: Operating Systems Part 1: OS Interface Dongyan Xu Department of Computer Science Purdue 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.
GPIO interface From programmer’s view
I/O Systems I/O Hardware Application I/O Interface
FINAL MPX DELIVERABLE Due when you schedule your interview and presentation.
1 Lecture 20: I/O n I/O hardware n I/O structure n communication with controllers n device interrupts n device drivers n streams.
CHAPTER 3 TOP LEVEL VIEW OF COMPUTER FUNCTION AND INTERCONNECTION
7/23 Interrupt Controller and Edge Port in Coldfire Computer Science & Engineering Department Arizona State University Tempe, AZ Dr. Yann-Hang Lee.
Tami Meredith, Ph.D. CSCI  Devices need CPU access  E.g., NIC has a full buffer it needs to empty  These device needs are often asynchronous.
Ethernet Driver Changes for NET+OS V5.1. Design Changes Resides in bsp\devices\ethernet directory. Source code broken into more C files. Native driver.
Slide 5-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 5.
Chapter 13: I/O Systems. 13.2/34 Chapter 13: I/O Systems I/O Hardware Application I/O Interface Kernel I/O Subsystem Transforming I/O Requests to Hardware.
NT Kernel CS Spring Overview Interrupts and Exceptions: Trap Handler Interrupt Request Levels and IRT DPC’s, and APC’s System Service Dispatching.
Lab 13 Department of Computer Science and Information Engineering National Taiwan University Lab13 – Interrupt + Timer 2014/12/23 1 /16.
Sogang University Advanced Operating Systems (Enhanced Device Driver Operations) Advanced Operating Systems (Enhanced Device Driver Operations) Sang Gue.
Real-time Systems Lab, Computer Science and Engineering, ASU Quark SPI Interface (ESP – Fall 2014) Computer Science & Engineering Department Arizona State.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 13: I/O Systems I/O Hardware Application I/O Interface Kernel I/O Subsystem.
12/8/20151 Operating Systems Design (CS 423) Elsa L Gunter 2112 SC, UIUC Based on slides by Roy Campbell, Sam King,
Preemptive Context Switching
Chapter 13 – I/O Systems (Pgs ). Devices  Two conflicting properties A. Growing uniformity in interfaces (both h/w and s/w): e.g., USB, TWAIN.
Dr Mohamed Menacer College of Computer Science and Engineering, Taibah University CE-321: Computer.
1/9/ :46 1 Priority Model Real-time class Idle Above Normal Normal Below Normal Lowest Highest 31 Time-critical Dynamic classes.
7. IRQ and PIC ENGI 3655 Lab Sessions. Richard Khoury2 Textbook Readings  Interrupts ◦ Section
Lab 12 Department of Computer Science and Information Engineering National Taiwan University Lab12 – Driver 2014/12/16 1 /21.
Chapter 13: I/O Systems Silberschatz, Galvin and Gagne ©2005 Operating System Concepts Chapter 13: I/O Systems Overview I/O Hardware Application.
Silberschatz, Galvin, and Gagne  Applied Operating System Concepts Module 12: I/O Systems I/O hardwared Application I/O Interface Kernel I/O.
Introduction to Operating Systems Concepts
MQX GPIO.
Chapter 13: I/O Systems.
Module 12: I/O Systems I/O hardware Application I/O Interface
Chapter 13: I/O Systems Modified by Dr. Neerja Mhaskar for CS 3SH3.
GPIO Driver and Driver Binding
1 Input-Output Organization Computer Organization Computer Architectures Lab Peripheral Devices Input-Output Interface Asynchronous Data Transfer Modes.
CS 286 Computer Organization and Architecture
Homework Reading Machine Projects Labs
CSCI 315 Operating Systems Design
Computer System Overview
I/O Systems I/O Hardware Application I/O Interface
Operating System Concepts
CS703 - Advanced Operating Systems
Chapter 13: I/O Systems I/O Hardware Application I/O Interface
Introduction to Linux Device Drivers
Module 12: I/O Systems I/O hardwared Application I/O Interface
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:

Real-time Systems Lab, Computer Science and Engineering, ASU Linux Input Systems (ESP – Fall 2014) Computer Science & Engineering Department Arizona State University Tempe, AZ Dr. Yann-Hang Lee (480)

Real-time Systems Lab, Computer Science and Engineering, ASU  An option: each attached input device is handled by a driver with the details of input port and protocol the device used.  The other one -- Layers  adapter (controller) and port  device and driver  event interface 1 Linux Input Systems (Figure is from ELDD, Chapter 7)

Real-time Systems Lab, Computer Science and Engineering, ASU  Device drivers, input core, and event handlers  Example:  i8042 is the driver for 8042 adapter  psmouse is the driver for ps2 mouse  mousedev is the event handler for all mice 2 Software Structure of Input Systems (

Real-time Systems Lab, Computer Science and Engineering, ASU  The adapter – 8042  from PC-AT, now a part of LPC IO  PS2 signals: clock, data 5V, and GND.  CLOCK and DATA are of "open collector" type  bidirectional serial protocol (start, data, parity, stop)  PC has always a priority and can stop the transmission any time by setting CLOCK low 3 Example: PS2 Mouse Driver ( (

Real-time Systems Lab, Computer Science and Engineering, ASU  The driver for the adapter (controller)  When installed –  create a platform_device  initialize kbd and aux controllers  create serio ports with ids ( serio->id.type = SERIO_8042; )  request_IRQ and add interrupt handler, and register ports error = request_irq(I8042_KBD_IRQ, i8042_interrupt, IRQF_SHARED, "i8042", i8042_platform_device); if (likely(port->exists)) serio_interrupt(port->serio, data, dfl);  Important fields in struct serio struct serio_device_id id; struct serio_driver *drv; struct device dev; 4 What is done in i8042.c

Real-time Systems Lab, Computer Science and Engineering, ASU  Threaded interrupt handlers  isr acknowledges the interrupt to the hardware  wake the kernel interrupt handler thread int request_threaded_irq(unsigned int irq, irq_handler_t handler, irq_handler_t thread_fn, unsigned long flags, const char *name, void *dev)  handler is called in hard interrupt context and checks if the interrupt was from the device  if thread_fn is NULL, use the normal handler, no irq thread  handle_IRQ_event – calls handler (check or normal) 5 Request_threaded_irq

Real-time Systems Lab, Computer Science and Engineering, ASU  The driver to handle ps2 mouse protocol  When installed,  create psmouse driver of type register it.  dispatch a serio_attach_driver event to “events_long” work queue  probe serio bus and connect to serio device via the matching serio_id  why work thread?in serio_bus static struct bus_type serio_bus = {.name = "serio", …...match = serio_bus_match,.uevent = serio_uevent,.probe = serio_driver_probe, ….., };  serio_driver_probe  serio_connect_driver  psmouse_connect  create a “psmouse” device  psmouse_interrupt : called after finding the psmouse device from serio device 6 What is done in psmouse-base.c (1)

Real-time Systems Lab, Computer Science and Engineering, ASU  When psmouse_interrupt is called  received mouse data and process the protocol  psmouse_process_byte() analyzes the PS/2 data stream and reports relevant events to the input module once full packet has arrived.  psmouse registers itself as an input device to input core  report events: EV_KEY and EV_REL  eventually, input_pass_event to handlers  What else  protocol – command and response with adapter, mouse state, and data decoding.  mouse types  use a work queue for mouse resync 7 What is done in psmouse-base.c (2)

Real-time Systems Lab, Computer Science and Engineering, ASU  evdev:  a generic input event interface to pass the events generated in the kernel straight to the program, with timestamps.  a char device to user space  when open, an evdev client is created with a buffer for events and is attached to file struct.  when read, fetch the events in the buffer and return to the user call.  register as a handler of an input device  when connected, evdev is created  handle is added to the input device  input device passes events to handler’s clients via  input core’s input_pass_event  handler’s evdev_pass_event 8 Event Handlers struct input_event { struct timeval time; __u16 type; __u16 code; __s32 value; };