Your IP : 216.73.216.40


Current Path : /var/www/html/bibhas.ghoshal/OS_2019/
Upload File :
Current File : /var/www/html/bibhas.ghoshal/OS_2019/exam2-pool.txt

                            Computer Science 284

                      Introduction to Operating Systems
					  
					  
Q: What are the three popular strategies for allocating free memory
  blocks to processes in dynamic memory partitioning? Explain briefly
  how each strategy works.
A: First-fit: chooses the first free block in the list that is large
              enough for the request.  
   Best-fit: chooses the free block that is closest in size to the
             request.
   Next-fit: chooses the first free block that  is large enough for
             the request and comes after the ``Last Allocated Block''
             in the list. 


Q: True or False?
   Buddy Strategy always allocates memory in chunks of size power of two and 
   uses a data structure based on a binary tree. 
A: True.


Q: Give an example drawing of a partially allocated memory and
  appropriate pointers in which each strategy ends up allocating
  a different free memory block to satisfy a memory request for 16 MB. 
  Indicate clearly which strategy allocates which memory block.
A: Refer to the example in Chapter 7 slides.

Q: What interrupt is created when a desired page frame is not 
   currently resident in RAM?
A: Page fault trap.


Q: How does the hardware 'know' that a desired page frame 
   is not currently resident in RAM?
A: Valid bit.


Q: What precisely does it mean if the 'dirty bit' is set for a page frame?
A: The page frame has been modified.


Q: What is 'good' vs. 'bad' program locality?
A: 'Good' locality means that the process executes in clustered pages.
'Bad' locality means that the process executes in scattered pages.


Q: Explain when/how internal fragmentation may occur.
A: When fixed-sized pages are used, the last page of a program may be partially filled.
   This is called internal fragmentation.


Q: Explain when/how external fragmentation may occur.
A: Segmentation system breaks up the memory space into variable-sized pieces. 
   After a sequence of allocation and deallocations, free memory may
   get fragmented into small pieces. Even if the total size of free
   memory is large enough to satisfy large memory requests, a large
   request may not be met due to the lack of continuity between small fragments. 
   This is called external fragmentation.
   Compaction is needed to put free blocks into one large memory block.

Q: What is a global allocation scheme?
A: Global replacement allows a process to select a replacement frame from the 
   set of all frames, even if that frame is currently allocated to some other 
   process; one process can take a frame from another.

Q: What is a working set model?
A: The working set model assumes that processes execute in localities. The 
   working set is the set of pages in the current locality. Accordingly, each 
   process should be allocated enough frames for its current working set.


Q: 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?
A: Working set allocation would be more adversely affected by a program
   with 'bad' locality. This is because the program with 'bad' locality has
   poorly defined working sets and therefore, many page faults are likely 
   to occur.


Q: Which one of the following is not among the set of events that may
   take place between the time a page fault occurs and the time the
   faulting process resumes execution?
   (a) OS blocks the process and puts it into a wait queue.
   (b) One of the processes in the ready queue is selected to run. 
   (c) A DMA is initiated to load the page from disk into main memory
   (d) A page replacement strategy is used to find a page frame to
       load the new page
   (e) Page table is updated to reflect the change.
   (f) none of the above

A: f

Q: Which one of the following is not among the set of events that may
   take place between the time a page fault occurs and the time the
   faulting process resumes execution?
   (a) OS blocks the process and puts it into a wait queue.
   (b) One of the processes in the ready queue is selected to run. 
   (c) A DMA is initiated to load the page from disk into main memory
   (d) The last page that the faulting process was executing is
       replaced with the newly loaded page.
   (e) Page table is updated to reflect the change.
   (f) none of the above

A: d


Q: True or False?
   While DMA (Direct Memory Access) is taking place, processor is free
   to do other things. The processor is only involved at the beginning
   and end of the DMA transfer. 
A: True

Q: True or False?
   DMA uses "cycle stealing" to transfer data on the system bus. Each
   time cycle stealing is used, CPU is interrupted.  
A: False. The only interrupts that occur during DMA transfer is at the
   beginning and at the end of DMA (no interrupts in between). 


Q: What is the "largest" program that could execute on a machine with 
   a 24-bit virtual address?
A: 2^24 byte

Q: What is the "largest" program that could execute on a machine with 
   a 24-bit physical address?
A: Can't tell. Need to know the size of the virtual (logical) address.


Q: The address contained in a TLB entry <PTE> is (physical | logical).
A: physical

Q: List at least 3 flags that are contained in a PTE.
A: Valid bit, Reference bit, Dirty bit.


Q: Define hit-ratio in a memory management context.
A: in a two-level memory (cache-RAM or RAM-Harddisk), the fraction of
   all memory accesses that are found in the master memory (i.e. the cache)  

Q: True or False?
   If a virtual page number X generates a miss in the TLB (Translation
   Lookaside Buffer), then the corresponding physical page number for
   X is guaranteed to be found in the Page Table Entry. 
A: False. Not necessarily. X may not be resident in RAM (still in secondary memory).

Q: True or False?
   It is possible that page tables are stored in virtual (secondary) memory.
A: True. when multi-level paging schemes are used

Q: True or False?
   In a virtual memory system with paging, page size must be large
   enough to offset the high cost of page faults.   
A: True

Q: True or False?
   The Least Recently Used (LRU) page replacement strategy is based on
   the principle of spatial locality (locality in space) as opposed to
   temporal locality (locality in time).
A: False. LRU strategy is based on the temporal locality.

Q: True or False?
   Consider "clock policy" for page replacement, a newly arrived
   page (i.e. just swapped in) will not get replaced before the clock
   pointer makes two full rotations in the circular buffer of
   candidate page frames.  
A: True. use=1 at arrival, use=0 after the first rotation of the clock
   pointer. if use=0 remains true after the second rotation, it may
   get replaced; otherwise, it stays on.

Q: True or False?
   In a virtual memory system with paging, you can run a program whose
   size is larger than the size of Main Memory. 
A: True.


