Difference between revisions of "COMP 3000 Midterm exam 2010"

From Soma-notes
Jump to navigation Jump to search
(Created page with "==Question 1== Q: On an x86-class processor that supports hardware virtualization, it is possible in principle to virtualize any OS that can run on the native hardware. In pract…")
 
 
(20 intermediate revisions by 2 users not shown)
Line 2: Line 2:
Q: On an x86-class processor that supports hardware virtualization, it is possible in principle to virtualize any OS that can run on the native hardware.  In practice, only certain operating system types and versions will run well on a given VM platform (e.g., VirtualBox, VMWare Player).  What is one reason for this discrepancy?
Q: On an x86-class processor that supports hardware virtualization, it is possible in principle to virtualize any OS that can run on the native hardware.  In practice, only certain operating system types and versions will run well on a given VM platform (e.g., VirtualBox, VMWare Player).  What is one reason for this discrepancy?


A:
A: - lack of VM guest drivers (either VM specific or for simulated hardware)
 
 
===Comments===


==Question 2==
==Question 2==
Q: Typically, what does a guest OS's hard disk look like to the host OS?
Q: Typically, what does a guest OS's hard disk look like to the host OS?


A:
A: The host OS typically sees one big file for a guest OS hard disk. Some VM software (e.g. VMWare) lets you break up this file into segments for performance and/or administrative reasons (e.g. the file size exceeds space on one volume), but this has no direct impact on the guest filesystem.
 
===Comments===


==Question 3==
==Question 3==
Line 14: Line 19:
A:
A:


''Path to executable:'' <code>/bin/chmod</code> (partly derived ... see note below)<br>
''Arguments:'' <code>chmod</code> <code>a+r</code> <code>foo.txt</code><br>
''Environment:'' (not shown ... depends on the shell)
Note: the full path to the executable is derived by the shell when the command is processed. It is based on the PATH environment variable.
===Comments===
==Question 4==
Q: Why doesn't <code>ldd</code> report all the libraries that are listed in /proc/<PID>/maps?
A: The <code>ldd</code> command only lists libraries that are dynamically linked and needed at program start. The proc mapping lists those and the ones loaded at runtime (plus other memory mapped files).
===Comments===
==Question 5==
Q: When a process becomes undead (a zombie), who can send it to its grave permanently?  What must it do?
A: The process's parent.  (When a process dies its children are adopted by init.)  The parent calls wait or waitpid to get the zombie's return value.
===Comments===
==Question 6==
Q: UNIX files each have permissions for three classes of users. What are those classes?
A: Owner, Group, Others. A file is typically created with owner set to the user running the program and the group set to that user's primary group. The value of the specific permissions (i.e. _rw_rw_r__) is determined at file creation by prior use of the <code>umask</code> command. Permissions can be changed after file creation with the <code>chown</code> command.
===Comments===
==Question 7==
Q: A solution to the producer/consumer problem must take into account many conditions.  What are three of them?
A: Consumer runs out of things to consume, producer runs out of space to produce in, and to prevent the producer and consumer from accessing the same memory at the same time (corrupting the shared data structure).  (Note both synchronization and mutual exclusion is required.)
===Comments===
==Question 8==
Q: What are three events that cause signals to be sent in UNIX?
A: child process exit, divide by zero, suspend/resume process (STOP, CONT), terminate (TERM), really kill (KILL), many others
===Comments===
==Question 9==
Q: What system call do you use to receive data over an already existing pipe?
A: The <code>read</code> call receives data in a pipe. Note: this will block if the pipe is empty. When a sender issues the <code>write</code> command the receiver will unblock and receive a data from the pipe.
===Comments===
--[[User:Jjpwilso|Jjpwilso]] 14:28, 27 October 2010 (UTC) If I recall correctly, the amount of data read depends on: 1) a record separator such as a line-feed (possibly based on IFS?) or 2) the length of PIPEBUF as set during OS compilation.
==Question 10==
Q: How is an exokernel library OS like a guest OS running on a VM? How are they different?
A:
===Comments===
==Question 11==
Q: What is one reason the UNIX system call interface has had to change in response to computer architectural changes?
A:
===Comments===
==Question 12==
Q: What is one reason why mainframes support near perfect hardware virtualization of CPU, memory, and all I/O devices?
A:
===Comments===
==Question 13==
Q: How can a cluster have higher overall reliability than the individual computers that it consists of?
A:
===Comments===
==Question 14==
Q: What was a key advantage of the Lisp machine OS, Genera, over current operating systems?  What was a key disadvantage?
A:
===Comments===
==Question 15==
Q: Why did kernel extensions in SPIN need to be written in a "safe" language?  Why don't kernel extensions in Windows and Linux  (drivers, modules) need to be written in a safe language?
A:
===Comments===
==Question 16==
Q: What is an important reason why modern schedulers, like the ULE and recent Linux schedulers, require a scheduling algorithm which operates in sublinear time?  Correspondingly, why was a linear-time scheduler okay for the original UNIX?  Explain briefly.
A:
===Comments===
==Question 17==
Q: Describe a race condition error and a test that would catch that error in testing.  (You may describe a ''well-known'' race condition or one that you make up.)
A:
===Comments===
==Question 18==
Q: Can a threading library like pthreads be implemented on a system  that has no native support for threads, such as the original UNIX? What is required for such an implementation?
A:
===Comments===
==Question 19==
Q: Despite their performance disadvantage, what is one reason kernel space thread schedulers are generally favored over userspace implementations?
A:
===Comments===
==Question 20==
Q: Linux's logical volume manager (LVM) allows for the creation of synthetic block devices that span physical disks, e.g., the blocks in two hard disks can be appended or striped so they appear to be one large hard disk.  LVM, however, implements no file system abstraction---the unified block device must be formatted with a regular filesystem. What is one way LVM plus ext4 (a standard Linux filesystem) is similar to ZFS?  What is one way in which they are different?
A:
===Comments===
==Question 21==
Q: Hard disk-based filesystems must design around the slow seek times of hard disks (relative to their sequential transfer speed). What characteristic(s) of flash (solid state) storage must flash-based filesystems design around to achieve high performance and reliability?
A:
===Comments===
==Question 22==
Q: Storage area networks (SANs) allow many computers to share access to the same storage devices via a special trusted network.  Standard SAN access protocols work in terms of blocks.  By reading from multiple devices concurrently, SANs can provide impressive I/O performance.  Given that SANs already are extremely high performance, why are many researchers arguing that they should transition to object-based stores?
A:
===Comments===
==Question 23==
Q: What key properties of a database are developers trying to capture with database-filesystem hybrids?
A:
===Comments===
==Question 24==
Q: Why aren't standard databases a drop-in replacement for filesystems?
A:


