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

查看: 5895|回復(fù): 3
打印 上一主題 下一主題

linux2.6下的設(shè)備驅(qū)動問題

[復(fù)制鏈接]
跳轉(zhuǎn)到指定樓層
樓主
發(fā)表于 2009-4-24 14:49:32 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
關(guān)鍵詞: linux , 驅(qū)動 , 設(shè)備
這是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 | 只看該作者
回復(fù)1樓chengnokia


#error "Unsupported AT91 processor"

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

本版積分規(guī)則

關(guān)于我們  -  服務(wù)條款  -  使用指南  -  站點地圖  -  友情鏈接  -  聯(lián)系我們
電子工程網(wǎng) © 版權(quán)所有   京ICP備16069177號 | 京公網(wǎng)安備11010502021702
快速回復(fù) 返回頂部 返回列表
主站蜘蛛池模板: 久久青青热 | 国产精品入口免费视频 | 四虎影视在线影院4hutv | 黄色a大片| 69香蕉视频 | 天堂在线.www资源在线观看 | 亚洲欧美一区在线 | 久久综合成人 | 久久久精品久久久久久 | 99re热久久精品这里都是精品 | 麻豆精品传媒成人精品 | 亚洲视频免 | 性欧美大战久久久久久久久 | 成人免费一区二区三区 | 伊人青青操 | 国产精品久久久久久久专区 | 美女国产在线观看免费观看 | 热久久久久 | 家庭教师动漫在线观看 | 亚洲欧美日韩久久一区 | 日韩一区二区中文字幕 | 全彩acg★无翼乌火影忍者 | 亚洲这里只有精品 | 青青草伊人 | 欧美日韩一区二区在线观看 | 欧洲成人在线 | 羞羞视频免费网站欧美 | 一区二区三区成人 | 欧美成人免费 | 在线人成精品免费视频 | 亚洲视频免费在线观看 | 欧美第二区 | 午夜精品网站 | 日本肥婆| 精品国产亚一区二区三区 | 四虎永久免费网站免费观看 | 美女免费视频一区二区 | www.亚洲免费| 性夜影院午夜看片 | 日韩视频一区二区在线观看 | 亚洲免费在线视频 |