
Device drivers are part of runtime linux. They can be added or removed from linux during runtime.
Know how device drivers operate from a high level perspective.
High level language like C program are converted to machine readable code using a tool called compiler. In this lecture, we shall look in depth into intermediate steps used by compiler to convert the c program to binary.
Regular compilation of file creates a binary for the architecture on which code is compiled.
If binary for a different architecture is required, we need to perform Cross Compilation.
Learn basics of makefile and syntax of makefile
Learn how to execute the Makefile. Creating custom Makefile and using the Makefile from the different directory.
Students will learn to create the entry and exit function along with the macros for adding the module description and module license.
Create the Makefile for building the helloworld module created in the previous lecture.
Insert the kernel module from userspace, list the modules and remove the modules. At the same time, observe the behavior during each step.
printk is used to print the messages in the console from kernelspace. However, printk has certain loglevels associated with it. Proper understanding of how printk works helps debugging in the constraint cases.
After inserting the module, understand how kernel exposes the module details to the userspace. Interact with the files, know more about each entries.
__init keryword is the most often used for module initializing. Understanding the behavior of __init keyword helps in writing efficient optimized code.
Understand how character drivers are identified, create a character driver node. Know basics of Major Number and Minor Number.
Know how to register a character driver and deregister a character driver
Know how file operations are declared in the driver. File operations are key part of driver development as everything in linux is managed through files.
Implement how file operations like open, close and read are performed as regular file operations on kernel driver.
Starting your journey in the Linux device driver development is a pain for beginners. This course is designed to clear the air and provide the right insights for beginners to get started in device driver development.
Before jumping right away into development it is better to know the basics and need of device drivers. So, the course begins with an introduction to Linux kernel architecture, the role of device drivers.
Course Structure Includes:
Introduction to Linux Kernel architecture.
Role of device drivers and their use case.
Intermediate steps involved in the compilation process.
Cross Compilation for the target architecture.
Kernel APIs understanding for getting started.
Implement a Hello World module.
Module Building, inserting, and checking status procedure.
__init and __exit keywords and their use case.
Character driver implementation.
Implementing read, write operations for the character driver.
Creating and submitting our first Linux kernel patch.
This course, if well practiced well enough along with supported theory and lecture, is good enough for any beginner to get started in device drivers development.
As time proceeds, I will be updating the course contents with the additional drivers and techniques for debugging the drivers.
Hope you will enjoy and have fun learning.
Cheers.