From: chessmylitis@hotmail.com
To: manningc2@actrix.gen.nz; yaffs@lists.aleph1.co.uk
Subject: RE: [Yaffs] (no subject)
Date: Thu, 9 Jun 2011 14:39:45 +0000



> From: manningc2@actrix.gen.nz
> To: yaffs@lists.aleph1.co.uk
> Subject: Re: [Yaffs] (no subject)
> Date: Thu, 9 Jun 2011 06:23:38 +1200
> CC: chessmylitis@hotmail.com
>
> On Wednesday 08 June 2011 18:51:36 Rhykie Rhykie wrote:
> > From: chessmylitis@hotmail.com
> > To: manningc2@actrix.gen.nz
> > Subject: RE: [Yaffs] (no subject)
> > Date: Wed, 8 Jun 2011 06:47:08 +0000
> >
> > > From: manningc2@actrix.gen.nz
> > > To: yaffs@lists.aleph1.co.uk
> > > Subject: Re: [Yaffs] (no subject)
> > > Date: Wed, 8 Jun 2011 17:01:01 +1200
> > > CC: chessmylitis@hotmail.com
> > >
> > > On Wednesday 08 June 2011 02:10:42 Rhykie Rhykie wrote:
> > > > Hi,
> > > > I have two questions:
> > > >
> > > > 1) In the cramfs file system i have a source code in which i want to
> > > > use fread()/fwrite() functions to read/write to a text file in the
> > > > yaffs file system, all this in a nand flash memory in two different
> > > > partitions. Unfortunately when compiling i get the "trying to access
> > > > read-only file system" error. Any idea of how i can achieve what i want
> > > > to do.
> > >
> > > That is very little info to work on/ Can you explain more?
> >
> > Ok, the nand flash is divided into four MTD block partitions; in mtdblock2
> > there is a cramfs file system which comprises my source code. Now since
> > cramfs is read-only, I want to permanently store some text files in
> > mtdblock3 which is a yaffs file system, allowing read and write. Then from
> > the cramfs[mtdblock2] I want to access those files in [yaffs]mtdblock3 to
> > perform read/write. For example I have the following instruction, in my
> > source code [mtdblock2], to open the file in mtdblock3: FILE*ft =
> > fopen("/dev/mtdblock3/myfile.txt", "r+"); So I get I get the error! If the
> > file myfile.txt is in mtdblock3 yaffs partition, is its directory written
> > as: /dev/mtdblock3/myfile.txt?
>
> I am curious about the file names. Are those you are really using?
> It does not look like you have mounted the yaffs partition. Once you have
> mounted the partition, the files become available at the mount pooint, not on
> the partition.
>
> When you type "mount" on a console, what do you get?

When typing mount on a console, just after boot-up, I get the following:
    rootfs on / type rootfs (rw)
   /dev/root on / type cramfs (ro)
   proc on /proc type proc (rw)
   none on /tmp type ramfs (rw)
   mdev on /dev type ramfs (rw)
   sysfs on /sys type sysfs (rw)

which shows that mtdblock3 is not mounted

I then typed: $mount -t yaffs /dev/mtdblock3 /mnt/, followed by: $mount This is what I got:
/dev/root on / type cramfs (ro)
proc on /proc type proc (rw)
none on /tmp type ramfs (rw)
mdev on /dev type ramfs (rw)
sysfs on /sys type sysfs (rw)
/dev/mtdblock3 on /mnt type yaffs (rw)

which shows that mtdblock3 is NOW mounted!

Now in the yaffs mount point /mnt, I have a file myfile.txt which I want to read and write from within the cramfs file system. So I now see that I can open the file by using the instruction: fopen("/mnt/myfile.txt", "r+");

The problem now is that I want mtdblock3 to be mounted automatically during boot-up, I included the following instruction in the /etc/fstab file:
/dev/mtdblock3 /mnt/  yaffs defaults  0 0
But during boot-up I get the following error message: mount: mounting mtdblock3 on /mnt/ failed: No such file or directory
The /dev/mtdblock3 and /mnt directories exist!!!!
I even issued the following instruction in the /etc/init.d/rcS file but couldnt get any help!!!: /bin/mount -t yaffs /dev/mtdblock3 /mnt/

Any idea of how I can solve the problem?

>
>
>
> >
> > > > 2)When the cramfs file system is configured to be the root after kernel
> > > > boot-up, i have read that i can mount the yaffs to mtdblock3 partition
> > > > by using the command mount -t yaffs /dev/mtdblock3 /mnt/.
> > > >
> > > > In the /mnt directory, i get the empty yaffs folder. As i was
> > > > researching about how to get going with yaffs i got a couple yaffs
> > > > source code which i dont know how to use them. Please help, how do i
> > > > get a yaffs file system in the nand partition.
> > >
> > > First, start off with an empty flash (before you mouint yaffs). You can
> > > use flash_eraseall to do this. Mount yaffs, then copy the files in from
> > > another source.
> > > -- Charles
>
>