Operating Systems 2018F: Assignment 4

From Soma-notes
Revision as of 20:37, 12 November 2018 by Soma (talk | contribs) (Created page with "'''This assignment is not yet finalized.''' Please submit the answers to the following questions via CULearn by 2:30 PM on Wednesday, November 21, 2018. There are 20 points i...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This assignment is not yet finalized.

Please submit the answers to the following questions via CULearn by 2:30 PM on Wednesday, November 21, 2018. There are 20 points in ?? questions.

Submit your answers as a single text file named "<username>-comp3000-assign4.txt" (where username is your MyCarletonOne username). The first four lines of this file should be "COMP 3000 Assignment 4", your name, student number, and the date of submission. You may wish to format your answers in Markdown to improve their appearance.

No other formats will be accepted. Submitting in another format will likely result in your assignment not being graded and you receiving no marks for this assignment. In particular do not submit an MS Word or OpenOffice file as your answers document!

Don't forget to include what outside resources you used to complete each of your answers, including other students, man pages, and web resources. You do not need to list help from the instructor, TA, or information found in the textbook.

Questions

  1. [1] Does alloc_pages() in the Linux kernel immediately allocate memory, or is memory allocated when it is accessed?
  2. [1] Does an anonymous mmap system call allocate memory immediately, or is the memory allocated as it is accessed?
  3. [2] What is one key advantage of lazy memory allocation? What is one key disadvantage?
  4. [2] Assume we have modified the remember module so it allocates 16K (4 pages) at a time, and assume we have stored in /dev/remember 16K copies of the letter "a".
    • As written, what will a read of /dev/remember return if we use a 4K buffer, starting at the beginning of the file?
    • What will happen if we do a second read, again with a 4K buffer (on the same open file)?
  5. [2] When is memory dynamically allocated in the remember module? When is it freed?
  6. [2] As written, what happens when multiple write calls are made to /dev/remember? What is remembered? Why?
  1. What lines in memoryll determine the inode numbers?
  2. What permissions does a process require for regular file access?
  3. When you run fusermount via execve, what euid does fusermount's process have?
  4. [2] What is a process's effective uid (euid)? Why is the euid not always equal to its uid?