从哪里开始学习 Linux DMA/设备驱动/内存分配
我正在移植/调试设备驱动程序(由另一个内核模块使用)并面临死胡同,因为 dma_sync_single_for_device() 因内核错误而失败。
我不知道这个函数应该做什么,而且谷歌搜索也没有什么帮助,所以我可能需要了解更多关于这个东西的知识。
问题是,从哪里开始呢?
哦,是的,如果相关的话,代码应该在 PowerPC 上运行(Linux 是 OpenWRT)
编辑: 最好有在线资源(书籍需要几天才能送达:)
I'm porting / debugging a device driver (that is used by another kernel module) and facing a dead end because dma_sync_single_for_device() fails with an kernel oops.
I have no clue what that function is supposed to do and googling does not really help, so I probably need to learn more about this stuff in total.
The question is, where to start?
Oh yeah, in case it is relevant, the code is supposed to run on a PowerPC (and the linux is OpenWRT)
EDIT:
On-line resources preferrable (books take a few days to be delivered :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在线:
Linuxlab 分配器剖析
了解 Linux 虚拟内存管理器
Linux 设备驱动程序,第三版
Linux 内核模块编程指南
在 Linux 中编写设备驱动程序:简要教程
书籍:
Linux 内核开发(第二版)
基本 Linux 设备驱动程序(仅前 4 - 5 章)
有用的资源:
Linux 交叉参考(所有内核的可搜索内核源代码)
2.6 内核系列中的 API 更改
dma_sync_single_for_device
进一步调用dma_sync_single_range_for_cpu
在文件中,这是源文档(我假设即使这是针对arm的,接口和行为是相同的):On-line:
Anatomy of the Linux slab allocator
Understanding the Linux Virtual Memory Manager
Linux Device Drivers, Third Edition
The Linux Kernel Module Programming Guide
Writing device drivers in Linux: A brief tutorial
Books:
Linux Kernel Development (2nd Edition)
Essential Linux Device Drivers ( Only the first 4 - 5 chapters )
Useful Resources:
the Linux Cross Reference ( Searchable Kernel Source for all Kernels )
API changes in the 2.6 kernel series
dma_sync_single_for_device
callsdma_sync_single_range_for_cpu
a little further up in the file and this is the source documentation ( I assume that even though this is for arm the interface and behavior are the same ):了解 Linux 内核?
Understanding The Linux Kernel?
Linux Device Drivers 一书(与 Understanding the Linux Kernel 同系列,由 @Matthew Flaschen 推荐)可能会有用。
您可以从LWN 网站下载各个章节。 第 16 章涉及 DMA。
The chapters of the Linux Device Drivers book (in the same series as Understanding the Linux Kernel, recommended by @Matthew Flaschen) might be useful.
You can download the indiivudal chapters from the LWN Website. Chapter 16 deals with DMA.