Operating Systems 2019W: Assignment 4

From Soma-notes
Revision as of 12:54, 1 April 2019 by Soma (talk | contribs) (Created page with "'''This assignment is not yet finalized.''' # [2] When you hit Ctrl-C while running the bc command, does the Ctrl-C generate a signal? How do you know? # [2] Does bashreadli...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This assignment is not yet finalized.

  1. [2] When you hit Ctrl-C while running the bc command, does the Ctrl-C generate a signal? How do you know?
  2. [2] Does bashreadline report commands given to bash via shell scripts? How do you know?
  3. [2] How can you modify 3000pc so the producer stops on the third time it fills its queue? Give your code as a diff -c versus the original 3000pc
  4. [2] Under what conditions would 3000pc never send a signal (from the producer to the consumer or vice versa)? How could you modify 3000pc so this occurance was more likely?
  5. [2] Implement and critique your own version of sem_wait() and sem_post() in pure C with no system calls. Do you think your version is free of race conditions? Explain.
  6. [2] Change 300pc so that uses a shared memory mapped file rather than simply shared memory to communicate between the producer and consumer. How big is the file? Does its size change?
  7. [2] How difficult is it for a userspace process to generate truly random numbers on its own, without the assistance of the kernel? Explain.
  8. [2] Does the ssh command use random numbers? How can you demonstrate this?
  9. [2] Can a setuid root process give up its privileges and run as a regular user? Is this change necessarily permanant?
  10. [2] What are the main factors that influence whether the attacker wins the race with 3000run-write? Explain what it means for the attacker to win.