Embedded Linux Driver Development: Starting with Character Devices

Embedded Linux Driver Development: Starting with Character Devices

1. What is a Character Device? First, we need to understand what a character device is. A character device is, simply put, a device that reads and writes data byte by byte, like keyboards, mice, and serial ports. Unlike block devices (like hard drives), character devices do not support random access; data must be read … Read more

Using SystemTap to Trace Custom Kernel Modules

Using SystemTap to Trace Custom Kernel Modules

One Background After reading the article “Dynamic Tracing Technology Discussion” (https://blog.openresty.com.cn/cn/dynamic-tracing/), I thought about using SystemTap to trace my own developed kernel module. However, the official documentation of SystemTap (https://sourceware.org/systemtap/documentation.html) only gives examples of tracing kernel modules by using drivers from the kernel source tree, for example: probe module(“ext3”).function(“*”) { }, and indeed, the verification … Read more

Linux Character Device Driver Example

Linux Character Device Driver Example

globalmem Looking at Linux device driver development details, the chapter on character device drivers provides test code and application programs that are very helpful for beginners. The reason for writing this article is that I noticed I had not yet written about character devices, despite having previously published articles. As for the role of the … Read more

Introduction to Linux Device Drivers

Introduction to Linux Device Drivers

01 — Linux Architecture The Linux architecture can be divided into user space and kernel space, which interact with each other through the system call interface. The so-called System Call Interface is a mature interface predefined by the Linux kernel for user space applications. User applications can call the services provided by the operating system … Read more