Introduction to Operating Systems Nptel Week 3 Answers

Are you looking for Introduction to Operating Systems Nptel Week 3 Answers? You’ve come to the right place! Access the latest and most accurate solutions for your Week 3 assignment in the Introduction to Operating Systems course.

Course Link: Click Here



Introduction to Operating Systems Nptel Week 3 Answers
Introduction to Operating Systems Nptel Week 3 Answers

Introduction to Operating Systems Nptel Week 3 Answers (July-Dec 2024)


Q1.If the MAX_SIZE is 0x20000000, the virtual address of a kernel variable is 0x2fffffff, and the Physical memory starts from 0x00000000, then the Physical address of the kernel variable will be _.
0xffffffff
0x00ffffff
0x0fffffff
0xffffff

Answer: 0x0fffffff


Q2.The kernel pages in Physical and Virtual Address space are mapped randomly.
True
False

Answer: False


For answers or latest updates join our telegram channel: Click here to join

These are Introduction to Operating Systems Nptel Week 3 Answers


Q3.There are multiple copies of kernel in the Physical Address space but there is only one copy of kernel in Virtual Address space from where all the processes share it.
True
False

Answer: False


Q4.There are two processes currently in a system. Process A has no I/O operations, process B has an I/O operation that reads the input from the keyboard. When Process A pre-empts process B (not executing I/O) process B goes from to _.
Ready, Running
Ready, Runnable
Running, Ready
Blocked, Runnable

Answer: Running, Ready


For answers or latest updates join our telegram channel: Click here to join

These are Introduction to Operating Systems Nptel Week 3 Answers


Q5There are two processes currently in a system. Process A has no I/O operations, process B has an I/O operation that reads input from the keyboard. When Process B executes the I/O, and Process A goes from to _.
Running, Ready
Ready, Runnable
Ready. Running
Blocked, Runnable

Answer: Ready. Running


Q6.When a child is being created from a parent using the fork() system call initially the state of the process is set to READY state and before the fork() system call returns the state is changed to RUNNING.
True
False

Answer: False


For answers or latest updates join our telegram channel: Click here to join

These are Introduction to Operating Systems Nptel Week 3 Answers


Q7.When a child process is created using the fork() system call, its state is set to running.
True
False

Answer: False


Q8.A zombie process is used to remove the reaper processes created on termination, which if not controlled, might lead to infinite resource leakage.
True
False

Answer: False


For answers or latest updates join our telegram channel: Click here to join

These are Introduction to Operating Systems Nptel Week 3 Answers


Q9.I. The value of all the registers are same for parent and child process except for the registers %eip and %ebp
II. forkret changes only the %eip of child
I- False, II- True
I- False, II- False
I- True, II – True
I- True, II – False

Answer: I- False, II- True


Q10. -s flag of the readelf utility shows details about ___.
Syntax errors
Symbol table
Semantics
Headers

See also  Introduction To Operating Systems NPTEL Week 3 Assignment

Answer: Symbol table


For answers or latest updates join our telegram channel: Click here to join

These are Introduction to Operating Systems Nptel Week 3 Answers


All weeks of Introduction to Operating Systems: Click Here

For answers to additional Nptel courses, please refer to this link: NPTEL Assignment Answers


Introduction to Operating Systems Nptel Week 3 Answers (July-Dec 2023)

Course Name: Introduction to Operating Systems

Course Link: Click Here

These are Introduction to Operating Systems NPTEL Week 3 Assignment Answers


Q1. Match the following
a. Inode 1) The pid is assigned to a process
b. New state 2)Never exits
c. Trapframe 3)Stores metadata
d. init 4) For restarting a process after a context switch

a-4, b-2, c-3, d-1
a-3, b-4, c-2, d-1
a-4, b-1, c-2, d-3
a-3, b-1, c-4, d-2

Answer: a-3, b-1, c-4, d-2


Q2. We have n number of fork system calls, denoted as nXfork(). What is the total number of process created?
n
2^n
2^(n-1)
(2^n) – 1

Answer: 2^n


Q3. State True/ False
The process whose parent exited before the child is an orphan process. Can a process can be Zombie and Orphan at the same time.

True
False

Answer: False


These are Introduction to Operating Systems NPTEL Week 3Assignment Answers


Q4. What is the output of the following program for any value of a
u =x+5
x=u+5
x=u+10
u=x+10

Answer: u =x+5


Q5. Which of the below statement is false.
Init is the first process created using booting
Init process is a daemon process.
Init process have process identifier as 1
None of these

Answer: None of these


Q6. A student have written a program and used pid = fork() function call in it. The pid returned by the fork was 5119. Which of the following is true about the process invoking fork?
Process is a parent process with pid = 5119
Process is a child process. Its Parent’s pid is 5119
The process is a parent process. Its Child’s pid is 5119
Process is a child process with pid = 5119

Answer: The process is a parent process. Its Child’s pid is 5119


These are Introduction to Operating Systems NPTEL Week 3 Assignment Answers


Q7. Which of the following is false?
Process : Contains code+data+heap+stack+process state
Program : One program can be used to create many processes
Process : Process is not a unique isolated entity
Program : Code + Static and Global data

Answer: Process : Process is not a unique isolated entity


Q8. The state transition that occurs due to the scanf system call in the program is ______.
NEW -> READY
READY -> RUNNING
RUNNING -> BLOCKED
BLOCKED -> READY

Answer: RUNNING -> BLOCKED


Q9. Which one of the following is the property of Operating system that helps to prevent attacks?
i)Rings
ii) a separate stack for the kernel
iii)Virtual memory
iv) Shared Libraries

i
i, ii
i, ii, iii
i, ii, iii, iv

Answer: i, ii


