Changeset b0fecad in mainline


Ignore:
Timestamp:
2012-02-22T20:28:18Z (12 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
6aeab59c
Parents:
3938375
Message:

mkexfat: Fix FAT initialization

  • Allocate clusters for the Root directory entry, the allocation bitmap and the upcase table;
  • Not the entire FAT was cleared.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/mkexfat/mkexfat.c

    r3938375 rb0fecad  
    319319        pfat[1] = host2uint32_t_le(0xFFFFFFFF);
    320320
     321        /* Allocate clusters for the bitmap, upcase table
     322         * and the root directory.
     323         */
     324        pfat[2] = host2uint32_t_le(0xFFFFFFFF);
     325        pfat[3] = host2uint32_t_le(0xFFFFFFFF);
     326        pfat[4] = host2uint32_t_le(0xFFFFFFFF);
     327
    321328        rc = block_write_direct(service_id, FAT_SECTOR_START, 1, pfat);
    322329        if (rc != EOK)
    323330                goto error;
    324331
    325         pfat[0] = pfat[1] = 0x00000000;
    326 
    327         for (i = 1; i < cfg->fat_sector_count; ++i) {
     332        memset(pfat, 0, 5 * sizeof(uint32_t));
     333
     334        for (i = 1; i < cfg->fat_sector_count + 1; ++i) {
    328335                rc = block_write_direct(service_id,
    329                     FAT_SECTOR_START + i + 1, 1, pfat);
     336                    FAT_SECTOR_START + i, 1, pfat);
    330337                if (rc != EOK)
    331338                        goto error;
Note: See TracChangeset for help on using the changeset viewer.