Introduction to Operating Systems Nptel Week 4 Answers

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

Course Link: Click Here


Introduction to Operating Systems Nptel Week 4 Answers
Introduction to Operating Systems Nptel Week 4 Answers

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


1. When an interrupt occurs, the privilege level at the CPU is changed to __ from .
a) ring 0, ring 3
b) ring 1, ring 2
c) ring 2, ring 1
d) ring 3, ring 0

Answer: a) ring 0, ring 3


2. Which of the following acts as a cache for page table mappings?
a) TLB
b) DCache
c) GDT
d) LDT

Answer:a) TLB


3. State True or False: INTR is the instruction used in x86 to generate software interrupts.
a) True
b) False

Answer:b) False


4. A system has 5 processes, where the scheduling used is non-preemptive. What is the total number of scheduling possible-____?

Answer: a) 120


5. The number returned by a successful “write” system call handler indicates:
a) The number of bytes written to the file descriptor
b) The return status of the system call
c) The system call number for write
d) None of the above

Answer: a) The number of bytes written to the file descriptor


6. State True or False: Kernel stack is used to store the function arguments during system calls.
a) True
b) False

Answer: b) False


7. What is the minimum number of traditional 8 input pin PICs required to interface 32 devices with CPU?
a) 8
b) 4
c) 32
d) 2

Answer:b) 4


8. State True or False: Stack switching happens during nested interrupt handling.
a) True
b) False

Answer: a) True


9. Consider a system having 5 CPUs, 9 processes. The upper bound of the number of processes in the RUNNING state is __, and BLOCKED states is _. (write the option such that the first is the answer for the first blank, and the second is for the second blank)

Answer: 5.4


10. What are the data structures used to obtain the interrupt handler of an interrupt?
a) IDT alone
b) GDT alone
c) Both IDT and GDT
d) stack

Answer: a) IDT alone


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 4 Answers (July-Dec 2023)

Course Name: Introduction to Operating Systems

Course Link: Click Here


Q1. Let the number of bits for Interrupt gate descriptor be 48, ie 32:16 (segment selector:offset). Each entry in the interrupt descriptor table is 5 Bytes. What will the total size of the IDT in bytes ?
1256
1024
1020
1280

Answer: 1280


Q2. State True or False
The user to kernel stack switching is done using Task Segment Descriptor, by changing SS to SS1 and ESP to ESP1

True
False

Answer: False


Q3. Which of the following is FALSE.
An interrupt occurs in the protected mode.

Determine the IRQ number from the interrupt controller.
Switch from user to kernel stack
Save the process states.
None of these

Answer: Switch from user to kernel stack


These are Introduction to Operating Systems NPTEL Week 4 Assignment Answers


Q4. Interrupt vector number used for system call is xv6 _.
16
32
48
64

Answer: 64


Q5. What does the the system call sys_uptime() return?
Time the when system call is invoked.
Time since the start of the process
The number of clock ticks interrupts that have occurred since the start.
Maximum time the interrupt taken to complete execution.

Answer: The number of clock ticks interrupts that have occurred since the start.


Q6. The signal sent from the processor to the device after receiving an interrupt is
Interrupt-acknowledge
Return signal
Service signal
Permission signal

Answer: Interrupt-acknowledge


These are Introduction to Operating Systems NPTEL Week 4 Assignment Answers


Q7. The return address from the interrupt-service routine is stored on the
Interrupt handler
Processor register
Kernel stack
Memory

Answer: Kernel stack


Q8. Which of the following are TRUE in a multiprogrammed OS?
a. More than one program can be in the ready state at the same time.
b. When a program exits, other programs are loaded into ready queue immediately.
c. After a software interrupt occurred, a process in the ready queue may switch to running state
d. If a higher priority process is present in the ready queue, then the running process will immediately switching from running to ready state.

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

Answer: a, c, d


Q9. Which of the following does not interrupt a running process?
A device
Timer
Power Failure
None of the above

Answer: None of the above


These are Introduction to Operating Systems NPTEL Week 4 Assignment Answers


