sider whether it is possible to construct a secure operating system for these ... [2]
Deitel, Deitel, and Choffnes, Operating Systems, Pearson / Prentice Hall, 2004.
CPSC 313 Introduction to Computer Systems
Fall 2008
Homework 1 (Due Date: Check CSNET) 1. [1] Which of the following instructions should be priviledged? (a) Set value of a timer. (b) Read the clock. (c) Clear memory. (d) Turn off interrupts. (e) Switch from user to monitor mode. 2. [1] Some computer systems do not provide a privileged mode of operation in hardware. Consider whether it is possible to construct a secure operating system for these computers. Give arguments both that it is and that it is not possible. 3. [1] What is the main advantage of multiprogramming? 4. [2] Why are the locations of interrupt handles generally not stored in a linked list? 5. [1] The experimental Synthesis operating system has an assembler incorporated within the kernel. To optimize system-call performance, the kernel assembles routines within kernel space to minimize the path that the system call must take through the kernel. This approach is the antithesis of the layered approach, in which the path through the kernel is extended so that building the operating system is made easier. Discuss the pros and cons of the Synthesis approach to kernel design and to system-performance optimization. 6. [2] (Research Assignment) How do the Linux fork and clone system calls differ? How are they alike? 7. (Programming Assignment) Write a C/C++ program (call it string invert) that takes a string argument from the command line and outputs the string in reversed order. Here comes the twist: Each process can output at most one character. If you want to output more than a single character, you must fork off one or more processes in order to do that, and each of the forked processes in turn outputs a single character. After the call to program string invert with the command line argument, the output should appear, and no more processes should be running, in addition to the shell. Test your program on any UNIX/LINUX machine, and turn in the source code as part of the written assignment. (The source code should be at most a few lines long.)
References [1] A. Silberschatz, P. Galvin, and G. Gagne, Applied Operating Systems Concepts, John Wiley & Sons, Inc., New York, NY, 2000. [2] Deitel, Deitel, and Choffnes, Operating Systems, Pearson / Prentice Hall, 2004
1