Changeset ed9bf14 in mainline
- Timestamp:
- 2015-11-07T23:46:59Z (9 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f63a0073
- Parents:
- 44183b98
- Location:
- uspace/app/mkfat
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/mkfat/fat.h
r44183b98 red9bf14 43 43 #define FAT16_CLST_MAX 65525 44 44 45 #define FATAUTO 0 45 46 #define FAT12 12 46 47 #define FAT16 16 -
uspace/app/mkfat/mkfat.c
r44183b98 red9bf14 102 102 cfg.addt_res_sectors = 0; 103 103 cfg.root_ent_max = 128; 104 cfg.fat_type = FAT 16;104 cfg.fat_type = FATAUTO; 105 105 106 106 if (argc < 2) { … … 189 189 } 190 190 191 if (cfg.fat_type != FAT12 && cfg.fat_type != FAT16 && cfg.fat_type != FAT32) { 191 if (cfg.fat_type != FATAUTO && cfg.fat_type != FAT12 && cfg.fat_type != FAT16 && 192 cfg.fat_type != FAT32) { 192 193 printf(NAME ": Error. Unknown FAT type.\n"); 193 194 return 2; … … 247 248 cfg->sectors_per_cluster); 248 249 249 if ((cfg->fat_type == FAT12 && cfg->total_clusters > FAT12_CLST_MAX) || 250 (cfg->fat_type == FAT16 && (cfg->total_clusters <= FAT12_CLST_MAX || 251 cfg->total_clusters > FAT16_CLST_MAX)) || 252 (cfg->fat_type == FAT32 && cfg->total_clusters <= FAT16_CLST_MAX)) 253 return ENOSPC; 250 if (cfg->total_clusters <= FAT12_CLST_MAX) { 251 if (cfg->fat_type == FATAUTO) 252 cfg->fat_type = FAT12; 253 else if (cfg->fat_type != FAT12) 254 return EINVAL; 255 } else if (cfg->total_clusters <= FAT16_CLST_MAX) { 256 if (cfg->fat_type == FATAUTO) 257 cfg->fat_type = FAT16; 258 else if (cfg->fat_type != FAT16) 259 return EINVAL; 260 } else { 261 if (cfg->fat_type == FATAUTO) 262 cfg->fat_type = FAT32; 263 else if (cfg->fat_type != FAT32) 264 return EINVAL; 265 } 254 266 255 267 fat_bytes = div_round_up((cfg->total_clusters + 2) *
Note:
See TracChangeset
for help on using the changeset viewer.