Skip to content
Snippets Groups Projects
Commit 40b87926 authored by Thierno souleymane Bah's avatar Thierno souleymane Bah
Browse files

feat(rmvol programm added, removing the last volume added)

parent 227f64c7
No related branches found
No related tags found
No related merge requests found
...@@ -13,7 +13,7 @@ LIBS = -L$(LIBDIR) -lhardware ...@@ -13,7 +13,7 @@ LIBS = -L$(LIBDIR) -lhardware
###------------------------------ ###------------------------------
### Main targets ### Main targets
###------------------------------------------------------------ ###------------------------------------------------------------
BINARIES= mkhd display_sector format_sector write_sector mkvol dvol BINARIES= mkhd display_sector format_sector write_sector mkvol dvol rmvol
all: $(BINARIES) $(OBJECTS) all: $(BINARIES) $(OBJECTS)
...@@ -33,6 +33,7 @@ format_sector: format_sector.o drive.o ...@@ -33,6 +33,7 @@ format_sector: format_sector.o drive.o
write_sector: write_sector.o drive.o write_sector: write_sector.o drive.o
mkvol: mkvol.o vol.o drive.o mkvol: mkvol.o vol.o drive.o
dvol: dvol.o vol.o drive.o dvol: dvol.o vol.o drive.o
rmvol: rmvol.o vol.o drive.o
###------------------------------ ###------------------------------
### Misc. ### Misc.
......
#include <stdio.h>
#include <stdlib.h>
#include "hardware.h"
#include "vol.h"
void display_vol()
{
if (mbr.nb_vols == 0)
{
fprintf(stderr, "Vous ne disposez d'aucun volume \n");
return;
}
mbr.nb_vols--;
}
static void
empty_it()
{
return;
}
int main(int argc, char const *argv[])
{
unsigned int i;
/* init hardware */
if (init_hardware("hwconfig.ini") == 0)
{
fprintf(stderr, "Error in hardware initialization\n");
exit(EXIT_FAILURE);
}
/* Interreupt handlers */
for (i = 0; i < 16; i++)
IRQVECTOR[i] = empty_it;
/* Allows all IT */
_mask(1);
load_mbr();
display_vol();
save_mbr();
/* and exit! */
exit(EXIT_SUCCESS);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment