WARNING: "rt_task_init" [*.ko] undefined!
YamatoKira <[email protected]> Thu, 29 Sep 2016 11:35:49 +0800
| Newsgroups | gmane.linux.real-time.rtai |
|---|---|
| Message-ID | <[email protected]> |
Hi, everyone
I am building the simple rtai kernel module showed in RTAI 3.4 User Manual rev 0.3, and I got a warning which said that the rt_task_init was not defined during the make process and an error about
Invalid Parameters when I tried to insert the *.ko file. The nm commands seems to verify this.
The outputs of the make/insmod/nm commands are:
***********************************************************************
root@Justice:/home/athrun/桌面/mRTAIcodes/KernelMode#
make
make
-C /lib/modules/3.4-9-rtai-686-pae/build
M=/home/athrun/桌面/mRTAIcodes/KernelMode
modules -I/usr/realtime-3.4-9-rtai-686-pae/include
make[1]:
Entering directory `/usr/src/linux-headers-3.4-9-rtai-686-pae'
CC
[M] /home/athrun/桌面/mRTAIcodes/KernelMode/rtai_kernel_mode_task2.o
Building
modules, stage 2.
MODPOST
1 modules
WARNING:
"rt_task_init"
[/home/athrun/桌面/mRTAIcodes/KernelMode/rtai_kernel_mode_task2.ko]
undefined!
CC
/home/athrun/桌面/mRTAIcodes/KernelMode/rtai_kernel_mode_task2.mod.o
LD
[M] /home/athrun/桌面/mRTAIcodes/KernelMode/rtai_kernel_mode_task2.ko
make[1]:
Leaving directory `/usr/src/linux-headers-3.4-9-rtai-686-pae'
root@Justice:/home/athrun/桌面/mRTAIcodes/KernelMode#
insmod rtai_kernel_mode_task2.ko
Error:
could not insert module rtai_kernel_mode_task2.ko: Invalid
parameters
root@Justice:/home/athrun/桌面/mRTAIcodes/KernelMode#
nm
rtai_kernel_mode_task2.ko00000000 b Simple_Task
00000000
t Simple_Thread
00000000
r ____versions
00000000
r __mod_license10
00000015
r __mod_vermagic5
0000000c
r __module_depends
00000000
D __this_module
00000090
T cleanup_module
00000030
T init_module
U
printk
U
rt_task_init
****************************************************************
and the source file rtai_kernel_mode_task2.c :
#include <linux/module.h>
//#include <linux/kernel.h>
//#include <linux/init.h>
#include <asm/io.h>
#include <rtai.h>
#include <rtai_sched.h>
static RT_TASK Simple_Task;
MODULE_LICENSE("GPL");
static void Simple_Thread(long int t)
{
//This is the real-time thread
int i=0;
for(i=0;i<100;i++)
{
printk("Simple_Thread i = %d",i);
}
}
int init_module(void)
{
int rt_task_init_result=1;
printk("Init module function starting point\n");
rt_task_init_result=rt_task_init(&Simple_Task,Simple_Thread,0,3000,0,0,0);
if(0==rt_task_init_result)
{
printk("RTAI task init success!\n");
}
return 0;
}
void cleanup_module(void)
{
printk("Cleanup module function starting point\n");
}
***********************************************
The makefile:
obj-m += rtai_kernel_mode_task2.o
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules -I/usr/realtime-3.4-9-rtai-686-pae/include
clean:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) clean***************************************************Have you ever met this problem before? Or would you help me to fix it?3Q~ yours: C.P. 2016-09-29
_______________________________________________
Rtai mailing list
[email protected]
https://mail.rtai.org/cgi-bin/mailman/listinfo/rtai