Device driver
Download
1 / 10

DEVICE DRIVER - PowerPoint PPT Presentation


  • 203 Views
  • Updated On :

DEVICE DRIVER. VINOD KAMATH CS691X PROJECT WORK. Introduction. How to write/install device drivers Systems, Kernel Programming Character, Block and Network devices. Tasks involved. Building and Running modules Character device drivers. Building device driver module.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'DEVICE DRIVER' - farrah


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
Device driver l.jpg

DEVICE DRIVER

VINOD KAMATH

CS691X PROJECT WORK


Introduction l.jpg
Introduction

  • How to write/install device drivers

  • Systems, Kernel Programming

  • Character, Block and Network devices


Tasks involved l.jpg
Tasks involved

  • Building and Running modules

  • Character device drivers


Building device driver module l.jpg
Building device driver module

  • Module vs. Applications

    • Appln - single task

    • Module - register for future

  • Compiling and Loading

    • ___KERNEL__, MODULE

    • insmod,rmmod

    • Global var-Symtab

  • Do in Kernel space (not User space)

    • response time; block/network devs


Character device drivers l.jpg
Character device drivers

  • Scull - Simple Char. Util. for Loading Localities

    • Acts on mem. Area as though it is a device

    • Demonstrate interface betn. Kernel and Char drivers

    • n devices for n mem. areas

  • Major/Minor no.- (un)register chr_dev


Design and implementation of scull l.jpg
Design and implementation of Scull

  • File operations/structure

    • Device id. By file structure

    • Kenerl uses file ops. To access driver’s functions

  • Open and Close

    • Initialize device, usage count,

  • Memory

    • Device-memory Link List

  • Read and Write

    • Transfer data from Kernel-User

  • Testing/Debugging

    • cp, cat, dd wls-l > dev/scull0


Examples hello world l.jpg
Examples-Hello World

  • #define MODULE

  • #include <linux/module.h>

  • int init_module (void) {printk(“<1>Hello, World\n”); return 0}

  • void cleanup_module {printk(“<1>Goodbye, cruel World\n”);}


Examples scull l.jpg
Examples-Scull

  • #define MODULE, __KERNEL__

  • #include <linux/module.h>….

  • Struct file_operations d0_fops = {r,w,o,c }

  • int init_module (void) {malloc, reg do_fops}

  • void cleanup_module (unreg, free...);l


Conclusions l.jpg
Conclusions

  • Writing device drivers is not for faint heart/Adventure

  • Very careful with Kernel codes


Future work l.jpg
Future work

  • Try Advanced drivers, Scheduling

  • Understand principle for multi user


ad