Home > Operation and Maintenance > Linux Operation and Maintenance > 5 pieces of advice that novices must listen to after joining the Linux driver position

5 pieces of advice that novices must listen to after joining the Linux driver position

Release: 2023-07-31 15:50:19
forward
1359 people have browsed it

1. Don’t just use printk

In addition to printk, there are many in the kernel For printing functions such as pr_info and pr_err, you must learn to control the printing level and use different printing functions for different scenarios.

2. Novices should not change defconfig directly

The kernel has a default configuration filexxx_defconfig, If you want to modify some kernel configurations, as a novice, do not modify xxx_defconfig directly.

The safe way is to execute make menucofigusual menu to configure, and finally overwrite the .config filexxx_defconfig, and then upload thisxxx_defconfig.

3. Do not map each physical address directly

The operation register under Linux must be mapped first, but usually only the base is mapped Address is operated by base address plus offset.

Don’t directly map the physical address of each register, because for a certain driver, although there are many registers, the base addresses are all the same.

4. Don’t learn uboot

Even if you are a Linux driver, uboot You must know how to start kernel, what parameters are passed, what addresses are involved, and how to write the driver of uboot.

5. If you don’t understand memory, it’s not enough to talk about drivers

Be sure to read more about memory knowledge. All operations under Linux are virtual addresses, and what is written into the register is the physical address. How to know the physical address corresponding to the virtual address? What is the difference between allocating DMA consistent memory and allocating normal memory?

The address written in the register manual is the physical address, so I remembered it .

dma memory problems, cache consistency problems, etc., you can't escape these .

The above is the detailed content of 5 pieces of advice that novices must listen to after joining the Linux driver position. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:嵌入式Linux充电站
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template