UNIVERSITY OF WISCONSIN-MADISON
Computer Sciences Department | ||
CS 537
Spring 2000 | A. Arpaci-Dusseau | |
Quiz #9: Wednesday, April 26 |
Name: | Student ID #: |
The top and bottom surface of a platter is usually not active in a disk (i.e., there is no disk arm). Therefore, there are probably 9 platters in this disk.
Credit will also be given for saying there are 8 platters.
b) How many sectors per track?
You need to know the relationship between tracks and cylinders to
answer this problem: there is one track on each surface in each
cylinder. Since there are 4096 sectors/cylinder and there are 16
surfaces, there are:
4096 sectors 1 cylinder
------------ * ------------ = 2^12 / 2^4 = 2^8 = 256 sectors/track
1 cylinder 16 tracks
c) What is the total size (i.e., capacity) of this disk?
For full credit, please show your work.
4096 sectors 2048 cylinders 512 bytes
------------ * * ------------ = 2^32 bytes = 4 GB
1 cylinder sector
Different processes can open the file in different manners; therefore, the mode must be kept in the per-process table. When the file is opened, the OS checks if that process has the necessary permissions to open the file in that mode. If not, the open call fails. Later, when the process calls read() or write(), the OS checks that the file was opened with the correct mode for this action.
This is the number of different processes that have opened the file; it corresponds to the number of pointers from entries in the per-process tables to a particular entry in the system table. Therefore, it is kept in the system table. When the count goes to 0, the OS knows that no processes have this file open and the entry in the system table can be deallocated.
This information must be the same across all processes. For example, if one process extends the length of a file, all other processes currently accessing that file need to see the new size and the pointers to the newly allocated data blocks. Therefore, this must be kept in the system table.
Each process should be able to read from a position (or location) in the file without determining the position that other processes are reading from. Therefore, this is kept in the per-process table.
Process B: fd1 = open("x", mode); Process A: fd1 = open("y", mode); Process B: fd2 = open("y", mode); Process A: close(stdin); Process A: fd3 = open("z", mode);The diagram will look like the following: