打印
[嵌入式linux]

yaffs中的在编译mtdemul2k.o时遇到的错误~

[复制链接]
2416|4
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
walxdwa|  楼主 | 2009-5-13 20:36 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
最近在想把Yaffs文件系统编入内核,现已支持。但是要测试比较麻烦,还好Yaffs下可以支持基于file和ram的模拟。
但是都是基于MTD层的接口,我在编译mtdemul2k.o文件就遇到了如下错误,前大半部分错误都是内核文件错误,不大可能吧,希望得到指教。谢谢。

我的makefile文件:
Makefile for NANDemul MTD
#
# NB this is not yet suitable for putting into the kernel tree.
# YAFFS: Yet another Flash File System. A NAND-flash specific file system. 
#
# Copyright (C) 2002 Aleph One Ltd.
# for Toby Churchill Ltd and Brightstar Engineering
#
# Created by Charles Manning <charles@aleph1.co.uk>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.

## Change or override KERNELDIR to your kernel
## comment out USE_xxxx if you don't want these features.

KERNELDIR = /lib/modules/$(shell uname -r)/build


#CFLAGS = -D__KERNEL__ -DMODULE -I$(KERNELDIR)/include -O2 -Wall -g
CFLAGS = -D__KERNEL__ -DMODULE -I$(KERNELDIR)/include -O2 -Wall -g



TARGET = nandemul2k.o

default: $(TARGET)

clean:
rm -f $(TARGET)

$(TARGET): %.o: %.c
gcc -c $(CFLAGS) $< -o $@