# Why doesn't \texttt{ldd} report all the libraries that are
===Comments===
  listed in /proc/$<$PID$>$/maps?
# When a process becomes undead (a zombie), who can send it to its
  grave permanently?  What must it do?
# UNIX files each have permissions for three classes of users.
# A solution to the producer/consumer problem must take into account many conditions.  What are three of them?
# What are three events that cause signals to be sent in UNIX?
# What system call do you use to receive data over an already
  existing pipe?
# How is an exokernel library OS like a guest OS running on a VM?
  How are they different?
# What is one reason the UNIX system call interface has had to
  change in response to computer architectural changes?
# What is one reason why mainframes support near perfect hardware
  virtualization of CPU, memory, and all I/O devices?
# How can a cluster have higher overall reliability than the
  individual computers that it consists of?
# What was a key advantage of the Lisp machine OS, Genera, over
  current operating systems?  What was a key disadvantage?
# Why did kernel extensions in SPIN need to be written in a "safe"
  language?  Why don't kernel extensions in Windows and Linux
  (drivers, modules) need to be written in a safe language?
# What is an important reason why modern schedulers, like the ULE
  and recent Linux schedulers, require a scheduling algorithm which
  operates in sublinear time?  Correspondingly, why was a linear-time
  scheduler okay for the original UNIX?  Explain briefly.
# Describe a race condition error and a test that would catch that
  error in testing.  (You may describe a ``well-known'' race condition
  or one that you make up.)
# Can a threading library like pthreads be implemented on a system
  that has no native support for threads, such as the original UNIX?
  What is required for such an implementation?
# Despite their performance disadvantage, what is one reason kernel space
  thread schedulers are generally favored over userspace implementations?
# Linux's logical volume manager (LVM) allows for the creation of
  synthetic block devices that span physical disks, e.g., the blocks
  in two hard disks can be appended or striped so they appear to be
  one large hard disk.  LVM, however, implements no file system
  abstraction---the unified block device must be formatted with a
  regular filesystem. What is one way LVM plus ext4 (a standard Linux filesystem) is similar to ZFS?  What is one way in which they are different?
# Hard disk-based filesystems must design around the slow seek
  times of hard disks (relative to their sequential transfer speed).
  What characteristic(s) of flash (solid state) storage must
  flash-based filesystems design around to achieve high performance
  and reliability?
# Storage area networks (SANs) allow many computers to share
  access to the same storage devices via a special trusted network.
  Standard SAN access protocols work in terms of blocks.  By reading
  from multiple devices concurrently, SANs can provide impressive I/O
  performance.  Given that SANs already are extremely high
  performance, why are many researchers arguing that they should
  transition to object-based stores?
# What key properties of a database are developers trying to
  capture with database-filesystem hybrids?
# Why aren't standard databases a drop-in replacement for filesystems?

Latest revision as of 10:11, 9 November 2010

Question 1

Q: On an x86-class processor that supports hardware virtualization, it is possible in principle to virtualize any OS that can run on the native hardware. In practice, only certain operating system types and versions will run well on a given VM platform (e.g., VirtualBox, VMWare Player). What is one reason for this discrepancy?

A: - lack of VM guest drivers (either VM specific or for simulated hardware)


Comments

Question 2

Q: Typically, what does a guest OS's hard disk look like to the host OS?

