Sunday 17 June 2012

Explain layered approach for the file system organization.


The file system itself is generally composed of many different levels.
The lowest level, the I/O control, consists of device drivers and interrupts handlers to transfer information between the memory and the disk system. The basic file system needs only to issue generic commands to the appropriate device driver to read and write physical blocks on the disk. Each physical block is identified by its numeric disk address. The file-organization module knows about files and their logical blocks, as well as physical blocks. This module also includes the free-space manager, which tracks unallocated blocks and provides these blocks to the file-organization module when requested.The logical file system uses the directory structure to provide the file organization module with the information the latter needs, given a symbolic file name. The logical file system is also responsible for protection and security.To create a new file, an application program calls the logical tile system. The logical file system knows the format of the directory structures. To create a new file, it reads the appropriate, directory into memory, updates it with the new entry, and  Layered File system. writes it back to the disk.

Three major methods of allocating disk space are in wide use. They are : contiguous, linked, and indexed. Each of them are explained below :


i) Contiguous allocation : The contiguous allocation method requires each file to occupy a set of contiguous blocks on the disk. Disk addresses define a linear ordering on the disk. The IBM VM/CMS operating system uses contiguous allocation because it provides such good performance.
Contiguous allocation of a file is defined by the disk address and length of the first block. If the file is n blocks long, and starts at location b, the it occupies blocks b. b+1, b+2, b+n-I. The
directory entry for each file indicates the address of the starting block and the length of the area allocated for this file.
One difficulty with contiguous allocation is finding space for a new file. A major problem is determining how much space is needed for a file.
To avoid several of these drawbacks, some operating systems use a modified contiguous allocation scheme, in which a contiguous chunk of space is allocated initially, and then, when that amount is not large enough, another chunk of contiguous space, an extent, is added to the initial allocation. The location of
a file's blocks is then recorded as a location and a block count, plus a link to the first block of the next extent.






No comments:

Post a Comment