Re: [Yaffs] yaffs1 mount - please help

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Charles Manning
Date:  
To: yaffs
Subject: Re: [Yaffs] yaffs1 mount - please help
Hello Marco

Firstly I suggest you use tha yaffs2 code base even if you are using the
yaffs1 formatting (ie. using yaffs1 backward compatibility).

Assuming you're using a Linux PC, it is pretty straight formward to build and
run the tests.

Get tarball from http://www.aleph1.co.uk/cgi-bin/viewcvs.cgi/yaffs2/

cd to yaffs2/direct
make


To make and run a Linux kernel module. This was done under Ubuntu.

You will need to have the appropriate kernel building packages installed.It
looks like you might be missing those.
The insmod is on yaffs2.ko, not yaffs.o


charles@linux-dual-head:/opt/y/ref/yaffs2$cd yaffs2
charles@linux-dual-head:/opt/y/ref/yaffs2$ make
make -C /lib/modules/2.6.24-24-generic/build M=/opt/y/ref/yaffs2 modules
make[1]: Entering directory `/usr/src/linux-headers-2.6.24-24-generic'
  Building modules, stage 2.
  MODPOST 1 modules
make[1]: Leaving directory `/usr/src/linux-headers-2.6.24-24-generic'
charles@linux-dual-head:/opt/y/ref/yaffs2$ sudo -s
[sudo] password for charles: 
root@linux-dual-head:/opt/y/ref/yaffs2# mkdir xxx
root@linux-dual-head:/opt/y/ref/yaffs2# modprobe mtd
root@linux-dual-head:/opt/y/ref/yaffs2# modprobe mtdblock
root@linux-dual-head:/opt/y/ref/yaffs2# modprobe nandsim first_id_byte=0x20 
second_id_byte=0xa2 third_id_byte=00 fourth_id_byte=0x15
root@linux-dual-head:/opt/y/ref/yaffs2# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 04000000 00020000 "NAND simulator partition 0"
root@linux-dual-head:/opt/y/ref/yaffs2# insmod yaffs2.ko
root@linux-dual-head:/opt/y/ref/yaffs2# cat /proc/filesystems 
nodev    sysfs
nodev    rootfs
nodev    bdev
nodev    proc
nodev    cgroup
nodev    cpuset
nodev    debugfs
nodev    securityfs
nodev    sockfs
nodev    pipefs
nodev    anon_inodefs
nodev    futexfs
nodev    tmpfs
nodev    inotifyfs
nodev    devpts
    cramfs
nodev    ramfs
nodev    mqueue
nodev    fuse
    fuseblk
nodev    fusectl
nodev    usbfs
    ext3
nodev    binfmt_misc
    yaffs
    yaffs2
root@linux-dual-head:/opt/y/ref/yaffs2# mount -t yaffs2 /dev/mtdblock0 xxx
root@linux-dual-head:/opt/y/ref/yaffs2# ls -ial xxx
total 8
      1 drwxr-xr-x 1 root    root    2048 2009-10-12 11:07 .
1089951 drwxr-xr-x 9 charles charles 4096 2009-10-12 11:06 ..
      2 drwx------ 1 root    root    2048 2009-10-12 11:07 lost+found
root@linux-dual-head:/opt/y/ref/yaffs2# 



On Sunday 11 October 2009 11:27:36 Marco wrote:
> Hi to all
> I am Marco Rimpatriato and I am a master student at the Politechnic of
> Torino in Italy. I have worked on YAFFS for my thesis that is focused on
> solving a problem in airspace environment. I have understood all the
> mechnisms of the file system's guts and I think of all the interfaces too
> (I have dealt with YAFFS1). I am interested to mount it in all the three
> options (direct, linux-module, linux-kernel) but, after two days if tries i
> had to realize that I am not able to do it.
>
> In particular for what concerns the linux module I followed precisingly all
> the procedure suggested but I did not came out:
>
> ********************************************************
> 1.. Hack the Makefile and change the KERNELDIR define to your kernel
> directory.
>
> 2.. If you don't have mtd support in your kernel, then you might need to
> turn off USE_MTD otherwise the yaffs module might not load.
>
> 3.. Type make clean; make to build yaffs
>
> 4.. Load yaffs as a module by typing /sbin/insmod yaffs.o (ya gotta be
> root!).
>
> 5.. Create a mount point eg. mkdir /mnt/y
>
> 6.. To mount the RAM emulation version of yaffs, mount -t yaffsram none
> /mnt/y
>
> 7.. Alternatively, to mount the mtd version of yaffs, mount -t yaffs
> /dev/mtd0 /mnt/y
>
> ***************************************************************
>
> The problem is that when I type "make clean; make" the resul is such a huge
> amount of errors:
>
> gcc -c -D__KERNEL__ -DMODULE -DCONFIG_YAFFS_RAM_ENABLED
> -DCONFIG_YAFFS_MTD_ENABLED -DCONFIG_YAFFS_USE_GENERIC_RW
> -DCONFIG_SHORT_NAMES_IN_RAM -DCONFIG_YAFFS_USE_NANDECC -I
> /usr/src/linux-headers-2.6.24-24/include -O2 -Wall yaffs_fs.c -o yaffs_fs.o
> yaffs_fs.c:36:26: error: linux/config.h: No such file or directory In file
> included from /usr/src/linux-headers-2.6.24-24/include/linux/kernel.h:11,
> from yaffs_fs.c:37:
> /usr/src/linux-headers-2.6.24-24/include/linux/linkage.h:4:25: error:
> asm/linkage.h: No such file or directory



>
> .........................
>
> yaffs_fs.c:1661: error: too many arguments to function
> 'create_proc_read_entry' yaffs_fs.c:1683: error: 'yaffs_ram_fs_type'
> undeclared (first use in this function) yaffs_fs.c: In function
> 'exit_yaffs_fs':
> yaffs_fs.c:1710: error: 'yaffs_ram_fs_type' undeclared (first use in this
> function) make: *** [yaffs_fs.o] Error 1
>
> I have reported just few rows at the beginning and at the end but row are a
> very huge number! (I am sorry for some strange characters but this is ue At
> a first sight errors seems to came only from not found packets in kernel
> directory and from yaffs_fs.c I saw that the file yaffs_fs calls config.h
> that in my kernel dir (/usr/src/linux-headers-2.6.24-24) is not present!
> But there are problems also with others.
>
>
> Please help me! How can I do to make YAFFS working on my Linux (I have
> tryed it on Ubuntu 9 and xubuntu 8.04)?
>
> I have tryed also YAFFS2, following the same procedure explained for YAFFS1
> and, when I make the files all works but when I insert the generated file
> yaffs2.o (/sbin/insmod yaffs2.o) it says that is not a module and if i try
> with yaffs2.mod.o (/sbin/insmod yaffs2.mod.o) it recognizes the module but
> tells me that there is an unknown symbol.
>
> Please help me...
>
> Marco