A: The host OS typically sees one big file for a guest OS hard disk. Some VM software (e.g. VMWare) lets you break up this file into segments for performance and/or administrative reasons (e.g. the file size exceeds space on one volume), but this has no direct impact on the guest filesystem.

Comments

Question 3

Q: The execve system call gets three arguments: a full pathname to an executable, arguments, and environment variables. What are each of these for when "chmod a+r foo.txt" is run?

A:

Path to executable: /bin/chmod (partly derived ... see note below)
Arguments: chmod a+r foo.txt
Environment: (not shown ... depends on the shell)

Note: the full path to the executable is derived by the shell when the command is processed. It is based on the PATH environment variable.

Comments

Question 4

Q: Why doesn't ldd report all the libraries that are listed in /proc/<PID>/maps?

A: The ldd command only lists libraries that are dynamically linked and needed at program start. The proc mapping lists those and the ones loaded at runtime (plus other memory mapped files).

Comments

Question 5

Q: When a process becomes undead (a zombie), who can send it to its grave permanently? What must it do?

A: The process's parent. (When a process dies its children are adopted by init.) The parent calls wait or waitpid to get the zombie's return value.

Comments

Question 6

Q: UNIX files each have permissions for three classes of users. What are those classes?

A: Owner, Group, Others. A file is typically created with owner set to the user running the program and the group set to that user's primary group. The value of the specific permissions (i.e. _rw_rw_r__) is determined at file creation by prior use of the umask command. Permissions can be changed after file creation with the chown command.

Comments

Question 7

Q: A solution to the producer/consumer problem must take into account many conditions. What are three of them?

A: Consumer runs out of things to consume, producer runs out of space to produce in, and to prevent the producer and consumer from accessing the same memory at the same time (corrupting the shared data structure). (Note both synchronization and mutual exclusion is required.)

Comments

Question 8

Q: What are three events that cause signals to be sent in UNIX?

A: child process exit, divide by zero, suspend/resume process (STOP, CONT), terminate (TERM), really kill (KILL), many others

Comments

Question 9

Q: What system call do you use to receive data over an already existing pipe?

A: The read call receives data in a pipe. Note: this will block if the pipe is empty. When a sender issues the write command the receiver will unblock and receive a data from the pipe.

Comments

--Jjpwilso 14:28, 27 October 2010 (UTC) If I recall correctly, the amount of data read depends on: 1) a record separator such as a line-feed (possibly based on IFS?) or 2) the length of PIPEBUF as set during OS compilation.

Question 10

Q: How is an exokernel library OS like a guest OS running on a VM? How are they different?

A:

Comments

Question 11

Q: What is one reason the UNIX system call interface has had to change in response to computer architectural changes?

A:

Comments

Question 12

Q: What is one reason why mainframes support near perfect hardware virtualization of CPU, memory, and all I/O devices?

A:

Comments

Question 13

Q: How can a cluster have higher overall reliability than the individual computers that it consists of?

A:

Comments

Question 14

Q: What was a key advantage of the Lisp machine OS, Genera, over current operating systems? What was a key disadvantage?

A:

Comments

Question 15

Q: Why did kernel extensions in SPIN need to be written in a "safe" language? Why don't kernel extensions in Windows and Linux (drivers, modules) need to be written in a safe language?

A:

Comments

Question 16

Q: What is an important reason why modern schedulers, like the ULE and recent Linux schedulers, require a scheduling algorithm which operates in sublinear time? Correspondingly, why was a linear-time scheduler okay for the original UNIX? Explain briefly.

A:

Comments

Question 17

Q: Describe a race condition error and a test that would catch that error in testing. (You may describe a well-known race condition or one that you make up.)

A:

Comments

Question 18

Q: Can a threading library like pthreads be implemented on a system that has no native support for threads, such as the original UNIX? What is required for such an implementation?

A:

Comments

Question 19

Q: Despite their performance disadvantage, what is one reason kernel space thread schedulers are generally favored over userspace implementations?

A:

Comments

Question 20

Q: Linux's logical volume manager (LVM) allows for the creation of synthetic block devices that span physical disks, e.g., the blocks in two hard disks can be appended or striped so they appear to be one large hard disk. LVM, however, implements no file system abstraction---the unified block device must be formatted with a regular filesystem. What is one way LVM plus ext4 (a standard Linux filesystem) is similar to ZFS? What is one way in which they are different?

A:

Comments

Question 21

Q: Hard disk-based filesystems must design around the slow seek times of hard disks (relative to their sequential transfer speed). What characteristic(s) of flash (solid state) storage must flash-based filesystems design around to achieve high performance and reliability?

A:

Comments

Question 22

Q: Storage area networks (SANs) allow many computers to share access to the same storage devices via a special trusted network. Standard SAN access protocols work in terms of blocks. By reading from multiple devices concurrently, SANs can provide impressive I/O performance. Given that SANs already are extremely high performance, why are many researchers arguing that they should transition to object-based stores?

A:

Comments

Question 23

Q: What key properties of a database are developers trying to capture with database-filesystem hybrids?

A:

Comments

Question 24

Q: Why aren't standard databases a drop-in replacement for filesystems?

A:

Comments