What is the purpose of interrupts why are they a critical


Question 1

A "system call" is used by a process to request that the operating system perform a t ask on behalf of the process.
- Using actual Linux system calls as examples, explain what sort of t asks an operating system will perform on behalf of a process?
- Why is it necessary that the operating system performs t asks and not the process it self?
- The system call interface is presented to the programmer as a library of standard functions calls, with standard parameter list s. Linux and MacOS has over 300 system calls.
- Explain how these functions notify the operating system that a service is being requested of it , and
- Explain the methods used to identify the system call and to pass the function parameters to the operating system.

Question 2

To answer the following questions you will need to do some research-

a. What is a hash map?
b. Using an example, explain the purpose of the hash function used with a hash map?
c. What are the properties of a good hash function?
d. Discuss at least two methods used to resolve the problem when a hash function produces collisions.

Question 3

Consider the following code:
#include #include #include
void *my_function(void *param); int main()
{
int i; pthread_t tid; pid_t pid;

for(i=0; i<3; i++) { pid = fork();
pthread_create(&tid,NULL,my_function,NULL); pthread_join(tid,NULL);

}
}

a. Explain what is happening within the for-loop. Your ex- planation must explain the purpose and e ect of the three system calls.
b. Including the init ial parent process, how many processes are created. (To answer this question do not supply just the number of processes-explain your reasoning).
N ot e: the answer is not 4.
c. How many unique threads are created? (To answer this ques- t ion do not supply just the number of threads-explain your reasoning. Also remember, the init ial process is thread 1).

Question 4

a. What is the purpose of interrupts? Why are they a critical concept of modern computers?
b. How does an interrupt differ from a trap?
c. Cant raps be generated intentionally by a user program? If so, for what purpose? Give examples.
d. What is the purpose of a timer? Why is a timer a critical component of modern computers?

Solution Preview :

Prepared by a verified Expert
Operating System: What is the purpose of interrupts why are they a critical
Reference No:- TGS02878385

Now Priced at $40 (50% Discount)

Recommended (93%)

Rated (4.5/5)