Re: [問題] 嵌入式板子掛載不了....
※ 引述《supershine2 (shine)》之銘言:
: 想請問各位大大
: 交叉編譯完後的.o檔無法掛載到我的版子上
: 出現了
: insmod : can't insert 'dri_arch.o' :
: Invalid module format(-1) : Exec format error
: 這樣的訊息
: 請問是哪裡出問題哩?
: 我的PC Linux是2.6.11 板子的是Xsbase270版本是2.6.9
: 我的Makefile
: CC =/opt/xscalev1/bin/arm-linux-gcc
: INCLUDE =/Desktop/Boot-XSBase270/include
: CFLAGS =-D__KERNEL__ -DMODULE -Wall -O2
: CFLAGS +=-I.. -I$(INCLUDE)
: TARGET =dri_arch
: OBJS =$(TARGET).o
: SRC =dri_arch.c
: ALL:dri_arch.o
: dri_arch.o:dri_arch.c
: $(CC) $(CFLAGS) -c -o dri_arch.o dri_arch.c
: clean:
: rm -rf*.o
in 2.4 kernel you can compile .o then insert this object file
but in 2.6 kernel, it's no way the driver must be *.ko file
The simplest way is to put your driver module under linux/driver/abc
(ex: your driver is abc) then just add one line in you Makefile
something like "obj-y += abc" you can refer to the other line in this makefile
(location is linux/driver/Makefile)
thne just make , after this, you will get abc.ko in your file system
then insmod abc.ko (location should be /lib/module/..... somewhere)
that's ok...
--
◢◢ ◣◣ 吃我一記紅蘿蔔!
⊙≡⊙ ◤
◣μ◥ 皿x◤
◥≡◥.人.◣
◥ \圭/ from cAshoNly
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 61.228.195.166
※ 編輯: boombastick 來自: 122.116.154.142 (06/03 10:46)
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 2 篇):
LinuxDev 近期熱門文章
PTT數位生活區 即時熱門文章