In-Depth Analysis of the Linux RTC Subsystem (Part 1)

In-Depth Analysis of the Linux RTC Subsystem (Part 1)

1. RTC Subsystem Framework The RTC (Real Time Clock) subsystem is divided into the following three parts: RTC Core is responsible for the registration and deregistration of RTC devices, providing character device files and sysfs interfaces to user space. RTC Driver registers the RTC device into the RTC subsystem and provides a set of low-level … Read more

RT-Thread Learning Notes Series – 28 I2C Driver

RT-Thread Learning Notes Series - 28 I2C Driver

@[toc] https://github.com/wdfk-prog/RT-Thread-Study 28 I2C Driver https://www.i2c-bus.org/i2c-primer/termination-versus-capacitance/ 28.0 Hardware Circuit External link image storage failed, the source site may have anti-leech mechanisms, it is recommended to save the image and upload it directly. The I2C bus uses SDA and SCL to transmit data and clock. First, it is important to realize that SDA and SCL are … 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

In-Depth Understanding of the Linux I2C Subsystem: From Hardware Protocol to Driver Practice

In-Depth Understanding of the Linux I2C Subsystem: From Hardware Protocol to Driver Practice

5. Composition of the I2C Subsystem The kernel space can be divided into: i2c device drivers, i2c core, and i2c bus drivers. i2c core: Implementation of the framework; provides methods for registering and unregistering i2c bus drivers and device drivers; the upper-level code for i2c communication methods (algorithm) that is independent of specific adapters, as … Read more

Understanding Linux Network Device Drivers (Part 1)

Understanding Linux Network Device Drivers (Part 1)

1.1 What is a Network Device 1. A network device is primarily responsible for sending and receiving network data packets. It transmits data packets received from upper-layer protocols using a specific media access control method and passes the received data packets to upper-layer protocols. The network interface is the third category of standard devices in … Read more

Understanding the USB Device Driver Framework

Understanding the USB Device Driver Framework

Hello everyone, today we will learn about USB device drivers. Kernel version: 4.4.94 1. Linux USB Subsystem Before introducing the device-side driver, let’s take a look at the Linux USB subsystem. The term “subsystem” here refers to the entire Linux kernel rather than a single device. It generally encompasses the communication framework between USB hosts … Read more

Windows PCI Device Driver Development Guide: Bringing the Device to D0 State by Opening the Device File

Windows PCI Device Driver Development Guide: Bringing the Device to D0 State by Opening the Device File

In the previous article (Implementing a PCIe Device in Qemu: Adding a Periodic Timer to the Device), we introduced how to add a Timer to a PCIe device simulated by Qemu. This Timer has a counter that increments by 1 every second once enabled, and it also sends an interrupt to the virtual machine.To test … Read more

Sharing My PPT on the Linux Bus, Device, and Driver Model from a Few Years Ago

Sharing My PPT on the Linux Bus, Device, and Driver Model from a Few Years Ago

Sharing my PPT on the “Linux Bus, Device, and Driver Model” from a few years ago, which explains why Linux is designed this way, the reasons behind it, and its main design principles.1. An imagined Ethernet controller/a board 2. Decoupling 3. Unified binding 4. Bus, device, driver 5. Matching 6. Devices are devices, drivers are … Read more

Windows PCI Device Driver Development Guide: Installing Drivers on QEMU Simulated PCIe Devices

Windows PCI Device Driver Development Guide: Installing Drivers on QEMU Simulated PCIe Devices

To add more functionality to the PCI device driver we wrote, we simulated a test PCIe device on QEMU, allowing us to implement features we wanted, such as DMA and interrupts. For the specific implementation of this PCIe test device, please refer to How to Implement a PCIe Device in QEMU. The Vendor ID and … Read more

Windows PCI Device Driver Development Guide: Accessing PCI Configuration Space and MMIO Registers

Windows PCI Device Driver Development Guide: Accessing PCI Configuration Space and MMIO Registers

In the previous article, we implemented some PnP callbacks in PCI drivers, allowing the driver to load onto the PCIe device and enabling the device to enter the D3 low power state. In essence, writing a driver involves using the APIs provided by the operating system’s driver framework to create device objects and implement various … Read more