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 […]

What does the Linux kernel have and what does the memory management subsystem have? Chapter 6 – Small memory allocation (4)

Continuing from the previous article: What does the Linux kernel have and what does the memory management subsystem have? Chapter 5 – Small memory allocation (3) 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” Thanks! 2. Small memory allocation […]

Linux interrupt subsystem (4) interrupt application registration

Linux interrupt subsystem (4) interrupt application registration Remark: 1. Kernel version: 5.4 2. Use tools: Source Insight 4.0 3. Reference blog: Linux interrupt subsystem (1) interrupt controller and driver analysis Linux interrupt subsystem (2)-general framework processing Compilation of vomiting blood | Ganfan Linux interruption all knowledge points Linux kernel interrupt subsystem (5): driver application interrupt […]

Programming LED lights based on GPIO subsystem

#include <stdlib.h> #include <stdio.h> #include <sys/types.h> #include <sys/stat.h> #include <sys/ioctl.h> #include <fcntl.h> #include <unistd.h> #include <string.h> // Construct the function code to turn the lights on and off #define LED_ON _IOW(‘l’, 1,int) #define LED_OFF _IOW(‘l’, 0,int) int main(int argc, char const *argv[]) { char buf[128] = {0}; int a, b; int fd; while (1) { […]

20231027 The core and application layer based on STM32mp157a control LED lights and timer functions through subsystems

1. Write an LED driver based on the GPIO subsystem and write an application for testing stm32mp157a-fsmp1a.dts Kernel program: ledk.c #include <linux/init.h> #include <linux/module.h> #include <linux/of.h> #include <linux/of_gpio.h> #include <linux/delay.h> #include <linux/timer.h> struct device_node *dnode1; struct gpio_desc *gpiono1; struct gpio_desc *gpiono2; struct gpio_desc *gpiono3; struct timer_list mytimer; unsigned int *vir_rcc; struct class *cls; struct device […]

Linux driver i2c subsystem 0.96 inch oled

Foreword: There is no preface. For relevant knowledge, please refer to my other blog. This one is for practice. The general idea is still to write the i2c device address in the device tree, register the i2c driver in the driver code, write the “hard operation of entering the number and note section” in the […]

Linux driver i2c subsystem mpu6050

Foreword: In fact, there is nothing new, because the Linux kernel implements the principle of separation of devices and drivers, and the process of i2c driver development is not much different from that of platform bus device driver development. This i2c subsystem is also the system that helps us prepare the bus. In terms of […]

pinctrl subsystem – source code analysis (5)

1, pincontroller (pinctrl server) structure 1, pin controller driver matches device and executes probe diwali_pinctrl_init platform_driver_register( & amp;diwali_pinctrl_driver); //Find the device according to the match table diwali_pinctrl_probe pinctrl_data = of_device_get_match_data( & amp;pdev->dev);//Get msm_pinctrl_soc_data msm_pinctrl_probe(pdev, pinctrl_data);//Pass soc data 2, probe process int msm_pinctrl_probe(struct platform_device *pdev, const struct msm_pinctrl_soc_data *soc_data) { // 1) Allocate a msm_pinctrl structure […]

pinctrl subsystem – coupling between pinctrl and gpio (6)

1. The relationship between gpio subsystem and pinctrl subsystem As software engineers, our expected hardware design should be as shown below: The HW block of GPIO should have an equal relationship with other function multiplexed blocks. They are jointly input to a multiplexer block. The register of this block controls which functional circuit is currently […]