980 * 2 * 32 = 62720
Since the number of sectors can be represented in 16 bits, we could represent each hole as a 16-bit start sector and 16-bit end sector, or a 16-bit start sector and a 16-bit length. In either case, a 32-bit entry would suffice. In the case of a sector number, we might use the high order 10 bits for the cylinder, the next bit for the track, and the final 5 bits for the sector number.
The bitmap approach will require 62720 bits (7840 bytes).
The total space available is 62720 sectors. If only 20% of this is to be reserved for free space, then we would consider the worse case to be 62720 * 20% = 12544 individual sectors separating the free space from the allocated sectors. 12544 holes * 4 bytes (32 bits) per hole = 50176 bytes. Clearly, the bitmap approach would require less space.
Indicate the state of each of the 8 processes (Running or Sleeping) after each of the following operations. Assume that the semaphore has a value of 0 at the start, and that all processes are running, and that the left-most process is wakened if there are multiple sleeping processes and a process needs to be restarted.
P6 sleeps
P7 sleeps
P6 wakes
P7 wakes
P3 sleeps
P4 sleeps
P2 sleeps
P2 wakes
P3 wakes
P4 wakes
With a protection fault, the type of operation (usually read, execute, write) is not one of the allowed operations for the particular page being requested. With a segment fault, the segment in which the page is located is not present in memory (i.e., swapped out). With a page fault, the requested page is not present in memory (i.e., paged out).
According to Tanenbaum, fragmentation is the effect of memory which remains un-used due to the page size. If n+1 bytes are needed for an allocation, and the allocation unit (page size) is n, then two units are required, even though n-1 bytes are "wasted". Checkerboarding is the effect caused by repeated allocation and de-allocation resulting in allocated space separated by unallocated spaces. We say that the free space is "checkerboarded".
A First In First Out (FIFO) page replacement algorithm keeps track of which pages were requested in which order. If a request for a page finds that the page is not in memory, then the "oldest" page in memory is purged, and the new page is used in its place.
A LRU (Least Recently Used) page replacement algorithm keeps track of which pages were used most recently. If a request for a page finds that the page is not in memory, then the page which was used least recently is purged, and the new page is loaded in its place.
Copyright © 1997,
Ray Ontko
(rayo@ontko.com).
If you're curious about why I copyright, see
Peter Suber's
Why
Copyright Web Documents?.