usage-model (from linux kernel)

Linux and the Device Tree The Linux usage model for device tree data Author: Grant Likely grant.likely@secretlab.ca This article describes how Linux uses the device tree. An overview of the device tree data format can be found on the device tree usage page at devicetree.org[1]. [1] http://devicetree.org/Device_Tree_Usage The “Open Firmware Device Tree”, or simply Device…

linux 内核 platform_match

/** * platform_match – bind platform device to platform driver. * @dev: device. * @drv: driver. * * Platform device IDs are assumed to be encoded like this: * “<name><instance>”, where <name> is a short description of the type of * device, like “pci” or “floppy”, and <instance> is the enumerated * instance of the…

Linux kernel coding style

Linux kernel coding style This is a short document describing the preferred coding style for the linux kernel. Coding style is very personal, and I won’t force my views on anybody, but this is what goes for anything that I have to be able to maintain, and I’d prefer it for most other things too….

error: implicit declaration of function ‘copy_from_user’

编译内核模块出现以下错误: error: implicit declaration of function ‘copy_from_user’ [-Werror=implicit-function-declaration] 解决办法: 添加头文件: #include <linux/uaccess.h> 原因: asm/uaccess.h does not have copy_to_user on kernel > 4.11. https://github.com/raspberrypi/linux/commit/701cac61d0250912b89cbc28589969530179099a#diff-073429958395ac01bbdf79a3face785d https://github.com/raspberrypi/linux/commit/d597580d373774b1bdab84b3d26ff0b55162b916

shell脚本运行中自动输入密码

需求:有一个shell脚本autoload.sh 需要运行过程中自动输入密码,而不用手工。 解决方法: 使用管道,并使用-S参数来指定密码输入方式: echo ‘mindthink’ | sudo -S ./autoload.sh 其中 mindthink 为密码。 参考链接