title: File Systems - Memory-Mapped Files
body: <p>An example final question for my operating systems class:</p>
  
  <p>Most operating systems support "memory-mapped files"; this describes files which are mapped into the address space of a running process.  Reads and writes to the file are converted into memory reads and writes.  We can imagine the existence of two new system calls, map() and unmap().</p>
  
  <p>a) Consider map(); it accepts a file name and a virtual address, causing the operating system to map the file into the address space starting at the virtual address.  Describe how the virtual memory system could be used to support this call.</p>
  
  <p>b) Consider unmap(); it disassociates the file from the virtual address space.  Describe the stats that should be taken to implement this system call.  List all your assumptions.</p>
  
  <p>c) In many UNIX systems, the inodes are kept at the start of disk. An alternative design is to allocate an inode when a file is created and put the inode at the start of the first block of the file.  Discuss the pros and cons of this alternative.</p>
  
  <p>d) What would happen if the bitmap or free list containing information about free disk blocks was completely lost due to a crash? Is there anyway to recover from this disaster, or is the disk no longer usable.  Discuss your answer for a UNIX and FAT-style of disk-block allocation.</p>
  
  <p>Any information of discussion on these questions is greatly appreciated.</p>