#include #include #include #include #include #include #include static void emptyIT() { return; } static void hddIT() { return; } int main(int argc, char *argv[]) { unsigned int i; /* init hardware */ if(initHardware("hardware.ini") == 0) { fprintf(stderr, "Error in hardware initialization\n"); exit(EXIT_FAILURE); } /* Interreupt handlers */ for(i=0; i<16; i++) IRQVECTOR[i] = emptyIT; IRQVECTOR[HDA_IRQ] = hddIT; /* Allows all IT */ _mask(1); if ( argc < 2 ) { printf("Utilisation : %s VOLUME\n", argv[0]); return EXIT_FAILURE; } unsigned int volume = atoi(argv[1]); if ( mount(volume) < 0 ) { printf("Erreur de montage du volume!\n"); return EXIT_FAILURE; } printf("Création du superbloc..."); init_super(volume); printf("ok\n"); printf("Création d'un dossier racine..."); /* le '/' */ inode_t root = create_file("/", FILET_DIR); /* Le mettre en tant que réel '/' */ struct superblock_desc_t sblock; load_super(volume, &sblock); sblock.first_inode = root; save_super(volume, &sblock); printf("ok\n"); printf("Système de fichiers créé sur le volume %u\n", volume); umount(); return EXIT_SUCCESS; }