Assignment 2
Introduction
Please answer the questions concisely and submit your assignment via sakai. Remember, please submit only plain text or pdf files (or html if within sakai's editor). Submissions in other formats (e.g., Word, Pages) will not be accepted.
Reading/skimming
- Week 2 lecture notes.
- Text:
- Chapter 2 (Operating System Structures) through 2.7.5.3, pages 55-86
- Chapter 3 (Processes), through 3.3.2, pages 105-122
- Chapter 4 (Threads). page 163-191
Papers (skim these) — discuss more details of system calls
- Kernel command using Linux system calls, M. Tim Jones, IBM developerWorks Technical Library, 2010
- System Calls, The Linux kernel, Andries Brouwer, aeb@cwi.nl, 2003
- SYSENTER Based System Call Mechanism in Linux 2.6, Manu Garg
Questions
- [text: 2.19] Why is the separation of mechanism and policy desirable?
- [text: 3.11] Explain the role of the init process on UNIX and Linux systems in regard to process termination.
-
Including the initial parent process,
how many processes are created by the following program?
#include <unistd.h> #include <stdio.h> int main(int argc, char **argv) { fork(); fork(); fork(); /* ... */ } -
Read
System Calls,
SYSENTER Based System Call Mechanism in Linux 2.6, and
Kernel command using Linux system calls.
(a) What mechanism did Linux used to use for invoking system calls (creating the mode switch) on the x86 Intel architecture?
(b) What mechanism is used to invoke system calls since the 2.6 kernel?
(c) Why was the system call mechanism changed? - [text: 4.9] Can a multithreaded solution using multiple user-level threads achieve better performance on a multiprocessor system than on a single- processor system? Explain.