Q10. State True/False for each of the following statements.
1. In a multitasking operating system, interrupt (either software, hardware, or exception) is required for the operating system to execute.
2. A context switching occurs whenever the OS executes.

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

Answer: True,False


Q11. Which of the following need not necessarily be saved when context switch occurs?
Registers
TLB
Program counter
None of the above

Answer: TLB


Q12. Consider a system having n CPUs, k processes, and k > n. Calculate the upper bound for the number of processes in the READY, RUNNING and BLOCKED states
k, k, k
n, n, n
k, k , n
k, n, k

Answer: k, n, k


These are Introduction to Operating Systems NPTEL Week 4 Assignment Answers


Q13. State True or False
Double fault is a fault that occurs when a CPU is trying to call an exception handler.

True
False

Answer: True


Q14. Devices that turn on interrupt in xv6?
UART
IDE
Keyboard
All of these

Answer: All of these


Q15. Match the following
Trapframe 1. Overflow
Trap 2. Difficult to recover
Fault 3. Restore the context
Abort 4. Segment not present

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

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


More Weeks of Introduction to Operating Systems: Click here

More Nptel Courses: Click here


Introduction to Operating Systems NPTEL Week 4 Answers (Jan-Apr 2023)

Link of course: Click here


Q1. A double fault is a fault that occurs when a CPU is trying to call an exception handler.
a. True
b. False

Answer: b. False


Q2. Arrange in order of occurrence
a) Obtain the IRQ number from the interrupt controller
b) I/O APIC transfer interrupt to Local APIC.
c) Save the program states
d)Local APIC assert the CPU interrupt

Answer: d, b, c, a


Q3. A system n processes, and with a non preemptive scheduler. What is the total number of scheduling possible?
a. n
b. n!
c. n(n-1)
d. 2^n

Answer: c. n(n-1)


Q4. When a CPU is interrupted, it
a. Stops executing instructions
b. Acknowledge interrupt and continues
c. Acknowledge interrupt and branches to a subroutine
d. Acknowledge interrupt and waits for the next instruction from the interrupted device

Answer: Acknowledge interrupt and waits for the next instruction from the interrupted device


These are Introduction to Operating Systems NPTEL Week 4 Assignment Answers


Consider a system having n CPUs, k processes, and k > n. Calculate the upper bound and lower bound for the number of processes in the RUNNING, READY and BLOCKED states.

Q5. The upper bound is :
a. k, k, k
b. n, k, k
c. k, k , n
d. k, n, k

Answer: n, k, k


Q6. The lower bound is :
a. 1, 1, 1
b. 0, 0, 0
c. 0, 1 , 1
d. 1, 1, 0

Answer: d. 1, 1, 0


These are Introduction to Operating Systems NPTEL Week 4 Assignment Answers


Q7. Six bytes are required to store the Interrupt gate descriptor in Intel’s 80386 processor. Each descriptor comprises of 32 bits for the segment
selector and 16 bits for the offset(segment selector:offset). What is the total size in bytes of the interrupt descriptor table (IDT)?

a. 1256
b. 1024
c. 1536
d. 1280

Answer: c. 1536


These are Introduction to Operating Systems NPTEL Week 4 Assignment Answers


Q8. Which one of the following is FALSE?
a. Kernel level threads cannot share the code segment
b. User level threads are not scheduled by the kernel
c. Context switching between user level threads is faster than context switching between kernel level threads
d. When a user level thread is blocked, all other threads of its process are blocked

Answer: a. Kernel level threads cannot share the code segment


Q9. Context switching is not required for a system without multi programmed OS
a. True
b. False

Answer: a. True


These are Introduction to Operating Systems Week 4 Assignment Answers


Q10. 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: b. User stack is used to store the function details during function calls


These are Introduction to Operating Systems NPTEL Week 4 Assignment Answers


Q11. Match the following
a) a-3, b-1 c-4, d-2
b) a-3, b-4,c-1, d-3
c) a-4, b-1, c-4, d-2
d) a-4, b-3, c-2, d -1

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


These are Introduction to Operating Systems NPTEL Week 4 Assignment Answers