Embedded Linux Driver Development: Lighting an LED

Embedded Linux Driver Development: Lighting an LED

Today, we will light up an LED using driver development. Let’s see what the differences are between the two methods. 1. First, let’s look at the schematic First, we check the schematic to see which IO port the LED on our board is connected to. Now, from the schematic, we know that the LED is … Read more

Kernel C++ Member Function and C Interface Adaptation Technology from an Assembly Language Perspective

Kernel C++ Member Function and C Interface Adaptation Technology from an Assembly Language Perspective

Fundamental Differences Between Member Functions and C Functions From an assembly perspective, the essential difference between member functions and ordinary C functions lies in the implicit <span>this</span> pointer passing: ; Ordinary C function call push param2 ; Parameter 2 push param1 ; Parameter 1 call CFunction ; Direct call add rsp, 10h ; Clean up … Read more

Kernel C/C++ Hybrid Programming Techniques from an Assembly Language Perspective

Kernel C/C++ Hybrid Programming Techniques from an Assembly Language Perspective

Assembly Level Analysis of Header File Declaration Issues When C++ references a C header file without adding <span>extern "C"</span>, it leads to name mangling issues: ; C-style function without processing call ?ExAllocatePoolWithTag@@YAPEAXW4_POOL_TYPE@@KPEAD@Z ; C++ mangled name ; Correct usage with extern "C" call ExAllocatePoolWithTag ; Original C name The correct approach when including <span>ntifs.h</span> is: … 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

Guide to Windows PCI Device Driver Development: Interrupt Handling

Guide to Windows PCI Device Driver Development: Interrupt Handling

In this article, we add a periodic Timer to the PCIe device previously simulated in Qemu. Once this Timer is enabled, it will trigger an MSI interrupt to the Qemu virtual machine every second. To verify that this interrupt function works correctly, we need to add interrupt handling capabilities to the driver for this PCIe … Read more

How a Veteran Embedded Developer Learns and Uses RT-Thread Quickly

How a Veteran Embedded Developer Learns and Uses RT-Thread Quickly

Warm Reminder This article is approximately 5000 words long, and it will take about 10 minutes to read, while skimming through will take about 5 minutes. If you like this article, please share it with your friends. For more information, please follow me. [Experience Summary] How a Veteran Embedded Developer with Nearly 10 Years of … Read more

X86 Kernel Notes_2_Driver Development

X86 Kernel Notes_2_Driver Development

This article is a highlight from the Kanxue ForumAuthor from Kanxue ForumID: SSH Landscape Painting 1 Creating a Driver Project Creating the Project Reference article for WDK and VS installation: X86 Kernel Notes 0 Configuring Dual Machine Debugging Environment Open VS2017, create a new project, select Visual C++ -> Windows Drivers -> Legacy -> Empty … Read more

Windows PCI Device Driver Development Guide: How to Bind Context to WDF Objects

Windows PCI Device Driver Development Guide: How to Bind Context to WDF Objects

When writing WDF drivers, we often need to bind some driver-defined data structures to WDF objects (such as device objects, queue objects, request objects). These data structures provide the driver with the capability to store and manage state information specific to the object, which we commonly refer to as context. These contexts are essentially data … Read more

In-Depth Explanation of LCD Driver at the Kernel Level in Embedded Linux Systems

In-Depth Explanation of LCD Driver at the Kernel Level in Embedded Linux Systems

1. The LCD from the Perspective of Application Engineers An LCD is composed of individual pixels: each row has xres pixels and there are yres rows, resulting in a resolution of: xres * yres. 2. How Colors are Represented in Pixels Colors can be represented using red, green, and blue. This can be done using … Read more

Windows PCI Device Driver Development Guide: PnP Callback

Windows PCI Device Driver Development Guide: PnP Callback

In the previous article, we introduced the driver code generated by the VS KMDF template, providing a preliminary understanding of the driver code. It should be evident that this driver is quite simple, essentially lacking any real functionality. After installing the driver we wrote, this PCIe device remains in the D0 state (if you are … Read more