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.
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 menucofig
usual menu to configure, and finally overwrite the .config
filexxx_defconfig
, and then upload thisxxx_defconfig
.
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.
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
.
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!