附件是一篇介绍linux内核和驱动的英文slides,简明扼要,相比厚重的书籍更能突出重点,以下是基于该slides的一些笔记
linux内核源码查看(参考P59-P62):
1. 客户端方式:可利用Ubuntu12.04及之后版本自带的Kscope工具
2. Web方式:使用lxr(linux cross reference),登录http://lxr.free-electrons.com可直接使用而无需自行配置lxr。
linux内核配置(参考P71-P77):
1. make xconfig,图形化配置,支持全局搜索和将缺失依赖项的item显示为灰色,使用需安装libqt4-dev g++
2. make gconfig,图形化配置,不支持搜索功能,使用需安装libglade2-dev
3. make menuconfig,使用需安装libncurses-dev
注:使用上述命令配置完成之后,都会自动生成一个.config.old文件,其作用是当新的配置不正确时,可通过cp .config.old .config命令来恢复之前的配置。但是,如果是手动方式更改的.config文件,就需要自行调用make oldconfig命令来生成.config.old文件
根文件系统中的内核相关文件(参考P93-P95)
1.内核默认配置文件在内核源码中的arch/<arch>/configs/,生成后的配置文件在根文件系统中的位置为/boot/config-<version>
2. 生成后的内核镜像在根文件系统中的位置为/boot/vmlinuz-<version>
3. 在内核配置时选择以module方式编译的,其在根文件系统中的位置为/lib/modules/<version>/
4. 内核源码在根文件系统中的位置为/usr/src/<version>
编译模块时,使用“make -C (KDIR) M=$(PWD)”脚本,其中KDIR为内核源码目录,该脚本实际是借助了KDIR里的Makefile,并通过M参数让内核知晓其为模块,该内核必须是经过配置的,且还需调用make modules_param为模块编译做好准备(参考P127-P128)
借助内核版本X编译出的模块不能再内核版本Y的系统上运行,否则会报错“Invalid module format”(参考P129)
相关推荐
分享一个来自free electrons公司推出的Linux Kernel and Driver Development Training文档。
Linux kernel and driver development training,Practical Labs https://bootlin.com ,February 19, 2019
Embedded Linux Kernel and Driver Development
processors (PRUs) and lots of peripherals. ▶ 512 MB of RAM ▶ 4 GB of on-board eMMC storage ▶ Ethernet, USB host and USB device, microSD, micro HDMI ▶ 2 x 46 pins headers, with access to many ...
一个人写的, 非常全面, 对新手有用。 Driver development Memory management I/O memory and ports Character drivers Debugging Handling concurrency Processes and scheduling
Linux Kernel and Driver Development Training
嵌入式 linux编程最新超值图书
Embedded Linux Kernel And Drivers development
Embedded Linux kernel and drivers
Linux Kernel Development.pdf Linux Kernel Development.pdf Linux Kernel Development.pdf
Linux Kernel and Driver Development Training
Linux Kernel Development details the design and implementation of the Linux kernel, presenting the content in a manner that is beneficial to those writing and developing kernel code, as well as to ...
Linux Driver Development for Embedded Processors – Second Edition 版本: Learn to develop Linux embedded drivers with kernel 4.9 LTS The flexibility of Linux embedded, the availability of powerful, ...
That is why Sams is excited to bring you the latest Linux kernel development information from a Novell insider in the second edition of Linux Kernel Development. This authoritative, practical guide ...
Mastering Linux Kernel Development
Linux kernel development 3rd edition, the classic good book