In-Depth Reading: Chapter 6 of ‘Linux Device Drivers’ – Advanced Character Drivers

In-Depth Reading: Chapter 6 of 'Linux Device Drivers' - Advanced Character Drivers

Hello, everyone, I am Programmer MM. This article is approximately 2400 words. Recently, I finished reading Chapter 6 of ‘Linux Device Drivers’, and I have organized my notes from this chapter. In this chapter, the development of device drivers has progressed from simple data transfer to an advanced stage with complete synchronization and control capabilities. … Read more

Stream On/Off Process for UVC Devices on Linux

Stream On/Off Process for UVC Devices on Linux

1. Introduction This article shares the execution process of the stream on and off for UVC devices under Linux. It focuses on the differences between isoc and bulk modes. 2. Process Ioctl Registration and Execution Process The application layer calls ioctl int ioctl(int fd, VIDIOC_STREAMON, const int *argp) Ultimately, it calls the file’s ->unlocked_ioctl where … Read more

Linux (Part 7) – File Operations with llseek and ioctl

Linux (Part 7) - File Operations with llseek and ioctl

Linux (Part 7) – File Operations with llseek and ioctl Overview In the Linux system, llseek is a system call used to control the read and write position of files. Its name comes from <span> "long long seek"</span>, indicating that it can handle positioning operations for large files (over 4GB). In simple terms, llseek acts … Read more

Python ctypes Wrapper for Linux ioctl: A New Paradigm for Cross-Language Hardware Control

Python ctypes Wrapper for Linux ioctl: A New Paradigm for Cross-Language Hardware Control

1. Technical Background and Core Value In Linux system development, ioctl (Input/Output Control) serves as the core interface for interaction between device drivers and user space, undertaking critical tasks such as hardware control and configuration queries. Its design philosophy allows developers to perform diverse device operations through a unified system call interface, such as: • … Read more

In-Depth Character Device Driver: Usage of the ioctl Function

In-Depth Character Device Driver: Usage of the ioctl Function

1. Function of the ioctl Function A function for device control is provided in the kernel source code, and device control is implemented through the ioctl function, while data transmission is achieved through read/write. Example: For instance, the control of the camera’s operating mode is implemented through ioctl, while the reading and writing of camera … Read more

Windows PCI Device Driver Development Guide: How to Use DMA in User Mode

Windows PCI Device Driver Development Guide: How to Use DMA in User Mode

In this article (Implementing a PCIe Device in Qemu: Adding DMA Functionality), we added a vector addition feature to the PCIe device simulated with Qemu. This PCIe device uses DMA read operations to transfer the contents of two operand vectors provided by the driver into an internal buffer of the PCIe device, computes the sum … Read more

Windows PCI Device Driver Development Guide: How to Trigger User-Space Events from Interrupt Handlers

Windows PCI Device Driver Development Guide: How to Trigger User-Space Events from Interrupt Handlers

In the article on interrupt handling in drivers, we introduced how to add logic for handling periodic Timer interrupts in the driver for our simulated PCIe device. To test the Timer counting functionality, we also created a user-space test program that reads the Timer’s count register every second. While this approach can test whether the … Read more

Embedded Linux: fcntl() and ioctl() Functions

Embedded Linux: fcntl() and ioctl() Functions

Click the blue text above to follow us fcntl() and ioctl() are two system calls used to control file descriptors, each serving different purposes and functionalities in various situations. 1 fcntl() Function The fcntl() function provides the capability to perform various control operations on an open file descriptor, such as duplicating a file descriptor (similar … Read more