On Wed, 07 Jun 2006 15:40:25 +0800, Charles Manning wrote: > On Tuesday 06 June 2006 20:35, eq wrote: >> Hi >> I comfront a problem about the yaff2,how to use the nandemul ? >> I just mount -t yaffsram none /mnt ,but it doesnot works, why? > > You misunderstand the use of the mount command. The parameter after -t > is the > file system type which must be yaffs or yaffs2. >> > > > With yaffs1 there is a built-in ram emulator (yaffs_ramem.c) that does > not > require an mtd device. This is no longer supported by yaffs2. > > Instead, for yaffs2 you must use a fake mtd device that does the > emulation. > You can eirther use one from the mtd group or the one in yaffs CVS. > Asusming > you're using the latter than you need to do something like the follwowng: > > First load the nand emulation module > > # insmod nandemul2k.o > > Now there is an "mtd device" which looks like NAND but is really RAM. > > You can now mount this with > > # mount -t yaffs2 /dev/mtdblock/1 /mnt > > NB I have not tied this for a while. > > -- Charles > I found that , compile the nandemul2k.o error: gcc -c -D__KERNEL__ -DMODULE -I/lib/modules/2.6.16.19/build/include -O2 -Wall -g nandemul2k.c -o nandemul2k.o In file included from /lib/modules/2.6.16.19/build/include/linux/rwsem.h:27, from /lib/modules/2.6.16.19/build/include/asm/semaphore.h:42, from /lib/modules/2.6.16.19/build/include/linux/sched.h:20, from /lib/modules/2.6.16.19/build/include/linux/module.h:10, from nandemul2k.c:19: /lib/modules/2.6.16.19/build/include/asm/rwsem.h: In function `__down_read': /lib/modules/2.6.16.19/build/include/asm/rwsem.h:105: parse error before "KBUILD_BASENAME" /lib/modules/2.6.16.19/build/include/asm/rwsem.h: In function `__down_write': /lib/modules/2.6.16.19/build/include/asm/rwsem.h:157: parse error before "KBUILD_BASENAME" /lib/modules/2.6.16.19/build/include/asm/rwsem.h: In function `__up_read': /lib/modules/2.6.16.19/build/include/asm/rwsem.h:194: parse error before "KBUILD_BASENAME" /lib/modules/2.6.16.19/build/include/asm/rwsem.h:188: warning: unused variable `tmp' /lib/modules/2.6.16.19/build/include/asm/rwsem.h: In function `__up_write': /lib/modules/2.6.16.19/build/include/asm/rwsem.h:220: parse error before "KBUILD_BASENAME" /lib/modules/2.6.16.19/build/include/asm/rwsem.h: In function `__downgrade_write': /lib/modules/2.6.16.19/build/include/asm/rwsem.h:245: parse error before "KBUILD_BASENAME" In file included from /lib/modules/2.6.16.19/build/include/linux/sched.h:20, from /lib/modules/2.6.16.19/build/include/linux/module.h:10, from nandemul2k.c:19: /lib/modules/2.6.16.19/build/include/asm/semaphore.h: In function `down': /lib/modules/2.6.16.19/build/include/asm/semaphore.h:105: parse error before "KBUILD_BASENAME" /lib/modules/2.6.16.19/build/include/asm/semaphore.h: In function `down_interruptible': /lib/modules/2.6.16.19/build/include/asm/semaphore.h:130: parse error before "KBUILD_BASENAME" /lib/modules/2.6.16.19/build/include/asm/semaphore.h: In function `down_trylock': /lib/modules/2.6.16.19/build/include/asm/semaphore.h:155: parse error before "KBUILD_BASENAME" /lib/modules/2.6.16.19/build/include/asm/semaphore.h: In function `up': /lib/modules/2.6.16.19/build/include/asm/semaphore.h:179: parse error before "KBUILD_BASENAME" In file included from /lib/modules/2.6.16.19/build/include/asm/smp.h:18, from /lib/modules/2.6.16.19/build/include/linux/smp.h:19, from /lib/modules/2.6.16.19/build/include/linux/sched.h:26, from /lib/modules/2.6.16.19/build/include/linux/module.h:10, from nandemul2k.c:19: /lib/modules/2.6.16.19/build/include/asm/mpspec.h:6:25: mach_mpspec.h: 没有 那个 文件或目录 In file included from /lib/modules/2.6.16.19/build/include/asm/smp.h:18, from /lib/modules/2.6.16.19/build/include/linux/smp.h:19, from /lib/modules/2.6.16.19/build/include/linux/sched.h:26, from /lib/modules/2.6.16.19/build/include/linux/module.h:10, from nandemul2k.c:19: /lib/modules/2.6.16.19/build/include/asm/mpspec.h: At top level: /lib/modules/2.6.16.19/build/include/asm/mpspec.h:8: `MAX_MP_BUSSES' undeclared here (not in a function) /lib/modules/2.6.16.19/build/include/asm/mpspec.h:9: `MAX_MP_BUSSES' undeclared here (not in a function) /lib/modules/2.6.16.19/build/include/asm/mpspec.h:10: `MAX_MP_BUSSES' undeclared here (not in a function) /lib/modules/2.6.16.19/build/include/asm/mpspec.h:12: `MAX_MP_BUSSES' undeclared here (not in a function) /lib/modules/2.6.16.19/build/include/asm/mpspec.h:21: `MAX_MP_BUSSES' undeclared here (not in a function) /lib/modules/2.6.16.19/build/include/asm/mpspec.h:21: conflicting types for `mp_bus_id_to_type' /lib/modules/2.6.16.19/build/include/asm/mpspec.h:8: previous declaration of `mp_bus_id_to_type' /lib/modules/2.6.16.19/build/include/asm/mpspec.h:23: `MAX_IRQ_SOURCES' undeclared here (not in a function) /lib/modules/2.6.16.19/build/include/asm/mpspec.h:25: `MAX_MP_BUSSES' undeclared here (not in a function) /lib/modules/2.6.16.19/build/include/asm/mpspec.h:25: conflicting types for `mp_bus_id_to_pci_bus' /lib/modules/2.6.16.19/build/include/asm/mpspec.h:12: previous declaration of `mp_bus_id_to_pci_bus' In file included from /lib/modules/2.6.16.19/build/include/asm/smp.h:20, from /lib/modules/2.6.16.19/build/include/linux/smp.h:19, from /lib/modules/2.6.16.19/build/include/linux/sched.h:26, from /lib/modules/2.6.16.19/build/include/linux/module.h:10, from nandemul2k.c:19: /lib/modules/2.6.16.19/build/include/asm/io_apic.h:158: `MAX_IRQ_SOURCES' undeclared here (not in a function) /lib/modules/2.6.16.19/build/include/asm/io_apic.h:158: conflicting types for `mp_irqs' /lib/modules/2.6.16.19/build/include/asm/mpspec.h:23: previous declaration of `mp_irqs' In file included from /lib/modules/2.6.16.19/build/include/linux/smp.h:19, from /lib/modules/2.6.16.19/build/include/linux/sched.h:26, from /lib/modules/2.6.16.19/build/include/linux/module.h:10, from nandemul2k.c:19: /lib/modules/2.6.16.19/build/include/asm/smp.h:77:26: mach_apicdef.h: 没有 那个文件或目录 In file included from /lib/modules/2.6.16.19/build/include/linux/smp.h:19, from /lib/modules/2.6.16.19/build/include/linux/sched.h:26, from /lib/modules/2.6.16.19/build/include/linux/module.h:10, from nandemul2k.c:19: /lib/modules/2.6.16.19/build/include/asm/smp.h: In function `hard_smp_processor_id': /lib/modules/2.6.16.19/build/include/asm/smp.h:81: warning: implicit declaration of function `GET_APIC_ID' In file included from /lib/modules/2.6.16.19/build/include/linux/irq.h:22, from /lib/modules/2.6.16.19/build/include/asm/hardirq.h:6, from /lib/modules/2.6.16.19/build/include/linux/hardirq.h:7, from /lib/modules/2.6.16.19/build/include/linux/interrupt.h:11, from nandemul2k.c:28: /lib/modules/2.6.16.19/build/include/asm/irq.h:16:25: irq_vectors.h: 没有那 个文 件或目录 In file included from /lib/modules/2.6.16.19/build/include/asm/hardirq.h:6, from /lib/modules/2.6.16.19/build/include/linux/hardirq.h:7, from /lib/modules/2.6.16.19/build/include/linux/interrupt.h:11, from nandemul2k.c:28: /lib/modules/2.6.16.19/build/include/linux/irq.h: At top level: /lib/modules/2.6.16.19/build/include/linux/irq.h:85: `NR_IRQS' undeclared here (not in a function) In file included from /lib/modules/2.6.16.19/build/include/linux/irq.h:94, from /lib/modules/2.6.16.19/build/include/asm/hardirq.h:6, from /lib/modules/2.6.16.19/build/include/linux/hardirq.h:7, from /lib/modules/2.6.16.19/build/include/linux/interrupt.h:11, from nandemul2k.c:28: /lib/modules/2.6.16.19/build/include/asm/hw_irq.h:30: `NR_IRQ_VECTORS' undeclared here (not in a function) /lib/modules/2.6.16.19/build/include/asm/hw_irq.h:34: `NR_IRQS' undeclared here (not in a function) In file included from /lib/modules/2.6.16.19/build/include/asm/hardirq.h:6, from /lib/modules/2.6.16.19/build/include/linux/hardirq.h:7, from /lib/modules/2.6.16.19/build/include/linux/interrupt.h:11, from nandemul2k.c:28: /lib/modules/2.6.16.19/build/include/linux/irq.h:99: `NR_IRQS' undeclared here (not in a function) /lib/modules/2.6.16.19/build/include/linux/irq.h:115: `NR_IRQS' undeclared here (not in a function) nandemul2k.c:258: warning: `nandemul2k_ReadId' defined but not used nandemul2k.c:267: warning: `nandemul2k_ReadStatus' defined but not used make: *** [nandemul2k.o] Error 1 I just cd the mtdemul dir ,type make ,but..,why ?