Linux Kernel-CPU Cache and Memory Barrier

1. CPU cache The origin of cpu cache In all instruction fetch cycles of the CPU (program calculation), the memory needs to be accessed at least once (that is, what we call data on physical memory) It usually requires multiple accesses to the memory to fetch operands or save results. The speed of CPU processing […]

2.3 Windows driver development: kernel string conversion method

In kernel programming, strings have two formats: ANSI_STRING and UNICODE_STRING. These two formats are safe versions of string structures introduced by Microsoft and are also formats recommended by Microsoft. , usually the type represented by ANSI_STRING is char *, which is a string in multi-byte mode of ANSI, and UNICODE_STRING represents wchar*, which is a […]

RT-Thread kernel-kernel API update log ①

RT-Thread kernel-kernel API update log① RT-Thread Kernel-Kernel API Update Log RT-Thread kernel-kernel API update log summary 1. New functions 2. Improvement and optimization 3. Fix the problem 4. Summary Kernel API update log 5.0.1 API addition: 5.0.0 API addition: 4.1.1 4.1.1-beta 4.1.0 API addition: API removal: API changes: 4.0.4 API addition: API removal: API changes: […]

RT-Thread kernel-atomic operation ①

RT-Thread kernel-atomic operation ① RT-Thread Kernel-Atomic Operations Atomic operations Introduction to atomic operations Advantages of Atomic Operations Implementation and usage of RT-Thread atomic operations RT-Thread Atomic Operation API Comprehensive example RT-Thread kernel-atomic operation Atomic operations Introduction to atomic operations Atomic operation refers to an indivisible operation that either executes completely successfully or does not execute […]

What is the Linux kernel and what is the memory management subsystem? Chapter 7 – Small memory allocation (5)

Continuing from the previous article: What does the Linux kernel have and what does the memory management subsystem have? Chapter 6 – Small memory allocation (4) References to this article: linux process virtual address space “Interesting Talk about the Core Principles of Linux Operating System: Part 4 Memory Management–Liu Chao” 4.6 In-depth understanding of Linux […]

Linux kernel critical section, mutex, semaphore

1. Critical section: Access public resources or a piece of code through serialization of multi-threads. It is fast and suitable for controlling data access. 2. Mutex: Designed to coordinate individual access to a shared resource. 3. Semaphore: Designed to control a resource with a limited number of users. Critical Section A simple way to ensure […]

C# OpenCvSharp corn kernel counting

Effect Project Code using OpenCvSharp; using System; using System.Drawing; using System.Text; using System.Windows.Forms; namespace OpenCvSharp_Demo { public partial class frmMain : Form { public frmMain() { InitializeComponent(); } string fileFilter = “*.*|*.bmp;*.jpg;*.jpeg;*.tiff;*.tiff;*.png”; string image_path = “”; DateTime dt1 = DateTime.Now; DateTime dt2 = DateTime.Now; Mat image; Mat result_image; StringBuilder sb = new StringBuilder(); private void […]

2023-2024-1 20232831 “Linux Kernel Principles and Analysis” Eighth Week Assignment

Article directory 1. How the Linux kernel loads and starts an executable program 2. Experimental process 1. Understand the compilation and linking process and the ELF executable file format 2. Programming uses the exec* library function to load an executable file, and programming practices two ways of using dynamic link libraries. 3. Use gdb to […]