当前位置:网站首页>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/HOWTO
I 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 tags
to 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.out
You 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_install
Change 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
边栏推荐
- Visual studio 2019 software installation package and installation tutorial
- 【初学者必看】vlc实现的rtsp服务器及转储H264文件
- 你好,现在网上炒股开户买股票安全吗?
- Geoffrey Hinton: my 50 years of in-depth study and Research on mental skills
- Coding Devops helps Sinochem information to build a new generation of research efficiency platform and drive the new future of "online Sinochem"
- Briefly introduce the conversion between tensorflow and pytorch (mainly tensorflow to pytorch)
- 同创伟业合伙人童子平:“元宇宙”究竟该投什么
- The sadness of software testers is Their own technical ability can not meet the requirements of large manufacturers?
- Mysql自連接查詢「建議收藏」
- 北京有哪些牛逼的中小型公司?
猜你喜欢
3. Caller 服务调用 - dapr
A new 25K byte from the Department showed me what the ceiling is
Naacl 2022 | distillation of machinetranslation SOTA model
IPDK — Overview
wallys/DR7915-wifi6-MT7915-MT7975-2T2R-support-OpenWRT-802.11AX-supporting-MiniPCIe-Module
Among US private server setup
首次失败后,爱美客第二次冲刺港交所上市,财务负责人变动频繁
Internet of things cloud convergence Security Guide
Etcd visualization tool: an introduction to kstone (I)
运维-- 统一网关非常必要
随机推荐
【Hot100】3. 无重复字符的最长子串
GAIN的代码实现(4)——基于GAN的Spam数据集缺失数据填补(序)【改进版】
大神详解开源 BUFF 增益攻略丨直播讲座
Ffmpeg forbidden output banner log (30)
24岁秃头程序员教你微服务交付下如何持续集成交付,学不会砍我
Big God explains open source buff gain strategy live lecture
What useful supplier management systems are available
麻烦问一下,我数据库中写入占99%查询很少,用按量付费模式还是预留模式比较好?
【MySQL】官网文档学习之查询语句sql注意事项
MySQL auto - Connect Query recommended favorites
LDD 知识整理
Open source technology exchange - Introduction to Chengying, a one-stop fully automated operation and maintenance manager
Qt5.5.1 configuring msvc2010 compiler and WinDbg debugger
【Proteus仿真】L297驱动步进电机
访中国信通院王蕴韬:数实融合赋能文化产业繁荣发展
全球陆续拥抱Web3.0,多国已明确开始抢占先机
Redmibook Pro 14 enhanced version cannot open delta software drastudio_ v1.00.07.52
Mysql自連接查詢「建議收藏」
#夏日挑战赛#OHOS构建自定义服务实战
Technical secrets of ByteDance data platform: implementation and optimization of complex query based on Clickhouse