460 likes | 568 Views
FILE MANAGEMENT SYSTEM. Supervisor M. TIMSIT Claude. Group Members RAMOLY Nathan HEMMI Florent AZANGUE Roméo CHOUIKH Jaouher JRIDI Bayrem NINTIDEM Estelle Olivia. Academic year 2011-2012. INTRODUCTION. PLAN. MATERIAL AND DIFFERENTS STAGES.
E N D
FILE MANAGEMENT SYSTEM SupervisorM. TIMSIT Claude Group Members RAMOLY Nathan HEMMI Florent AZANGUE Roméo CHOUIKH Jaouher JRIDI Bayrem NINTIDEM Estelle Olivia Academic year 2011-2012
INTRODUCTION PLAN MATERIAL AND DIFFERENTS STAGES II. METHODS AND SYSTEM DESIGN III. PROBLEMS AND SOLUTIONS IV. DEMONSTRATION CONCLUSION Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, JaouherCHOUIKH, Bayrem JRIDI, Estelle NINTIDEM
INTRODUCTION Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, JaouherCHOUIKH, Bayrem JRIDI, Estelle NINTIDEM
INTRODUCTION • The file management system • Software that manages data files • Create, enter, change and query files • EXT2, HFS PLUS , FAT RAMOLY Nathan, HEMMI Florent, AZANGUE Roméo, CHOUIKH Jaouher, JRIDI Bayrem, NINTIDEM Estelle
INTRODUCTION Requirements • Functional Requirements • Management module • Execution module • Documentation module • Non-Functional Requirements • Convenient GUI • Clear errors messages RAMOLY Nathan, HEMMI Florent, AZANGUE Roméo, CHOUIKH Jaouher, JRIDI Bayrem, NINTIDEM Estelle
INTRODUCTION Use Case Diagram RAMOLY Nathan, HEMMI Florent, AZANGUE Roméo, CHOUIKH Jaouher, JRIDI Bayrem, NINTIDEM Estelle
I. MATERIAL AND DIFFERENT STAGES Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, JaouherCHOUIKH, Bayrem JRIDI, Estelle NINTIDEM
I. MATERIAL AND DIFFERENTS STAGES Material • Software • Code blocks • QT • Turtoise SVN (Subversion) • Libraries • Standard libraries RAMOLY Nathan, HEMMI Florent, AZANGUE Roméo, CHOUIKH Jaouher, JRIDI Bayrem, NINTIDEM Estelle
I. MATERIAL AND DIFFERENTS STAGES Differents Stages • The Theory • Realisation • Debug RAMOLY Nathan, HEMMI Florent, AZANGUE Roméo, CHOUIKH Jaouher, JRIDI Bayrem, NINTIDEM Estelle
II. METHODS AND SYSTEM DESIGN • THE THEORY • HANDLING OF THE DISK • BITMAPS • INODES • DIRECTORIES • FILES RAMOLY Nathan, HEMMI Florent, AZANGUE Roméo, CHOUIKH Jaouher, JRIDI Bayrem, NINTIDEM Estelle
II. METHODS AND SYSTEM DESIGN The Theory • The disk is declared as static • It is composed of a number of blocks that’s declared in the defines Simulation of the disk RAMOLY Nathan, HEMMI Florent, AZANGUE Roméo, CHOUIKH Jaouher, JRIDI Bayrem, NINTIDEM Estelle
II. METHODS AND SYSTEM DESIGN Handling of the disk • int8_t disk_access(Block** block, int pos) • Block* disk_ptr() • int8_t disk_set_block(Block* block, int pos) • int8_t disk_get_block(Block* block, int pos) • int8_t save_disk_hard_drive() • int8_t load_disk_hard_drive()… RAMOLY Nathan, HEMMI Florent, AZANGUE Roméo, CHOUIKH Jaouher, JRIDI Bayrem, NINTIDEM Estelle
II. METHODS AND SYSTEM DESIGN Bitmaps Bitmap We can consider the bitmap as a map that facilitatesmoving in the blocks of our disk Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, JaouherCHOUIKH, Bayrem JRIDI, Estelle NINTIDEM
II. METHODS AND SYSTEM DESIGN Bitmaps Bitmap Inode Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, JaouherCHOUIKH, Bayrem JRIDI, Estelle NINTIDEM
II. METHODS AND SYSTEM DESIGN Bitmaps Bitmap Block Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, JaouherCHOUIKH, Bayrem JRIDI, Estelle NINTIDEM
II. METHODS AND SYSTEM DESIGN Bitmaps • Implementation of some functions • int8_t bitmap_inode_init() • int8_t bitmap_inode_get_status(int numInode) • int8_t bitmap_inode_set_status(int numInode, int status) • int32_t bitmap_first_free_inode() • int32_t bitmap_nb_free_inode() Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, JaouherCHOUIKH, Bayrem JRIDI, Estelle NINTIDEM
II. METHODS AND SYSTEM DESIGN Bitmaps • Bitmap Bloc • int8_t bitmap_block_init(). • int8_t bitmap_block_get_status(int nBlock) • int8_t bitmap_block_set_status(int nBlock, int status) • int32_t bitmap_first_free_block() • int32_t bitmap_nb_free_block() • int32_t bitmap_nb_occupied_block() Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, JaouherCHOUIKH, Bayrem JRIDI, Estelle NINTIDEM
II. METHODS AND SYSTEM DESIGN Inodes • The structure • Size (in bytes) • The last access time • Type (file or folder) • 10 addresses blocks • An address for the single indirection block • An address for the double indirection block Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, JaouherCHOUIKH, Bayrem JRIDI, Estelle NINTIDEM
II. METHODS AND SYSTEM DESIGN Inodes • Indirections Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, JaouherCHOUIKH, Bayrem JRIDI, Estelle NINTIDEM
II. METHODS AND SYSTEM DESIGN Inodes • Indirections • 1 block = N bytes • 10 blocks: 10*N bytes • Single indirection: N²/4 • Double indirection: N3/16 • Total: [10 + N/4 + (N/4)²]*N Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, JaouherCHOUIKH, Bayrem JRIDI, Estelle NINTIDEM
II. METHODS AND SYSTEM DESIGN Inodes • Navigation functions • Inode_get_next_block:next adress block • Inode_get_pos_block_from_byte:block adress which contains the byte number Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, JaouherCHOUIKH, Bayrem JRIDI, Estelle NINTIDEM
II. METHODS AND SYSTEM DESIGN Inodes • Inode low level function • Function in charge allocating and freeing blocks • Two choices: • Allocate and stop (no more free space) • Don’t allocate if there is not enough space • Take two parameters: • A pointer to an inode • A new size for the inode Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, JaouherCHOUIKH, Bayrem JRIDI, Estelle NINTIDEM
II. METHODS AND SYSTEM DESIGN Inodes • Allocating a block • Allocated an indirection block if necessary • Asked to the bitmap the address of the first free block • Added it to the inode by selecting the corresponding block (10 blocks or indirections) • Indicated that the block in now occupied Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, JaouherCHOUIKH, Bayrem JRIDI, Estelle NINTIDEM
II. METHODS AND SYSTEM DESIGN Inodes • Freeing a block • Flagged the address block to -1 • Removed indirection block from the inode if necessary(memory leak possible if it is not done) • Indicated that the block in now free so it can be used by another Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, JaouherCHOUIKH, Bayrem JRIDI, Estelle NINTIDEM
II. METHODS AND SYSTEM DESIGN Inodes • Basic functions • Initialization: • Size: 0 • Type: 1 for a file (by default) • Last access time: system time • Addresses: -1 • Last access time • Inode storage: • Get an inode from the RAM-disk • Save an inode to the RAM-disk Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, JaouherCHOUIKH, Bayrem JRIDI, Estelle NINTIDEM
II. METHODS AND SYSTEM DESIGN Directories • Needed in any file system • Lists all the files • Allows the user to create hierarchy • Travel in the tree • Main directory called root Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, JaouherCHOUIKH, Bayrem JRIDI, Estelle NINTIDEM
II. METHODS AND SYSTEM DESIGN Directories • Directory implementation • A special file (inode, blocks, etc…) • Contains the list with the following forms • 4 bytes for the address • 8+1 bytes for the name • Not sorted • First entry: “..” referring the parent directory • Root corresponds to the first inode • Current directory saved as a global variable Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, JaouherCHOUIKH, Bayrem JRIDI, Estelle NINTIDEM
II. METHODS AND SYSTEM DESIGN Directories • Addition of an element • Two steps • Increase the size • Add the entry at the end RAMOLY Nathan, HEMMI Florent, AZANGUE Roméo, CHOUIKH Jaouher, JRIDI Bayrem, NINTIDEM Estelle
II. METHODS AND SYSTEM DESIGN Directories • Deleting an element • Four main steps • Save the last element • Find the element to delete • Replace it by the last one • Reduce the size of the directory • No memory is released Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, JaouherCHOUIKH, Bayrem JRIDI, Estelle NINTIDEM
II. METHODS AND SYSTEM DESIGN Directories • Deleting of an element • Schemas of a deletion in the system Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, JaouherCHOUIKH, Bayrem JRIDI, Estelle NINTIDEM
II. METHODS AND SYSTEM DESIGN Directories • Searching a file • Main interest of directory • Simply do a loop • Going through entry by entry until the directory’s size is reached • Moving inside a block until there is no more space, then go on to the next block • Exiting as soon as the file is found Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, JaouherCHOUIKH, Bayrem JRIDI, Estelle NINTIDEM
II. METHODS AND SYSTEM DESIGN Directories • Creating a directory • Four steps • Check if it doesn’t already exists • Allocate an inode • Create a basic inode and put it in the allocated space • Add the entry “..” Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, JaouherCHOUIKH, Bayrem JRIDI, Estelle NINTIDEM
II. METHODS AND SYSTEM DESIGN Directories • Deleting a directory • Delete all the content • Loop to read all the content • File: call the specified function • Directory: recall this function • Set the size to 0 • Free the inode • Remove the entry from the parent directory Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, JaouherCHOUIKH, Bayrem JRIDI, Estelle NINTIDEM
II. METHODS AND SYSTEM DESIGN Directories • Printing • Extraction of the directory’s content as a linked list • Sorting the list • Using comparison functions (Size, date and name) • Using a bubble sort algorithm • Printing the list • Function ls • Simply allow the user to select : • The kind of sort • Ascendant or not • Complete or not Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, JaouherCHOUIKH, Bayrem JRIDI, Estelle NINTIDEM
II. METHODS AND SYSTEM DESIGN Directories • Moving in the tree • Move the current directory • Path syntax used: “dir1/dir2/dir3” • Path interpretation by cut_dir • Movement done by mini_cd • Moves the current directory Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, JaouherCHOUIKH, Bayrem JRIDI, Estelle NINTIDEM
II. METHODS AND SYSTEM DESIGN Files HEADER FUNCTIONS • Mini _format : int8_t mini_format () This function allows to free all the inodes and blocks and set status of Bitmaps to available. • Mini_ls : void mini_ls (char* input, int8_t dataSort, int8_t asc, int8_t complete) This function allows to view the content of our directories • Mini_rm : int8_t mini_rm (char* dir, char* name) It removes file in the directory dir • toto/titi • .. titi Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, JaouherCHOUIKH, Bayrem JRIDI, Estelle NINTIDEM
II. METHODS AND SYSTEM DESIGN Files • Mini_open : Fs_file* mini_open (char* file_name, int8_t mode) It works like fopen we pass in parameter the file name and the flag • FS_CREATE/ FS_RDWR write at the beginning • FS_RDONLY • FS_WRONLY • FS_WRONLY/FS_APPEND write at the end • Mini_read : int32_t mini_read (void* data, size_t size, Fs_file* file) • Mini_write : int32_t mini_write (void* data, size_t size, Fs_file* file) Flag Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, JaouherCHOUIKH, Bayrem JRIDI, Estelle NINTIDEM
II. METHODS AND SYSTEM DESIGN Files • Mini_cd : int32_t mini_cd (char* directory) • Mini_df : int8_t mini_df (Fs_stat* st) • Mini_close : : int8_t mini_close (Fs_file* file) Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, JaouherCHOUIKH, Bayrem JRIDI, Estelle NINTIDEM
III. PROBLEMS AND SOLUTIONS Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, JaouherCHOUIKH, Bayrem JRIDI, Estelle NINTIDEM
III. PROBLEMS AND SOLUTIONS • None technical problems • Technical problems • Conception “disk.img” File Structure Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, JaouherCHOUIKH, Bayrem JRIDI, Estelle NINTIDEM
III. PROBLEMS AND SOLUTIONS • Tests • The Inodes • The directories • The files Inode_get_next_block(Inode *inode); Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, JaouherCHOUIKH, Bayrem JRIDI, Estelle NINTIDEM
III. PROBLEMS AND SOLUTIONS • Error management #define RET_SUCCESS 0 #define RET_TRUE1 #define RET_FALSE0 #define ERROR -1 #define ERR_NULL -2 #define ERR_READ -3 #define ERR_CORRUPT -4 #define ERR_OUT_OF_RANGE -5 #define ERR_PARAMETER -6 #define ERR_INIT -7 #define ERR_ALLOC -8 #define ERR_FILE -9 Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, JaouherCHOUIKH, Bayrem JRIDI, Estelle NINTIDEM
IV. DEMONSTRATION Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, JaouherCHOUIKH, Bayrem JRIDI, Estelle NINTIDEM
CONCLUSION Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, JaouherCHOUIKH, Bayrem JRIDI, Estelle NINTIDEM
CONCLUSION • FMS with a GUI • UNIX Based • Further improvements • Indirection algorithm • Alias & shortcuts • Improve the block structure • Upper layer applications -> OS Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, JaouherCHOUIKH, Bayrem JRIDI, Estelle NINTIDEM
THANK FOR YOUR ATTENTION Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, JaouherCHOUIKH, Bayrem JRIDI, Estelle NINTIDEM