Linux 网络驱动程序移植到 ARM
我有一个最初为 2.4 内核编写的 Linux 网络驱动程序。它工作完美。
我想将其移植到内核 2.6.31,然后移植到具有相同内核(即 2.6.31)的 ARM Linux。我实际上对驱动程序做了一些小的更改,以便它能够在内核 2.6.31 下编译,并且加载和卸载时不会崩溃。它还针对 ARM Linux 进行交叉编译。但目前我还无法在 ARM 上进行测试。
如何检查驱动是否与目标内核完全兼容,需要考虑哪些因素才能兼容ARM。
该驱动程序是虚拟网络设备驱动程序。
提前致谢。
I have a Linux network driver that was originally written for 2.4 kernel. It works perfect.
I want to port it to kernel 2.6.31 and then to ARM Linux with same kernel i.e. 2.6.31. I have actually done some minor changes to the driver so that it is able to compile under kernel 2.6.31 and it also loads and unloads without crashing. It also cross compiles for the ARM Linux. But I am unable to test it on ARM so far.
How do I check that the driver is fully compatible with the target kernel, and what considerations shall be made to make it compatible with ARM.
The driver is a virtual network device driver.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
也许您可以使用 Qemu (http://wiki.qemu.org/Main_Page) 来模拟 ARM 平台能够测试您的驱动程序。
Maybe you could use Qemu ( http://wiki.qemu.org/Main_Page) to emulate an ARM platform to be able to test your driver.
您不能这样检查驱动程序 - 您必须考虑 2.6.x 系列内核中的 API 更改。与 2.4 系列相比,API 的总体变化非常显着,目前尚未使用。
我建议您前往此处亚马逊书店特别推荐这本书。这本书的名字是“Essential Linux Device Drivers”,作者是 Sreekrishnan Venkateswaran。非常详细的解释将指导您确保其正常工作。
既然您提到设备驱动程序是一个网络,大概是字符设备(您不是以块的形式访问它),好消息是字符设备的 2.6.x 系列内核 API 明显更容易且更集中on - 事实上,很多框架已经就位,该书的作者在其中解释得非常清楚。
顺便说一句,本书重点介绍 2.6.19 之后的后一个 2.6.x 系列,因此这将帮助您了解需要做什么来确保您的驱动程序正常工作。
您没有指定您的目标 ARM 芯片组吗?
至于测试...好吧..也许是最好的方法,这取决于您如何回答上述有关 ARM 芯片组的问题 - 如果是 ARMv6,那么也许是一款便宜的 Android 手机,您可以轻松解锁并root,然后将内核放入其中,看看会发生什么 - 抱歉,听起来很做作,但这是我能想到的最好的事情,这就是我脑海中浮现的内容,使您能够测试它以便于测试:)
PS:A很多便宜的ARMv6 手机将具有运行 Froyo 的内核 2.6.32(如果这有任何帮助的话)!
You cannot check the driver like that - you have to consider the API changes within 2.6.x series kernel. The changes are quite significant and the overall of the API's from the 2.4 series which is not currently in use.
I would suggest you to go here to the Amazon book store for this book in particular. The book is called 'Essential Linux Device Drivers', by Sreekrishnan Venkateswaran. A very well detailed explanation that will be your guidance in ensuring it works properly.
Since you mentioned the device driver is a network, presumably char device (You're not accessing it in blocks), well, the good news is that the 2.6.x series kernel APIs for the character devices are significantly easier and more centralized to focus on - in fact a lot of the framework is already in place in which the author of said book explains very clearly.
By the way, the book focusses on the latter 2.6.x series after 2.6.19, so this will help you clue in on what needs to be done to ensure your driver works.
You did not specify the ARM chipset you're targetting?
As for testing... well.. perhaps the best way to do this, this is dependant on how you answer the above question to you regarding ARM chipset - if its ARMv6, then perhaps, a cheap android handset that you can easily unlock and root, and pop the kernel in there and see what happens - sorry for sounding contrived but that's the best thing I can think of and that's what pops into my head, to enable you to test it out for ease of testing :)
PS: A lot of cheap ARMv6 handsets would have kernel 2.6.32 running Froyo if that's of any help!