Operating Systems Concepts: A Quiz
What is the main function of timer interrupts?
- They notify the system a given time interval has elapsed since the timer was set.
Delaying disk–or SSD–writes:
- May result in lost data if the system crashes.
Accessing the disk drive of your computer is approximately:
- 100,000 times slower than accessing its main memory.
- 100,000 times slower than accessing its main memory.
Which hardware mechanism allows a device to notify the CPU of an event?
- Interrupts
Memory protection is normally done through privileged instructions.
- False
A computer not having privileged instructions cannot prevent its users from tampering, accidentally or otherwise, with its file system.
- True
Real-time applications with “soft deadlines” have fuzzy deadlines.
- False
In a “symmetric” multiprocessor organization, there can be several copies of the kernel running at the same time.
- True
What is the main disadvantage of “modular kernels” compared to other kernel organizations?
- They are less reliable.
The kernels of virtual machines typically operate in “privileged mode”.
- False
Consider a process:
The three states it will visit are:- Running, Blocked, Ready
Which processes should we suspend first when we need to make space in main memory?
- Blocked
How many lines will the following program print out?
- 2
What happens when a UNIX process issues a wait() system call and all its child processes have already terminated?
- It continues its execution without further delay.
Which LINUX system call sends a signal to another process?
- kill()
What is the “default action” a LINUX process takes when it receives a signal from another process?
- It terminates.
What are the two major disadvantages of user–
Level threads over kernel-supported threads?- They can only run on a single core.
- Each time a thread does a blocking system call, the kernel will move the whole process to the blocked state.
Which of the following statements apply to the “program.Cs.Uh.Edu” server?
- Both A and B. (It is an interactive system and a time-sharing system.)
Which of these events can move a process from the “running” state to the “ready” state?
- Both A and B. (The arrival in the ready state of a higher-priority process and a timer interrupt.)
In a “vectorized interrupt” system, an interrupt can only be interrupted by an interrupt of “higher priority”.
- True
What is the major reason for the success of “modular kernels”?
- They let users add extensions to the kernel.
How many lines will the following program print?
- 3
Which of the following statements about the “fork()” system call is FALSE?
- fork() returns zero in the parents process.
Each process has its own “process control block”
- True
In which queue is a newly created process initially put?
- Ready queue
The “execv()” system call creates a new process.
- False
A process in the “blocked state” can only move from that state to the:
- Ready state.
Which of the following operating systems is NOT derived from UNIX?
- Windows
A program in execution is called:
- A process
The first computer system with a graphical user interface was:
- Alto from Xerox PARC.
What characterizes a time-sharing system?
- It lets multiple users access the computer at the same time.
Direct memory access (DMA):
- Allows the disk controller to access the main memory without any CPU intervention.
Some “soft real-time” systems do NOT have fixed deadlines.
- False
What is the main advantage of modular kernels?
- They let users add extensions to the kernel.
How many lines will the following program print?
- 2
In a modern computer system, most small read operations can be completed WITHOUT any disk access.
- True
You notice that the kernel of your operating system starts suspending too many processes. What can you infer from that?
- Your computer does not have enough RAM.
What is the main advantage of copy-on-write (COW)?
- It reduces the cost of the fork() system call.
What does the signal() system call do?
- It specifies what a process will do when it receives a signal.
How do user-level threads handle blocking system calls?
- All the threads of the task are moved to the blocked state.
A process in the READY state can only move from that state to the:
- RUNNING state
What are zombie processes?
- Terminated processes that have not been waited on by their parent.
How is memory protection typically implemented?
- Through the memory management unit of the computer.
How do kernel-supported threads handle blocking system calls?
- The thread issuing the call is moved to the blocked state.
In a dual-mode CPU, how can the CPU switch from user mode to privileged mode?
- Through the interrupt mechanism.
What would be the main drawback of a system lacking timer interrupts?
- It would let CPU-bound processes occupy cores for as long as they can.
What came first?
- Batch systems
What is the main disadvantage of the flash drive?
- They wear down after a limited number of write cycles.
What is the main advantage of delayed writes?
- They reduce the number of physical disk accesses.
What is the main reason for having privileged instructions?
- To prevent user processes from directly accessing the system storage units.
Soft real-time systems do NOT have hard deadlines.
- False
In which mode does a kernel of a virtual machine run?
- User mode.
In which state does a process go when it waits for the completion of a system request?
- BLOCKED state.
What happens when a process is swapped out?
- The process is expelled from main memory and a copy of its address space is saved on disk SSD.
How many lines will the following program print?
- 3
Consider the argument vector corresponding to the shell command: $ ls 3360. What is the sole possible values for argv[0]?
- ls
Why are lightweight processes much cheaper to create than regular processes?
- Because we do not have to create a new address space for the new process.
In which language is most of the LINUX kernel written?
- C
Why is memory protection always implemented in hardware?
- Because it is the only way to make it fast enough
What happens when the kernel of a virtual machine attempts to execute a privileged instruction?
- The attempt will be trapped and the hypervisor will take control of the system.
Why is Linux an ideal platform for system research?
- Because it is free and its source code is available.
Which are the only entities UNIX/Linux processes share with their parent?
- The file descriptors of all opened files.
Why is the kill() system call called that way?
- Because it terminates the process it was sent to (unless that process can catch it).
What is the main disadvantage of CPUs not having a privileged mode?
- Because it allows all processes to execute all instructions, including those that access their secondary store.
What is the main advantage of using copy-on-write in fork() system calls?
- Reduces the cost of the fork() call by minimizing the number of pages needed to be copied.
What is the main feature of signal number 9 (SIGKILL)?
- It always terminates the process that it is sent to as it cannot be caught.
How many lines will the following program print?
- 6
Consider the argument vector that your UNIX/Linux shell will pass to ls when you type: $ vim Assignment1.Cpp. What are the respective values of: – argv[0] – argv[2]
- “vim” NULL
Processes that request a blocking system call go to the __________________ state.
- BLOCKED
After that request is completed, they return to the ___________________ state.
- READY
What is the main advantage of all lightweight processes over regular processes?
- They have a much lower creation overhead as regular processes because they share the address space of their parent.
How many lines will the following program print?
- 8
Consider the argument vector that your UNIX/Linux shell will pass to ls when you type: $ ls -alg Assignment1. What are the respective values of: – argv[0] – argv[3]
- “ls” NULL
Processes that have exceeded their time slice of CPU time must leave the ___________ state and return to the ___________ state.
- RUNNING READY
What should the OS do then there is not enough free memory?
- Start swapping processes
Which processes are the best candidates for swapping out processes?
- BLOCKED processes and very low priority processes
What should the CPU do when it detects an interrupt?
- The CPU should save its current state and fetch a new state
What would happen to a computer system lacking a DMA controller?
- The data transfer between its secondary store and its main memory would be much slower
What is the main reason for the lack of layered kernels?
- It is very difficult to partition a kernel into hierarchical layers
The Windows OS is:
- Fast, extensive, but not as reliable
What will happen when the kernel of a virtual machine attempts to execute a privileged instruction?
- An interrupt will occur and the VM hypervisor will take take control, which will allow it to perform the physical equivalent of the action attempted by the VM kernel
When a process issues an I/O request, it goes from the ________________ state to the ___________________ state.
- RUNNING BLOCKED
Add the three system calls that will ensure that the program will print EXACTLY ONCE, “Hello World!” and “Goodbye!” in that order.
- fork() _exit(0) wait(0)
In the round-robin scheduling policy, the priority of a process is a function of its past CPU storage.
- False
In a typical multi-level scheduler, the CPU-bound processes will be assigned:
- Low priority, large time slice
Why do most operating systems keep in memory all the file blocks that were recently accessed?
- Because these blocks are likely to be accessed again in the near future
What is the main advantage of the symmetric organization for multiprocessor operating systems?
- Kernel calls are much less likely to create a bottleneck, as the kernel can now run in parallel on every processor
In virtual machine setup, the kernels of the virtual machines run in _____________________ mode while the kernel of the host OS/hypervisor runs in _____________________ mode.
- USER PRIVILEGED
