[Yaffs] MTD nandsim HOWTO for yaffs users

Martin Fouts Martin.Fouts at palmsource.com
Fri Jul 29 05:13:59 BST 2005


If you wish to use the mtd nandsim device as a simulator for testing
yaffs, you can follow these steps:
 
1) Make sure you have a recent 2.6 kernel with a recent MTD tree.  (If
you ask the MTD folk, they'll tell you to run the mtd patchin script
from the latest cvs version of MTD.)
 
2) Configure your kernel to enable the mtd nand support and nandsim
driver. Make sure that the following are set in .config:
 
CONFIG_MTD=m
CONFIG_MTD_CHAR=m
CONFIG_MTD_BLOCK=m
CONFIG_MTD_NAND=m
CONFIG_MTD_NAND_NANDSIM=m

You can set them to 'y' rather than 'm' if you don't want the modules
form.
 
3) make and install your kernel and modules in the usual way, then boot.
 
4) To use the nandsim, you need to load some MTD modules, unless you've
configured MTD into the kernel:
 
modprobe mtdblock
modprobe mtdchar
modprobe nandsim

5) Verify that the nandsim device has loaded properly:
 
cat /proc/mtd
 
You will see something like
 
dev:    size   erasesize  name
mtd0: 00800000 00002000 "NAND simulator partition"

If everything went well.
 
6) what the nand device is called will depend on your Linux distro, and
whether you are using devfs or udev, but the '0', or whatever mtd
reports as the device associated with the simulator, in the above will
show up in the name.  On my ubuntu system, if /proc/mtd reports 'mtd0'
then the block device is /dev/mtdblock0 and the char device is
/dev/mtd0.
 
7) You can mount yaffs on the nandsim in the usual way.  I have
/mnt/nand as the directory I mount on, so I would mount using
 
mount -t yaffs /dev/mtdblock0 /mnt/nand
 
 
If you find any errors in this, please let me know.  It wll eventually
find its way into the yaffs documentation.
 
Marty
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.aleph1.co.uk/pipermail/yaffs/attachments/20050728/38e87146/attachment.html


More information about the yaffs mailing list