Changeset 1433ecda in mainline for uspace/app/mkfat
- Timestamp:
- 2018-04-04T15:42:37Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2c4e1cc
- Parents:
- 47b2d7e3
- Location:
- uspace/app/mkfat
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/mkfat/fat.h
r47b2d7e3 r1433ecda 86 86 /** Boot sector signature. */ 87 87 uint16_t signature; 88 } __attribute__ ((packed));88 } __attribute__((packed)); 89 89 struct { 90 90 /* FAT32 only */ … … 117 117 /** Signature. */ 118 118 uint16_t signature; 119 } __attribute__ ((packed)) fat32;119 } __attribute__((packed)) fat32; 120 120 }; 121 } __attribute__ ((packed)) fat_bs_t;121 } __attribute__((packed)) fat_bs_t; 122 122 123 123 #endif -
uspace/app/mkfat/fat_dentry.h
r47b2d7e3 r1433ecda 116 116 uint16_t eaidx; /* FAT12/FAT16 */ 117 117 uint16_t firstc_hi; /* FAT32 */ 118 } __attribute__ ((packed));118 } __attribute__((packed)); 119 119 uint16_t mtime; 120 120 uint16_t mdate; … … 122 122 uint16_t firstc; /* FAT12/FAT16 */ 123 123 uint16_t firstc_lo; /* FAT32 */ 124 } __attribute__ ((packed));124 } __attribute__((packed)); 125 125 uint32_t size; 126 } __attribute__ ((packed));126 } __attribute__((packed)); 127 127 struct { 128 128 uint8_t order; … … 134 134 uint16_t firstc_lo; /* MUST be 0 */ 135 135 uint16_t part3[FAT_LFN_PART3_SIZE]; 136 } __attribute__ ((packed)) lfn;137 } __attribute__ ((packed)) fat_dentry_t;136 } __attribute__((packed)) lfn; 137 } __attribute__((packed)) fat_dentry_t; 138 138 139 139 #endif -
uspace/app/mkfat/mkfat.c
r47b2d7e3 r1433ecda 116 116 } 117 117 118 --argc; ++argv; 118 --argc; 119 ++argv; 119 120 120 121 while (*argv[0] == '-') { 121 122 if (str_cmp(*argv, "--size") == 0) { 122 --argc; ++argv; 123 --argc; 124 ++argv; 123 125 if (*argv == NULL) { 124 126 printf(NAME ": Error, argument missing.\n"); … … 134 136 } 135 137 136 --argc; ++argv; 138 --argc; 139 ++argv; 137 140 } 138 141 139 142 if (str_cmp(*argv, "--type") == 0) { 140 --argc; ++argv; 143 --argc; 144 ++argv; 141 145 if (*argv == NULL) { 142 146 printf(NAME ": Error, argument missing.\n"); … … 152 156 } 153 157 154 --argc; ++argv; 158 --argc; 159 ++argv; 155 160 } 156 161 157 162 if (str_cmp(*argv, "--label") == 0) { 158 --argc; ++argv; 163 --argc; 164 ++argv; 159 165 if (*argv == NULL) { 160 166 printf(NAME ": Error, argument missing.\n"); … … 165 171 cfg.label = *argv; 166 172 167 --argc; ++argv; 173 --argc; 174 ++argv; 168 175 } 169 176 170 177 if (str_cmp(*argv, "-") == 0) { 171 --argc; ++argv; 178 --argc; 179 ++argv; 172 180 break; 173 181 } … … 268 276 if (dp != NULL) 269 277 dp[i] = toupper(*sp); 270 ++i; ++sp; 278 ++i; 279 ++sp; 271 280 } 272 281 … … 305 314 /* Only correct for FAT12/16 (FAT32 has root dir stored in clusters */ 306 315 rd_sectors = div_round_up(cfg->root_ent_max * DIRENT_SIZE, 307 cfg->sector_size);316 cfg->sector_size); 308 317 non_data_sectors_lb_16 = cfg->reserved_sectors + rd_sectors; 309 318 … … 333 342 if (cfg->fat_type != FAT32) { 334 343 cfg->rootdir_sectors = div_round_up(cfg->root_ent_max * DIRENT_SIZE, 335 cfg->sector_size);344 cfg->sector_size); 336 345 non_data_sectors_lb = cfg->reserved_sectors + cfg->rootdir_sectors; 337 346
Note:
See TracChangeset
for help on using the changeset viewer.
