1/24
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai | Chat |
|---|
No analytics yet
Send a link to your students to track their progress
Which IPC approaches utilize buffering?
POSIX pipes and message queues.
Which IPC approach respects message boundaries?
Message queues. Pipes are byte streams and do not preserve message boundaries.
Which IPC approaches support bidirectional communication?
Message queues and shared memory. A POSIX pipe is unidirectional.
IPC via Shared Memory: What are its main communication properties?
No message buffering, no message boundaries, direct communication through shared memory, and bidirectional communication.
IPC via Message Queues: What are its main communication properties?
Has buffering, preserves message boundaries, uses indirect communication through a named queue, and supports bidirectional communication.
How does the OS quickly know all the processes in the Ready state?
It maintains a ready queue containing the processes that are ready to run.
IPC via POSIX Pipes: What are its main communication properties?
Has buffering, does not preserve message boundaries, uses indirect communication, and is unidirectional.
Are POSIX pipes unidirectional or bidirectional?
Unidirectional. Data travels from the write end to the read end. Two pipes can be used for two-way communication.
Process FSM: P1 is Ready and P2 is Running. P2 finishes. Is it valid for P2 to move to Terminated and P1 to move to Running?
Yes. P2 can terminate, and the scheduler can then select ready process P1 to run.
Process FSM: P1 is Waiting for keyboard input and P2 is Running. Keyboard input completes. Is it valid for P1 to immediately move to Running and P2 to Ready?
No. The I/O completion moves P1 from Waiting to Ready. It does not automatically preempt P2.
Process FSM: P1 is Running and P2 is Ready. P1 performs a blocking disk read. Is it valid for P1 to move to Ready and P2 to Running?
No. P1 should move from Running to Waiting because it is waiting for I/O. P2 may then move from Ready to Running.
What is a context switch?
The OS saves the CPU state of the currently running process and restores the state of another process so it can run.
What is the boot sequence for getting the kernel into main memory?
Firmware runs → firmware loads the boot loader → boot loader loads the kernel into RAM → kernel begins initialization.
What is a downside of context switches?
They create overhead because CPU time is spent saving and restoring process state instead of doing useful application work.
Where does the kernel permanently reside when the computer is powered off?
On non-volatile secondary storage such as an SSD or disk. It is loaded into RAM during boot.
Order the memory hierarchy from smallest to largest.
Registers → cache → main memory/RAM → disk or secondary storage.
Which CPU mode grants access to all CPU instructions and registers?
Kernel mode.
Which memory/storage types are volatile?
Registers, cache, and main memory/RAM are volatile. Disk/SSD storage is non-volatile.
How many processes exist after this loop: for (int i = 0; i < 3; i++) { fork(); }?
8 processes. Each fork doubles the number of processes: 1 → 2 → 4 → 8.
After pid_t pid = fork(), which process executes if (pid == 0)?
The child process.
What are the main roles of an operating system?
Provide abstractions for hardware, manage resources, support program execution, provide protection/security, manage memory and files, and provide communication between programs.
True or False: Once a program uses a system call, it cannot make libc calls afterward.
False. A program can continue using library functions and system calls normally.
Why might a programmer use a system call instead of a C standard library function?
A system call provides lower-level, direct access to an OS service and can give the programmer more control over the operation.
Which of these are system calls: open(), read(), fopen(), fread()?
open() and read() are system calls. fopen() and fread() are C standard library functions.
What is wrong with allowing applications to interact directly with hardware?
Applications could interfere with the OS or other programs, bypass protection mechanisms, mishandle shared resources, and become dependent on specific hardware.