1. Some operating systems provide a system call RENAME to give a file a new name. Is there any difference at all between using this call to rename a file, and just copying the file to a new file with the new name, followed by deleting the old one?
Yes. Rename does not change creation and modification times.
2. Contiguous allocation of files leads to disk fragmentation. Is this internal or external fragmentation?
This external fragmentation since the wasted storage is between the files. This is similar to variable-size (segmentation) allocation in memory.3. It has been suggested that the first part of each UNIX file be kept in the same disk block as its inode. What good would this do?
If many files are short this makes sense since only one access is needed for the i-node and the data.4. Would compacting disk storage periodically be of any conceivable value? Explain.
Yes. Faster access is the outcome due to minimizing seek time.5. When a file is removed, its blocks are generally put back on the free list, but they are not erased. Do you think it would be a good idea to have the operating system erase each block before deleting it? Consider both security and performance factors in your answer, and explain the effect of each.
From security point of view, it is more secure. From performance point of view, it is slower due to many erase writes to disk.6. Two computer science students, Carolyn and Elinor, are having a discussion about i-nodes. Carolyn maintains that memories have gotten so large and so cheap that when a file is opened, it is simpler and faster just to fetch a new copy of the inode into the inode table, rather than search the entire table to see if it is already there. Elinor disagrees. Who is right?
Elinor is right. Having two copies of the i-node in the table (located in main memory) at the same time is disastrous especially when both i-nodes are being updated simultaneously.7. If a disk controller writes the bytes it receives from the disk to memory as fast as it receives them, with no internal buffering, is interleaving conceivably useful? Discuss.
Possibly. It might be worthwhile interleaving the sectors to give programs time to process the data just received.8. Disk reauests come in to the disk driver for cylinders 10, 22, 20, 2, 40, 6, and 38, in that order. A seek takes 6 msec per cylinder moved. Assuming for all cases the arm is initially at cylinder 20, how much seek time is needed for: a) FCFS b) Closest cylinder first or SSTF c) Elevator algorithm (initially moving upwards).
a) 10 + 12 + 2 + 18 + 38 + 34 + 32 = 146 cylinders = 876 msec
b) 0 + 2 + 12 + 4 + 4 + 36 + 2 = 60 cylinders = 360 msec
c) 0 + 2 + 16 + 2 + 30 + 4 + 4 = 58 cylinders = 348 msec
Writing characters to RS232 terminal takes long time, so waiting would be wasteful, so interrupts are used. In memory-mapped terminals characters are accepted instantly.
10. RAID 2 gives a lower I/O request rate than RAID 0 and RAID 1. Explain why.
In RAID2 all disks participate in the execution of every I/O request.
11. A password may become known to other users in a variety of ways. Is there a simple method for detecting that such an event has occurred? Explain your answer.
Whenever a user logs in, the system prints the last time that user was logged on the system.
12. The list of all passwords is kept within the operating system. Thus, if a user manages to read this list, password protection is no longer provided. Suggest a scheme that will avoid this problem. (Hint: Use different internal and external representations.)
Encrypt the passwords internally so that they can only be accessed in coded form. The only person with access or knowledge of decoding should be the system operator.
13. Discuss ways by which managers of systems connected to the Internet could have limited or eliminated the damage done by the worm. What are the drawbacks of making such changes to the way in which the system operates?
“Firewalls” can be erected between systems and the Internet. These systems filter the packets moving from one side of them to the other, assuring that only valid packets owned by authorized users are allowed to access the protect systems. Such firewalls usually make use of the systems less convenient (and network connections less efficient).
14. What are the main differences between capability lists and access lists?
An access list is a list for each object consisting of the domains with a nonempty set of access rights for that object. A capability list is a list of objects and the operations allowed on those objects for each domain.
15. If all the access rights to an object are deleted, the object can no longer be accessed. At this point, the object should also be deleted, and the space it occupies should be returned to the system. Suggest an efficient implementation of this scheme.
Reference counts.