What is Page Fault?
Each page table entry has a valid bit, it indicates whether the corresponding page is currently in memory. If the page is not in memory, a page fault has occurred and the control is trapped to the OS. During address translation, if valid/invalid bit in page table entry is 0, a page fault has occurred.
What is File Allocation Methods and its types?
The main problem is how to allocate space to a file so that disk space is utilized effectively and file can be accessed quickly. There are three major methods of allocating disk space:
- Contiguous allocation
- Linked allocation
- Indexed allocation
Contiguous Allocation
- Each file is allocated a set of contiguous disk blocks.
- The contiguous allocation method requires each file to occupy a set of contiguous blocks on the disk.
Linked Allocation
Linked allocation solves all problems of contiguous allocation. Each file is a linked list of disk blocks. The disk blocks may be scattered anywhere on the disk. Each disk block has a pointer to the next disk block in the file as well as some file data.
Indexed Allocation
FAT tries to solve as many problems as possible but has its own drawback. The more the number of blocks, the mor will be the size of FAT. Hence, more space needs to be allocated to FAT.
Since, FAT needs to be cached, therefore it is impossible to have this many space in cache.
Instead of maintaining a FAT of all the disk pointers, indexed allocation scheme stores all the disk pointers in one of the blocks called as indexed block or node. Index nodes does not hold data, but it holds pointers to all the disk blocks allocated to that particular file. Directory entry only contains index node address.
<< Previous | Next >>
Must Read: What is an operating system and its types?