Linux 系统中 USB 设备开发与管理全解析
1. 代码运行警告
在 Linux 系统中,部分代码示例会直接与计算机设备交互,这些代码对设备和内核版本极为敏感。某些方法可能会因设备(芯片组)和内核版本的不同而异常终止。不过,这种异常终止不会导致系统崩溃,但会使模块加载异常,且模块残留无法卸载。例如:
$ sudo insmod lab1_dma.ko
Убито
$ lsmod | head -n3
Module Size Used by
lab1_dma 1412 1
8021q 20506 0
$ dmesg | tail -n50
...
[ 1485.891268] lab1_dma: loading out-of-tree module taints kernel.
[ 1485.891505] => kbuf=ffff880035c50000, handle= 35c50000, size = 40960
[ 1485.891509] => (kbuf-handle)= ffff880000000000, 18446612132314218496,
PAGE_OFFSET=18446612132314218496, compare=0
[ 1485.891510] => string written was, This is the dma_alloc_coherent() string
[ 1485.891533] BUG: unable to handle kernel NULL pointer
超级会员免费看
订阅专栏 解锁全文
1878

被折叠的 条评论
为什么被折叠?



