非教程,仅记录学习过程
S081官网今天爆了 顺手开个新坑学一下x
Lab1
bootlin原始教程基于stable 6.7版本完成,本贴编写时kernel stable 版本为6.12,因此本贴将尝试使用6.12完成后续内容
git checkout -b stable-6.12 stable/linux-6.12.y
Exploring the sources manually
-
Find the Linux logo image in the sources2 .
find . -name "*logo*"
-
Find who the maintainer of the MVNETA network driver is.
linux目录下有一个MAINTAINER文本文档记录了维护者信息,在其中搜索即可。 -
Find the declaration of the platform_device_register() function.
我目前一般使用ripgrep
进行搜索。GNU grep也可以通过部分参数来进行快速查找。
unclebiglu@ublhw:~/Documents/repo/bootlin/src/linux$ rg -g "*.h" platform_device_register
include/linux/platform_device.h
52:extern int platform_device_register(struct platform_device *);
136:extern struct platform_device *platform_device_register_full(
140: * platform_device_register_resndata - add a platform-level device with
153:static inline struct platform_device *platform_device_register_resndata(
169: return platform_device_register_full(&pdevinfo);
173: * platform_device_register_simple - add a platform-level device and its resources
194:static inline struct platform_device *platform_device_register_simple(
198: return platform_device_register_resndata(NULL, name, id,
203: * platform_device_register_data - add a platform-level device with platform-specific data
218:static inline struct platform_device *platform_device_register_data(
222: return platform_device_register_resndata(parent, name, id,