diff --git a/tpfs/vol.c b/tpfs/vol.c index 4379f60a994423f4b3b8534811338acbee0fcf03..c177583444b88a1eb0cd42b7f515de92ce072c97 100644 --- a/tpfs/vol.c +++ b/tpfs/vol.c @@ -65,4 +65,10 @@ void read_bloc(unsigned int vol, unsigned int nbloc, unsigned char *buffer) { int sector_cylinder[2] = get_sector_cylinder(vol, nbloc); // [sector, cylinder] 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 diff --git a/tpfs/vol.h b/tpfs/vol.h index 29eb93a57fbc0992bea5b0ba5ca961119dcdd5ef..9966fc1e24d12fee30ac26916d87dade90825238 100644 --- a/tpfs/vol.h +++ b/tpfs/vol.h @@ -32,5 +32,6 @@ void load_mbr(void); void save_mbr(void); unsigned int *get_sector_cylinder(int volume, int bloc); 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