These are Introduction to Operating Systems NPTEL Week 3 Assignment Answers


Q10. State True or False.
1. If the parent and the child process share the same page table. Does this mean they share the same page frames in the RAM?
2. COW creates a copy of the shared pages if it changes. All further changes are made in this new page.

True, False
False, True
False, False
True, True

See also  Introduction to Operating Systems Nptel Week 8 Answers

Answer: True, True


Q11. Match the following
a. Init.d 1) Created when system call occurs
b. Zombie 2) The %eax register is cleared when this is created
c. Child process 3) Created by kernel while booting
d. Trapframe 4) Allows a parent process to read the status of child

a-1, b-2, c-3, d-4
a-3, b-4, c-2, d-1
a-2, b-1, c-4, d-3
a-4, b-3, c-1, d-2

Answer: a-3, b-4, c-2, d-1


Q12. State True/False
In memory mapping, the entire kernel is mapped into process’ address space, which helps the user process to easily access the kernel data.

True
False

Answer: False


These are Introduction to Operating Systems NPTEL Week 3 Assignment Answers


Q13. Arrange the following in order
a. Change state to runnable
b. Copy page directory contents from parent to child process
c. Copy the trapframe from the parent process
d. Change state to embryo

a, c, b, d
c, d, a, b
d, b, c, a
a, c, b, d

Answer: d, b, c, a


Q14. wait() system call inside the parent process returns the status of the child. What does it returns when it is called inside the child?
Returns -1 , when it is not the parent of any other process
Returns its own process id
Returns the exit status of the parent currently exited.
None of these.

Answer: Returns -1 , when it is not the parent of any other process


Q15. State True/False
execlp() system call replaces the child process with a new program file, but the process ID will not change.

True
False

Answer: True


These are Introduction to Operating Systems NPTEL Week 3 Assignment Answers

More Weeks of Introduction to Operating Systems: Click here

More Nptel Courses: Click here


Introduction to Operating Systems Nptel Week 3 Answers (Jan-Apr 2023)

Course Name: Introduction To Operating Systems

Link of course: Click here


Q1) int main(){

int i, n;

for(i=1;i<n; i++){

if (fork() == 0)

printf(“OS”);

printf(“NPTEL”);

}

Number of times OS and NPTEL printed ?

a. 2^n and 2^n

b. 2^(n-1) and 2^(n-1)

c. 2^(n-1)-1 and 2^(n-1)

d. 2^n and 2^(n-1)

Answer: c. 2^(n-1)-1 and 2^(n-1)


These are Introduction to Operating Systems NPTEL Week 3 Assignment Answers


Q2) State True or False.

A program to compute the sum of first 5,000 numbers can be divided into 4 sub parts and executed on 4 CPUs using either fork or threads. The reason why we prefer fork is because large portions of the data/code between the 4 sub-parts are very similar and need not be duplicated.

a. True

b.False

Answer: a. True


These are Introduction to Operating Systems NPTEL Week 3 Assignment Answers


Q3) Match the following :

1.NEW A. Waiting for an i/o

2.READY B. Currently Executing

3.RUNNING C. Process is being created

4.SLEEPING D. waiting to be picked up by scheduler

a. 1-A, 2-D, 3-B, 4-C

b. 1-C, 2-B, 3-D, 4-A

c. 1-A, 2-C, 3-D, 4-B

See also  Introduction to Operating Systems Nptel Week 2 Answers

d. 1-C, 2-D, 3-B, 4-A

Answer: d. 1-C, 2-D, 3-B, 4-A


These are Introduction to Operating Systems NPTEL Week 3 Assignment Answers


Q4) State True or False for a process currently in RUNNING state. A software interrupt will result in the change to ring 1.

a. True

b. False

Answer: b. False


Q5) State True or False. In the absence of system calls, a user process can never dynamically allocate memory.

a. True

b. False

Answer: a. True


These are Introduction to Operating Systems NPTEL Week 3 Assignment Answers


Q6) The wait() system call inside the parent process returns the pid of an exiting child process. Which of the following best fits when wait is called inside the child process?

a. Returns -1, when the child is not the parent of any other process

b. Returns its own process id.

c. Returns the exit status of the parent currently exited.

d. Such a call is not feasible and is likely to crash the process.

Answer: a. Returns -1, when the child is not the parent of any other process


These are Introduction to Operating Systems NPTEL Week 3 Assignment Answers


Q7) A student has written a program and used pid = fork() function call in it. The pid returned by the fork was 5129. Which of the following is true about the process invoking fork?

a. Process is a parent process with pid=5129

b. Process is a child process. Its Parent’s pid is 5129

c. The process is a parent process. Its Child’s pid is 5129

d. Process is a child process with pid = 5129

Answer: c. The process is a parent process. Its Child’s pid is 5129


Q8) State True/False

When the child process state is set to Zombie, all page directories and the kernel are also deallocated.

a. True

b. False

Answer: b. False


These are Introduction to Operating Systems NPTEL Week 3 Assignment Answers


Q9) Which of the below statement is False.

a. Kernel stack can be used to store the context of a process.

b. User stack is used to store the function details during function calls.

c. Kernel stack is used to store the function arguments during systems calls.

d. Context of the process is useful to restart the process after some time.

Answer: d. Context of the process is useful to restart the process after some time.


These are Introduction to Operating Systems NPTEL Week 3 Assignment Answers


Q10) What is the output in the parent process? int main() { int a=0, pid; pid = fork(); if(pid == 0){ a= a – 10; printf(“u = %d\n”, a); } else{ a= a + 10; printf(“x = %d\n”,a); } }

a. U = -10

b. X = 10

c. x=0

d. U = 10

Answer: b. X = 10