Welcome to File Allocation

Theory as well as a simulation to explain the need for file allocation within the OS

About topic

Know About topic

File Allocation

Contignous Allocation

Contignous Allocation

  • Address of starting block

    In the figure displayed the file mail starts from block 19.

  • Length of Allocated portion required

    The length of the file "mail" is 6 blocks

Advantages

Both sequential access and direct access are possible here.This is extremely fast since the number of seeks are minimal because of contiguous allocation of file blocks.

Disadvantages

Both Internal and external fragmentation is their.Increasing file size is difficult as it depends upon the availability of contignous memory at that instance of time.

Linked Allocation

Linked Allocation

  • Need not be contignous

    In the figure shown starting is 9 and ending is 25 not contignous.

  • Each block contains a pointer to the next pointer to the another file

Advantages

This is very flexible in terms of file size.This method does not suffer from external fragmentaion

Disadvantages

It does not support random or direct access.We can not directly access the blocks of a file. A block k of a file can be accessed by traversing k blocks sequentially (sequential access ) from the starting block of the file via block pointers.Pointers required in the linked allocation incur some extra overhead

F.A.Q

Frequently Asked Questions

We will be updating the rest of the questions soon

  • In Multilevel index allocation, we have various levels of indices. There are outer level index blocks which contain the pointers to the inner level index blocks and the inner level index blocks contain the pointers to the file data.

  • IPC (Interprocess Communication) is a mechanism that requires the use of resources like a memory that is shared between processes or threads. With IPC, OS allows different processes to communicate with each other. It is simply used for exchanging data between multiple threads in one or more programs or processes. In this mechanism, different processes can communicate with each other with the approval of the OS. Different IPC Mechanisms: 1.Pipes 2.Message Queuing 3.Semaphores 4.Socket 5.Shared Memory 6.Signals

  • Overlays is basically a programming method that divides processes into pieces so that instructions that are important and need can be saved in memory