如何为program.c创建makefile,以及如何在实时应用程序界面中编译和执行
我有一个如何为program.c创建makefile,以及如何在实时应用程序界面中编译和执行,c,makefile,linux-kernel,real-time,rtai,C,Makefile,Linux Kernel,Real Time,Rtai,我有一个hollowworld.c: /* hello.c */ #include <linux/kernel.h> #include <linux/module.h> MODULE_LICENSE("GPL"); int init_module(void) { printk("Hello world!\n"); /* printk = kernel printf, to the console */ return 0; } void cleanup_mod
hollowworld.c
:
/* hello.c */
#include <linux/kernel.h>
#include <linux/module.h>
MODULE_LICENSE("GPL");
int init_module(void)
{
printk("Hello world!\n"); /* printk = kernel printf, to the console */
return 0;
}
void cleanup_module(void)
{
printk("Goodbye world!\n");
return;
}
/*hello.c*/
#包括
#包括
模块许可证(“GPL”);
int init_模块(void)
{
printk(“Hello world!\n”);/*printk=kernel printf,到控制台*/
返回0;
}
空洞清理_模块(空洞)
{
printk(“再见,世界!\n”);
返回;
}
如何为program.c创建makefile,以及如何在实时应用程序接口中编译和执行 要编译内核模块,请参阅内核源代码树中的其他驱动程序。在您的示例中,您会发现Makefile非常简单:
obj-M += hollowworld.o
这是一个内核模块,你所说的“实时应用程序”是什么意思?实时应用程序界面,好的,但这与你发布的内核模块代码有什么关系?