Operating Systems 2018F: Assignment 3

From Soma-notes
Revision as of 20:31, 26 October 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 7, 2018. There are ?? points in...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This assignment is not yet finalized.

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

Submit your answers as a single text file named "<username>-comp3000-assign3.txt" (where username is your MyCarletonOne username). The first four lines of this file should be "COMP 3000 Assignment 3", 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

THESE QUESTIONS ARE FROM LAST YEAR, THEY ARE BEING CHANGED

  1. [1] If you erase the first few blocks of a filesystem, it will become unmountable; however, fsck will generally be able to recover the filesystem. What extra information stored in the filesystem allows fsck to do the repair?
  2. [1] Sometimes the kernel will refuse to unmount a filesystem (when the requesting user has sufficient privileges). What is one important reason why this happens?
  3. [2] Why can't you use printf() in Linux kernel modules, but you can use similar C library functions such as snprintf()? More generally, why is only some some of the standard C library available to kernel code?
  4. [2] When you load a kernel module, are you creating a new process? Why or why not?
  5. [2] Is a running Linux system that is generating multiple "Oops" messages at risk of doing something bad, like corrupting data or crashing? Explain.
  6. [2] Why does newgetpid.c use put_user() in newgetpid_read(), rather than just writing directly to buf? Explain briefly.
  7. [2] How can the logical size of a filesystem be larger than the physical size? How can the logical size be smaller than the physical size?
  8. [2] What type is "current" normally in Linux source code? What does "current" refer to?
  9. [2] What line(s) in newgetpid.c sets the name of the device file (i.e. making it /dev/newgetpid rather than /dev/ones)? How did you verify that your answer was correct?
  10. [2] What changes need to be made to newgetpid.c to allow it to respond to write requests? Hint: How does newgetpid.c respond to read requests?