#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; } struct fs_stats_t info = fs_info(); printf("Etat du volume %d :\n", volume); printf("* Numéro de série : %d\n", info.serial); printf("* Label : %s\n", info.label); printf("* Inode racine : %u\n", info.root_inode); printf("* Espace libre (en blocs) : %u\n", info.free_space); umount(); return EXIT_SUCCESS; }