Presentation is loading. Please wait.

Presentation is loading. Please wait.

FILE MANAGEMENT SYSTEM Group Members RAMOLY Nathan HEMMI Florent AZANGUE Roméo CHOUIKH Jaouher JRIDI Bayrem NINTIDEM Estelle Olivia Supervisor M. TIMSIT.

Similar presentations


Presentation on theme: "FILE MANAGEMENT SYSTEM Group Members RAMOLY Nathan HEMMI Florent AZANGUE Roméo CHOUIKH Jaouher JRIDI Bayrem NINTIDEM Estelle Olivia Supervisor M. TIMSIT."— Presentation transcript:

1 FILE MANAGEMENT SYSTEM Group Members RAMOLY Nathan HEMMI Florent AZANGUE Roméo CHOUIKH Jaouher JRIDI Bayrem NINTIDEM Estelle Olivia Supervisor M. TIMSIT Claude Academic year 2011-2012 1

2 INTRODUCTION PLAN CONCLUSION I.MATERIAL AND DIFFERENTS STAGES II. METHODS AND SYSTEM DESIGN III. PROBLEMS AND SOLUTIONS IV. DEMONSTRATION Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, Jaouher CHOUIKH, Bayrem JRIDI, Estelle NINTIDEM 2

3 INTRODUCTION 3

4 RAMOLY Nathan, HEMMI Florent, AZANGUE Roméo, CHOUIKH Jaouher, JRIDI Bayrem, NINTIDEM Estelle INTRODUCTION The file management system  Software that manages data files  Create, enter, change and query files  EXT2, HFS PLUS, FAT 4

5 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 5

6 RAMOLY Nathan, HEMMI Florent, AZANGUE Roméo, CHOUIKH Jaouher, JRIDI Bayrem, NINTIDEM Estelle INTRODUCTION Use Case Diagram 6

7 Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, Jaouher CHOUIKH, Bayrem JRIDI, Estelle NINTIDEM I. MATERIAL AND DIFFERENT STAGES 7

8 RAMOLY Nathan, HEMMI Florent, AZANGUE Roméo, CHOUIKH Jaouher, JRIDI Bayrem, NINTIDEM Estelle I. MATERIAL AND DIFFERENTS STAGES Material Software o Code blocks o QT Turtoise SVN (Subversion) Libraries o Standard libraries 8

9 RAMOLY Nathan, HEMMI Florent, AZANGUE Roméo, CHOUIKH Jaouher, JRIDI Bayrem, NINTIDEM Estelle I. MATERIAL AND DIFFERENTS STAGES Differents Stages The Theory Realisation Debug 9

10 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 10

11 II. METHODS AND SYSTEM DESIGN RAMOLY Nathan, HEMMI Florent, AZANGUE Roméo, CHOUIKH Jaouher, JRIDI Bayrem, NINTIDEM Estelle The Theory Simulation of the disk o The disk is declared as static o It is composed of a number of blocks that’s declared in the defines 11

12 II. METHODS AND SYSTEM DESIGN RAMOLY Nathan, HEMMI Florent, AZANGUE Roméo, CHOUIKH Jaouher, JRIDI Bayrem, NINTIDEM Estelle 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()… 12

13 II. METHODS AND SYSTEM DESIGN Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, Jaouher CHOUIKH, Bayrem JRIDI, Estelle NINTIDEM Bitmaps Root / Boot block Inode bitmap Block bitmap InodesBlocks Bitmap We can consider the bitmap as a map that facilitates moving in the blocks of our disk 13

14 II. METHODS AND SYSTEM DESIGN Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, Jaouher CHOUIKH, Bayrem JRIDI, Estelle NINTIDEM Bitmaps 01100100 01occupied 10corrupt 00free Bitmap Inode 14

15 01000110 01occupied 10corrupt 00free II. METHODS AND SYSTEM DESIGN Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, Jaouher CHOUIKH, Bayrem JRIDI, Estelle NINTIDEM Bitmaps Bitmap Block 15

16 II. METHODS AND SYSTEM DESIGN Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, Jaouher CHOUIKH, Bayrem JRIDI, Estelle NINTIDEM 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() 16

17 II. METHODS AND SYSTEM DESIGN Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, Jaouher CHOUIKH, Bayrem JRIDI, Estelle NINTIDEM 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() 17

18 II. METHODS AND SYSTEM DESIGN Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, Jaouher CHOUIKH, Bayrem JRIDI, Estelle NINTIDEM Inodes The structure o Size (in bytes) o The last access time o Type (file or folder) o 10 addresses blocks o An address for the single indirection block o An address for the double indirection block 18

19 II. METHODS AND SYSTEM DESIGN Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, Jaouher CHOUIKH, Bayrem JRIDI, Estelle NINTIDEM Inodes Indirections 19

20 II. METHODS AND SYSTEM DESIGN Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, Jaouher CHOUIKH, Bayrem JRIDI, Estelle NINTIDEM Inodes Indirections  1 block = N bytes  10 blocks: 10*N bytes  Single indirection: N²/4  Double indirection: N 3 /16  Total: [10 + N/4 + (N/4)²]*N 20

21 21 II. METHODS AND SYSTEM DESIGN Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, Jaouher CHOUIKH, Bayrem JRIDI, Estelle NINTIDEM Inodes Navigation functions  Inode_get_next_block: next adress block  Inode_get_pos_block_from_byte: block adress which contains the byte number

22 II. METHODS AND SYSTEM DESIGN Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, Jaouher CHOUIKH, Bayrem JRIDI, Estelle NINTIDEM Inodes Inode low level function 22  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

23 23 II. METHODS AND SYSTEM DESIGN Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, Jaouher CHOUIKH, Bayrem JRIDI, Estelle NINTIDEM 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

24 24 II. METHODS AND SYSTEM DESIGN Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, Jaouher CHOUIKH, Bayrem JRIDI, Estelle NINTIDEM 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

25 II. METHODS AND SYSTEM DESIGN Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, Jaouher CHOUIKH, Bayrem JRIDI, Estelle NINTIDEM 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 25

26 Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, Jaouher CHOUIKH, Bayrem JRIDI, Estelle NINTIDEM Needed in any file system Lists all the files Allows the user to create hierarchy ◦ Travel in the tree ◦ Main directory called root II. METHODS AND SYSTEM DESIGN Directories 26

27 Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, Jaouher CHOUIKH, 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 27

28 RAMOLY Nathan, HEMMI Florent, AZANGUE Roméo, CHOUIKH Jaouher, JRIDI Bayrem, NINTIDEM Estelle  Addition of an element ◦ Two steps  Increase the size  Add the entry at the end Directories II. METHODS AND SYSTEM DESIGN 28

29 Directories II. METHODS AND SYSTEM DESIGN  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, Jaouher CHOUIKH, Bayrem JRIDI, Estelle NINTIDEM 29

30 Directories II. METHODS AND SYSTEM DESIGN  Deleting of an element ◦ Schemas of a deletion in the system Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, Jaouher CHOUIKH, Bayrem JRIDI, Estelle NINTIDEM 30

31 Directories II. METHODS AND SYSTEM DESIGN  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, Jaouher CHOUIKH, Bayrem JRIDI, Estelle NINTIDEM 31

32 Directories II. METHODS AND SYSTEM DESIGN  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, Jaouher CHOUIKH, Bayrem JRIDI, Estelle NINTIDEM 32

33 Directories II. METHODS AND SYSTEM DESIGN  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, Jaouher CHOUIKH, Bayrem JRIDI, Estelle NINTIDEM 33

34 Directories II. METHODS AND SYSTEM DESIGN  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, Jaouher CHOUIKH, Bayrem JRIDI, Estelle NINTIDEM 34

35 Directories II. METHODS AND SYSTEM DESIGN  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, Jaouher CHOUIKH, Bayrem JRIDI, Estelle NINTIDEM 35

36 Files II. METHODS AND SYSTEM DESIGN Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, Jaouher CHOUIKH, Bayrem JRIDI, Estelle NINTIDEM 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 36

37 Files II. METHODS AND SYSTEM DESIGN Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, Jaouher CHOUIKH, Bayrem JRIDI, Estelle NINTIDEM  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 37

38 Files II. METHODS AND SYSTEM DESIGN Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, Jaouher CHOUIKH, Bayrem JRIDI, Estelle NINTIDEM  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) 38

39 III. PROBLEMS AND SOLUTIONS Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, Jaouher CHOUIKH, Bayrem JRIDI, Estelle NINTIDEM 39

40 III. PROBLEMS AND SOLUTIONS Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, Jaouher CHOUIKH, Bayrem JRIDI, Estelle NINTIDEM 40 None technical problems Technical problems Conception “disk.img” File Structure

41 41 III. PROBLEMS AND SOLUTIONS Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, Jaouher CHOUIKH, Bayrem JRIDI, Estelle NINTIDEM Tests The Inodes The directories The files Inode_get_next_block(Inode *inode);

42 42 III. PROBLEMS AND SOLUTIONS Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, Jaouher CHOUIKH, Bayrem JRIDI, Estelle NINTIDEM 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

43 Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, Jaouher CHOUIKH, Bayrem JRIDI, Estelle NINTIDEM IV. DEMONSTRATION 43

44 Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, Jaouher CHOUIKH, Bayrem JRIDI, Estelle NINTIDEM CONCLUSION 44

45 CONCLUSION Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, Jaouher CHOUIKH, Bayrem JRIDI, Estelle NINTIDEM FMS with a GUI UNIX Based Further improvements Indirection algorithm Alias & shortcuts Improve the block structure Upper layer applications -> OS 45

46 46 Nathan RAMOLY, Florent HEMMI, Roméo AZANGUE, Jaouher CHOUIKH, Bayrem JRIDI, Estelle NINTIDEM


Download ppt "FILE MANAGEMENT SYSTEM Group Members RAMOLY Nathan HEMMI Florent AZANGUE Roméo CHOUIKH Jaouher JRIDI Bayrem NINTIDEM Estelle Olivia Supervisor M. TIMSIT."

Similar presentations


Ads by Google