Page 233 - DCAP103_Principle of operating system
P. 233

Principles of Operating Systems



                   Notes
                                                          Figure 6.10: Chained Allocation


                                                                              File allocation table
                                                   File B                  File Name Start Block Length
                                              0     1    2    3     4         ...    ...    ...
                                                                             File B  1      5
                                              5     6    7    8     9         ...    ...    ...
                                              10   11   12   13    14
                                              15   16   17   18    19
                                              20   21   22   23    24
                                              25   26   27   28    29

                                              30   31   32   33    34

                                 A small “pointer” of typically 32 or 64 bits is allocated within each file block to indicate the next
                                 block in the chain. Thus seeking within a file requires a read of each block to follow the pointers.
                                 New blocks may be allocated from any free block on the disk. In particular, a file’s blocks need
                                 no longer be contiguous.
                                 6.10.3 File Allocation Methods—Indexed

                                 The file allocation method of choice in both Unix and Windows is the indexed allocation method.
                                 This method was championed by the Multics operating system in 1966.


                                                  Figure 6.11: Indexed Allocation with Block Portions



                                                                             File allocations table
                                                                            File Name  Index Block
                                                0    1    2   3    4           ...       ...
                                                                              File B     24
                                                5    6    7   8    9           ...       ...
                                               1 0  1 1  12   13  1 4
                                               1 5  16   1 7  18   1 9
                                                                               1
                                               20   21   22   23  2 4          8
                                                                               3
                                               25   26   27   28  29          14
                                                                              28
                                               30   31   32  33   34


                                 The file-allocation table contains a multi-level index for each file. Indirection blocks are introduced
                                 each time the total number of blocks “overflows” the previous index allocation. Typically, the
                                 indices are neither stored with the file-allocation table nor with the file, and are retained in
                                 memory when the file is opened.


                                                Before using memory allocation must be know index concept of memory.








        226                               LOVELY PROFESSIONAL UNIVERSITY
   228   229   230   231   232   233   234   235   236   237   238