Assignment 6, due Oct 4
Part of
the homework for 22C:116, fall 2002
|
The Problem: In what sense is the relationship between windows, window managers and graphical display devices similar to that between files, file systems and disks? What are the key conceptual differences, aside from the obvious difference that a file is a one dimensional string of bytes while a window is a two dimensional array of pixels and the differences that are consequences of this.
Usually, we think of disk files as being smaller than the corresponding physical disk, but this need not be the case.
Assume your machine has a disk interface bus that allows several tens of disks to be attached, and your disk I/O driver is able to direct input or output to any of these disks.
The problem: Your customer wants to develop software for editing motion pictures, with an expected uncompressed file size of 2 terabytes (2 hours times 24 frames per second times 4 million pixels per frame times 24 bytes per pixel). You can store such a file only on an array of disks. Describe the internal representation of an open file of this type and outline any special code you would need in the read and write routines.
All XDFS files were self-describing, with sector -1 of each file holding the file name of the file and the file number of the directory where that file was indexed. In theory, therefore, no data needed to be stored in each directory, since these back pointers encode the entire directory tree; In fact, of course the directory stored <textual-name,file-number> tuples.
Assume 32-bit file numbers, 32-bit sector numbers in the file, 32-bit sector numbers on disk. Assume 1K bytes per sector, and assume a disk that holds 4 Gigabytes. (All these are modern numbers; the real system had smaller numbers!)
Part A: Given that each B-tree node is 1 disk sector, and given that the file system is half full, how many disk accesses would be expected to find the disk address of sector i of file j, assuming that sector exists!
Part B: A power failure during a write operation corrupts the contents of a random sector on disk. Describe the computation required to recover from this loss prior to the start of normal operation. Also, what is the maximum information loss due to this system failure. (Unix systems have a similar recovery program called fsck, but it cannot recover as well as its cousin on XDFS).