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

feat(write bloc funtion done)

parent f8f65635
Branches
Tags
No related merge requests found
...@@ -66,3 +66,9 @@ void read_bloc(unsigned int vol, unsigned int nbloc, unsigned char *buffer) ...@@ -66,3 +66,9 @@ void read_bloc(unsigned int vol, unsigned int nbloc, unsigned char *buffer)
int sector_cylinder[2] = get_sector_cylinder(vol, nbloc); // [sector, cylinder] int sector_cylinder[2] = get_sector_cylinder(vol, nbloc); // [sector, cylinder]
read_sector(buffer, sector_cylinder[1], sector_cylinder[0]); read_sector(buffer, sector_cylinder[1], sector_cylinder[0]);
} }
void write_bloc(unsigned int vol, unsigned int nbloc, const unsigned char *buffer)
{
int sector_cylinder[2] = get_sector_cylinder(vol, nbloc); // [sector, cylinder]
write_sector(sector_cylinder[1], sector_cylinder[0], buffer);
}
\ No newline at end of file
...@@ -32,5 +32,6 @@ void load_mbr(void); ...@@ -32,5 +32,6 @@ void load_mbr(void);
void save_mbr(void); void save_mbr(void);
unsigned int *get_sector_cylinder(int volume, int bloc); unsigned int *get_sector_cylinder(int volume, int bloc);
void read_bloc(unsigned int vol, unsigned int nbloc, unsigned char *buffer); void read_bloc(unsigned int vol, unsigned int nbloc, unsigned char *buffer);
void write_bloc(unsigned int vol, unsigned int nbloc, const unsigned char *buffer);
#endif // VOL_H #endif // VOL_H
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment