Unnamed pipe Create: int pipe(int fd[2]); Function: Create and process an unnamed pipe in the kernel, and generate two file descriptors (fd[0] for reading, fd[1] for writing) Return value: 0 for success, -1 for failure fd: the resulting file descriptor Read: the read data will disappear When the write terminal exists: read data will return […]
Tag: linux
Use VScode to read Linux source code
Install and compile dependencies sudo apt install build-essential libncurses-dev bison flex libssl-dev libelf-dev Download kernel source code Download the version you want from www.kernel.org, here is 5.4.34. Configure kernel compilation options cd linux-5.4.34/ make menuconfig The relevant configurations to be noted are as follows make menuconfig # Open debug related options Kernel hacking —> Compile-time […]
Linux blocking and non-blocking
1. Introduction to blocking and non-blocking block non-blocking fd = open(“/dev/xxx_dev”, O_RDWR); //open file in blocking mode fd = open(“/dev/xxx_dev”, O_RDWR | O_NONBLOCK); /* open in non-blocking mode */ 2. Waiting queue 1. Waiting for the head of the queue The biggest advantage of blocking access is that when the device file is inoperable, the […]
Linux–Data Link Layer–ARP Protocol–0319-21
Directory 1. Understanding Ethernet 1.1 Ethernet frame format 1.2 Simple simulation of LAN communication based on Ethernet frame Question 1: What if multiple hosts are sending data? Question 2: Does the sender know that his data has been affected? 1.3 MTU 1.3.1 The influence of MTU on IP protocol 1.3.2 The influence of MTU on […]
[linux] CentOS 7 error: yum command reports “Cannot find a valid baseurl for repo: base/7/x86_6” or cannot access the Internet
1. Error reporting 2. Reason for error The system cannot parse the yum source for the following reasons The virtual machine cannot access the Internet! You need to check the network configuration to confirm that you can access the Internet and then look at the second situation Check if you can access the Internet: ping […]
Linux installation mysql8.0 (the most detailed in the whole station)
Software as Environment Preparation 1. Prepare a Linux server Either cloud server or virtual machine is fine; (The following download is a virtual machine under Windows11) The version of Linux is CentOS7; Download ISO image file address: https://repo.huaweicloud.com/centos/7.9.2009/isos/x86_64/CentOS-7-x86_64-DVD-2207-02.iso Download operating environment: VMware8.0 Please contact QQ: 1742756263—–virtual machine installation tutorial/packaging software/Sinicization/serial number because it cannot be […]
Several ways of communication between Linux user mode and kernel mode
Due to the limitation of CPU permissions, the communication between Linux user mode and kernel mode is not as simple as the imaginary use of inter-process communication. Today’s article will take a look at the communication methods between Linux user mode and kernel mode. When we usually write code, we usually access the kernel space […]
IP address, subnet mask, gateway (Linux view and configuration)
1.IP address IP address = network address + host address, hosts with the same network address (network number) are hosts in the local network and can communicate with each other directly, while hosts with different network addresses are hosts in the remote network, and the mutual communication must be through the local Gateway (Gateway). Including […]
Loop Statement of Linux Shell Script
1. echo echo -n // means no newline output echo -e //Output escape characters, and output the escaped content to the screen Common escape characters Escape Symbol Meaning -n means no newline output \e output escape character, output the escaped content to the screen \b After escaping, it is equivalent to pressing the backspace key, […]
Linux system shell script to install MYSQL with one click
This article uses the configuration source to install MYSQL, the configuration source address is http://repo.mysql.com/, you can download the version you need by yourself, my installation environment: debian10 1. Configuration source installation MYSQL process This part is manual installation. If you need shell script to install automatically, you can skip this part and go directly […]