How to Write a Block Device Driver

How to Write a Block Device Driver

First, refer to the kernel code in z2ram.c Simulate a block device driver using memory The specific process of a block device driver: 1. Register the block device with the kernel int register_blkdev(unsigned int major, const char *name) Parameter 1: major write 0 to automatically get the major device number Parameter 2: The registered name … Read more

Rust Takes Over C: Notable C Projects Rewritten in Rust

Rust Takes Over C: Notable C Projects Rewritten in Rust

Welcome to subscribe to my paid column “Zhang Handong’s Rust Channel” on Mowen Dongxi, where I take you deep into understanding everything related to the Rust language, its ecosystem, and applications in the commercial field. This article is an excerpt from it. “ The purpose of this article is not to praise Rust, but to … Read more

How to Write and Run C Programs in VC++2010

How to Write and Run C Programs in VC++2010

Since March 2018, the development environment for the national Level 2 C and C++ language exams has changed from VC6.0 to VC++2010 Express. For users accustomed to VC6.0, it may take some time to adapt to VC++2010, but it offers more powerful features, and after a while, it feels quite good. Below, I will share … Read more

In-Depth Notes on ZephyrRTOS (2): Basic Program Structure and Multithreading

In-Depth Notes on ZephyrRTOS (2): Basic Program Structure and Multithreading

I believe that the most important aspect of embedded systems is the scheduler, which I think is also the main value of FreeRTOS. However, in addition to the debugger, ZephyrRTOS offers much more. Main Thread The ZephyrRTOS kernel starts the Main Thread after completing the necessary startup tasks, including the initialization of drivers, before entering … Read more

Introduction to Zephyr C Standard Library

Introduction to Zephyr C Standard Library

C Standard Library Zephyr provides several C standard libraries for users: Generic C Library Minimal libc Newlib Picolibc Generic C Library The Generic C Library is not a complete C standard library; it provides some C library functions to be used in conjunction with other C standard libraries, mainly to address: Providing functionalities that other … Read more

Picolibc: A C Standard Library for Embedded Systems

Picolibc: A C Standard Library for Embedded Systems

Picolibc is a C standard library suitable for small microcontroller embedded systems, which can operate in low memory (RAM) devices. Picolibc is an upgraded version of “newlib-nano” that lacks a mature stdio lib, using a lightweight stdio lib from avrlibc, making it more suitable for low memory embedded devices. Zephyr introduced Picolibc in v3.3.0, and … Read more

Understanding Zephyr Build System Process

Understanding Zephyr Build System Process

The build process of Zephyr is divided into two main stages: the configuration stage and the compilation stage. The configuration stage generates the necessary configuration items, while the compilation stage selects the source code to compile based on the configuration items and links them into the final executable file. The configuration stage is driven by … Read more

Zephyr Timing Measurement

Zephyr Timing Measurement

Zephyr provides a set of timing APIs for measuring code execution time, helping to analyze and optimize code. These timing APIs may use a different timer than the default kernel timer, and the timer used is specified by the architecture, SoC, or board configuration. API The timing APIs are defined in zephyr/include/zephyr/timing/timing.h and will only … Read more

How printf() Works with UART Peripheral Driver Functions

How printf() Works with UART Peripheral Driver Functions

Today, I will share with you the hardware UART peripheral debugging output mechanism under IAR. In the embedded world, outputting print information is a very common auxiliary debugging method. With the help of print information, we can easily locate and analyze program issues. There are many ways to implement print information output in embedded application … Read more

Configuring MinGW in VSCode for C Language

Configuring MinGW in VSCode for C Language

C Language Editor VSCode VSCode is a personal favorite editor software. I have run three terminals simultaneously in VSCode, developing in Python, Golang, and C language. The download link is as follows: code.visualstudio.com Configuring MinGW in VSCode To configure MinGW in VSCode, follow these steps: Install the C/C++ extension from the extensions in VSCode; Create … Read more