1/101
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
What does the device controller cause an interrupt? a. When it starts the operation b. When it finishes its operation c. When the CPU requests I/O information from a device d. When the device produces data to be sent
When it finishes its operation
If our process divides by zero, an interrupt is invoked, the unique number 0 is associated with it. What is this number used for? a. The unique number zero represents the first interrupt service routine b. The number zero is used to correct the division and continue execution c. The number zero represents the memory address the interrupt service routine resides at d. Indexing the interrupt vector to find the correct memory address that points to the correct interrupt service routine
Indexing the interrupt vector to find the correct memory address that points to the correct interrupt service routine
Jesse is writing a program that will consistently use a variable named “counter”, counter will be incremented by 1 every time the function it is in is called. Where should the counter be stored in memory? a. Cache b. Register c. Main Memory d. Hard-Disk Drive
Register (if persistent across calls then static in main memory)
How many interrupts are generated when we use Direct Memory Access to move a block of data? a. 2 b. 3 c. 4 d. 1
1
What type of multiprocessing system has each processor assigned to a specific task? a. Asymmetric multiprocessing b. Symmetric multiprocessing c. Asymmetric cluster d. Symmetric cluster
Asymmetric multiprocessing
Which of the following is not a way to pass parameters to the operating system? a. Pass the parameters in registers b. Parameters are stored in a block, or table, in memory, and the address of the block is passed as a parameter in a register c. Parameters can be placed, or pushed, onto a stack by the program and popped off the stack by the operating system d. Parameters are stored in a queue and processed in a first in first out order by the operating system
Parameters are stored in a queue and processed in a first in first out order by the operating system
Jesse has an idea to create a new service where packets received from a network are filtered based on specific parameters. He wants this service to run at boot-time each time he loads the system. How might he implement this? a. Write a bash script that must be manually invoked b. Write a C program that automatically is ran by the Kernel at run time c. Write a kernel module that is linked in with the other services of the kernel d. Write a kernel module that is dynamically linked at runtime with other services of the kernel
Write a kernel module that is linked in with the other services of the kernel
Which of the following is not a part of an activation record? a. Global variables b. Function parameters c. Local variables d. Return address
Global variables
Which of the following is not a scheduling queue the process scheduler maintains? a. Job Queue b. Ready Queue c. Device Queue d. Message Queue
Message Queue
The system invokes a process that writes to a text file every 10 seconds the state of the system. Another process reads from this file to check to ensure everything is running smoothly. What type of processes are these? a. CPU bound processes b. I/O bound processes c. Memory bound processes d. Network bound processes
I/O bound processes
Which of the following is not one of the issues we may encounter from shared memory? a. Race conditions b. Deadlocks c. Buffer overflow d. Data inconsistency
Buffer overflow
Which of the following methods do not implement implicit threading a. Pthread_create() b. Thread pools c. OpenMP d. Grand Central Dispatch
Pthread_create()
I am running a process and I get stuck in an infinite loop, I input control+c on the keyboard. This generates a SIGINT which interrupts the process. What is this considered? a. Synchronous signal b. Nonmaskable interrupt c. Asynchronous signal d. Maskable interrupt
Asynchronous signal
Which of the following is an example of a direct system call in C? a. printf() b. scanf() c. malloc() d. socket()
socket()
Which of the following is not an issue that can occur from preemptive scheduling? a. Race conditions b. CPU monopolization c. Inconsistent data d. Interrupt during crucial OS activities
CPU monopolization
Using the formula below, please approximate the next CPU burst using the following: Jesse is trying to determine the next CPU burst that may occur in the system. He predicted the first burst was 6ms, but the actual burst was 10ms, his second prediction was 8ms, but the actual burst was 6ms. What will be his third CPU burst prediction? The alpha value is .5
7ms
Using Amdahl’s law, calculate the potential speedup of a program on two different systems. A program consists of 25% serial execution and 75% parallel execution. You want to run this program on a system with: i. 6 processing cores ii. 10 processing cores. What is the potential speedup for both systems, going to the third decimal place?
Speedup (6 cores) ≈ 2.667; Speedup (10 cores) ≈ 3.077
What is the operating system?
A program that acts as an intermediary between a user of a computer and the computer hardware
What are some goals of the operating system?
Execute user programs easily, make system convenient to use, efficient use of hardware
What are the components of a computer system?
Hardware, Operating system, Application programs, Users
Define what the operating system does depending on user view vs system view
User view: ease of use, performance, security. System view: resource allocator, control program
What is the kernel?
The core part of OS always running
What is the responsibility of the device controller?
Manage data transfer between device and its local buffer
When does it cause an interrupt?
When it finishes its operation
What is the purpose of the device driver?
Provide standard interface for OS to interact with hardware
What is an interrupt service routine (ISR)/what does it do?
Handles interrupt and returns control to interrupted instruction
What is an interrupt vector?
A table of pointers to service routines
How do we ensure we choose the correct interrupt service?
Use the interrupt’s unique number to index the interrupt vector
If we consider an operating system to be interrupt driven, what features are needed?
Deferred interrupt handling, efficient handler invocation, prioritization
What is a nonmaskable interrupt and maskable interrupt?
Nonmaskable: cannot be disabled (e.g. hardware fault). Maskable: can be disabled during critical code
What is caching? Why is it beneficial?
Cache = fast memory storing frequently accessed data. Benefit: faster access, fewer main memory operations
What is direct memory access (DMA)? What problem do we solve?
DMA lets device controller transfer whole block to memory with minimal CPU involvement, solves overhead of many interrupts
What is the job of a CPU core?
Execute instructions and maintain registers
What are the two types of multiprocessor systems?
Asymmetric multiprocessing, symmetric multiprocessing
What are the advantages of a multicore design?
Faster on-chip communication, lower power consumption vs multiple chips
In a clustered environment, what is graceful degradation and fault tolerance?
Graceful degradation: maintain reduced service in face of failures. Fault tolerance: continue operation despite individual component failure
What is an asymmetric cluster vs a symmetric cluster?
Asymmetric cluster: one hot-standby server monitors active; symmetric cluster: multiple active servers monitoring one another
What does a mode bit do? What are the two modes it allows us to switch between?
Mode bit distinguishes kernel mode (0) and user mode (1)
What is the difference between a program and a process?
Program: static instructions. Process: executing instance of program
What does the program counter do?
Holds the address of the next instruction to execute
How many program counters are needed for a single threaded process vs a multithreaded process
Single thread: one PC. Multi-threaded: one PC per thread
What is the purpose of cache coherency?
Ensure all CPUs see the most recent value in their caches
What is the difference between protection and security?
Protection: controlling access to resources. Security: defending system from threats
What are some methods of checking user and group control and access?
User ID, group ID, privilege escalation
What are some services the operating system provides?
User interface, program execution, I/O, file system, communications, error detection, resource allocation, logging, protection/security
Between I/O operations and File System Manipulation, how do we differ between reading from a network interface or writing to a file system?
Use socket/ networking syscalls vs file open/read/write syscalls
What are some resources that need to be allocated when we have multiple processes running concurrently?
CPU cycles, memory, file storage, I/O devices
What is a system call?
An interface provided to processes to request OS services
What is the purpose of the system call interface?
Link processes to OS services; syscall numbers index function table
What are the three methods used to pass parameters to the operating system? Why do we prefer the block or stack method?
In registers; via memory block; via stack. Prefer block or stack when parameters > registers
In C, when we invoke a printf() statement, what type of system call will be made?
write()
Describe the difference between a single task system and a multitask system
Single: one process at a time, reload shell when exit. Multitask: supports multiple processes concurrently via fork/exec
What are object files?
Relocatable binary code not yet loaded
What is a linker? What is a loader?
Linker: combines modules & libraries. Loader: loads executable into memory
When linking and loading, what does the activity relocation mean?
Adjust addresses in code/data based on load address
What are the steps that take place when we run a program using “./filename”?
Shell forks, exec loads program into child, child runs
Why is it beneficial to dynamically link libraries?
Load only libraries used, save memory and CPU
Why is there no one stop shop solution when developing an operating system? What are the requirements divided into?
Because system goals vary. Requirements split into user goals and system goals
What principle do we follow when designing and implementing an OS? What does it state?
Separation of policy and mechanism: mechanism defines how, policy defines what
What are the four ways an OS can be structured that we discussed?
Monolithic, layered, microkernel, modules
What are modules? Why might we use modules?
Kernel loadable components. Use to extend OS without rebuilding whole kernel
What are the sections of memory a process is divided into?
Text, Data, BSS, Heap, Stack
What is an activation record?
Data for function call: parameters, local variables, return address
What are the states a process may be in?
New, Ready, Running, Waiting/Sleeping, Zombie, Stopped, Terminated
What is a process control block? What does it serve as?
Data structure storing all info needed to manage a process (state, registers, memory, I/O info)
What are our two objectives with process scheduling?
Maximize CPU utilization (multiprogramming) and provide responsive time-sharing
What is a process scheduler? What happens if there are more processes than cores?
Selects a process to run on CPU. Excess processes wait in ready queue until a core becomes free
What are the three scheduling queues the process scheduler maintains?
Job Queue, Ready Queue, Device Queues
What does degree of multiprogramming mean?
Number of processes in memory concurrently
What does the CPU scheduler do?
Selects a process from ready queue and assigns it to CPU
What is an I/O bound process vs a CPU-bound process?
I/O bound: many short bursts, does I/O often. CPU bound: long CPU bursts, does computation mainly
What is a context switch?
Save current process state and restore another’s state on CPU
How are processes represented in the system?
Often in a tree (parent/child relationships)
When a process is created, how is it allocated resources?
It may inherit some of parent’s, request fresh ones, or share resources as defined by OS
What must a parent process do prior to terminating?
Wait for all its children to terminate (reap them)
What is the difference between an independent process and a cooperating process?
Independent: no data sharing. Cooperating: can share data or affect each other
What are some reasons we want process cooperation?
Information sharing, speedup, modularity
What are the two models of interprocess communication? How do they work?
Shared memory: processes share memory region. Message passing: OS mediates message send/receive
What are some synchronization issues we may encounter from shared memory?
Race conditions, deadlocks, data inconsistency
What is the producer-consumer paradigm? Why is it important when discussing interprocess communication?
Producer generates data, consumer uses it. Important for buffer management and synchronization
What is the method we discussed for indirect communication?
Mailboxes
Message passing may be either blocking or nonblocking. What is the difference between them/how do they work?
Blocking (synchronous): sender/receiver wait until op completes. Nonblocking (asynchronous): do not wait
How do remote procedure calls work?
RPC: caller sends message saying “execute function X with args Y” to remote process; remote does work and sends back result
What are the two types of pipes we covered? What do they do?
Anonymous pipes (unidirectional, between related processes) and named pipes/FIFOs (bidirectional or unidirectional between unrelated processes)
What is a thread? What is it composed of?
A thread is the smallest unit of execution; composed of program counter, stack, and registers
What is the difference in the term “concurrency” between a single core system and a multicore system?
Single core: concurrency via time-sharing (interleaving). Multicore: true parallel execution of concurrent tasks
What are the two types of parallelism? What do they focus on?
Data parallelism (same op on many data) and task parallelism (different tasks in parallel)
What are user threads? What are kernel threads?
User threads: managed in user space without kernel support. Kernel threads: managed and scheduled by kernel
What are the four relationships we discussed that must exist between user threads and kernel threads? How do they work?
Many-to-one, one-to-one, many-to-many, two-level
What is asynchronous threading and synchronous threading?
Synchronous: thread operations block until complete. Asynchronous: operations return immediately, completion happens later
What is the create/join strategy?
Threads are created; parent may join to wait for their termination before proceeding
What is the difference between implicit threading and explicit threading?
Explicit: programmer creates threads. Implicit: runtime/threading library handles threads automatically
What are three methods we covered when implementing implicit threading? What do they do?
Thread pools, OpenMP, Grand Central Dispatch – they abstract thread creation and scheduling for you
What is a signal? What is an asynchronous signal? What about a synchronous signal?
Signal is notification to a process of event. Asynchronous: comes from external event (e.g. keyboard). Synchronous: comes from process itself (e.g. divide by zero)
Every signal has a default signal handler that the kernel runs when handling that signal, what are some predefined default actions?
Terminate process, core dump, ignore, stop, continue
How do we know where to deliver a signal?
Kernel associates signal with process or specific thread based on type (synchronous signals go to thread generating them)
What is thread cancellation? a. Asynchronous cancellation? b. Deferred cancellation? c. What are some issues we can encounter?
Asynchronous: immediately terminate thread. Deferred: thread periodically checks cancellation point. Issues: resource leaks, inconsistent state
What is a lightweight process?
Kernel‐level thread or LWP: unit scheduling between user threads and kernel threads
What happens when an event triggers an upcall?
Kernel calls back into user thread library to invoke handler in user space
What is nonpreemptive scheduling? a. What is preemptive scheduling? b. What are some issues that can occur from both?
Nonpreemptive: process runs until it blocks/finishes. Preemptive: scheduler can interrupt process. Issues: with nonpreemptive, a process may monopolize CPU. With preemptive: race conditions, inconsistent data, interrupt during critical OS operations