当前位置:网站首页>LDD knowledge sorting
LDD knowledge sorting
2022-06-28 16:17:00 【Full stack programmer webmaster】
Hello everyone , I meet you again , I'm your friend, Quan Jun .
Learning summary :
1、 Learn the documentation that comes with the kernel
I read the documentation in the kernel yesterday :
README
Documentation/HOWTOI learned a lot . Got a website http://kernelnewbies.org, some FAQ , Below are
(1) Code Browsing
a) cscope,tags
The original kernel has generated cscope and tags Script for
make cscope
make tagsto make add V=1, You can see which commands are executed .
$ make cscope V=1
/bin/bash linux-2.6.32.63/scripts/tags.sh cscope
.....
+ cscope -b -f cscope.outYou can see that the call is scripts/tags.sh This script .
b) find + grep
Find the structure definition
find . -name ‘*.[chS]’ | xargs grep -EnH “\W*struct\W+task_struct\W*{“
Find the function definition
find . -name ‘*.[chS]’ | xargs grep -EnH “cdev_init\W*\(struct cdev”
notes : find The command is used to determine the type of file to look for , Look here for .c .h .S( assembly ) file .
xargs More critical , Without him , unable Run correctly , It takes the output of the previous command as an argument to the following command .( A pipeline is one that takes the previous output as the subsequent input stdin.)
grep -E Indicates the use of regular expressions . \W Represents a white space character , * Indicates that the preceding character appears 0 Times or times
c) lxr ( Good website )
2、 Get ready ’ console ’
The written driver needs insmod To test . You can prepare a virtual machine for learning driven development . Think of it as your game console !
download fedora 12. use virtual box Install as a virtual machine . Then download the kernel you want to study . I downloaded it 2.6.32
Then compile and install your kernel . After success , Take this kernel as the source tree , Then write the driver , Enjoy insmod Well
( It turns out that the driver is verified on the development board , however LDD3 When the example of does not involve specific hardware , You can use this virtual machine . But how can a real driver not deal with hardware , So finally, you must write a driver for the development board , The most important thing is to put theory into practice !)
Compile and install kernel reference :
http://blog.chinaunix.net/uid-26497520-id-3593098.html
http://lesca.me/archives/config-and-install-kernel.html
http://www.cnblogs.com/parrynee/archive/2010/05/13/1734791.html
download , After decompressing the kernel .
cd linux-2.6.32
cp /boot/config-`uname -r` ./.config
make menuconfig
make
make modules
sudo make install
sudo make modules_installChange the virtual machine run level to text mode : modify /etc/inittab file
id:3:initdefault:Use ssh Log in to the virtual machine . ssh ip Address .
Use screen To manage the call back , Very convenient .
3、 Write driver
The written driver code is put into github, Then write a summary page , Put the link here
4、 Kernel source code analysis
Distribute driver related or other kernel source code
copy_to_user and copy_from_user
Learning materials :
1、LDD3 book
english :
chinese :
http://oss.org.cn/kernel-book/ldd3/index.html
thank Author and open source China oss.org.cn
2、 The code download
kernel 2.6.X http://examples.oreilly.com/9780596005900/
kernel 3.x https://github.com/kerneltravel/ldd3-examples-3.x
other: https://github.com/4get/ldd3_examples
Publisher : Full stack programmer stack length , Reprint please indicate the source :https://javaforall.cn/132879.html Link to the original text :https://javaforall.cn
边栏推荐
- LDD 知识整理
- 中能融合携手天翼云打造“能源大脑”
- 薅羊毛的机会了,点个“赚”即有机会赚取高额佣金
- Geoffrey Hinton:我的五十年深度学习生涯与研究心法
- 同创伟业合伙人童子平:“元宇宙”究竟该投什么
- 机器学习之卷积神经网络使用cifar10数据集和alexnet网络模型训练分类模型,安装labelimg,以及报错ERROR
- 论文解读(GCC)《Efficient Graph Convolution for Joint Node RepresentationLearning and Clustering》
- 【力扣】977. 有序数组的平方
- REDIS00_详解redis.conf配置文件
- 早晨有些犹豫
猜你喜欢

【Proteus仿真】L297驱动步进电机

【Hot100】1. 两数之和

10 years of testing experience, worthless in the face of the physiological age of 35

QQ出现大规模盗号,为什么会这样?就没有解决方法了吗?

Slim gain (sgain) introduction and code implementation -- missing data filling based on generated countermeasure network

讲师征集令 | Apache DolphinScheduler Meetup分享嘉宾,期待你的议题和声音!

抖音实战~我关注的博主列表、关注、取关

Redmibook Pro 14 enhanced version cannot open delta software drastudio_ v1.00.07.52

IPDK — Overview

Opengauss kernel: analysis of SQL parsing process
随机推荐
【Spock】处理 Non-ASCII characters in an identifier
数字藏品热潮之下,你必须知道的那些事儿
成功迁移到云端需要采取的步骤
零钱兑换(动态规划)
The Web3.0 era is coming. See how Tianyi cloud storage resources invigorate the system to enable new infrastructure (Part 1)
ID卡复制教程(使用T5577卡复制4100卡)
Change exchange (dynamic planning)
Briefly introduce the conversion between tensorflow and pytorch (mainly tensorflow to pytorch)
LDD 知识整理
昨日元宇宙| 沃尔玛成立探索元宇宙和Web3的创新部门,Dior发布元宇宙展览
Etcd可视化工具:Kstone简介(一)
Mysql自连接查询「建议收藏」
抖音实战~我关注的博主列表、关注、取关
A little hesitant in the morning
【MySQL】表连接为什么比子查询快
QQ出现大规模盗号,为什么会这样?就没有解决方法了吗?
Etcd visualization tool: an introduction to kstone (I)
机器学习之卷积神经网络使用cifar10数据集和alexnet网络模型训练分类模型,安装labelimg,以及报错ERROR
【Hot100】4. 寻找两个正序数组的中位数
Android, eclipse and MySQL upload pictures and get