임베디드 리눅스 timer 커널모듈 컴파일 해서 insmod하는데 symbol오류가 발생합니다. ㅠ 해결방법을 모르겠습니다.
글쓴이: skaskawl / 작성시간: 화, 2019/01/08 - 7:07오후
타켓보드에서 insmod할시에 계속 이와같은 오류가나오는데 방법을 모르겠습니다.
root@am57xx-evm:/WaveFile/home/root# insmod timer_dev.ko
[ 47.038103] timer_dev: disagrees about version of symbol kmem_cache_alloc
[ 47.044934] timer_dev: Unknown symbol kmem_cache_alloc (err -22)
[ 47.050992] timer_dev: disagrees about version of symbol kmalloc_caches
[ 47.061224] timer_dev: Unknown symbol kmalloc_caches (err -22)
insmod: ERROR: could not insert module timer_dev.ko: Invalid parameters
아시는분 알려주세요 ㅠㅠ
————Makefile———————————-
KERDIR:=/home/ksm/ti-processor-sdk-linux-rt-am57xx-evm-05.01.00.11/board-support/linux-rt-4.14.67+gitAUTOINC+cfb76a2032-gcfb76a2032
PATHCEK:=/home/ksm/ti-processor-sdk-linux-rt-am57xx-evm-05.01.00.11/targetNFS
obj-m:=timer_dev.o
PWD:=$(shell pwd)
all: $(MAKE)C $(KERDIR) ARCH=arm CROSS_COMPILE=arm-linux-gnueabihftisdk_am57xx-evm-rt_defconfig $(MAKE)C $(KERDIR) ARCH=arm CROSS_COMPILE=arm-linux-gnueabihfSUBDIRS=$(PWD) modules $(MAKE)C $(KERDIR) ARCH=arm CROSS_COMPILE=arm-linux-gnueabihfINSTALL_MOD_PATH=/tmp INSTALL_MOD_STRIP=1 modules_install
clean: rm -rf *.ko rm -rf .mod. rm -rf .*.cmd rm -rf .tmp* rm -rf *.o rm -rf modules.order rm -rf Module.markers rm -rf Module.symvers rm -rf /tmp/lib
——timer_dev.c———————————-
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/version.h>
#include <linux/init.h>
#include <linux/fs.h>
#include <linux/sched.h>
#include <linux/interrupt.h>
#include <linux/wait.h>
#include <linux/ioport.h>
#include <linux/slab.h>
#include <linux/poll.h>
#include <linux/proc_fs.h>
#include <linux/workqueue.h>
#include <asm/uaccess.h>
#include <asm/ioctl.h>
#include <asm/unistd.h>
#include <asm/io.h>
#include <asm/irq.h>
#include <asm/gpio.h>
#include <linux/irq.h>
#include <linux/time.h>
#include <linux/timer.h>
#include <asm/mach/arch.h>
#define TIME_HZ 100
struct timer_list *timer;
static int TimerCount=0;
void Timer_function(unsigned long arg);
void Timer_register(struct timer_list* rtimer);
int timer_init(void);
void timer_exit(void);
void Timer_register(struct timer_list *rtimer)
{ init_timer(timer); rtimer->expires = get_jiffies_64() + TIME_HZ; rtimer->data = 0; rtimer->function = Timer_function; add_timer(timer);
}
void Timer_function(unsigned long arg)
{ printk(" Count : %d \n",TimerCount++); Timer_register(timer);
}
int timer_init(void)
{ timer=kmalloc(sizeof(struct timer_list),GFP_KERNEL); if(timer == NULL) return -ENOMEM;
memset(timer,0,sizeof(struct timer_list)); Timer_register(timer); return 0;
}
void timer_exit(void)
{ if(timer!= NULL) { del_timer(timer); kfree(timer); }
}
module_init(timer_init);
module_exit(timer_exit);
MODULE_LICENSE("Dual BSD/GPL");
Forums:
MODULE_LICENSE을 다시 설정해보세요.
다음과 같이 GPL 테이블을 설정해보시는 것은 어떨까요?
MODULE_LICENSE("GPL");
module_init(my_init);
module_exit(my_exit);
(개인블로그)
http://rousalome.egloos.com
아 댓글 감사합니다.. 확인해서 해결했는데 제가
아 댓글 감사합니다.. 확인해서 해결했는데 제가 컴파일한 커널이랑 타겟보드에 올라간 커널이 서로 달라서 나오는 오류였었어요 ..
댓글 달기