Computer Science 284 - Question Pool - Fall 2001

Exam 2

Introduction to Operating Systems

FOR THE PURPOSE OF THIS EXAM, A 'SIGNAL' MEANS A cond_signal AND AN 'INTERRUPT' MEANS A UNIX/KERNEL TYPE signal.

  1. Why is it always important to associate a 'mutex lock' variable with a 'condition' variable?
  2. From the point of view of the calling thread, what actions occur from the time that a condition_wait() is called until the calling thread is allowed to resume execution?
  3. What is the "lost wake-up" with respect to condition signals?
  4. Explain what programming 'logic error' could allow a "lost wake-up" to occur.
  5. What is a possible undesirable result of a  "lost wake-up" having occurred?
  6. List a sequence of events that might result in a lost wake-up' if it were not programmed correctly.  Number the events 1..N and be explicit as to where/when the signal 'gets lost'.
  7. What does it mean that "condition signals do not pend"?
  8. What is the difference between starvation and deadlock?
  9. Define Deadlock.
  10. What are the necessary conditions for a deadlock to exist.
     
  11. What are the 3 possible dispositions that a process may specify with respect to an interrupt?
  12. True False Different threads within a process may specify different dispositions for a specific interrupt
  13. An interrupt will pend unless a process specifies _______________________.
  14. Using signal(...), show the program parts necessary to cause a process to print a message the 1st time that the keyboard operator presses ^C (and further ^Cs would exit the program).  For the same program, show/describe what has to be changed to get the message N times and then exit on the (N+1)th time? (assume that N is hard coded).
  15. What is a sigset_t? 
    How is a variable of this type set/modified? 
    In what ways can a variable of this type be used after it has been assigned an appropriate value(s)?
  16. Using sigaction(...), show how you would block the delivery of SIGINT within a thread.
  17. What functions are used from within a process to send an interrupt to a process?
  18. What is the "very largest" program that could execute on a machine with a 24-bit location counter?
  19. The address contained in a page table entry <PTE> is(physical | logical).
  20. List at least 3 flags that are contained in a PTE.

  21. Given the figure presented in class, (or use the figure on page 351) you will be given some (enough) of the following to allow you to calculate values for the remainder.  You are to assume that page tables and segment table(s) 'fit' into one frame

Description

Answer
s number of bits in the segment number portion of the virtual address  
d number of bits in the displacement portion of the virtual address  
p number of bits in the page number portion of the virtual address  
f number of bits in the frame number portion of the physical address  
frame size (bytes)  
segment table entry size (bytes)  
page table entry size (bytes)  
max physical address  
max virtual address  
max segment size  
max number of entries in segment table  
max number of entries in page table  
  1. Describe the behavior of a "2-handed clock" algorithm.
  2. Describe the differences between a global allocation scheme and the working-set model for allocation.
  3. Why would the page-in mechanism immediately mark a newly loaded page as 'dirty'?
  4. When reading from a pipe, what causes the kernel to send EOF to the reader?
  5. Why can parent/child processes communicate via unnamed pipes but 2 unrelated processes can not?
  6. If your program contains a race condition, what does that mean?
  7. How can the code segment    
    if( i < y ) cout << foobar(i,y)
    ;
    be made to behave as if it were atomic? 
    Answer the question by recoding the segment.
  8. What interrupt is created when a desired frame is not currently resident in RAM?
  9. How does the hardware 'know' that a desired frame is not currently resident in RAM?
  10. How does the kernel 'know' where on disk the desired information is for a non-resident frame?
  11. What precisely does it mean if the 'dirty bit' is set for a frame?
  12. What is 'good' vs. 'bad' program locality?
  13. Comparing global allocation vs. working set allocation, which would be more adversely affected by a program with 'bad' locality? and
    WHY would that be true?
  14. Unix uses a global page allocation scheme.  Describe  NT's scheme.
  15. Describe what demand paging means.
  16. ____________________ and _____________________ are generally credited with the invention of C/Unix?
  17. ____________________ and _____________________ started Microsoft in 19______.
  18. What corp./laboratory may fairly take credit for inventions like the mouse, windows, pull-down menus etc.?
  19. ____________________ and ______________________ co-founded Apple.  ________________ then started NeXT, and is now the CEO of Pixar?
  20. What company purchased NeXT and their OS NExT Step?
  21. What did Steve Jobs see while visiting PARC that inspired him to build a different kind of computer? 
    What did he see that he completely ignored?
        What was the 1st computer that he built based on this inspiration (that flopped)?
        What was the 2nd one that didn't flop?
  22. What 'product' got Microsoft into the microcomputer software business?
  23. What lucky event got Microsoft into the operating system market?
  24. MS/DOS was 90% derived from a predecessor product named  ________
        which was written by _______________
        and owned by   _________________.
        which in turn had been cloned from ____________
        written by _______________________
  25. What is a 'killer application'?
  26. What was the killer app for the Apple II?
  27. What was the killer app for the IBM PC?
  28. What was the killer app for the Apple MacIntosh?
  29. Why didn't IBM create their own OS for their 1st PC?
  30. Who 'should have' sold IBM their operating system for the 1st IBM PC?
  31. What was the one part of the 1st IBM PC that was proprietary (that Compaq had to later reverse engineer)?
  32. Why did IBM decide to build the PC using 'open architecture'?
        What was the almost immediate result of IBM having made that decision?
  33. What was IBM's motivation for designing/building PS-2/OS-2?
  34. What person ______________ what company ________________ built the 1st commerically available micro computer in 19____?
  35. SOCKETS

  36. What is the practical difference between a 'unix' socket and an 'internet' socket?

  37. What are the functional differences between a 'stream' socket and a 'datagram' socket?

  38. Why can two unrelated processes communicate via a socket but not via a pipe? 
    Give your answer in terms of the internal data structures that make it possible with socket but NOT with pipes.

  39. If a server is blocked in an accept() and an incoming connection() request arrives; explain what happens at the server end.

  40. What do each of the following do:
  41. If main() is acting as a server with the intent of fork()ing a new process each time an incoming connection is requested;
    sketch out what the code surrounding the accept() would look like.