The material for the questions below
can be found in any operating system text.
Once forked, the child calls a function which
sleeps for a period of seconds where the sleep time
in seconds
is (command line) input as a startup parameter to the program
(data sharing between parent and child).
Once the child wakes up, it prints out the date
(do not use system to do the date, but find
the underlying OS system call)
and terminates.
The printout should delineate between parent and child.
Turn in a copy of your program and a script file
of its execution
(do a man script if you do not know
what a script file is).
On the script file, differentiate between
parent and child output.
Remember, no hand written material.
Use a text processor - you might try troff
or latex/xfig.
Also remember to date and time stamp your homework.
S.1.7, pg. 21,
Define the essential properties of the following types
of operating systems:
Batch,
Interactive,
Time Sharing,
Real Time,
and
Distributed.
s.2.2,
How does the distinction between monitor mode
and user mode function as a rudimentary form
of protection (security) system?
s.2.3,
What are the differences between a trap
and an interrupt?
What is the use of each function?
Tanenbaum #1.6, pg 26,
Which of the following instructions should be allowed only
in kernel mode?
Tanenbaum #1.12, pg 26,
Why is the process table needed in a timesharing system?
Is it also needed in personal computer systems in which
only one process exists, that process taking over the
entire machine until it is finished?
Tanenbaum #2.3, pg 71,
Explain the difference between busy waiting and blocking.
Using the figure handed out in class,
write a small program
(C++) that
has a parent and child process.
The parent process forks the child, then
calls a function which prints out the parent
and child process id (with a tag indicating which
pid is which).
The parent then waits for the child to complete.
If you have problems with I/O, then make sure to flush
the buffers.
Write a small program
(C++) that takes input from the user
via the command line
and checks that input for validity,
and prints out the date as
mm/dd/yy .
The 1st parameter is a character string of 3 characters that
is the abbreviation of the month.
The 2nd parameter is an integer that is the day of the month.
The 3rd parameter is an integer specifying the year.
You do NOT have to worry about the user putting a character
in place of an integer, but you do need to worry about the
range of integers, e.g., negative where you really want positive.
Turn in a copy of your program and a script file
of its execution, make sure to show handling of lousy input.
Do NOT worry about leap years.
Do worry about different days in each month,
and the case of the input.
Determine an alias to get
ps to print out all the processes assigned to a user.
What do time and C tell you about each job.
Also, add this alias to your shell startup script.
On turing which manual section holds the descriptions
of the system calls.
Last modified Jan 25, 01 by mike@cs.hmc.edu