click below
click below
Normal Size Small Size show me how
OS
| Question | Answer |
|---|---|
| Why is turning off interrupts considered a privileged instruction? | It prevents unauthorized programs from monopolizing the CPU. |
| Which of the following instructions is a privileged instruction? | Set value of timer. |
| Which instruction must be executed in kernel mode to ensure system stability? | Modify entries in device-status table. |
| How does an operating system (OS) handle multiple interrupts occurring simultaneously? | It uses a priority-based system to handle higher-priority interrupts first. |
| What is a maskable interrupt? | An interrupt that can be ignored or delayed by the CPU by setting a bit in the interrupt mask register. |
| Which of the following are advantages and disadvantages of open-source operating systems (OS), and who would find each aspect beneficial or detrimental? | Advantages: Low cost, high customization, strong community support. Disadvantages: Limited commercial support, potential compatibility issues with proprietary software. Beneficiaries: Developers, small businesses, and tech enthusiasts. |
| Which of the following are general methods for passing parameters to the operating system? | Passing parameters through registers, using memory addresses, and pushing them onto the stack |
| What is the primary purpose of system programs in an operating system? | To provide a user-friendly interface for accessing system resources |
| What is a potential disadvantage of using the same system call interface for both files and devices? | It may introduce performance overhead due to the need for generic handling of devices |
| How do iOS and Android differ in terms of app distribution? | iOS apps can only be distributed through Apple's App Store, while Android apps can be downloaded from multiple app stores and websites. |
| Which system call is used by a process to wait for its child process to finish execution? | wait() |
| What is a primary advantage of iOS over Android? | iOS is more consistent in terms of user experience and software updates across devices. |
| Which of the following is an advantage of the message passing model over the shared memory model? | It eliminates the need for synchronization mechanisms |
| Consider the following C code: #include <sys/types.h> #include <stdio.h> #include <unistd.h> int value = 5; int main() { pid t pid; pid = fork(); if (pid == 0) { /* child process */ value += 15; return 0; } else if (pid | It is incremented by 15, changing its value to 20 in the child’s memory. |
| Consider the code below: #include <stdio.h> #include <unistd.h> int main() { /* fork a child process */ fork(); /* fork another child pro-cess */ fork(); /* and fork another */ fork(); return 0; } | 8 |
| How many total processes will be running after 3 fork() calls by the following program, including the initial process? #include <stdio.h> #include <unistd.h> int main() { int i; for (i = 0; i < 4; i++) fork(); return 0; } | 8 |
| How does stable storage (e.g., a disk log) help guarantee exactly once semantics for RPCs? | By tracking what RPC operations were received, performed, and their results |
| What happens during a context switch if the new context is already loaded in a register set? | The CPU changes the register-set pointer, making the switch very fast |
| Which of the following issues can arise when multiple processes try to access shared resources without proper synchronization? | Race conditions |
| When a context switch occurs, what must be done with the CPUs data and instruction caches? | They must be flushed to ensure the new process executes correctly |
| Which of the following is an architecture-specific operation that must be performed during a context switch? | Flushing data and instruction caches |
| In which scenario would kernel-level threads be more advantageous than user-level threads? | When a program needs to take full advantage of multiple CPU cores. |
| The Grand Central Dispatch system exibits task parallelism. | True |
| An application that creates photo thumbnails from a collection of images using a separate thread for each image primarily exhibits | data parallelism. |
| Consider the following code segment: pid t pid; pid = fork(); if (pid == 0) { /* child process */ fork(); thread create( . . .); } fork(); How many unique threads are created if each child process creates one thread using thread_create() | 2 |
| Which data structure does the kernel use to store the execution state of a thread during a context switch? | Thread Control Block (TCB) |
| In which situation would the operating system need to allocate a separate memory space for each entity? | When creating a process |
| The program shown below uses the Pthreads API. What would the output of the program be at LINE 1 if the code executes as expected? #include <pthread.h> #include <stdio.h> int value = 0; void *runner(void *param); /* the thread */ int main(int argc, | The child prints "value = 5" |
| Using a separate thread to generate a thumbnail for each photo in a collection exibits task parallelism. | False |
| Assume that an operating system (OS) maps user-level threads to the kernel using the many-to-many model and that the mapping is done through lightweight processes (LWPs). Furthermore, the system allows developers to create real-time threads for use in rea | A bound real-time thread is managed directly by the kernel scheduler |
| Which type of application benefits the most from a multithreaded solution on a single-processor system? | A web server handling multiple client requests with I/O operations |
| Processes and thread are treated in Linux as | unified tasks |
| Processes and thread are treated in Windows as | seperate data structures |
| Linux handles kernel management through | a single data structure to represent both possesses and threads |
| Windows handles kernel management through | seperate data structures called the process objects and the thread object, |
| The system call for the creation of a Linux processes or thread | clone(), |
| The system call for the creation of a Windows processes or thread | CreateProcess() for processes and CreateThread() for threads |
| Which of the following would most likely result in a voluntary context switch? | A process waiting for a network response to continue execution |
| If a process holds 10 tickets in a lottery and another holds 2 tickets, what is true about the CPU allocation? | The process with 10 tickets has a higher chance of getting CPU time. |
| Which of the following scheduling algorithms is most similar to an algorithm that favors processes with the least recent CPU usage? | Shortest Remaining Time First (SRTF) |
| What is the primary characteristic of the SCAN disk scheduling algorithm? | Moves the disk head in one direction servicing requests, then reverses direction |
| Why is rotational latency usually not considered in operating system-level disk scheduling? | The OS typically lacks access to the disk’s rotational position |
| Which of the following devices typically has the longest access latency? | Tape drive |
| A disk is considered a random-access device for: | Transfers large enough to minimize the effect of latency |
| Why is it important to balance I/O across multiple disks and controllers in a multitasking system? | To prevent any single component from becoming a bottleneck |
| Which of the following is a benefit of rereading code pages from the file system instead of using swap space? | Eliminates swap space overhead |
| How do systems generally improve reliability when implementing stable storage? | By storing redundant copies on different devices or locations |
| Why can RAID 1 offer better read performance than RAID 0? | Because it can read from multiple mirrored disks simultaneously |
| Which statement about RAID 1 is true? | RAID 1 stores data on multiple disks for fault tolerance |
| Why are HDDs commonly used for secondary storage? | They provide large storage capacity at low cost |
| Compared to NVM storage devices like SSDs, HDDs: | Maintain steady performance even when nearly full |
| How are NVM devices like SSDs typically used in smartphones and small electronics? | As surface-mounted components on motherboards |
| In C-SCAN, what happens when the disk head reaches the end of the disk? | It jumps to the beginning without servicing requests |
| Suppose that a disk drive has 200 cylinders, numbered 0 to 199. The drive is currently serving a request at cylinder 53 and the head movement is measured in total cylinders moved. The queue of pending requests, in FIGO order, is: 98, 183, 37, 122, 14, 124 | 59 |
| In a one-bit protocol, how does the device indicate it has processed the command? | It toggles the bit back to its original state |
| In which environment is pure polling most efficient? | In real-time systems with very fast I/O devices |
| Why can memory-mapped I/O simplify compiler and OS design? | Because device registers are treated like regular memory |
| Which is a typical use case for nonblocking I/O? | Real-time or interactive applications requiring immediate responsiveness |
| What is the primary reason the file allocation bitmap must be stored on mass storage? | To ensure data persists after power loss or shutdown |
| In a hybrid allocation method that starts with a contiguous area and adds linked overflow areas, what is the primary benefit over pure contiguous allocation? | Greater flexibility for file growth |
| What is one disadvantage of standard contiguous file allocation? | The file size must be preallocated and cannot grow easily |
| Which statement best describes indexed allocation for random file access? | It allows direct access to any block through the index with some lookup overhead |
| Where should the free-space list pointer be stored to avoid loss due to memory failure? | Persistently on disk, in filesystem metadata like the superblock |
| Why are languages like Java less prone to buffer-overflow attacks? | They have built-in bounds checking for arrays |
| What is the purpose of adding a salt to a user password? | To make password cracking attacks harder |
| What does a watchdog do when a program requests file access? | Checks and either grants or denies access |
| Which concern relates to operating system security? | Unauthorized data transfers prevention or logging |
| What makes a system vulnerable to man-in-the-middle attacks? | Unauthenticated session key exchange |
| Which key is used to encrypt in this scheme? | Public key |
| What benefit does separating partitions provide during system upgrades? | System upgrades can occur without erasing user data |
| Why use a counter with capability? | To limit number of accesses |
| What does a capability list contain? | Objects and allowed operations for each domain |
| In this scheme, which process has the most access? | Process with largest number |
| Which mechanism enforces limited access times? | Counter with capability |
| Why overwrite deleted sensitive files with random bits? | To prevent old data recovery |
| Why can’t capability hardware features be used for memory protection? | They only offer binary identification |
| Which function in Java sets privilege context? | doPrivileged() |
| The access-control matrix can be used to determine whether a process can switch from domain A to domain B. What must be included for this to be equivalent to domain A having domain B's access? | The matrix must include both access rights and switch privileges of domain B in domain A |
| Why must HTTP use a reliable transport protocol like TCP? | Because web resources must be delivered completely and correctly |
| Why might reliable message delivery at the lowest layer be unnecessary for some applications? | Some applications, like real-time video, can tolerate packet loss |
| Why do many network protocols implement fewer than the seven OSI layers? | To reduce complexity by combining functionalities |