Question 71
HardWhich of these must run in kernel mode?
- A.
Adding two numbers
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Operating Systems
Which of these must run in kernel mode?
Adding two numbers
Calling a library function like strlen()
Reading a local variable
Changing the page-table base register
Sign up free to see the answer and a step-by-step explanation.
What does the 'dual-mode' operation of a CPU (user and kernel modes) protect against?
Disk fragmentation
Power failures
User programs executing privileged instructions that could harm the system
Network attacks only
Sign up free to see the answer and a step-by-step explanation.
A program calls read() on a file. What happens if the data is not yet in memory?
read() returns random data
The program crashes
The process blocks while the kernel starts disk I/O and schedules another process
The CPU busy-waits in user mode
Sign up free to see the answer and a step-by-step explanation.
What is a daemon in Unix?
A kernel thread only
A virus
A background process that runs without a controlling terminal, often providing a service
A zombie process
Sign up free to see the answer and a step-by-step explanation.
Why does an operating system keep a separate kernel stack for each process?
To store file contents
To save memory
So that system calls and interrupts can run safely without trusting or corrupting the user stack
Because user stacks are read-only
Sign up free to see the answer and a step-by-step explanation.
What does the system call wait() return to a parent?
Always 0
The parent's own PID
The PID of a child that has terminated (and its exit status through an argument)
The number of open files
Sign up free to see the answer and a step-by-step explanation.
What is spooling, as in a print spooler?
Encrypting print jobs
Holding output for a slow device in a buffer (usually on disk) so programs can continue without waiting
Running two printers at once
Compressing documents
Sign up free to see the answer and a step-by-step explanation.
Which is true of interrupts compared with polling for I/O?
Interrupts let the CPU do other work until the device signals, while polling repeatedly checks the device
Polling always uses less CPU time
They are identical
Interrupts need the CPU to check the device in a loop
Sign up free to see the answer and a step-by-step explanation.
What is a process control block (PCB) used for during a context switch?
Printing the process list
Saving and restoring the process's registers, program counter and scheduling information
Holding the disk's free list
Storing the program's source code
Sign up free to see the answer and a step-by-step explanation.
What does the 'nice' value of a Linux process affect?
Its scheduling priority: a higher nice value means lower priority
Its network speed
Its file permissions
Its memory limit
Sign up free to see the answer and a step-by-step explanation.