Re: [問題] 嵌入式板子掛載不了....

看板LinuxDev作者 (快樂很容易~)時間17年前 (2008/06/03 02:28), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/2 (看更多)
※ 引述《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)
文章代碼(AID): #18H3l1xD (LinuxDev)
討論串 (同標題文章)
文章代碼(AID): #18H3l1xD (LinuxDev)