Embisyslabs is the Linux Device Drivers Training Institute conducts best Courses on Linux Kernel, Character Device Driver. The kernel is a computer program that is the core of a computer's operating system. The kernel is responsible for deciding which memory each process can use, and determining what to do when not enough memory is available.Translate the OS-mandated function calls (programming calls) into device-specific calls.Courses on Weekend as well Weekdays in Bangalore Bengaluru India.
CH1: AN INTRO. TO DEVICE DRIVERSRole of the Device Drivers
Splitting the kernel
Classes of devices and modules
Kernel Architecture or Model
CH2: BUILDING AND RUNNING MODULESTypes of Modules in the kernel
Writing Your first kernel module
Module Related Commands
Kernel Module vs Applications
Loading and Unloading Modules
Modules and Exporting Symbols
Hands-On AssignmentsLab1: Simple Hello Linux Kernel Module.
Lab2: Write a module that can take an integer parameter when it is loaded, It should have a default value when none is specified.
Lab3: Write a pair of modules where the second one calls a function in the first one
CH3: CHAR DEVICE DRIVERSMajor and Minor Numbers
The Internal Representation of Device Numbers
Allocating and Freeing Device Numbers
File Operations Data structure
Driver methods and Function Pointers
Char Device Registration
The Cdev Structure
The inode Structure
The file Structure
Manual Creation of Device Files
Automatic Creation of Device Files
Hands-On AssignmentsLab1: Print the major and minor numbers when Registering by Static or Dynamic method.
Lab2: Implement a open,write,read and close entry point.
Lab3: Print the major and minor numbers when the device is Opened and keep track of the number of times it has been opened since loading, and print out the counter every time the device is opened.
Lab4: Modify the previous driver so that each opening of the device allocates its own data area, which is freed upon release. Thus data will not be persistent across multiple opens.
Lab5 : Implement a lseek entry point and Keeping track of file position.
Lab6: Dynamical Node Creation,Adapt the previous dynamic registration driver to use udev to create the device node on the fly.
CH4: MEMORY ALLOCATION TECHNIQUEThe Real Story of kmalloc
The Flags Argument
vmalloc and Friends
Hands-On AssignmentLab1:Testing Maximum Memory Allocation ,using kmalloc().
Lab2:Testing Maximum Memory Allocation ,using __get_free_pages().
Lab3: Testing Memory Allocation,using vmalloc().
Lab4 :Memory cachesExtend your chararcter driver to allocate the driver's internal buffer by using your own memory cache.Make sure you free any slabs you create.
CH5: ADVANCED CHAR DRIVER OPERATIONSInpout/Output Control (ioctl)
User space, the ioctl system call
The ioctl driver method
Choosing the ioctl Commands
Using the ioctl Argument
Hands-On AssignmentsLab1 : Implement a ioctl entry point along with read and write entry point. Lab2 : Implement read and write entry point using ioctl command. Lab3 : Write a character driver that has three ioctl commands: a)Set the process ID to which signals should be sent. b)Set the signal which should be sent. c)Send the signal.
CH6: CONCURRENCY AND RACE CONDITIONConcurrency and its Managements
Semaphores and Mutexes
Linux Semaphore Implementation
Introduction to the Semaphore API
Introduction to the Spinlock API
Spinlocks and Atomic Context
Hands-On AssignmentsLab1: Mutex Contention -Write three simple modules where the second and third one use a variable exported from the first one.The second (third) module should attempt to lock the mutex and if it is locked, either fail to load or hang until the mutex is available.
Lab2: Sempahore Contention -Now do the same thing using semaphores.
CH7: INTERRUPT AND INTERRUPT HANDLINGThe Definition and Role of Interrupt
Installing an Interrupt Handler
The /proc Interface
Implementing a Handler
Handler Arguments and Return Value
Installing a Shared Handler Hands-On Assignments
Hands-On AssignmentsLab1: Write a module that shares its IRQ with your network card. You can generate some network interrupts either by browsing or pinging.
Lab2: Extend the previous solution to construct a character driver that shares every possible interrupt with already installed handlers.
Lab3: Mutex Unlocking from an Interrupt. Modify the simple interrupt sharing lab to have a mutex taken out and then released in the interrupt handler.
CH8: TIME, DELAY AND DEFERRED WORKTop and Bottom Halves
Tasklets and Workqueues Mechanisms
Measuring Time Lapses
Using the jiffies Counter
The Timer API
Hands-On AssignmentsLab1: Program based on Kernel Timer API
Lab2: Program based on Jiffies and HZ
Lab3: Program based on Taklet API
Lab4: Prgram based on Workqueue API
Lab5: Write a driver that puts launches a kernel timer whenever a write to the device takes place. Pass some data to the driver and have it print out. Have it print out the current->pid field when the timer function is scheduled, and then again when the function is executed.
Lab6: Write a module that launches a periodic kernel timer function; i.e., it should re-install itself.