存储介质block和sector的区别
1. SD卡中block和sector的区别
SD卡协议中 与 HardDisk(文件系统)的block和sector不一个意思。
block :
A number of bytes, basic data transfer unit (SD中最小的读写单位,一般为512B)。
block length 可以被 SET_BLOCKLEN (CMD16)设置 。
SDHC and SDXC block length 是固定的512Bytes。
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. 文件系统中block和sector的区别
Linux中,block和sector的区别
文件偏移量pos,是针对文件本身而言,即文件内的偏移。
Block是文件系统上的概念,一般文件系统block大小为4K。
Sector是硬盘/U盘最小读写单元,一般为512字节。
3. uboot下U盘测试
3.1 U盘 block
30031872 x 512 / 1024 / 1024 /1024 = 14.3GB
总共30031872个sector,每个sector大小为512B
3.2 read & write block
usb read addr blk# cnt
- read `cnt' blocks starting at block `blk#' to memory address `addr'
usb write addr blk# cnt
- write `cnt' blocks starting at block `blk#' from memory address `addr'
这里的block,即U盘最小读写单位,512字节
3.3 test
1)未执行操作时,0x50000000处地址内容为0x00
2)usb read 0x50000000 800000 1
读取第8388608处的1块block到0x50000000
3)dump内存
可以看到有512字节被写入
4. linux下U盘测试
可以看到sector大小为512B,总共30031872个sector
jxwild: 大侠,现在visualSVN用AD域认证功能,是要收费了吗
Step1207: 博主文章中的操作都做了吗?
yao523340118: 楼主分享一下,怎么解决的呗,快搞疯了
Step1207: 感谢,问题解决了
李佩奇.: 你好,我想问一下怎么保存读出来的信息呢