指導教授 : 蔡亮宙 報告者 : 黃柏愷. Outline Introduction Hardware platform Software platform Design of driver program Traditional keyboard driver The first improved.

Slides:



Advertisements
Similar presentations
Principles of I/O Hardware I/O Devices Block devices, Character devices, Others Speed Device Controllers Separation of electronic from mechanical components.
Advertisements

Lecture 101 Lecture 10: Kernel Modules and Device Drivers ECE 412: Microcomputer Laboratory.
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.
purpose Search : automation methods for device driver development in IP-based embedded systems in order to achieve high reliability, productivity, reusability.
USERSPACE I/O Reporter: R 張凱富.
A Sample RTOS Presentation 4 Group A4: Sean Hudson, Manasi Kapadia Syeda Taib.
Programmable Interval Timer
Real-time Systems Lab, Computer Science and Engineering, ASU Please Standby Galileo Tech Talk at ASU Will Begin Shortly.
Maciej Gołaszewski Tutor: Tadeusz Sondej, PhD Design and implementation of softcore dual processor system on single chip FPGA Design and implementation.
I/O Multiplexing The role of the ‘poll()’ method in Linux device-driver operations.
Introduction Characteristics of USB System Model What needs to be done Platform Issues Conceptual Issues Timeline USB Monitoring Final Presentation 10.
ECE 526 – Network Processing Systems Design Software-based Protocol Processing Chapter 7: D. E. Comer.
Handheld TFTP Server with USB Andrew Pangborn Michael Nusinov RIT Computer Engineering – CE Design 03/20/2008.
PWM ON SAMSUNG's S3C2410X. Building Embedded LINUX SYSTEM Outline SAMSUNG's S3C2410X components CLOCK & POWER MANAGEMENT PWM TIMER I/O PORTS Finally Project.
Concurrency: Deadlock and Starvation Chapter 6. Revision Describe three necessary conditions for deadlock Which condition is the result of the three necessary.
CSE Fall Introduction - 1 What is an Embedded Systems  Its not a desktop system  Fixed or semi-fixed functionality (not user programmable)
Chapter 1- Visual Basic Schneider 1 Chapter 1 An Introduction to Computers and Visual Basic.
WSN based Innovative Education Practice 報告:曾宗揚 指導老師:溫志煜.
Computer System Laboratory
Performance Evaluation of Real-Time Operating Systems
RTOS Design & Implementation Swetanka Kumar Mishra & Kirti Chawla.
Alternate Version of STARTING OUT WITH C++ 4 th Edition Chapter 1 Introduction to Computers and Programming.
 What Is a Computer? What Is a Computer?  Computer System Components Computer System Components  Hardware Hardware  Types of Memory Types of Memory.
