Home | Projects | Notes > Linux Device Drivers > Kernel APIs Used in Device Drivers

Kernel APIs Used in Device Drivers

 

Kernel APIs Overview

Kernel Functions and Header Files

Kernel functions and data structuresKernel header file
alloc_chrdev_region()
unregister_chardev_region()
include/linux/fs.h
cdev_init()
cdev_add()
cdev_del()
include/linux/cdev.h
device_create()
class_create()
device_destroy()
class_destroy()
include/linux/device.h
copy_to_user()
copty_from_user()
include/linux/uaccess.h
VFS structure definitionsinclude/linux/fs.h

 

Kernel APIs in Detail (Creation)

1. Dynamically Register a Range of Char Device Numbers

2. Create and Register Char Device to VFS

3. Create Device Files

 

 

Kernel APIs in Detail (Deletion)

1. Remove Device

2. Remove cdev Registration from the Kernel VFS

3. Unregister Device Numbers