Udemy
    •  
    •  
    •  
    •  
    •  
    •  
    •  
    •  
Turn what you know into an opportunity and reach millions around the world.
Learn More
Your cart is empty.
Keep shopping
Character Device Drivers in deep
Rating: 4.3 out of 5(151 ratings)
1,416 students

Character Device Drivers in deep

Linux Kernel Programming - Character Device Drivers
Created byLinux Trainer
Last updated 10/2020
English

What you'll learn

  • Write character device driver from scratch
  • Understand the various file operations provided by character driver

Course content

6 sections88 lectures4h 20m total length
  • Introduction to character device drivers3:36
  • List Character and Block Devices2:28
  • Steps in Registering a character driver0:41
  • Device Number = Major + Minor3:32
  • How to choose a device number1:58
  • Data type for device number dev_t0:50
  • Example of MAJOR,MINOR,MKDEV macros3:27
  • /proc/devices file1:03
  • Static Allocation of Device Numbers1:36
  • Example of static allocation of device numbers2:26
  • Test cases on Previous Example1:58
  • What happens if i try to register same major number1:39
  • What happens if i try to register same name1:36
  • Registering Maximum Minor Numbers3:27
  • What is Maximum Major Number3:02
  • Dynamic Allocation of Device Number0:48
  • Example of dynamic allocation of device number1:54
  • Calling alloc_chrdev_region in loop4:12
  • Manual Device Node Creation3:54
  • Automatic Device Node Creation - class_create4:02
  • Automatic Device Node Creation - device_create2:48
  • Example of automatic device node creation1:54
  • Quiz 1

Requirements

  • Should be able to write/compile/load/unload Hello World Linux Kernel Modules

Description

Updated on Oct 10: Added Downloads section

What will you learn from this course?

  • Introduction to character drivers

  • What is device number and device file

  • Allocating device number - statically and dynamically

  • Creating device file - Manually(mknod) and automatically (udev)

  • Registering character device and its file operation with Kernel

  • Copying data from user space to kernel space and vice versa

  • Understanding the various structures - struct file and struct inode

  • Implementation of open, release, read, write, llseek, ioctl file operations

  • How to create multiple device nodes and add support for private data

  • Flow of write system call from kernel system call entry point to driver write file operations

  • Handling all the error cases in ioctl implementation

  • Sending a signal to user space from kernel space

  • Various access control mechanisms and capabilities

  • Misc Driver

API's covered in this course:

  • MAJOR

  • MINOR

  • MKDEV

  • register_chrdev_region

  • alloc_chrdev_region

  • class_create

  • device_create

  • class_destroy

  • device_destroy

  • unregister_chrdev_region

  • imajor

  • iminor

  • copy_from_user

  • copy_to_user

  • put_user

  • get_user

  • print_dev_t

  • format_dev_t

  • strnlen_user

  • container_of

  • access_ok

Commands used in this course:

  • mknod

  • udevadm monitor

Who this course is for:

  • Developers interested in learning Linux Kernel Programming