SOC Consortium Course Material SoC Design Laboratory Lab 8 Real-time OS - 2 Speaker: Yung-Chih Chen Advisor: Prof. Chun-Yao Wang November 17, 2003 Department.
Overview Introduction The Level of Abstraction Organization & Architecture Structure & Function Why study computer organization?
Real-time Systems Lab, Computer Science and Engineering, ASU Linux Input Systems (ESP – Fall 2014) Computer Science & Engineering Department Arizona State.
UNIT - 1Topic - 1. An electronic device, operating under the control of instructions stored in its own memory unit, that can accept data (input), manipulate.
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,
GIANFRANCO BARBALACE Y FRANCO CAVIGLIA CATENAZZI1ºB Types and components of a computer systems.
Lab 1 Department of Computer Science and Information Engineering National Taiwan University Lab1 - Sensor 2014/9/23/ 13 1.
2001 Networking Operating Systems (CO32010) 1. Operating Systems 2. Processes and scheduling 3.
The IT700 PIM only supports up to network layer, all other above layers must be executed by other processor. Therefore in the PLC control network two types.
Lecture 3 Process Concepts. What is a Process? A process is the dynamic execution context of an executing program. Several processes may run concurrently,
Operating Systems Lecture 7 OS Potpourri Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard. Zhiqing Liu School of Software.
1 Announcements The fixing the bug part of Lab 4’s assignment 2 is now considered extra credit. Comments for the code should be on the parts you wrote.
指導老師 : 蔡亮宙 報告者 : 黃柏愷 A new method of vehicle license plate location under complex scenes.
The Linux Operating System C. Blane Adcock Bryan Knehr Kevin Estep Jason Niesz.
OS2014 PROJECT 2 Supplemental Information. Outline Sequence Diagram of Project 2 Kernel Modules Kernel Sockets Work Queues Synchronization.
Lab 13 Department of Computer Science and Information Engineering National Taiwan University Lab13 – Interrupt + Timer 2014/12/23 1 /16.
Application of XSBase270 and FPGA Presenter : Ming-Hsien Tsai.
POR:NATALIA RESTREPO BUSTAMANTE. hardware refers to all physical parts of a computer system; its components are: electrical, electronic, electromechanical.
Computer main parts HARDWARE It corresponds to all physical and tangible parts of a computer: your electrical, electronic, electromechanical and mechanical.
Proposal for an Open Source Flash Failure Analysis Platform (FLAP) By Michael Tomer, Cory Shirts, SzeHsiang Harper, Jake Johns
Lab 12 Department of Computer Science and Information Engineering National Taiwan University Lab12 – Driver 2014/12/16 1 /21.
COMP 3438 – Part I - Lecture 5 Character Device Drivers
Lecture 4 General-Purpose Input/Output NCHUEE 720A Lab Prof. Jichiang Tsai.
Confidential 1 Human Machine Interface Platform J-0977M-N01.
HARDWARE AND SOFTWARE. What is hardware? Hardware is any physical component of a computer system. Without any hardware, your computer would not exist,
Interrupts and Interrupt Handling David Ferry, Chris Gill CSE 522S - Advanced Operating Systems Washington University in St. Louis St. Louis, MO
OPERATING SYSTEM REVIEW. System Software The programs that control and maintain the operation of the computer and its devices The two parts of system.
Introduction To Computer Programming – 1A Computer Parts, Words, and Definition Herriman High School.
Big Picture Lab 4 Operating Systems C Andras Moritz
Linux Sound Drivers Framework
Information Processing
Linux Kernel Development - Robert Love
Operating System Review
Event Driven Programming Dick Steflik
CS 286 Computer Organization and Architecture
Operating System Review
Input Device Interrupt Latency of KVM on ARM using Passthrough
Inter-Process Communication and Synchronization
I/O Systems I/O Hardware Application I/O Interface
CS703 - Advanced Operating Systems
Synchronization Issues
Operating System Review
Lecture Topics: 11/1 General Operating System Concepts Processes
Chapter 6 Synchronization Principles
Computer System Laboratory
Introduction to Linux Device Drivers
Presentation transcript:

指導教授 : 蔡亮宙 報告者 : 黃柏愷

Outline Introduction Hardware platform Software platform Design of driver program Traditional keyboard driver The first improved method The second improved method Summary Reference

Introduction The keyboard is a very important input device of HID (Human Interface Device) The commonly-used non-coded keyboard is divided into matrix keyboard and independent keyboard S3C2440 processor of SAMSUNG, with the dominant frequency 400MHz NAND Flash of 64MB and used SDRAM of 64MB

Hardware platform 4X4 matrix keyboards scanning

Software platform host machine development platform is the Red Hat Enterprise Linux5.5 the version of Linux kernel for the target board is Toolchan: the cross-compiler is arm-Linux-GCC-4.3.2

Design of driver program Traditional keyboard driver The first improved method The second improved method

Traditional keyboard driver(1/4) The driver initialization struct file_operations button _fops struct button_dev struct class *btn_class; int button_init(void) class_device_create(btn_class,devno,NULL,"btndev ",0); Event handling key_interrupt() Keyboard scanning

