2 Points
Write a UNIX pipeline that prints the eighth line of file Z on
standard output.
2 Points
When the UNIX shell starts up a process,
it puts copies of its environment variables,
such as HOME, on the process' stack,
so the process can find out what its home
directory is.
If this process should later fork,
will the child automatically get these
variables too?
2 Points
To what hardware concept is a signal closely related?
Give two examples of how signals are used.
3 Points
If a UNIX process runs for 1 sec without competition
from other processes, how long does it take for its
CPU usage counter to get back down to 0?
"Once a second, all process priorities are recalculated.
First, all the CPU usage counters are divided by 2,
so that processes are not punished forever for past CPU
use.
Then each process' priority is calculated according to the
formula:
New priority = base + CPU usage
The base is normally 0..."
About how long does it take to fork off a child process
under the following conditions:
text size = 100K bytes,
data size = 20K bytes,
stack size = 10K bytes,
process table size = 1K,
user structure = 5K.
The kernel trap and return takes 1 msec,
and the machine can copy one 32-bit word
every 500nsec.
Text segments are shared.
When the file
/usr/ast/work/f
is opened, several disk accesses are needed to read
i-node and directory blocks.
Calculate the number of disk accesses required under the
assumption that the i-node for the root directory is
always in memory,
and all directories are one block long.
Does 4.2BSD UNIX give scheduling priority to
I/O or CPU-bound processes?
For what reason does it differentiate
between these categories, and why is one
given priority over the other?
How does it know which of these categories
fits a given process?
Last modified April 5, 1999 by mike@cs.hmc.edu