Skip to main content
Linux Device Drivers | Building and Running Modules

Utilities

insmod
modprobe
rmmod

User-space utilities that load modules into the running kernels and remove them.

<linux/init.h>

module_init(init_function);
module_exit(cleanup_function);

ResearchC/C++LinuxLinux Device DriversLinux KernelAbout 1 minAbout 434 words
Linux Device Drivers | Char Drivers

<linux/types.h>

dev_t

dev_t is the type used to represent device numbers within the kernel.

int MAJOR(dev_t dev);
int MINOR(dev_t dev);

ResearchC/C++LinuxLinux Device DriversLinux KernelAbout 1 minAbout 411 words
Linux Device Drivers | Concurrency and Race Conditions
<asm/semaphore.h> (not found)

The include file that defines semaphores and the operations on them.

DECLARE_MUTEX(name);
DECLARE_MUTEX_LOCKED(name);

ResearchC/C++LinuxLinux Device DriversLinux KernelAbout 2 minAbout 640 words
Linux Device Drivers | Time, Delays, and Deferred Work

Timekeeping

<linux/param.h>
HZ

The HZ symbol specifies the number of clock ticks generated per second.

<linux/jiffies.h>
volatile unsigned long jiffies
u64 jiffies_64

ResearchC/C++LinuxLinux Device DriversLinux KernelAbout 4 minAbout 1104 words