Obtain key value keyboard driver flowchart Traditional keyboard driver(2/4) Init_keyboard Button_open() Scanning key Blocking thread Get key value By semphore Get key value By semphore Create wait queue Put the task into wait queue and sleep Put the task into wait queue and sleep Awake by semphore Obtain key value key value to userspce Task in sleeping Set the task runing,remove it from wait queue Interrupt occurred Interrupt occurred No yes No yes

Traditional keyboard driver(3/4) struct file_operations button _fops = {.owner = button _MODULE,.read = button _read,.open = button _open,.poll= button _poll,.release = button _release, }; struct button_dev { struct semaphore sem; /* mutual exclusion semaphore*/ wait_queue_head_t rq; struct cdev cdev; /* Char device structure*/ unsigned char key; };

Traditional keyboard driver(4/4) struct class *btn_class; int button_init(void){ int result; dev_t devno = MKDEV(btn _major, 0); if (btn _major) result = register_chrdev_region(devno,1, " btndev"); else{ result = alloc_chrdev_region(&devno,0, 1, " btndev "); btn _major = MAJOR(devno); } ………… btn _class =class_create(THIS_MODULE," btndev "); ………… class_device_create(btn_class,devno,NULL," btndev ",0); ………… }

The first improved method(1/4) Drive initialization static struct input_dev *simplekey_dev; static unsigned char simplekey_keycode[] set_bit(EV_KEY,simplekey_dev->evbit); set_bit(simplekey_keycode[i],simplekey_dev->keybit); Event Reporting input_report_key(simplekey_dev,simplekey _keycode[ code],1); input_sync(simplekey_dev);

The first improved method(2/4) 輸入子系統 (input subsystem) 的架構圖

The first improved method(3/4) static unsigned char simplekey_keycode[] = {…… [9] = KEY_RIGHT, [10] = KEY_DOWN, [11] = KEY_LEFT, [12] = KEY_UP, [13] = KEY_A, [14] = KEY_B, [15] = KEY_B, };

The first improved method(4/4) set_bit(EV_KEY,simplekey_dev->evbit); set_bit(simplekey_keycode[i],simplekey_dev->keybit); input_report_key(simplekey_dev,simplekey_keycode [code], 0); input_sync(simplekey_dev);

The second improved method(1/3) S3C2440 Linux 驅動移植 —— 按键 include/linux/gpio_keys.h struct gpio_keys_button struct gpio_keys_platform_data arch/arm/mach-s3c2440/mach-smdk2440.c static struct gpio_keys_button s3c_buttons[] static struct gpio_keys_platform_data buttons_platdata static struct platform_device s3c_device_buttons 添加 static struct gpio_keys_platform_data buttons_platdata static struct platform_device *smdk2440_devices[] __initdat a 添加 static struct platform_device s3c_device_buttons make xconfig qt3

The second improved method(2/3) static struct gpio_keys_button s3c2440_buttons[] = { {.gpio = S3C24XX_GPN(0),.code = KEY_DOWN,.desc= "Down",. active_low = 1, },…..} Static struct gpio_keys_platform_data s3c2440_but ton_data = {.buttons = s3c2440_but tons,.nbuttons = ARRAY_SIZE, };

The second improved method(3/3) Static struct platform_device s3c2440_device_button = {.name = "gpio-keys ",. id = -1,.dev = {.platform_data = &s3c2440_button_data, } };

Summary the improvement of driver design, the keyboard driver code has at least two-thirds reduction in the course the keystrokes have been transformed into a system message without a separate thread detecting button

Reference LIU Long , ZHANG Yun-cui , GUO Jing-fu Monitor System for Neutron Room Based on Embedded System Nuclear Electronics & Detection Technology 2009,7: Zhu Xiang-wei Lu Wei-zhong Design of a Byte Device of the Driving Program in LINUX System Journal of Huaihai Institute of Technology(Hamaitie & Science Edition) 2001,3:18-20 Luo Zhijie Interrupt Design of Embedded Linux System Computer & Telecommunication 2011, 9:58-61 YU Qi-jian , ZHANG Hai-feng Realization of touch screen‘s driver with Linux input subsystem MECHANICAL & ELECTRICAL ENGINEERING MAGAZINE 2009, 26(3)