System Call: Using actual Linux system calls as examples, explain what sort of tasks an operating system will perform on behalf of a process?

Question 1 (marks 25) A “system call” is used by a process to request that the operating system perform a task on behalf of the process. 7 marks • Using actual Linux system calls as examples, explain what sort of tasks an operating system will perform on behalf of a process? 7 marks • Why is it necessary that the operating system performs tasks and not the process itself? • The system call interface is presented to the programmer as a library of standard functions calls, with standard parameter lists. Linux and MacOS has over 300 system calls. 5 marks – Explain how these functions notify the operating system that a service is being requested of it, and 6 marks – Explain the methods used to identify the system call and to pass the function parameters to the operating system. Question 2 (marks 25) To answer the following questions you will need to do some research— 6 marks a. What is a hash map? 6 marks b. Using an example, explain the purpose of the hash function used with a hash map? 5 marks c. What are the properties of a good hash function? 8 marks d. Discuss at least two methods used to resolve the problem when a hash function produces collisions. 4 Question 3 (marks 25) 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); } } 11 marks a. Explain what is happening within the for-loop. Your explanation must explain the purpose and effect of the three system calls. 7 marks b. Including the initial parent process, how many processes are created. (To answer this question do not supply just the number of processes—explain your reasoning). Note: the answer is not 4. 7 marks c. How many unique threads are created? (To answer this question do not supply just the number of threads—explain your reasoning. Also remember, the initial process is thread 1). Question 4 (marks 25) 7 marks a. What is the purpose of interrupts? Why are they a critical concept of modern computers? 6 marks b. How does an interrupt differ from a trap? 6 marks c. Can traps be generated intentionally by a user program? If so, for what purpose? Give examples. 6 marks d. What is the purpose of a timer? Why is a timer a critical component of modern computers? 

Click here to request for this assignment help

Powered by WordPress | Designed by: photography charlottesville va | Thanks to ppc software, penny auction and larry goins