Changeset eaf9794 in mainline


Ignore:
Timestamp:
2011-03-03T19:40:43Z (13 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7413683
Parents:
e3675427
Message:

Add some comments to mkminix

Location:
uspace/app/mkminix
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/mkminix/mfs.h

    re3675427 reaf9794  
    6262#define MFS_MAGIC_V3            0x4D5A
    6363#define MFS_MAGIC_V3R           0x5A4D
     64
     65#define MFS_VALID_FS            0x0001
     66#define MFS_ERROR_FS            0x0002
    6467
    6568struct mfs_superblock {
  • uspace/app/mkminix/mkminix.c

    re3675427 reaf9794  
    8383        uint32_t block_size = MFS_MAX_BLOCK_SIZE;
    8484        size_t devblock_size;
    85         unsigned long total_inodes = 0;
     85        unsigned long n_inodes = 0;
     86
     87        struct mfs_superblock *sb;
     88        sb = (struct mfs_superblock *) malloc(sizeof(struct mfs_superblock));
    8689
    8790        if (argc == 1) {
     
    109112                        break;
    110113                case 'b':
    111                         block_size = (unsigned long) strtol(optarg, NULL, 10);
     114                        block_size = (uint32_t) strtol(optarg, NULL, 10);
    112115                        break;
    113116                case 'i':
    114                         total_inodes = (unsigned long) strtol(optarg, NULL, 10);
     117                        n_inodes = (unsigned long) strtol(optarg, NULL, 10);
    115118                        break;
    116119                }
     
    120123                printf(NAME ":Error! Invalid block size.\n");
    121124                exit(0);
    122         } else if (num_of_set_bits((uint32_t) block_size) != 1) {
     125        } else if (num_of_set_bits(block_size) != 1) {
     126                /*Block size must be a power of 2.*/
    123127                printf(NAME ":Error! Invalid block size.\n");
    124128                exit(0);
     
    129133        }
    130134
    131         argc -= optind;
    132135        argv += optind;
    133136
     
    171174
    172175        printf("Creating Minix file system on device\n");
     176
     177        /*Prepare superblock*/
    173178
    174179        return 0;
     
    185190                "-3         Make a Minix version 3 filesystem\n"
    186191                "-b ##      Specify the block size in bytes (V3 only),\n"
    187                 "           valid block size are 1024, 2048 and 4096 bytes per block\n"
     192                "           valid block size values are 1024, 2048 and 4096 bytes per block\n"
    188193                "-i ##      Specify the number of inodes for the filesystem\n");
    189194        }
Note: See TracChangeset for help on using the changeset viewer.