报错的内容:
In file included from /lib/modules/2.6.18-pae/build/include/asm/thread_info.h:16,
from /lib/modules/2.6.18-pae/build/include/linux/thread_info.h:21,
from /lib/modules/2.6.18-pae/build/include/linux/preempt.h:9,
from /lib/modules/2.6.18-pae/build/include/linux/spinlock.h:49,
from /lib/modules/2.6.18-pae/build/include/linux/capability.h:45,
from /lib/modules/2.6.18-pae/build/include/linux/sched.h:44,
from /lib/modules/2.6.18-pae/build/include/linux/module.h:9,
from nandemul2k.c:20:
/lib/modules/2.6.18-pae/build/include/asm/processor.h:80: error: ‘CONFIG_X86_L1_CACHE_SHIFT’ undeclared here (not in a function)
/lib/modules/2.6.18-pae/build/include/asm/processor.h:80: error: requested alignment is not a constant
In file included from /lib/modules/2.6.18-pae/build/include/linux/rwsem.h:24,
from /lib/modules/2.6.18-pae/build/include/asm/semaphore.h:42,
from /lib/modules/2.6.18-pae/build/include/linux/sched.h:57,
from /lib/modules/2.6.18-pae/build/include/linux/module.h:9,
from nandemul2k.c:20:
/lib/modules/2.6.18-pae/build/include/asm/rwsem.h: In function ‘__down_read’:
/lib/modules/2.6.18-pae/build/include/asm/rwsem.h:97: error: expected ‘:’ or ‘)’ before ‘KBUILD_BASENAME’
/lib/modules/2.6.18-pae/build/include/asm/rwsem.h: In function ‘__down_write_nested’:
/lib/modules/2.6.18-pae/build/include/asm/rwsem.h:149: error: expected ‘:’ or ‘)’ before ‘KBUILD_BASENAME’
/lib/modules/2.6.18-pae/build/include/asm/rwsem.h: In function ‘__up_read’:
/lib/modules/2.6.18-pae/build/include/asm/rwsem.h:192: error: expected ‘:’ or ‘)’ before ‘KBUILD_BASENAME’
/lib/modules/2.6.18-pae/build/include/asm/rwsem.h:192: warning: unused variable ‘tmp’
/lib/modules/2.6.18-pae/build/include/asm/rwsem.h: In function ‘__up_write’:
/lib/modules/2.6.18-pae/build/include/asm/rwsem.h:216: error: expected ‘:’ or ‘)’ before ‘KBUILD_BASENAME’
/lib/modules/2.6.18-pae/build/include/asm/rwsem.h: In function ‘__downgrade_write’:
/lib/modules/2.6.18-pae/build/include/asm/rwsem.h:242: error: expected ‘:’ or ‘)’ before ‘KBUILD_BASENAME’
In file included from /lib/modules/2.6.18-pae/build/include/linux/sched.h:57,
from /lib/modules/2.6.18-pae/build/include/linux/module.h:9,
from nandemul2k.c:20:
/lib/modules/2.6.18-pae/build/include/asm/semaphore.h: In function ‘down’:
/lib/modules/2.6.18-pae/build/include/asm/semaphore.h:99: error: expected ‘:’ or ‘)’ before ‘KBUILD_BASENAME’
/lib/modules/2.6.18-pae/build/include/asm/semaphore.h: In function ‘down_interruptible’:
/lib/modules/2.6.18-pae/build/include/asm/semaphore.h:123: error: expected ‘:’ or ‘)’ before ‘KBUILD_BASENAME’
/lib/modules/2.6.18-pae/build/include/asm/semaphore.h: In function ‘down_trylock’:
/lib/modules/2.6.18-pae/build/include/asm/semaphore.h:145: error: expected ‘:’ or ‘)’ before ‘KBUILD_BASENAME’
/lib/modules/2.6.18-pae/build/include/asm/semaphore.h: In function ‘up’:
/lib/modules/2.6.18-pae/build/include/asm/semaphore.h:172: error: expected ‘:’ or ‘)’ before ‘KBUILD_BASENAME’
In file included from /lib/modules/2.6.18-pae/build/include/asm/smp.h:17,
from /lib/modules/2.6.18-pae/build/include/linux/smp.h:18,
from /lib/modules/2.6.18-pae/build/include/linux/sched.h:63,
from /lib/modules/2.6.18-pae/build/include/linux/module.h:9,
from nandemul2k.c:20:
/lib/modules/2.6.18-pae/build/include/asm/mpspec.h:6:25: error: mach_mpspec.h: No such file or directory
In file included from /lib/modules/2.6.18-pae/build/include/asm/smp.h:17,
from /lib/modules/2.6.18-pae/build/include/linux/smp.h:18,
from /lib/modules/2.6.18-pae/build/include/linux/sched.h:63,
from /lib/modules/2.6.18-pae/build/include/linux/module.h:9,
from nandemul2k.c:20:
/lib/modules/2.6.18-pae/build/include/asm/mpspec.h: At top level:
/lib/modules/2.6.18-pae/build/include/asm/mpspec.h:8: error: ‘MAX_MP_BUSSES’ undeclared here (not in a function)
/lib/modules/2.6.18-pae/build/include/asm/mpspec.h:22: error: ‘MAX_IRQ_SOURCES’ undeclared here (not in a function)
In file included from /lib/modules/2.6.18-pae/build/include/linux/smp.h:18,
from /lib/modules/2.6.18-pae/build/include/linux/sched.h:63,
from /lib/modules/2.6.18-pae/build/include/linux/module.h:9,
from nandemul2k.c:20:
/lib/modules/2.6.18-pae/build/include/asm/smp.h:76:26: error: mach_apicdef.h: No such file or directory
In file included from /lib/modules/2.6.18-pae/build/include/linux/smp.h:18,
from /lib/modules/2.6.18-pae/build/include/linux/sched.h:63,
from /lib/modules/2.6.18-pae/build/include/linux/module.h:9,
from nandemul2k.c:20:
/lib/modules/2.6.18-pae/build/include/asm/smp.h: In function ‘hard_smp_processor_id’:
/lib/modules/2.6.18-pae/build/include/asm/smp.h:80: warning: implicit declaration of function ‘GET_APIC_ID’
In file included from /lib/modules/2.6.18-pae/build/include/linux/module.h:9,
from nandemul2k.c:20:
/lib/modules/2.6.18-pae/build/include/linux/sched.h: In function ‘dequeue_signal_lock’:
/lib/modules/2.6.18-pae/build/include/linux/sched.h:1209: warning: implicit declaration of function ‘local_irq_save’
/lib/modules/2.6.18-pae/build/include/linux/sched.h:1211: warning: implicit declaration of function ‘local_irq_restore’
In file included from /lib/modules/2.6.18-pae/build/include/asm/pgtable.h:244,
from /lib/modules/2.6.18-pae/build/include/linux/mm.h:38,
from /lib/modules/2.6.18-pae/build/include/linux/pagemap.h:7,
from nandemul2k.c:27:
/lib/modules/2.6.18-pae/build/include/asm/pgtable-3level.h: In function ‘set_pte’:
/lib/modules/2.6.18-pae/build/include/asm/pgtable-3level.h:55: error: ‘pte_t’ has no member named ‘pte_high’
/lib/modules/2.6.18-pae/build/include/asm/pgtable-3level.h:55: error: ‘pte_t’ has no member named ‘pte_high’
/lib/modules/2.6.18-pae/build/include/asm/pgtable-3level.h: In function ‘pte_clear’:
/lib/modules/2.6.18-pae/build/include/asm/pgtable-3level.h:97: error: ‘pte_t’ has no member named ‘pte_high’
/lib/modules/2.6.18-pae/build/include/asm/pgtable-3level.h: At top level:
/lib/modules/2.6.18-pae/build/include/asm/pgtable-3level.h:100: error: expected ‘)’ before ‘*’ token
/lib/modules/2.6.18-pae/build/include/asm/pgtable-3level.h: In function ‘ptep_get_and_clear’:
/lib/modules/2.6.18-pae/build/include/asm/pgtable-3level.h:114: error: ‘pte_t’ has no member named ‘pte_high’
/lib/modules/2.6.18-pae/build/include/asm/pgtable-3level.h:114: error: ‘pte_t’ has no member named ‘pte_high’
/lib/modules/2.6.18-pae/build/include/asm/pgtable-3level.h:115: error: ‘pte_t’ has no member named ‘pte_high’
/lib/modules/2.6.18-pae/build/include/asm/pgtable-3level.h: In function ‘pte_same’:
/lib/modules/2.6.18-pae/build/include/asm/pgtable-3level.h:122: error: ‘pte_t’ has no member named ‘pte_high’
/lib/modules/2.6.18-pae/build/include/asm/pgtable-3level.h:122: error: ‘pte_t’ has no member named ‘pte_high’
/lib/modules/2.6.18-pae/build/include/asm/pgtable-3level.h: In function ‘pte_none’:
/lib/modules/2.6.18-pae/build/include/asm/pgtable-3level.h:129: error: ‘pte_t’ has no member named ‘pte_high’
/lib/modules/2.6.18-pae/build/include/asm/pgtable-3level.h: In function ‘pte_pfn’:
/lib/modules/2.6.18-pae/build/include/asm/pgtable-3level.h:135: error: ‘pte_t’ has no member named ‘pte_high’
/lib/modules/2.6.18-pae/build/include/asm/pgtable-3level.h: In function ‘pfn_pte’:
/lib/modules/2.6.18-pae/build/include/asm/pgtable-3level.h:144: error: ‘pte_t’ has no member named ‘pte_high’
/lib/modules/2.6.18-pae/build/include/asm/pgtable-3level.h:144: warning: right shift count >= width of type
/lib/modules/2.6.18-pae/build/include/asm/pgtable-3level.h:146: error: ‘pte_t’ has no member named ‘pte_high’
/lib/modules/2.6.18-pae/build/include/asm/pgtable-3level.h: At top level:
/lib/modules/2.6.18-pae/build/include/asm/pgtable-3level.h:152: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘pfn_pmd’
In file included from /lib/modules/2.6.18-pae/build/include/linux/mm.h:38,
from /lib/modules/2.6.18-pae/build/include/linux/pagemap.h:7,
from nandemul2k.c:27:
/lib/modules/2.6.18-pae/build/include/asm/pgtable.h: In function ‘pte_modify’:
/lib/modules/2.6.18-pae/build/include/asm/pgtable.h:318: error: ‘pte_t’ has no member named ‘pte_high’
/lib/modules/2.6.18-pae/build/include/asm/pgtable.h:319: error: ‘pte_t’ has no member named ‘pte_high’
/lib/modules/2.6.18-pae/build/include/asm/pgtable.h:319: warning: right shift count >= width of type
In file included from /lib/modules/2.6.18-pae/build/include/asm/pgtable.h:450,
from /lib/modules/2.6.18-pae/build/include/linux/mm.h:38,
from /lib/modules/2.6.18-pae/build/include/linux/pagemap.h:7,
from nandemul2k.c:27:
/lib/modules/2.6.18-pae/build/include/asm-generic/pgtable.h: At top level:
/lib/modules/2.6.18-pae/build/include/asm-generic/pgtable.h:199: error: expected ‘)’ before ‘*’ token
/lib/modules/2.6.18-pae/build/include/asm-generic/pgtable.h:223: error: expected ‘)’ before ‘*’ token
In file included from /lib/modules/2.6.18-pae/build/include/linux/pagemap.h:7,
from nandemul2k.c:27:
/lib/modules/2.6.18-pae/build/include/linux/mm.h: In function ‘lowmem_page_address’:
/lib/modules/2.6.18-pae/build/include/linux/mm.h:531: warning: implicit declaration of function ‘__page_to_pfn’
/lib/modules/2.6.18-pae/build/include/linux/mm.h: At top level:
/lib/modules/2.6.18-pae/build/include/linux/mm.h:809: error: expected declaration specifiers or ‘...’ before ‘pmd_t’
/lib/modules/2.6.18-pae/build/include/linux/mm.h:810: error: expected ‘)’ before ‘*’ token
/lib/modules/2.6.18-pae/build/include/linux/mm.h:823: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
In file included from /lib/modules/2.6.18-pae/build/include/linux/irq.h:22,
from /lib/modules/2.6.18-pae/build/include/asm/hardirq.h:5,
from /lib/modules/2.6.18-pae/build/include/linux/hardirq.h:7,
from /lib/modules/2.6.18-pae/build/include/linux/interrupt.h:11,
from /lib/modules/2.6.18-pae/build/include/asm/highmem.h:23,
from /lib/modules/2.6.18-pae/build/include/linux/highmem.h:23,
from /lib/modules/2.6.18-pae/build/include/linux/pagemap.h:10,
from nandemul2k.c:27:
/lib/modules/2.6.18-pae/build/include/asm/irq.h:15:25: error: irq_vectors.h: No such file or directory
In file included from /lib/modules/2.6.18-pae/build/include/asm/hardirq.h:5,
from /lib/modules/2.6.18-pae/build/include/linux/hardirq.h:7,
from /lib/modules/2.6.18-pae/build/include/linux/interrupt.h:11,
from /lib/modules/2.6.18-pae/build/include/asm/highmem.h:23,
from /lib/modules/2.6.18-pae/build/include/linux/highmem.h:23,
from /lib/modules/2.6.18-pae/build/include/linux/pagemap.h:10,
from nandemul2k.c:27:
/lib/modules/2.6.18-pae/build/include/linux/irq.h:169: error: ‘NR_IRQS’ undeclared here (not in a function)
In file included from /lib/modules/2.6.18-pae/build/include/linux/irq.h:182,
from /lib/modules/2.6.18-pae/build/include/asm/hardirq.h:5,
from /lib/modules/2.6.18-pae/build/include/linux/hardirq.h:7,
from /lib/modules/2.6.18-pae/build/include/linux/interrupt.h:11,
from /lib/modules/2.6.18-pae/build/include/asm/highmem.h:23,
from /lib/modules/2.6.18-pae/build/include/linux/highmem.h:23,
from /lib/modules/2.6.18-pae/build/include/linux/pagemap.h:10,
from nandemul2k.c:27:
/lib/modules/2.6.18-pae/build/include/asm/hw_irq.h:31: error: ‘NR_IRQ_VECTORS’ undeclared here (not in a function)
nandemul2k.c: In function ‘nand_read’:
nandemul2k.c:307: warning: implicit declaration of function ‘nand_read_ecc’
nandemul2k.c: At top level:
nandemul2k.c:314: error: static declaration of ‘nand_read_ecc’ follows non-static declaration
nandemul2k.c:307: error: previous implicit declaration of ‘nand_read_ecc’ was here
nandemul2k.c: In function ‘nand_read_oob’:
nandemul2k.c:387: error: invalid operands to binary * (have ‘int’ and ‘size_t *’)
nandemul2k.c: In function ‘nand_write’:
nandemul2k.c:410: warning: implicit declaration of function ‘nand_write_ecc’
nandemul2k.c: At top level:
nandemul2k.c:416: error: static declaration of ‘nand_write_ecc’ follows non-static declaration
nandemul2k.c:410: error: previous implicit declaration of ‘nand_write_ecc’ was here
nandemul2k.c: In function ‘nandemul2k_scan’:
nandemul2k.c:602: error: ‘struct mtd_info’ has no member named ‘oobavail’
nandemul2k.c:617: warning: assignment from incompatible pointer type
nandemul2k.c:618: warning: assignment from incompatible pointer type
nandemul2k.c:619: warning: assignment from incompatible pointer type
nandemul2k.c:620: warning: assignment from incompatible pointer type
nandemul2k.c:623: error: ‘struct mtd_info’ has no member named ‘readv’
make: *** [nandemul2k.o] Error 1

