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

feat(format vol function done)

parent ac581563
No related branches found
No related tags found
No related merge requests found
......@@ -72,3 +72,15 @@ void write_bloc(unsigned int vol, unsigned int nbloc, const unsigned char *buffe
int sector_cylinder[2] = get_sector_cylinder(vol, nbloc); // [sector, cylinder]
write_sector(sector_cylinder[1], sector_cylinder[0], buffer);
}
void format_vol(unsigned int vol)
{
int nbloc;
vol_t current_vol = mbr.vols[vol];
for (nbloc = 0; nbloc < current_vol.nb_sectors; nbloc++)
{
int sector_cylinder[2] = get_sector_cylinder(vol, nbloc);
format_sector(sector_cylinder[1], sector_cylinder[1], FMT_SIZE, FMT_DATA);
}
}
\ No newline at end of file
......@@ -3,6 +3,8 @@
#define VOLS_MAX 8
#define MBR_MAGIC 0xCAFE // Savoir si le mbr a déjà été initialisé ou non
#define FMT_DATA 0xCAFEBABE
#define FMT_SIZE 0x1
static mbr_t mbr;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment