CS604 Operating Systems Assignment 1 Solution Spring 2013

Question 1:
Let us point out some events that cause the kernel code to invoke in order to manage computer resources (like I/O devices memory and storage management) and control user programs to prevent errors and improper use of a computer system. Write their names.

[Marks : 02]

Solution:

There are four events that cause execution of a piece of code in the kernel. These events are: interrupt, trap, system call, and signal.

Question 2:
Operating System “XYZ” installed on a computing machine. .”ABC” serves as an intermediary between the hardware of the system and users. During the execution of a program or process, CPU generates different signals. You have to identify how do theses signals are handled by the operating system “XYZ”? [Marks : 03]

Solution:

A signal handler is just a function that you compile together with the rest of the program. Instead of directly invoking the function, you use signal or sigaction to tell the operating system to call it when a signal arrives. This is known as establishing the handler.
Question 3:
General Electric (GE) is leading electronic company .They have 10 thousand employees. At the end of each month they need to get payroll prints. Once payroll data are submitted to computer, left running without human interaction.
Being a student of operating system, you know OS is also scheduled the jobs. If there are numbers of jobs having same type and resource requirements that are ready to run. Keep in mind the above scenario, you need to identify in which system, these jobs are run easily. [Marks : 05]

Solution: Multi programed system is best according to the scenario
Question 4:
Categorize the following examples into Interrupt, signal and traps:
1. Ali is typing Alphabets in notepad by hitting keystroke.
2. Ayesha opening a folder from desktop by double clicking mouse.
3. Ahmad write a code in c language, like a=b/0.
4. Fatima is compiling a C program an error occurs Invalid memory access or buffer overflow.
5. While running a program ,you press <Ctrl-C>.
[Marks : 0
Solution:

1. Ali is typing Alphabets in notepad by hitting keystroke.

In terupt

2. Ayesha opening a folder from desktop by double clicking mouse.

 Interupt

3.Ahmad write a code in c language, like a=b/0.

 Trap

4. Fatima is compiling a C program an error occurs Invalid memory access or buffer overflow. Trap

5. While running a program ,you press <Ctrl-C>. Signal

DOWNLOAD SOLUTION HERE
loading...