1.Linux login interface1. Check the current file directory: After connecting to the Linux system through Xshell Enter the command: ls 2. Create a new code/kernel folder 2. Write code1. Create hello_module.c Command: vim hello_module.c 2. Press i to enter edit mode and enter the following code The above code is explained as follows: 3. Save and exit, and press ESC to view the file directory; 3. Write the Makefilevim Makefile obj-m := hello_module.o KERNELBUILD := /lib/modules/$(shell uname -r)/build CURRENT_PATH := $(shell pwd) all: make -C $(KERNELBUILD) M=$(CURRENT_PATH) modules clean: make -C $(KERNELBUILD) M=$(CURRENT_PATH) clean The above code is explained as follows: :wq save and exit 4. Compile:Enter the command: make You can see the compiled files Check compiled modules You can also use the modinfo command to further check: 5. Insert moduleInsert the module using the insmod command. After the insertion is complete, you can use the lsmod command to check whether the current module has been loaded into the system: The first one is. After the system loads the module, it will also create a new directory named after the module under the "/sys/module" directory: 6. View log outputSince prink() uses the default output level in this demonstration, you can view the output results through the "dmesg" or "tail /var/log/kern.log" command. This is the end of this article about Ubuntu compiling kernel modules and the content reflected in the system log. For more relevant content about Ubuntu compiling kernel modules, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Concat() of combined fields in MySQL
>>: Using CSS3 and JavaScript to develop web color picker example code
Nginx (engine x) is a high-performance HTTP and r...
PCIE has four different specifications. Let’s tak...
Preface Today, when I was using a self-written co...
This article example shares the specific code of ...
This article shares the specific code of typescri...
Install Docker Update the yum package to the late...
Load balancing is a commonly used device in serve...
Common comments in HTML: <!--XXXXXXXX-->, wh...
Each of these 16 sites is worth reading carefully,...
I have been in contact with MGR for some time. Wi...
Typical layout examples As shown in the above pic...
MySQL-Group-Replication is a new feature develope...
As a technical novice, I am recording the process...
Page Description: Main page: name —> shisheng...
Table of contents Preface 1. JDBC timeout setting...