|
楼主 |
发表于 2016-12-23 08:54:14
|
显示全部楼层
- if (_MULTI_PARTITION && part) {
- /* Get partition information from partition table in the MBR */
- if (disk_read(pdrv, fs->win, 0, 1) != RES_OK) return FR_DISK_ERR;
- if (ld_word(fs->win + BS_55AA) != 0xAA55) return FR_MKFS_ABORTED;
- tbl = &fs->win[MBR_Table + (part - 1) * SZ_PTE];
- if (!tbl[4]) return FR_MKFS_ABORTED; /* No partition? */
- b_vol = ld_dword(tbl + 8); /* Volume start sector */
- n_vol = ld_dword(tbl + 12); /* Volume size */
- } else {
- /* Create a single-partition in this function */
- if (disk_ioctl(pdrv, GET_SECTOR_COUNT, &n_vol) != RES_OK || n_vol < 128) { //--wj 128个扇区
- return FR_DISK_ERR;
- }
- b_vol = (sfd) ? 0 : 63; /* Volume start sector */
- n_vol -= b_vol; /* Volume size */
- }
-
-
- st_word(tbl + BS_55AA, 0xAA55); /* Signature (Offset is fixed here regardless of sector size) */
复制代码 我想要在铁电上使用文件系统,一直挂载不上去。铁电的大小为8K
FAFTS文件系统对存储介质的容量是否有要求,从上面的代码可以看出建立文件系统至少要在存储介质上建立128个扇区,而每个扇区至少512字节(因为挂载文件系统会一次性读取512个字节的数据,然后判断511,512个字节是否为0X55,0XAA)..因此设置扇区大小小于512字节时,就会导致文件系统挂载失败。所以我觉得存储介质的大小至少未128*512 = 64K 字节。
我的想法对不对啊,还有我不太明白disk_ioctl()函数中GET_BLOCK_SIZE的作用,他是用来干什么的 |
|