博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
raw flash vs FTL
阅读量:7038 次
发布时间:2019-06-28

本文共 2709 字,大约阅读时间需要 9 分钟。

1. 区别

raw flash devices: NAND, NOR, OneNAND, etc,其被作为MTD设备处理(既不是字符设备,也不是块设备)。

FTL device:Flash Translation layer device, MMC, eMMC, SD,不仅包含flash,还包含控制器,其被作为块设备处理。

FTL stands for "Flash Translation Layer" and it is software which emulates a block device on top of flash

hardware. At early days FTL ran on the host computer. For example, old PCMCIA flash devices were essentially
raw flash devices, and the PCMCIA standard defined the media storage format for them. So the host computer
had to run the FTL software driver which implemented PCMCIA FTL. However, nowadays FTL is usually firmware,
and it is run by the controller which is built into the storage device. For example, if you look inside an
USB flash drive, you'll find there a NAND chip (or several of them), and a micro-controller, which runs FTL
firmware. Some USB flash drives are known to have quite powerful ARM processors inside. Similarly, MMC,
eMMC, SD, SSD, and other FTL devices have a built-in controller which runs FTL firmware.

All FTL devices have an interface which provides block I/O access. Well, the interfaces are different and

they are defined by different specifications, e.g., MMC, eMMC, SD, USB mass storage, ATA, and so on. But all
of them provide block-based access to the device. By block-based access we mean that whole device is
represented as an linear array of (usually 512-byte) blocks. Each block may be read or written.

http://www.linux-mtd.infradead.org/doc/ubifs.html#L_raw_vs_ftl

2. 常用的文件系统ext2、FAT等不能用于MTD设备上(raw flash),可运行于FTL device上。

3. mtd设备对应的设备文件为/dev/mtd,FTL设备对应的设备文件可为/dev/mtdblock。

There is an extremely simple FTL layer in Linux MTD subsystem - mtdblock. It emulates block devices over MTD
devices. There is also an mtdblock_ro module which emulates read-only block devices. When you load this
module, it creates a block device for each MTD device in the system. The block devices are then accessible
via /dev/mtdblockX device nodes.

But in many cases using mtdblock is a very bad idea because what it basically does if you change any sector

of your mtdblockX device, it reads the whole corresponding eraseblock into the memory, erases the
eraseblock, changes the sector in RAM, and writes the whole eraseblock back. This is very straightforward.
If you have a power failure when the eraseblock is being erased, you lose all the block device sectors in
it. The flash will likely decay soon because you will wear few eraseblocks out - most probably those ones
which contain FAT/bitmap/inode table/etc.

Unfortunately it is a rather difficult task to create a good FTL layer and nobody still managed to implement

one for Linux. But now when we have UBI (see here) it is much easier to do it on top of UBI.

转载地址:http://lxnal.baihongyu.com/

你可能感兴趣的文章
LaTex:图片排版
查看>>
对比两个同类型的泛型集合并返回差异泛型集合 ——两个List<类名>的比较
查看>>
使用 ContentProviderOperation 来提升性能
查看>>
command >/dev/null 2>&1 解说
查看>>
磁盘分区知识总结
查看>>
赵又廷解锁全新代言 低调睿智展现绅士质感
查看>>
精读《重新思考 Redux》
查看>>
GitHub Universe 大会总结:信息流推荐开源库,推出社区功能
查看>>
如何构建自定义人脸识别数据集
查看>>
码农,有趣的灵魂...
查看>>
Mac编译Hadoop源码
查看>>
【翻译】深入理解ES6的模块
查看>>
通用对话框QMessageBox
查看>>
JavaScript数组API汇总
查看>>
如何理解Java静态?
查看>>
用 Golang 写一个搜索引擎 (0x04) --- B + 树
查看>>
检测php网站是否已经被攻破的方法
查看>>
iOS VIPER架构实践(二):VIPER详解与实现
查看>>
[译]在HealthKit中用 Swift 进行睡眠分析
查看>>
【刷算法】数组中出现次数超过一半的数字
查看>>