11.3 Why do some systems keep track of the type of file, while others leave it to the user? Which system is better?

Some systems allow different file operations based on the type of the file (for instance, an ASCII file can be read as a stream while a database file can be read via a index to a block). Other systems leave such interpretation of a file’s data to the process and provide no help in accessing the data. The method that is “better” depends on the needs of the processes on the system, and the demands the users place on the operating system. If a system runs mostly database applications, it may be more efficient for the operating system to implement a database-type file and provide operations, rather than making each program implement the same thing (possibly in different ways). For general-purpose systems it may be better to only implement basic file types to keep the operating system size smaller and allow maximum freedom to the processes on the system.

11.5 What are the advantages / disadvantages of recording the name of the creating program with the file’s attributes?

By recording the name of the creating program, the operating system is able to implement features (such as automatic program invocation when the file is accessed) based on this information. It does add overhead in the operating system and require space in the file descriptor, however.



11.11 Subdirectories as files

a.        Describe protection problems that could arise
One piece ofinformation kept in a directory entry is file location. If a user could modifythis location, then he could access other files defeating the access-protectionscheme.

b.       Suggest a scheme for dealing with each of the protectionproblems
Do not allowthe user to directly write onto the subdirectory. Rather, provide system operations to do so.

11.12 Sharing a file among 4990 of 5000 users

a.        Unix
Create a group with 4990 users and give the group access to the file
Put 4990 users on the file with the appropriate access

b.       What other scheme could be more effective?
Create a group with the 10 users thatcannot access the file. Set the ACL on the file to deny access to the group of 10 users.
Put the 10 users on the file with no access, and grant everyone access.

12.1     Consider a file currently consisting of 100 blocks. Assume that the file control block (and the index block, in the case of indexed allocation) is already in memory. Calculate how many disk I/O operations are required for contiguous, linked, and indexed (single-level) allocation strategies, if, for one block, the following conditions hold. In the contiguous allocation case, assume that there is no room to grow in the beginning, but there is room to grow in the end. Assume that the block information to be added is stored in memory.

a. The block is added at the beginning.

b. The block is added in the middle.

c. The block is added at the end.

d. The block is removed from the beginning.

e. The block is removed from the middle.

f. The block is removed from the end.

 There could be a couple of possibilities for some of these, depending on how you interpreted the question.

 

Contiguous

Linked

Indexed

A

201

1

1

B

101

52

1

C

1 (or 101ish)

3

1

D

198 (or 0)

1

0

E

98

52 (maybe 51, depending on which block you removed)

0

F

0

100

0

 

 12.4     Why must the bit map for file allocation be kept on mass storage, rather than in main memory?

  In case of system crash (memory failure) the free-space list would not be lost as it would be if the bit map had been stored in main memory

   

12.12   Explain why logging metadata updates ensures recovery of a file system after a file system crash.

                  In the case of a system crash, the system will be able to determine all metadata updates that did not finish. Using this information, it will be able to redo those updates to keep the file system in a consistent state.

 

 

12.13    Explain how the VFS layer allows an operating system easily to support multiple types of file systems.

             The VFS provides a layer of abstraction for the operating system. It allows the operating system to make general file system calls without knowing which specific file system it is talking to. The VFS deals with figuring out how to translate these calls into something that the current file system will understand.

           

 

15.4     What network configuration would best suit the following environments?

a. A dormitory floor

b. A university campus

c. A state

d. A nation

 

a.        LAN

b.       LAN

c.        WAN

d.       WAN

 

15.11   The original HTTP protocol used TCP/IP as the underlying network protocol. For each page, graphic, or applet, a separate TCP session was constructed, used, and torn down. Because of the overhead of building and destroying TCP/IP connections, there were performance problems with this implementation method. Would using UDP rather than TCP have been a good alternative? What other changes could be made to improve HTTP performance?

UDP would probably not be a good alternative. Although UDP would alleviate the overhead of creating and destroying connections, it has the potential to drop packets.

If you came up with any reasonable ideas for other improvements, I accepted them.       

 

15.15   Process migration within a heterogeneous network is usually impossible, given the differences in architectures and operating systems. Describe a method for process migration across different architectures running:

a. The same operating system

b. Different operating systems  

a.        You could attempt to implement a protocol that is invisible to the process. The OS would handle transferring the process around.  Some code recompilation/translation would be necessary since the architectures are different.

b.       This would probably be very complicated because there is virtually no common ground. Processes would need to have knowledge of different OS/hardwares and a protocol would need to be established with some layer of abstraction (possibly similar to the VFS).