Changeset 557e5b13 in mainline


Ignore:
Timestamp:
2012-02-24T21:50:48Z (12 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
89a0a827
Parents:
69f9cf5
Message:

mkexfat: write the rootdir cluster index to the boot sector

File:
1 edited

Legend:

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

    r69f9cf5 r557e5b13  
    8484        unsigned long data_start_sector;
    8585        unsigned long rootdir_cluster;
     86        unsigned long upcase_table_cluster;
    8687        unsigned long total_clusters;
    8788        unsigned long allocated_clusters;
     
    216217            div_round_up(cfg->data_start_sector, cfg->cluster_size));
    217218
    218         mbs->rootdir_cluster = 0;
     219        mbs->rootdir_cluster = host2uint32_t_le(cfg->rootdir_cluster);
    219220        mbs->volume_serial = 0;
    220221        mbs->version.major = 1;
     
    573574        cfg_print_info(&cfg);
    574575
    575         rc = bootsec_write(service_id, &cfg);
    576         if (rc != EOK) {
    577                 printf(NAME ": Error, failed to write the VBR to disk\n");
    578                 return 2;
    579         }
    580 
    581576        rc = fat_initialize(service_id, &cfg);
    582577        if (rc != EOK) {
    583578                printf(NAME ": Error, failed to write the FAT to disk\n");
    584                 return 2;
    585         }
    586 
    587         rc = bitmap_write(service_id, &cfg);
    588         if (rc != EOK) {
    589                 printf(NAME ": Error, failed to write the allocation" \
    590                     " bitmap to disk.\n");
    591579                return 2;
    592580        }
     
    602590        next_cls = FIRST_FREE_CLUSTER +
    603591            div_round_up(cfg.bitmap_size, cfg.cluster_size);
     592        cfg.upcase_table_cluster = next_cls;
    604593
    605594        /* Allocate clusters for the upcase table */
     
    621610        }
    622611
     612        rc = bitmap_write(service_id, &cfg);
     613        if (rc != EOK) {
     614                printf(NAME ": Error, failed to write the allocation" \
     615                    " bitmap to disk.\n");
     616                return 2;
     617        }
     618
     619        rc = bootsec_write(service_id, &cfg);
     620        if (rc != EOK) {
     621                printf(NAME ": Error, failed to write the VBR to disk\n");
     622                return 2;
     623        }
     624
    623625        return 0;
    624626}
Note: See TracChangeset for help on using the changeset viewer.