我正在尝试在 Ubuntu 上编写一个简单的设备驱动程序。我想使用 Eclipse(或适合驱动程序编程的更好的 IDE)来做到这一点。这是代码:
#include <linux/module.h>
static int __init hello_world( void )
{
printk( "hello world!\n" );
return 0;
}
static void __exit goodbye_world( void )
{
printk( "goodbye world!\n" );
}
module_init( hello_world );
module_exit( goodbye_world );
Run Code Online (Sandbox Code Playgroud)
经过一番研究,我决定使用Eclipse CTD来开发驱动程序(虽然我仍然不确定它是否支持多线程调试工具)。所以我:
eclipse-cdt和linux-headers-2.6.38-8,C Project命名TestDriver1并复制粘贴到上面的代码,make以下自定义构建命令:make -C /lib/modules/2.6.38-8-generic/build M=/home/isaac/workspace/TestDriver1
当我尝试使用 eclipse 构建此项目时出现错误。这是构建的日志: …