Innovation... driven by intelligence and logic

Character Device Driver Development

Abstract:

A character device driver is one that transfers data directly to and from a user process. This is the most common type of device driver and there are plenty of simple examples in the source tree.

Character device drivers may transfer data between a user-level process and the device using any scheme other than the system buffer cache. Character drivers control devices such as network cards, terminal devices, printers, and specialized devices such as robots, medical devices, and retail sales devices.

Training Topics in brief:

  • Introduction to Device Drivers
  • Device Registration
  • Device Operations: open, release
  • Device Operations: writing, reading, trimming, seeking
  • Device Access Synchronization: Semaphores, Completions, Spinlocks, Blocking IO, wait queues, file locks, sequential locks, capabilities
  • Prefetching using Sequential Files,
  • Software implemented filesystem: /proc
  • Control operations: ioctl
  • poll and select
  • sysfs
  • Timing Measurements, delays, timers, tasklets, shared queues
  • Interrupts and Handling

Salient Features of Training Program

Objective:

  • This project is designed to ensure that students of Engineering College with academic capabilities will have the skill set needed to deal with the challenges involved in real-world projects involving device drivers developemnt and associated protocols / technologies to meet the needs of industries both today and in the future.

  • The course considers linux based system programming/kernel programming, network programming and communication techniques which can help to ensure that such techniques are reliable and act as a stable platform for networking and communication.

  • The course is taught mainly using the Linux, C, gcc, gdb and PC emulated as an embedded device.

Pre-requisite:

  • Education: ​BE, B Tech in ECE, EEE, CSE, IT or MCA.
  • ​The trainee must be
    • comfertible in using Linux Operating System
    • well versed with Shell Scripting using Bash
    • Having Advanced level knowledge of C
    • having basic knowledge of Linux System programming and network programming
  • ​Basic knowledge of Operating System Internals is a must.

Agenda:

  • The Duration of training would be 20 working days
  • There would be:
    • 20 Classroom Sessions of 2 hours each
    • 30 Lab Sessions of 4 hours each
    • 160 hours of Training

Deliverables:

After the training is over, the Trainee should be able to:-

  • understable device driver architecture for Linux
  • insert and register character device driver with the Linux Kernel
  • do complete initialization for the device driver
  • Implement the following operations on the character device driver
    • ​open. release, write, read, trim, lseek
  • Implement the following synchronization techniques on the simultanious operations on through the driver
    • semaphore, completion, spinlock, blockingIO, wait queues, file locks, seqlocks, capabilities
  • Implement advanced character device driver operations
    • IO using sequential files, IO control, software implemented filesystem - proc
  • Timing measurements, delays, timers, kernel threads
  • Interrupts: tasklets, shared queues, h/w and s/w interrupts, top and bottom halfs​

EmbLogic would issue/provide the following:-

  • Project Report for Submitting into their college.
  • Project presentation and demonstration assistance.
  • Completed Project (by the trainee).
  • Certificate of Completion for the training and Project as mentioned above.

Introduction:

Character special files or character devices relate to devices through which the system transmits data one character at a time by, for example, getchar. These device nodes often serve for stream communication with devices such as mice, keyboards, virtual terminals, and serial modems, and usually do not support random access to data.
 
In most implementations, character devices use unbuffered input and output routines. The system reads each character from the device immediately or writes each character to the device immediately.

Synopsys:

Character Device Driver


The kernel offers several subroutines or functions in user space, which allow the end user application programmer to interact with the hardware. Usually, in UNIX or Linux systems, this dialogue is performed through functions or subroutines in order to read and write files. The reason for this is that in Unix devices are seen, from the point of view of the user, as files.

​On the other hand, in kernel space Linux also offers several functions or subroutines to perform the low level interactions directly with the hardware, and allow the transfer of information from kernel to user space.

​Usually, for each function in user space (allowing the use of devices or files), there exists an equivalent in kernel space (allowing the transfer of information from the kernel to the user and vice-versa). 
Scull is implemented on virtual disk having 8 register set. Application accesses the device through Kernel entry points available at user level. Any amount of data can  be read or written to scull depending on device size on character by character basis. 

Various operations can be  performed on the device. Device can be opened in append mode where user can write and read from any position. In read mode , any data can be read from the device from any position .In write mode, any data can be written to the  device from beginning , device will be treated as fresh device. Proc file system is used for debugging driver. Ioctl is implemented for changing device parameters . All we need to do is to pass the specification of device from the application. Synchronization Technique – Semaphore,Kernel Mutex , Blocking i/o , Completion , Poll, Spin-lock , Sequential locks,Big Kernel lock is used for multi-threaded application to avoid synchronization problem. Application is delayed before accessing scull using Kernel Timers. Kernel Timers along with Blocking i/o are used for delaying the application to access to device while the device  is getting ready.


Training and projects Resources:   Click here...


EmbLogicTM is an ISO 9001:2008(QMS) (Quality Management System) Certified Company

 

 

Go to Top ^
+91-9818467776
We can call you