国产毛片a精品毛-国产毛片黄片-国产毛片久久国产-国产毛片久久精品-青娱乐极品在线-青娱乐精品

查看: 5673|回復: 3
打印 上一主題 下一主題

linux2.6下的設備驅動問題

[復制鏈接]
跳轉到指定樓層
樓主
發(fā)表于 2009-4-24 14:49:32 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
關鍵詞: linux , 驅動 , 設備
這是C文件

#include
#include
MODULE_LICENSE("Dual BSD/GPL");

static int hello_init(void)
{
        printk(KERN_ALERT "hello,world\n");
        return 0;
}

static void hello_exit(void)
{
        printk(KERN_ALERT "Goodbye,cruel world\n");
}

module_init(hello_init);
module_exit(hello_exit);
~                           


下面是makefile

CC =/usr/local/arm/bin/arm-linux-gcc
KERNELDIR=/home/work/linux2.6
CFLAGS =-D__KERNEL__ -DMODULE -I$(KERNELDIR)/include -O -Wall

hello.hello.c

        $(CC)$(CFLAGS)  -g -c $<

clean:



這時報錯:

/usr/local/arm/bin/arm-linux-gcc -D__KERNEL__ -DMODULE -I/home/work/linux2.6/include -O -Wall  -g -c hello.c   
In file included from /home/work/linux2.6/include/asm/hardware.h:16,
                 from /home/work/linux2.6/include/asm/arch/memory.h:24,
                 from /home/work/linux2.6/include/asm/memory.h:27,
                 from /home/work/linux2.6/include/asm/system.h:6,
                 from /home/work/linux2.6/include/asm/bitops.h:23,
                 from /home/work/linux2.6/include/linux/bitops.h:9,
                 from /home/work/linux2.6/include/linux/thread_info.h:20,
                 from /home/work/linux2.6/include/linux/preempt.h:9,
                 from /home/work/linux2.6/include/linux/spinlock.h:49,
                 from /home/work/linux2.6/include/linux/module.h:9,
                 from hello.c:2:
/home/work/linux2.6/include/asm/arch/hardware.h:30:2: #error "Unsupported AT91 processor"
In file included from /home/work/linux2.6/include/linux/bitops.h:9,
                 from /home/work/linux2.6/include/linux/thread_info.h:20,
                 from /home/work/linux2.6/include/linux/preempt.h:9,
                 from /home/work/linux2.6/include/linux/spinlock.h:49,
                 from /home/work/linux2.6/include/linux/module.h:9,
                 from hello.c:2:
/home/work/linux2.6/include/asm/bitops.h: In function `____atomic_set_bit':
/home/work/linux2.6/include/asm/bitops.h:40: warning: implicit declaration of function `local_irq_save'
/home/work/linux2.6/include/asm/bitops.h:42: warning: implicit declaration of function `local_irq_restore'
In file included from /home/work/linux2.6/include/linux/kobject.h:25,
                 from /home/work/linux2.6/include/linux/module.h:17,
                 from hello.c:2:
/home/work/linux2.6/include/linux/rwsem.h:24:65: asm/rwsem.h: No such file or directory
In file included from /home/work/linux2.6/include/linux/module.h:17,
                 from hello.c:2:
/home/work/linux2.6/include/linux/kobject.h: At top level:
/home/work/linux2.6/include/linux/kobject.h:178: error: field `rwsem' has incomplete type
In file included from /home/work/linux2.6/include/linux/memory_hotplug.h:7,
                 from /home/work/linux2.6/include/linux/mmzone.h:463,
                 from /home/work/linux2.6/include/linux/gfp.h:4,
                 from /home/work/linux2.6/include/linux/slab.h:14,
                 from /home/work/linux2.6/include/linux/percpu.h:5,
                 from /home/work/linux2.6/include/asm-generic/local.h:4,
                 from /home/work/linux2.6/include/asm/local.h:1,
                 from /home/work/linux2.6/include/linux/module.h:19,
                 from hello.c:2:
/home/work/linux2.6/include/linux/notifier.h:62: error: field `rwsem' has incomplete type
In file included from /home/work/linux2.6/include/asm/io.h:76,
                 from /home/work/linux2.6/include/asm/arch/irqs.h:24,
                 from /home/work/linux2.6/include/asm/irq.h:4,
                 from /home/work/linux2.6/include/asm/hardirq.h:6,
                 from /home/work/linux2.6/include/linux/hardirq.h:7,
                 from /home/work/linux2.6/include/asm-generic/local.h:5,
                 from /home/work/linux2.6/include/asm/local.h:1,
                 from /home/work/linux2.6/include/linux/module.h:19,
                 from hello.c:2:
/home/work/linux2.6/include/asm/arch/io.h: In function `at91_sys_read':
/home/work/linux2.6/include/asm/arch/io.h:36: error: `AT91_BASE_SYS' undeclared (first use in this function)
/home/work/linux2.6/include/asm/arch/io.h:36: error: (Each undeclared identifier is reported only once
/home/work/linux2.6/include/asm/arch/io.h:36: error: for each function it appears in.)
/home/work/linux2.6/include/asm/arch/io.h: In function `at91_sys_write':
/home/work/linux2.6/include/asm/arch/io.h:43: error: `AT91_BASE_SYS' undeclared (first use in this function)
make: *** [hello.o] 錯誤 1



到底是什么原因,版主和朋友們能不能幫個忙,謝謝了
沙發(fā)
發(fā)表于 2009-4-24 17:32:26 | 只看該作者
回復1樓chengnokia


#error "Unsupported AT91 processor"

樓主使用的處理器是AT91系列的嗎?最好是找一個支持該處理器或開發(fā)板的Linux整個包,自己移植太累了
板凳
發(fā)表于 2009-4-24 19:06:48 | 只看該作者
謝謝阿南!!!
地板
發(fā)表于 2009-4-27 12:01:58 | 只看該作者
老郭客氣
應該的,嘿嘿
您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規(guī)則

關于我們  -  服務條款  -  使用指南  -  站點地圖  -  友情鏈接  -  聯(lián)系我們
電子工程網 © 版權所有   京ICP備16069177號 | 京公網安備11010502021702
快速回復 返回頂部 返回列表
主站蜘蛛池模板: 伊人久热这里只有精品视频99 | 精品在线免费观看视频 | 黄色小说app下载 | 在线免费亚洲 | 久久精品视频网 | 老师感受到它在你里面了吗app | 久久99国产一区二区三区 | 久久五月婷 | 岛国视频在线观看免费播放 | 麻豆精品永久免费视频 | 亚洲午夜久久久久久91 | 老司机亚洲精品影院在线观看 | 久久99精品福利久久久 | 蝴蝶传媒视频免费观看 | 邪恶家庭教师 | 亚洲人成在线中文字幕 | 阿v精品一区二区三区 | 国产区欧美 | 久青草国产在线视频亚瑟影视 | 久久这里精品青草免费 | 日日夜夜天天干 | 欧美亚洲欧美日韩中文二区 | 六月丁香七月婷婷 | 国产一级在线 | 日韩精品毛片 | 欧美性福 | 日韩欧美国产偷亚洲清高 | 狠狠操五月天 | 国产综合色在线视频 | 九九热免费在线观看 | 尻逼小说 | 日本亚洲成高清一区二区三区 | 久久久久国产精品四虎 | 精精国产www视频在线观看免费 | 成人免费一区二区三区 | 在线麻豆国产传媒60在线观看 | 日日夜夜操操 | 国产亚洲日本人在线观看 | 欧美黑人一区二区 | 中文字幕1区2区 | 精品不卡一区中文字幕 |