相关帖子

沙发
sinanjj| | 2009-5-13 22:17 | 只看该作者

.

make |grep nandemul2k

再看出错信息,找那几行

使用特权

评论回复
板凳
walxdwa|  楼主 | 2009-5-14 10:14 | 只看该作者

还是这几行代码。。。

我make |grep nandemul2k之后,出错代码没有减少。

使用特权

评论回复
地板
未来是梦| | 2009-5-14 12:59 | 只看该作者

makefile 写的不对,2.6内核kbuild和2.4不同


ifneq ($(KERNELRELEASE),)
obj-m := nandemul2k.o 
else
KERNELDIR ?= /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd) 
modules:
   $(MAKE) -C $(KERNELDIR) M=$(PWD) modules
endif 

使用特权

评论回复
5
walxdwa|  楼主 | 2009-5-14 13:58 | 只看该作者

谢谢,果然是Makefile写错了,但是还有错误。。。

修改过后的错误:

make -C /lib/modules/2.6.18-pae/build M=/usr/src/linux-2.6.18/fs/yaffs2/mtdemul modules
make[1]: Entering directory `/usr/src/linux-2.6.18'
  CC [M]  /usr/src/linux-2.6.18/fs/yaffs2/mtdemul/nandemul2k.o
/usr/src/linux-2.6.18/fs/yaffs2/mtdemul/nandemul2k.c: In function ‘nand_read’:
/usr/src/linux-2.6.18/fs/yaffs2/mtdemul/nandemul2k.c:307: warning: implicit declaration of function ‘nand_read_ecc’
/usr/src/linux-2.6.18/fs/yaffs2/mtdemul/nandemul2k.c: At top level:
/usr/src/linux-2.6.18/fs/yaffs2/mtdemul/nandemul2k.c:314: error: static declaration of ‘nand_read_ecc’ follows non-static declaration
/usr/src/linux-2.6.18/fs/yaffs2/mtdemul/nandemul2k.c:307: error: previous implicit declaration of ‘nand_read_ecc’ was here
/usr/src/linux-2.6.18/fs/yaffs2/mtdemul/nandemul2k.c: In function ‘nand_read_oob’:
/usr/src/linux-2.6.18/fs/yaffs2/mtdemul/nandemul2k.c:387: error: invalid operands to binary * (have ‘int’ and ‘size_t *’)
/usr/src/linux-2.6.18/fs/yaffs2/mtdemul/nandemul2k.c: In function ‘nand_write’:
/usr/src/linux-2.6.18/fs/yaffs2/mtdemul/nandemul2k.c:410: warning: implicit declaration of function ‘nand_write_ecc’
/usr/src/linux-2.6.18/fs/yaffs2/mtdemul/nandemul2k.c: At top level:
/usr/src/linux-2.6.18/fs/yaffs2/mtdemul/nandemul2k.c:416: error: static declaration of ‘nand_write_ecc’ follows non-static declaration
/usr/src/linux-2.6.18/fs/yaffs2/mtdemul/nandemul2k.c:410: error: previous implicit declaration of ‘nand_write_ecc’ was here
/usr/src/linux-2.6.18/fs/yaffs2/mtdemul/nandemul2k.c: In function ‘nandemul2k_scan’:
/usr/src/linux-2.6.18/fs/yaffs2/mtdemul/nandemul2k.c:602: error: ‘struct mtd_info’ has no member named ‘oobavail’
/usr/src/linux-2.6.18/fs/yaffs2/mtdemul/nandemul2k.c:617: warning: assignment from incompatible pointer type
/usr/src/linux-2.6.18/fs/yaffs2/mtdemul/nandemul2k.c:618: warning: assignment from incompatible pointer type
/usr/src/linux-2.6.18/fs/yaffs2/mtdemul/nandemul2k.c:619: warning: assignment from incompatible pointer type
/usr/src/linux-2.6.18/fs/yaffs2/mtdemul/nandemul2k.c:620: warning: assignment from incompatible pointer type
/usr/src/linux-2.6.18/fs/yaffs2/mtdemul/nandemul2k.c:623: error: ‘struct mtd_info’ has no member named ‘readv’
make[2]: *** [/usr/src/linux-2.6.18/fs/yaffs2/mtdemul/nandemul2k.o] Error 1
make[1]: *** [_module_/usr/src/linux-2.6.18/fs/yaffs2/mtdemul] Error 2
make[1]: Leaving directory `/usr/src/linux-2.6.18'
make: *** [modules] Error 2

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

3

主题

7

帖子

0

粉丝