OSY Chapter 6
OSY Chapter 6
OSY Chapter 6
2. Scattered Disk Blocks: In linked allocation, the disk blocks that make
up a file can be scattered anywhere on the disk. This means that the
blocks do not need to be contiguous.
3. Directory Pointers: The directory entry for a file contains pointers to
the first and the last blocks of the file. This helps in locating the start
and end of the file.
4. Creating a New File: To create a new file, a new entry is simply added
to the directory. This entry will include pointers to the blocks that will
store the file's data.
5. Linked Allocation: The method involves linking each block to the next
block in the sequence. This is typically done using pointers stored
within each block.
6. No External Fragmentation: Since only one block is needed at a time,
there is no external fragmentation.
7. Dynamic File Size: The size of a file does not need to be declared when
it is created. The file can grow dynamically as long as there are free
blocks available on the disk.
8. Sequential Access: This method is primarily used for files that are
accessed sequentially.
9. Pointer Storage: Linked allocation requires additional space to store
pointers in each block. These pointers link the blocks together in the
correct order.
Clusters for Allocation: To reduce the overhead of storing pointers,
clusters (groups of blocks) are sometimes used instead of individual
blocks. However, this can lead to internal fragmentation, where there is
unused space within the allocated clusters.
In summary, linked allocation is a method of file storage where each block
points to the next block, allowing files to be stored in non-contiguous blocks
on the disk. This method avoids external fragmentation and allows files to
grow dynamically, but it is best suited for sequential access and requires
additional space for storing pointers.
Chapter 3
Q1. Define Process and PCB