Q: Draw a picture which shows the relationship between ``Virtual Address 
   (virtual page#, offset)'', ``Translation Lookaside Buffer'', ``Page Table'', ``Real
  Address (frame#, offset)'', ``Main Memory'', and ``Secondary Memory''. 
A: Slide #18 in CHAP8.ppt

Q: Draw the flowchart for paging using TLB, Page Table, and DMA.
A: Slide #19 in CHAP8.ppt

Q: How does the kernel 'know' where on disk the desired 
   information is for a non-resident frame?
A: If valid bit=0, Page Table Entry should contain the Disk address


Q: Describe what demand paging means.
A: The technique of only loading virtual pages into memory as they are 
   accessed is known as demand paging. If the demand pages are not in
   memory, a page fault trap happens, and the operation system swaps them in.

Q: Describe what prepaging means.
A: Prepaging brings in more consecutive pages than needed. If a virtual page X causes
   a pagefault, then virtual page (X+1) is also brought in along with X.
   It is less overhead to bring in pages that reside contiguously on the disk


-> Must know slides 14 through 20 (in CHAP8.ppt) in detail


========================================================================
Please fill in the blanks for the following questions:
------------------------------------------------------

Q: If a desired page frame is not currently resident in RAM,
   __________________ occurs.
A: A Page Fault

Q: Since paging system uses _____________________-sized pages,
  ____________ fragmentation may occur. 
A: fixed size;   internal

Q: If a memory management system uses dynamic partitioning,
   _______________ fragmentation may occur.
A: External

Q: _____________________ is a form of I/O in which a special module
   controls the exchange of data between main memory and an I/O
   device. During this I/O transfer, CPU is free to do other computation.
A: DMA (Direct Memory Access)


Q: The least recently used (LRU) page replacement strategy is
   based on the principle of __________________  as opposed to
   ________________________. 
A: temporal locality;    spatial locality

Q: The top four levels in the memory hierarchy, starting with the
   fastest, are: _____________; ______________; ___________;
   ___________
A: Registers;  cache memory;  RAM; Disk.


Q: Swapping out a piece of a process (i.e. pages of a process) just
   before that piece is needed is called ________________________
A: Thrashing 

=======================================================================			  
 
Q: True or False?
   A unix socket is used for communication between processes running
   on the same machine. On the other hand, an internet socket can not
   be used for communication between processes running on the same machine.   
A: False. Internet Socket can be used for processes running on the same
   machine as well as different machines


Q: True or False?
   If clients are connected to a server through "connect()" and
   "accept()" calls and the server calls "listen(soc,2)" before
   "accept()", then at most 2 clients can get connected to the server
   at anytime. 
A: False. listen() determines the size of the wait queue before the
   connections take place, not the max. number of clients that can get
   connected.   

Q: True or False?
   In RAID (Redundant Array of Independent Disks) Level 1, every disk
   in the array has a mirror disk that contains the same data.
A: True.

Q: True or False?
In Client/Server architectures, OS and the platforms in the client and server
machines must be the same. 
A: FALSE


Q: True or False?
In Client/Server applications, there is heavy emphasis on providing a
user-friendly Graphical User Interface (GUI) on the client side.
A: True.


Q: True or False?
In client/server applications, fat client models can not take advantage
of the desktop power and therefore can only serve a small number of clients.
A: FALSE


Q: True or False?
First-Come-First-Served (FCFS) process scheduling favors I/O-bound processes.
A: FALSE


Q: True or False?
Most antivirus software is based on program emulation and virus signature analysis. 
A: True.

Q: True or False?
RAID 2 (Redundant Array of Independent Disks with Level 2) is designed
to provide error detection/correction. 
A: True.


Q: True or False?
User Datagram Protocol (UDP) provides unduplicated and reliable packet
delivery.
A: FALSE


Q: True or False?
Two periodic real-time processes A and B have periods T_a=0.2 ms and
T_b=0.5 ms respectively. Furthermore, their execution times are
C_a=10 micro sec. and C_b=40 micro sec. respectively. If Rate
 Monothonic scheduling is used A has higher priority than B.

A: True.


Q: True or False?
The following I/O devices are sorted correctly in decreasing order
according to the typical data rates that they can sustain:
Gigabit Ethernet, firewire 800, laser printer, hard disk, keyboard, and modem.  
A: FALSE


Q: True or False?
   DMA uses "cycle stealing" to transfer data on the system bus. Each
   time cycle stealing is used, CPU is interrupted.  
A: FALSE

   
Q: Which  of the following strategies is not used in a Disk Scheduling
   Algorithm?  
  (a) First in first out (FIFO)      
  (b) Last in first out (LIFO)
  (c) Shortest service time first (SSTF)  
  (d) Longest service time first (LSTF)
  (e) Back and forth over disk (SCAN)

A: d.


Q:  Explain what the following C calls do both when the call is
    successful and when it is unsuccessful.
    1.  socket( AF_INET, SOCK_STREAM, 0 )
    2.  bind(sd, (struct sockaddr*)&server_addr, sizeof(server_addr)) 
    3.  socket( AF_INET, SOCK_DGRAM, 0 )
    4.  accept( sd, (struct sockaddr*)&client_addr, &client_len )
A: 
   1. creates an internet stream (TCP) socket and returns the socket descriptor. 
      If the call fails, it returns -1. 
   2. Binds the definition of a socket (socket descriptor) to a port number.
      If the call fails, it returns -1. 
   3. creates an internet datagram (UDP) socket and returns the socket descriptor. 
      If the call fails, it returns -1. 
   4. Blocks execution until a client connection is received. When
      that happens, it returns a descriptor for the connection.
      If the call fails, it returns -1. 

Q: Which one of the following is not among the 7-layers defined for
   ISO Open Systems Interconnect (OSI) model ? 
   (a) Application
   (b) Routing
   (c) Transport
   (d) Data Link
   (e) Physical

A: b


Q: Which of the following are among the direct goals of process scheduling algorithms (circle all that apply):
a. improve response time
b. minimize interrupts
c. improve throughput
d. minimize page faults
e. improve turnaround time for jobs
f. increase memory efficiency

A:  a, c, e


Q: When we compare clusters with SMP (Symmetric Multiprocessors),
   which of the following are true (circle all that apply)?
a. Clusters are easier to manage and configure
b. Clusters take up less space and draw less power
c. Clusters are better for incremental and absolute scalability
d. Clusters are superior in terms of availability
e. Clusters have superior price/performance

A: c, d, e


Q: Which of the following malicious software need a host program to
  operate? (circle all that apply) 
a. Logic Bomb
b. Worm
c. Zombie (bots)
d. Trojan Horse
e. Virus

A: a, d, e


Q: Which of the following scheduling policies may cause 
    starvation for certain jobs? (circle all that apply)
a. First Come First Serve (FCFS)
b. Feedback
c. Round Robin
d. Shortest Process Next (SPN)
e. Shortest Remaining Time Next (SRT)

A: b, d, e


Q: Which of the following features are specific
  to Real-Time OS? (circle all that apply) 
a. Small size
b. Fast context switch
c. Less user control
d. Nondeterministic delays
e. Fail-safe operation

A: a, b. e


Q: In which one of the following OSI layers Transmission Control
  Protocol (TCP) and User Datagram Protocol (UDP) are defined and
  implemented? 
a. Application
b. Physical
c. Transport
d. Data Link
e. Session

A: c


Q: What does an Internet Protocal do?
A: 1. Provides a naming scheme which uses a uniform format for host addresses
   2. Provides a delivery mechanism by defining a standard packet format.

Q: True or False?
   Sockets are bidirectional communication ports in UNIX. Once a
   socket is created, it can be bound to an internet port using
   socket() call. 
A: False. First statement is true but the 2. statement is false.
   Sockets can be bound to an internet port using bind() call.

Q: True or False?
   There is only one internet port in each networked host.
A: False. There are many internet ports in each host; some are
   reserved by the OS. 

Q: True or False?
   The UNIX call listen(soc,N) allows only N clients to be connected
   to a socket at any time. 
A: False. N specifies the length of the wait queue for the clients who
   are waiting to be connected. 

Q: True or False?
   The two lowest layers in the 7-layer ISO Open Systems Interconnect (OSI)
   model are Physical and Data Link layers and their primary function is
   to implement the TCP/IP protocol.
A: False. First part of the statement is true but the second part is false,
   because Transport layer (which is the 4. layer from the bottom)
   implements TCP/IP.

Q: What are the possible goals that any scheduling policy might try
   to accomplish (list at least three)?
A: To improve:
   - response time
   - Turnaround time (TAT)
   - Throughput
   - Processor Efficieny

Q: True or False?
   Long-Term scheduler controls the degree of multiprogramming
A: True

Q: True or False?
   Among the three scheduling disciplines (long-term, medium-term, and
   short-term), long-term scheduler executes most frequently.
A: False. Short-term scheduler (dispatcher) executes most frequently.

Q: True or False?
   Among the short-term scheduling policies, feedback policy penalizes
   jobs that have been running longer.
A: True



Q: Which decisions are made by Long-term, Medium-term, and Short-term scheduling? Be brief.
A: 
Long-term scheduling:
   Determines which programs are admitted to the system for processing
   Controls the degree of multiprogramming

Medium-term scheduling: 
Determines which programs will be resident. Part of the swapping function.
Swapping-in decision is based on the need to manage the degree of multiprogramming

Short-term scheduling:
Determines which program will be executed on CPU next. Known as the dispatcher
Executes most frequently


Q: Name 3 things that are essential to launch a "`bots"' attack:
A:
(1) attack software 
(2) a large number of vulnerable machines   
(3) locating these machines (scanning or fingerprinting)



========================================================================
Please fill in the blanks for the following questions:
------------------------------------------------------

Q: The two lowest layers in the 7-layer ISO Open Systems Interconnect (OSI)
   model are ______________ and ____________  layers and their primary
   function is to provide ______________ and ____________ .
A: Physical;  Data Link;  signaling technology;  frame management.


Q: Two transport protocols, __________________________________ and
   _________________________, are defined and handled at the Transport
   Layer.  
A: Transmission Control Protocol (TCP);  User Datagram Protocol (UDP)


========================================================================
=                                                                      =
=   Miscellaneous questions related to the VIDEO: TRIUMP OF THE NERDS  =
=                                                                      =
=                                                                      =
========================================================================

Q: Fill in the blanks.

  1. ____________________ and _____________________ are generally credited
     with the invention of C/Unix.
   
     A. Dennis Richie,  Ken Thompson


  2. ____________________ and _____________________ started Microsoft in
     19______.

     A. Bill Gates, Paul Allen, 1975.

  3. What corp./laboratory may fairly take credit for inventions like the
     mouse, windows, pull-down menus etc.?

     A. Xerox/PARC

  4. ____________________ and ______________________ co-founded Apple.
     ________________ then started NeXT, and was the CEO of Pixar.

     A. Steve Jobs, Steve Wozniac, Steve Jobs

  5. 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 _______________________
      
     A: QDOS, Tim Patterson, CL Computer Products, CPM, Gary Kildall


Q: Answer the following questions.


  6. What did Steve Jobs see while visiting PARC that inspired him to build
     a different kind of computer?   
     A: GUI

     What did he see that he completely ignored? 
     A: object oriented programming  and E-mail

     What was the 1st computer that he built based on this inspiration
     (that flopped)?   
     A: Lisa

     What was the 2nd one that didn't flop?
     A; Macintosh

  7. What 'product' got Microsoft into the microcomputer software business?
     A: BASIC language interpreter 

  8. What lucky event got Microsoft into the operating system market?

      Gary Kildall didn't eagerly pursue IBM when they requested a new
      OS. His wife and attorney would not sign a nondisclosure
      agreement. Bill Gates of Microsoft saw this as an opportunity and
      jumped in.

  9. What company purchased NeXT and their OS NExTStep? What year?

     A. Apple, in 1996

 10. What is a 'killer application'?
     A: Software that's so useful that people will buy computers just to run it.

 11. What was the killer app for the Apple II?
     A: Visicalc

 12. What was the killer app for the IBM PC?
     A: Lotus 1-2-3
 
 13. What was the killer app for the Apple MacIntosh?
     A: Wysiwyg - What you see is what you get -----> Desktop Publishing

 14. Why didn't IBM create their own OS for their 1st PC?
     A: wanted to manufacture and market it very fast; within one-year
     "....Once IBM decided to do a personal computer and to do it in a year -
     they couldn't really design anything, they just had to slap it
     together, so that's what they did ..."

 15. Who 'should have' sold IBM their operating system for the 1st IBM PC?
     A: Gary Kildall of Digital Research

 16. What was the one part of the 1st IBM PC that was proprietary (that
     Compaq had to later reverse engineer)?
     A: ROM-BIOS

 17. Why did IBM decide to build the PC using 'open architecture'?
 
     To save time, instead of building a computer from scratch, IBM
     initially decided to buy PC components off the shelf and assemble
     them -- in IBM terms, this was called an 'open architecture'.
     IBM made some changes to this initial decision.

   What was the almost immediate result of IBM having made that decision?

     IBM had to buy the OS and other software from other companies as well.

 18. What was IBM's motivation for designing/building PS-2/OS-2?

     IBM planned to steal the market from Gates with a brand new OS
     called OS/2.

 19. What person ______________ what company ________________ built the 1st
     commercially available personal computer in 1975?

     A: Ed Roberts; MITS

 20. Gordon Moore is one of the _______________ founders.   
     A: Intel

 21. World's first personal computer, ________________, was designed by 
     ______________________ and was introduced in 19___

     A: Altair 8800; Ed Roberts; 1975

 22. The first mass market PC company is _____________.
     A: Apple