新浪博客

关于Block(块)和sector(扇区)

2015-04-17 16:41阅读:
关于Block(块)和sector(扇区):(在针对于SD卡和文件系统)
1. 在SD卡上:
block : A number of bytes, basic data transfer unit (SD中最小的读写单位)。
block length 可以被 SET_BLOCKLEN (CMD16)设置 。
SDHC and SDXC block length 是固定的512Bytes。
协议原文:
7.2.3 Data Read
The SPI mode supports single block read and Multiple Block read operations (CMD17 or CMD18 in the
SD Memory Card protocol). Upon reception of a valid read command the card will respond with a
response token followed by a data token (refer to Figure 7-3). In case of Standard Capacity Card, the
size in the data token is determined by the block length set by SET_BLOCKLEN (CMD16). In case of
SDHC and SDXC Cards, block length is fixed to 512 Bytes regardless of the block length set by
CMD16.
ont >sector: A number of blocks, basic erase unit (SD擦除单位)
可以设置为N*block
协议原文:
SECTOR_SIZE
The size of an erasable sector. The content of this register is a 7-bit binary coded value, defining the
number of write blocks (see WRITE_BL_LEN). The actual size is computed by increasing this number
by one. A value of zero means one write block, 127 means 128 write blocks.


2. 在文件系统上
(1):
Block是文件系统上的概念,一般文件系统block大小为4K。
Sector是磁介质硬盘最小单元,一般为512字节。
Block值一般与sector值是不相等的。
(2):
扇区(block)是驱动可以操作的最小单位,是磁盘级别的。
一个磁盘扇区(sector)512个字节(现在有4K的了),扇区(sector)是磁盘的最小存储单位,
块(block)是文件系统层的,mkfs时可以设置块的大小.
磁盘块(block)应该是类似FAT的簇大小的概念,是操作系统中分配磁盘容量的最小单位.
块(block)是数据存储的最小单位!

我的更多文章

下载客户端阅读体验更佳

APP专享