Hardware Reference
In-Depth Information
to locate all the blocks of a file. Free disk storage can be kept track of using a list
or a bit map.
Parallel processing is often supported and is implemented by simulating multi-
ple processors by timesharing a single CPU. Uncontrolled interaction between
processes can lead to race conditions. To solve this problem, synchronization
primitives are introduced, of which semaphores are a simple example. Using sem-
aphores, producer-consumer problems can be solved simply and elegantly.
Two examples of sophisticated operating systems are UNIX and Windows 7.
Both support paging and memory-mapped files. They also both support hierarchi-
cal file systems, with files consisting of byte sequences. Finally, both support
processes and threads and provide ways to synchronize them.
PROBLEMS
1. Why does an operating system interpret only some of the level 3 instructions, whereas
a microprogram interprets all the ISA-level instructions?
2. A machine has a 32-bit byte-addressable virtual address space. The page size is 4 KB.
How many pages of virtual address space exist?
3. Is it necessary to have the page size be a power of 2? Could a page of size, say, 4000
bytes be implemented in theory? If so, would it be practical?
4. A virtual memory has a page size of 1024 words, eight virtual pages, and four physical
page frames. The page table is as follows:
Virtual page
Page frame
0
3
1
1
2
not in main memory
3
not in main memory
4
2
5
not in main memory
6
0
7
not in main memory
a. Make a list of all virtual addresses that will cause page faults.
b. What are the physical addresses for 0, 3728, 1023, 1024, 1025, 7800, and 4096?
5. A computer has 16 pages of virtual address space but only four page frames. Initially,
the memory is empty. A program references the virtual pages in the order
0, 7, 2, 7, 5, 8, 9, 2, 4
 
 
Search WWH ::




Custom Search