Operating Systems 2019W: Assignment 2: Difference between revisions

From Soma-notes
Created page with "'''This assignment is not yet finalized.''' Please submit the answers to the following questions via CULearn by 4 PM on Monday, February 11, 2019. There are ?? points in ?? q..."
 
No edit summary
Line 16: Line 16:
# [2] If you change line 68 of 3000test.c to be <tt>data[i] = 'A';</tt>  (from <tt>count++;</tt>), what will the program do?  Explain briefly.
# [2] If you change line 68 of 3000test.c to be <tt>data[i] = 'A';</tt>  (from <tt>count++;</tt>), what will the program do?  Explain briefly.
# [2] What does setup_comm_fn() do in 3000shell?
# [2] What does setup_comm_fn() do in 3000shell?
# [1] If you destroy all of the superblocks in a filesystem, will fsck be able to recover the filesystem? Explain.
# [1] When would you expect to find files in the lost+found directory? 
# [2] When first connecting to a remote host via ssh, you will normally get a message saying something similar to this: "The authenticity of host 'access.scs.carleton.ca (134.117.29.72)' can't be established.  RSA key fingerprint is SHA256:MexEKZF0Os0Vl6VTObN70lRf2DFsGfD8DTQ7FKKqVJ4.  Are you sure you want to continue connecting (yes/no)?"
#* Why is this question important?
#* What is the "fingerprint" for?
# [2] As user student (uid=1000), you run "sshfs <scs-username>@access.scs.carleton.ca:. scs-files", where <scs-username> is your username. 
#* Will the files in scs-files have a uid=1000?  Why or why not?
#* Assume a file in scs-files is marked as being readable only by the owner.  Will you be able to read the contents of this file?  Why or why not?
# [1] How can you make a file that is 20 GB in size (you can read 20 GB of information from it) but takes up essentially no space on disk?

Revision as of 03:11, 1 February 2019

This assignment is not yet finalized.

Please submit the answers to the following questions via CULearn by 4 PM on Monday, February 11, 2019. There are ?? points in ?? questions.

Submit your answers as a single text file named "<username>-comp3000-assign2.txt" (where username is your MyCarletonOne username). The first four lines of this file should be "COMP 3000 Assignment 2", 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. [2] Assume you have a file A. You type ln A B in order to create file B. What is the relationship between the return of lstat() on A versus B? Explain briefly.
  2. [2] Assume you have a file A. You type ln -s A B in order to create file B. What is the relationship between the return of lstat() on A versus B? Explain briefly.
  3. [2] How could you modify 3000test.c so it can report on what a file's user ID and group ID are and the corresponding username and group name? Specify the changes you make rather than writing all the code out. (In other words, code a solution and explain the changes you made here.)
  4. [2] If you change line 68 of 3000test.c to be data[i] = 'A'; (from count++;), what will the program do? Explain briefly.
  5. [2] What does setup_comm_fn() do in 3000shell?
  6. [1] If you destroy all of the superblocks in a filesystem, will fsck be able to recover the filesystem? Explain.
  7. [1] When would you expect to find files in the lost+found directory?
  8. [2] When first connecting to a remote host via ssh, you will normally get a message saying something similar to this: "The authenticity of host 'access.scs.carleton.ca (134.117.29.72)' can't be established. RSA key fingerprint is SHA256:MexEKZF0Os0Vl6VTObN70lRf2DFsGfD8DTQ7FKKqVJ4. Are you sure you want to continue connecting (yes/no)?"
    • Why is this question important?
    • What is the "fingerprint" for?
  9. [2] As user student (uid=1000), you run "sshfs <scs-username>@access.scs.carleton.ca:. scs-files", where <scs-username> is your username.
    • Will the files in scs-files have a uid=1000? Why or why not?
    • Assume a file in scs-files is marked as being readable only by the owner. Will you be able to read the contents of this file? Why or why not?
  10. [1] How can you make a file that is 20 GB in size (you can read 20 GB of information from it) but takes up essentially no space on disk?