GP2X Files On Vfat On Yaffs On Nand...


sparr

Member
Joined
Jun 3, 2006
Messages
292
It seems that the NAND files are stored in a vfat filesystem image stored on a yaffs filesystem on /dev/mtdblock/4. This seems needlessly complex. Why not just format /dev/mtdblock/4 as vfat, or actually store the NAND files in the yaffs filesystem?
 
I'm not sure why they felt they had to use vfat (just to screw with people who want to use symlinks in it?), but yaffs is used because normal filesystems don't work well at all on NAND flash - sectors aren't guaranteed to work and the filesystem has to cope with that (if a sector used for the FAT burned out with vfat, it would be a mess). I'm guessing yaffs also does write balancing too.

Maybe there's some extra overhead involved with creating or deleting files in yaffs? Just a guess. Actually another idea is probably to allow it to be mounted as a USB block device.
 
yaffs is required because of the nand - there's the possibility of bad blocks appearing anywhere and at anytime, and the file system must support this and relocate blocks appropriately.

vfat is required because the most popular os is Windows, and windows doesn't support yaffs.

So, we have a mixture of both.

Of course, if you mount the gp2x as a samba device, it doesn't matter what file system it uses, as it only deals with files. But if you mount it as a usb mass storage device, then only sectors are transferred, and so the host os needs to know how to handle the file system.
 
Well, my computers all run Linux or OS X, no FS-blind OSes here. I think I am going to un-nest it and store my NAND files directly on the yaffs*. Should yield a slight improvement in performance, and a little extra storage too. I already took the old payback and vektar demos off my NAND and put on the newest vektar along with a few other games.

* i am tempted to make the NAND jffs2. the kernel supports it and after all my fruitless sd-automount hunting i know i can fix the mount scripts to handle it. jffs2 supports transparent compression, which would be a performance hit but would allow for quite a bit better storage since not every application supports (g/b/pk)zipped files.
 
don't forget that if you make your entire nand jffs2, you will be increasing your startup time, as it'll take a while to check the nand when you mount it (which is the reason gph moved to yaffs).
 
Back
Top