Fall+2003+final

2. (20 pts) Across the operating systems we have studied, we have seen two general approaches to file data access: memory mapped files, and streaming I/O.(a) Briefly describe these approaches.

-Memory mapped file: System represents files as virtual memory pages -Streaming I/O - we think the system starts at the beginning of the file and seeks to the position desired to read, reads files seqentially

(b) For each approach, give two examples of operating systems that support it

-Sprite and we think Unix classic use streaming access -Memory mapped are used by Mach and Tenex

(c) For each approach, give two advantages and disadvantages

-Advantages of mapped ---Random access ---Caching ---No system call for file operations

-Advantages of streams ---Easier for networked operating systems ---Consistent interface between devices and files ---Don't fill up your address space with files

(d) Can each be implemented in terms of the other? If so, briefly describe how. If not, why not?

- We don't think streaming can be implemented in terms of a memory-mapped file system. - Memory-mapped files can be implemented in terms of streaming by using a smart page cache.

(e) Even though commercial operating systems support both approaches, why do you think most programs today use streaming I/O?

-If you have large files in a 32-bit address space you could run out of memory with large files in a memory mapped environment -Streams are great when you don't know how large a file will be

3. (20 pts) Many of the papers we have read can be placed into one of two categories: papers that attempt to virtualize a resource to provide transparency to the underlying implementation, and papers that attempt to expose a resource to allow applications to improve their performance. For the following systems, describe which resource is virtualized or exposed and what they hoped to accomplish by doing this: (a) Scheduler Activations

-Virtual processors map to physical processors 1:1 -Allows processes to schedule their own threads at user level

(b)GMS

Virtualizes the location of memory to allow transparent access to network memory without

(c)Sprite

Virtualizes the file system so that network file system is done transparently