ldd3-examples-3.x
=================
port of the ldd3 source code examples after linux 3.x
Backgroud
=================
ldd3 is Linux Device Drivers, Third Edition.
This is a great book about how to write linux device drivers.
You can get this book and its source code examples free
from http://lwn.net/Kernel/LDD3/.
But, the souce code examples in the book are based on linux 2.6.10,
which was released in 2005. This means that all the original examples
won't compile in the current linux 3.x branch. I've ported all examples
to the longterm stable branch after linux 3.0, including:
|branch |original release date|
|----------------|:--------------------:|
|linux 3.0 |July 2011 |
|linux 3.2 |January 2012 |
|linux 3.4 |May 2012 |
|linux 3.10 |June 2013 |
|linux 3.12 |November 2013 |
|linux 3.14 |March 2014 |
|linux 3.16 |August 2014 |
|linux 3.18 |December 2014 |
|linux 4.1 |June 2015 |
|linux 4.4 |January 2016 |
|linux 4.9 |December 2016 |
The key difference between this project and other porting attemps is that
all these examples not only compile on the modern kernel version,
but they also **RUN** on the modern kernel!
Quick start
=================
a. clone this repo
b. checkout to branch which is nearest to your linux kernel version
c. just type ```make``` to build ldd3 examples
How to port
=================
(This section is for developers who want to port ldd3 examples by themselves,
reading previous quick start section is enough for the beginners.)
Make it compile.
-----------------
a. clone linux-stable repo from
http://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable.git
b. Use git log to find out who changed what when. Then determine what is causing
it to not compile. then change ldd3 examples according to those commits.
If compiling errors are 'XXX symbol not found', find root causing commits by:
```
$git log -p <XXX symbol's file path in original linux version> |\
grep <XXX symbol>
```
c. Use git bisect when git log fails to work.
Make it run.
-----------------
First you should understand the original examples,
Second you should understand the related commits in the modern linux version.
If you still can't fix the bug, debug it using below methods:
a. compare similar driver code in linux-stable.
For example: debuging snull by refering to loopback.c,
debug sbull by refering to loop.c...
b. printk
c. gdb/qemu.
compile busybox+linux running in qemu, load buggy module, use gdb to debug it.
Embedded Linux From Scratch is useful when doing such tasks, refer to
http://free-electrons.com/docs/elfs/.
Update Ubuntu kernel.
-----------------
download from http://kernel.ubuntu.com/~kernel-ppa/mainline/.
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
linux设备驱动程序开发 第三版 源码 (103个子文件)
snull.c 17KB
short.c 17KB
main.c 16KB
usb-skeleton.c 16KB
tiny_tty.c 16KB
main.c 15KB
shortprint.c 14KB
main.c 13KB
main.c 13KB
main.c 13KB
pipe.c 11KB
access.c 11KB
sbull.c 11KB
jit.c 8KB
jiq.c 6KB
tiny_serial.c 6KB
silly.c 6KB
skull_init.c 6KB
simple.c 5KB
lddbus.c 4KB
outp.c 3KB
mmap.c 3KB
mmap.c 3KB
mmap.c 3KB
mmap.c 3KB
inp.c 3KB
netifdebug.c 2KB
kdataalign.c 2KB
mapper.c 2KB
sleepy.c 2KB
complete.c 2KB
dataalign.c 2KB
seq.c 2KB
faulty.c 2KB
mapcmp.c 2KB
asynctest.c 1KB
kdatasize.c 1KB
setconsole.c 1KB
setlevel.c 1KB
datasize.c 1KB
polltest.c 1KB
nbtest.c 1KB
pci_skel.c 1KB
hellop.c 1KB
load50.c 925B
hello.c 463B
skull_clean.c 310B
gdbline 417B
scull.h 5KB
sculld.h 4KB
scullc.h 3KB
scullp.h 3KB
scullv.h 3KB
sbull.h 2KB
snull.h 1KB
shortprint.h 1KB
lddbus.h 855B
scull.init 3KB
LICENSE 1KB
Makefile 1016B
Makefile 805B
Makefile 780B
Makefile 780B
Makefile 780B
Makefile 773B
Makefile 752B
Makefile 750B
Makefile 743B
Makefile 735B
Makefile 735B
Makefile 734B
Makefile 548B
Makefile 500B
Makefile 303B
Makefile 289B
Makefile 237B
Makefile 5B
src_layout.md 3KB
README.md 3KB
git-misc.md 124B
test_with_g_zero.patch 917B
sbull_load 1KB
sbull_unload 184B
scull_load 2KB
scull_unload 335B
scullc_load 755B
scullc_unload 182B
sculld_load 755B
sculld_unload 182B
scullp_load 755B
scullp_unload 182B
scullv_load 755B
scullv_unload 182B
short_load 2KB
short_unload 237B
shortprint_load 624B
shortprint_unload 174B
simple_load 737B
simple_unload 170B
snull_load 171B
共 103 条
- 1
- 2
资源评论
huochao_suma
- 粉丝: 0
- 资源: 11
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功