Filesystem in RTEMS

xuelin.tian at qkmtech.com xuelin.tian at qkmtech.com
Sun Oct 22 10:00:03 UTC 2017


I have mounted JFFS2 successfully, according to the return value. 
Yes, it takes some time to do the mounting work.

But, when I downloaded a file like "test.txt" into flash via FTP and restarted the system, error came up.

<5>JFFS2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x01FC0028: 0xE5DF instead
<5>JFFS2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x01FC002C: 0xE5DF instead
<5>JFFS2: Further such events for this erase block will not be printed
<5>JFFS2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x01FD0000: 0x000C instead
<5>JFFS2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x01FD0004: 0xB0B1 instead
<5>JFFS2: jffs2_scan_eraseblock(): Magic bitmask 0x1985 not found at 0x01FD0008: 0x0054 instead
<5>JFFS2: Cowardly refusing to erase blocks on filesystem with no valid JFFS2 nodes
<5>JFFS2: empty_blocks 0, bad_blocks 0, c->nr_blocks 510
mount failed.

Everything worked well, after erasing the whole flash. But errors came up without erasing it. 



Best wishes,
xuelin.tian at qkmtech.com
 
From: xuelin.tian
Date: 2017-10-21 22:07
To: Sebastian Huber
CC: users
Subject: Re: Filesystem in RTEMS
> 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

I have already tested my flash operations, they all worked well. Now, I use the same handle (an instance based on Xilinx BSP) to access to the hardware. And I just have one little question here, what is the appropriate block size for the JFFS2? The size of page is 256B, and size of segment is either 4KB or 64KB. 

> 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.
 
Sure, I am willing to do that, after fully understanding the file system in RTEMS.
 
------------------ Original ------------------
From:  "Sebastian Huber"<sebastian.huber at embedded-brains.de>;
Date:  Sat, Oct 21, 2017 06:52 PM
To:  "xuelin tian"<xuelin.tian at qkmtech.com>; 
Cc:  "users"<users at rtems.org>; 
Subject:  Re: Filesystem in RTEMS
 
----- 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.
自动判断 中文中文(简体)中文(香港)中文(繁体)英语日语朝鲜语德语法语俄语泰语南非语阿拉伯语阿塞拜疆语比利时语保加利亚语加泰隆语捷克语威尔士语丹麦语第维埃语希腊语世界语西班牙语爱沙尼亚语巴士克语法斯语芬兰语法罗语加里西亚语古吉拉特语希伯来语印地语克罗地亚语匈牙利语亚美尼亚语印度尼西亚语冰岛语意大利语格鲁吉亚语哈萨克语卡纳拉语孔卡尼语吉尔吉斯语立陶宛语拉脱维亚语毛利语马其顿语蒙古语马拉地语马来语马耳他语挪威语(伯克梅尔)荷兰语北梭托语旁遮普语波兰语葡萄牙语克丘亚语罗马尼亚语梵文北萨摩斯语斯洛伐克语斯洛文尼亚语阿尔巴尼亚语瑞典语斯瓦希里语叙利亚语泰米尔语泰卢固语塔加路语茨瓦纳语土耳其语宗加语鞑靼语乌克兰语乌都语乌兹别克语越南语班图语祖鲁语 自动选择 中文中文(简体)中文(香港)中文(繁体)英语日语朝鲜语德语法语俄语泰语南非语阿拉伯语阿塞拜疆语比利时语保加利亚语加泰隆语捷克语威尔士语丹麦语第维埃语希腊语世界语西班牙语爱沙尼亚语巴士克语法斯语芬兰语法罗语加里西亚语古吉拉特语希伯来语印地语克罗地亚语匈牙利语亚美尼亚语印度尼西亚语冰岛语意大利语格鲁吉亚语哈萨克语卡纳拉语孔卡尼语吉尔吉斯语立陶宛语拉脱维亚语毛利语马其顿语蒙古语马拉地语马来语马耳他语挪威语(伯克梅尔)荷兰语北梭托语旁遮普语波兰语葡萄牙语克丘亚语罗马尼亚语梵文北萨摩斯语斯洛伐克语斯洛文尼亚语阿尔巴尼亚语瑞典语斯瓦希里语叙利亚语泰米尔语泰卢固语塔加路语茨瓦纳语土耳其语宗加语鞑靼语乌克兰语乌都语乌兹别克语越南语班图语祖鲁语 有道翻译 百度翻译 必应翻译 谷歌翻译 谷歌翻译(国内) 翻译 朗读 复制 正在查询,请稍候…… 重试 朗读 复制 复制 朗读 复制 via 译 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/users/attachments/20171022/eb613a00/attachment-0002.html>


More information about the users mailing list