Filesystem in RTEMS

Sebastian Huber sebastian.huber at embedded-brains.de
Sat Oct 21 10:52:24 UTC 2017


----- Am 21. Okt 2017 um 2:17 schrieb xuelin tian xuelin.tian at qkmtech.com:

> I followed the example (testsuites/fstests/jffs2_support/fs_support.c), and some
> error came up, like
> "undefined reference to rtems_jffs2_initialize",
> "undefined reference to rtems_jffs2_compressor_zlib_compress", and
> "undefined reference to rtems_jffs2_compressor_zlib_decompress"
> I have no clue here. Do I have to give my own implementation of these functions
> here? I can exploit the default functions for jffs2 entry table and compress, I
> think.

In order to use JFFS2 with compression you have to add "-ljffs2 -lz" to your linker command line.

> 
> And I have a little confused about the model of device driver in rtems, since I
> get stuck for a few days.
> First, a deivce descriptor (rtems_fdisk_device_desc) should be given, including
> some handlers defined in rtems_fdisk_driver_handlers,  and device configuration
> (rtems_flashdisk_config).
> Then, I need to register (or initialize) my flash device into rtems dynamically
> or statically, with my own initialize, open, close functions.
> Last, the JFFS2 should be set up based on the registered device driver. The
> block size need to be equal to the page size of flash, and the read, write,
> erase operations should invoke the corresponding functions defined in
> rtems_fdisk_driver_handlers.
> 
> Am I correct in this whoe process?

There is no general purpose flash framework in RTEMS (like MTD on Linux). The JFFS2 uses therefore a framework independent interface.  You have to provide functions for the basic flash operations read, program and erase yourself.  You should test these operations separately.

The first mount of JFFS2 on a completely erased flash may take a while since it is erased block by block and then the clean markers are programmed.

http://www.linux-mtd.infradead.org/faq/jffs2.html#L_clmarker

We have a filesystem guide:

https://docs.rtems.org/branches/master/filesystem/index.html

Unfortunately it is out dated and incomplete. Maybe you can help to improve it.



More information about the users mailing list