Home CS439

# CS439: Principles of Computer Systems

## Homework 8, Part 1

### Due: 9:45a Thursday, October 30, 2014

Part 1 of the homeworks must be submitted electronically. Please refer to the homework turnin instructions.

1. In some operating systems, I/O from/to disk is done directly to/from a buffer in the user program's memory. The user program does a system call specifying the address and length of the buffer (the length must be a multiple of the disk record size).
The disk controller needs a physical memory address, not a virtual address. Your co-worker proposes that when the user does a write system call, the operating system should check that the user's virtual address is valid, translate it into a physical address, and pass that address and the length (also checked for validity) to the disk hardware.
This won't quite work. In no more than two sentences, what did your co-worker forget?
2. The MegaGiga hard disk rotates at 5400 rpm with an arm seek time given by = 4 + 0.05t msec, where t is the number of tracks the arm seeks. Assume a block size of 512 bytes, and 1024 tracks with 512 blocks/track. The disk controller and DMA read or write data from/to disk at a rate of 4MB/sec. What is the storage capacity of the disk?
3. Disk requests come into the disk driver for tracks 10, 22, 20, 2, 40, 6, and 38, in that order. A seek takes 6 msec per track moved. How much seek time is needed for the following scheduling algorithms?
a) FIFO
b) SSTF
c) LOOK (SCAN, but doesn't move to the end)
In all cases, the arm is initially at track 20, and you may assume that the head is traveling towards higher numbers.
4. Assume a spinning disk. Where on that disk would you place the inode array? Justify your answer.
5. Some file allocation schemes limit the size of the file whether or not there is enough space for a larger file. Which ones and why?
1. Linked
2. Direct
3. Contiguous
4. Multi-Level index
5. Extents
6. Pooh Software Ltd. is selling a file system that uses a UNIX-like file system with multi-level indexing. For more reliability, the inode array is actually replicated on the disk in two different places. The intent is that if one or a group of sectors that are storing either replica of the array become bad, the system can always recover from the replica. Discuss the effect of having this replicated data structure on performance.