Homework 1

Due 1/20/2012 [start of section]

Problem 1

Which of the following components is responsible for loading the initial value in the program counter for an application program before it starts running:

        * Compiler
        * Linker
        * Loader
        * Boot module or boot ROM

Problem 2

A hardware designer argues that there are enough transistors on the chip to provide 1024 integer registers and 512 floating point registers. You have been invited as the operating system guru to give opinion about the new design.

        1. What is the effect of having such a large number of registers on the operating system?
        2. What additional hardware features you would recommend added to the design above.
        3. What happens if the hardware designer also wants to add a 16-station pipeline into the CPU. How would that affect the context
            switching overhead?

Problem 3

What is the output of the following programs (inspect the manual for the system calls if you need more information, but please solve the problem without compiling and running the program).

Program 1:
main()
{
    val = 5;
    if(fork()){
        wait(&val);
        val = WIFEXITSTATUS(val);
   }
    val++;
    printf("%d\n", val);
    return val;
}

Program 2:
main()
{
    val = 5;
    if(fork()){
        wait(&val);
        val = WIFEXITSTATUS(val);
    }
    else
        exit(val);
    val++;
    printf("%d\n", val);
    return val;
}
 

Problem 4

Explain the steps that an operating system goes through when the CPU receives an interrupt.

Problem 5

Anderson and Dahlin OSPP Chapter: 1 Problem: 2a

Problem 6

Anderson and Dahlin OSPP Chapter: 1 Problem: 3

Problem 7

Anderson and Dahlin OSPP Chapter: 2 Problem: 1

Problem 8

Anderson and Dahlin OSPP Chapter: 2 Problem: 6