The algorithms for reading and writing disk blocks use the algorithm
GETBLK
to allocate buffers from the pool. There are five typical scenarios the kernel may follow in getblk to allocate a buffer for a disk block.
-
The kernel finds the block on its hash queue, and its buffer is free.
-
The kernel cannot find the block on the hash queue, so it allocates a buffer from the free list.
-
The kernel cannot find the block on the hash queue and, in attempting to allocate a buffer from the free list (as in scenario 2), finds a buffer on the free list that has been marked *"delayed write." The kernel must write the "delayed write" buffer to disk and allocate another buffer.
-
The kernel cannot find the block on the hash queue, and the free list of buffers is empty.
-
The kernel finds the block on the hash queue, but its buffer is currently busy.
- Linux 64 bit (Ubuntu 18.04.3)
- Python3.7 and above
Run Driver.py
- Simulates Kernel
- Creates Processes
- Calls getblk()
- Implements Free List
- Implements Hash Queue
- Implements Buffer Header data structure
- Implements Sleep Queue
- Implements getblk() algorithm
- Implements asynchronousWrite() for Delayed Write
- Implements Signals
- Implements Signal Handling
- Implements brelse() algorithm