1/181
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
What are the two core jobs of an operating system?
Provide abstractions that make hardware usable and provide control that manages resources safely and correctly.
What is OS abstraction?
Hiding complex hardware details and presenting simpler concepts such as files, processes, virtual memory, and sockets.
How does a process act as an abstraction?
It hides direct CPU control and makes a running program appear to have its own execution context.
How does virtual memory act as an abstraction?
It hides raw physical addresses and presents programs with a protected virtual address space.
What does the OS do as an extended or virtual machine?
It hides inconvenient hardware details, offers stable high-level operations, and creates useful illusions such as many processes and large memory.
What does the OS do as a resource manager?
It tracks ownership and availability, schedules and allocates resources, and resolves conflicts using policies.
What is the difference between mechanism and policy?
Mechanism answers how something is done; policy answers which choice should be made.
What are the five major OS responsibility areas?
Processes, memory, storage, devices, and security.
What does the OS do for processes?
Create, schedule, synchronize, and terminate them.
What does the OS do for memory?
Allocate, protect, map, and reclaim memory.
What does the OS do for storage?
Name, organize, persist, and retrieve data.
What does the OS do for devices?
Control, buffer, cache, and abstract devices.
What does the OS do for security?
Authenticate, authorize, isolate, and audit.
What is the main goal of batch systems?
Throughput; jobs run in groups with little interaction.
What is the main goal of multiprogramming?
CPU utilization by keeping several jobs in memory so another can run while one waits.
What is the main goal of time-sharing?
Responsiveness by rapidly switching the CPU among interactive users or tasks.
What is the defining goal of a real-time system?
Deadline correctness: results must arrive within required timing constraints.
What is characteristic of embedded/RTOS environments?
Limited memory and power with strict deterministic timing; minimal footprint and guaranteed response are emphasized.
What is characteristic of mobile operating systems?
Battery preservation, variable connectivity, many sensors, touch interaction, background suspension, and strong app sandboxing.
What is characteristic of server/enterprise operating systems?
High throughput, high availability, scalable multicore processing, networking, virtualization, and often headless management.
What are the basic hardware components coordinated by the OS?
CPU/cores, RAM, storage, network, display, input devices, and the system interconnect/bus.
What is the difference between RAM and storage?
RAM holds active instructions/data temporarily; storage retains information persistently.
What is a device controller?
Hardware that operates a specific device, exposes command/register interfaces, buffers transfers, and reports completion or errors.
What is a device driver?
OS software that translates generic OS requests into device-specific operations for a controller.
Device controller vs. device driver?
The controller is hardware; the driver is software.
What is the stored-program (von Neumann) architecture?
Instructions and program data are both stored in memory for the CPU to fetch and execute.
What are the main stages of the CPU instruction cycle?
Fetch, decode, execute, write back/update, then check for events such as interrupts.
What does the program counter (PC) identify?
The address of the next instruction to execute.
How do interrupts affect the normal instruction cycle?
They can redirect execution to an OS handler so the system can respond to an event.
Shared-memory vs. distributed-memory systems?
Shared-memory systems communicate with loads/stores in one address space; distributed-memory nodes have private memory and communicate with messages.
What is multicore?
Multiple execution cores within one processor package.
What is dual-mode operation?
A protection model that separates restricted application execution in user mode from privileged OS execution in kernel mode.
What runs in user mode?
Ordinary applications with restricted hardware and memory access.
What runs in kernel mode?
The OS kernel and commonly device drivers, with privileged access to hardware and protected system resources.
Why is a user-mode application crash usually less severe than a kernel failure?
User-mode failures are normally isolated; kernel-mode failures can affect the entire system.
What records the CPU's current privilege level?
The CPU mode bit or equivalent hardware privilege state.
Give four categories of privileged instructions.
I/O control, memory control, interrupt control, and processor control.
What happens if user-mode code attempts a privileged instruction?
The hardware raises an exception and transfers control to the kernel.
Why is the hardware timer important for OS control?
It guarantees the OS can regain control from a running program through a timer interrupt.
What is the basic system-call privilege transition?
User prepares arguments → trap instruction → kernel mode → kernel validates/performs service → return to user mode.
Why can't applications directly access hardware?
Direct access could cause conflicting commands, memory corruption, disabled interrupts, or exposure of protected data.
What is a hardware interrupt?
An asynchronous event from external hardware, such as input, I/O completion, network arrival, or timer expiration.
What is an exception/fault?
A synchronous event caused by the currently executing instruction, such as divide by zero, invalid opcode, page fault, or protection violation.
What is a trap?
An intentional synchronous software event used for controlled kernel entry, such as a system call or breakpoint.
Interrupt vs. exception?
An interrupt is external and asynchronous; an exception comes from the current instruction and is synchronous.
What are the main steps of interrupt handling?
Detect event → save PC/minimal state → use interrupt vector to locate handler → service cause → restore state and resume.
What is an interrupt vector?
A mapping from event/interrupt numbers to handler entry points.
What is a system call?
The kernel's controlled interface for a program to request a protected OS service.
What are major categories of system calls?
Process, file, device, information, communication, and protection operations.
What does a library wrapper do for a system call?
It provides a convenient language-level function, prepares the system-call number/arguments, and performs controlled kernel entry.
API vs. system call?
An API is an application-facing programming contract; a system call is the low-level protected kernel-entry mechanism.
Can an API call avoid a system call?
Yes. An API call may remain in user space or invoke zero, one, or multiple system calls.
What is a mode switch?
A change in CPU privilege level, such as user mode to kernel mode, while the same process/thread may continue.
What is a context switch?
A change in the running process or thread that requires saving old CPU state and restoring another execution context.
Does every system call cause a context switch?
No. A system call causes controlled kernel entry (a mode switch), but the same process may resume without the scheduler choosing another process.
What happens when read(fd, buffer, n) is called?
Wrapper arranges arguments → trap enters kernel → kernel validates fd/buffer/permissions → data is returned or process blocks for I/O → result/error returns.
What can read() return?
A positive byte count, 0 for end-of-file, or -1 for an error.
What is a monolithic kernel?
An architecture where major OS services run together in one privileged kernel address space and can call each other directly.
Why can monolithic kernels be fast?
Kernel subsystems can communicate through direct procedure calls with fewer protection-boundary crossings, context switches, and message-passing costs.
What is the main risk of a monolithic kernel?
A faulty or compromised kernel component can corrupt shared kernel memory or crash/compromise the whole system.
What is a microkernel?
A design that keeps a small privileged core—such as scheduling, IPC, and basic memory management—while services run outside the kernel and communicate by messages.
What is the main advantage of a microkernel?
Stronger isolation and a smaller trusted privileged core, improving fault containment and security.
What trade-off can microkernels introduce?
More protection-boundary crossings and message passing can increase overhead.
What is a modular kernel?
A fundamentally monolithic kernel that can dynamically load or remove kernel-space modules such as drivers or file systems.
Does a loadable kernel module run in user space?
No. Modules still execute in kernel space, so a faulty module can damage the system.
What is a hybrid kernel?
A design combining ideas from monolithic and microkernel approaches to balance performance, flexibility, compatibility, and isolation.
What design pressure tends to move more services into kernel space?
Performance: fewer crossings and copies.
What design pressure tends to favor a smaller privileged core?
Reliability and security through better fault containment and a smaller trusted computing base.
What is the high-level boot sequence?
Firmware → bootloader → kernel → user-space services → login/UI.
What does firmware do during boot?
BIOS/UEFI initializes hardware enough to locate and launch the next boot stage.
BIOS vs. UEFI?
BIOS is the legacy firmware interface; UEFI is the modern standard with richer services, boot entries/filesystem awareness, and Secure Boot support.
What does the bootloader do?
Selects an OS/kernel, loads the kernel and initramfs into memory, passes boot parameters, and transfers execution to the kernel.
Why must the bootloader load the kernel into RAM?
The CPU needs the kernel's executable instructions and working data in memory to begin executing it.
What does the kernel initialize before user space?
Memory management, CPU cores/timers/scheduler, devices/drivers, and the root filesystem.
What is the role of the initial user-space process?
It starts and manages the service ecosystem; on modern Linux this is commonly systemd.
Program vs. process?
A program is passive executable instructions on disk; a process is a running instance with a PID, address space, CPU state, and resources.
What is a PID?
A process identifier: a unique number for an active process that may be reused after the process terminates.
What is a daemon?
A background program that provides a system or network service, usually without direct user interaction.
What are the main regions of a process address space?
Text, data, heap, stack, plus free virtual-address space between growing regions.
What is stored in the text segment?
Executable machine instructions.
What is stored in the data segment?
Global and static variables.
What is stored in the heap?
Dynamically allocated memory; it traditionally grows toward higher addresses.
What is stored in the stack?
Function-call frames, parameters, return addresses, and local variables; it traditionally grows toward lower addresses.
What information/resources make up a process besides code?
CPU state, memory, open files, identity, IPC resources, and accounting information.
What do file descriptors 0, 1, and 2 normally represent?
0 standard input, 1 standard output, 2 standard error.
What is a parent-child process relationship?
The creating process is the parent; the created process is the child, has its own PID, and may inherit selected resources.
What are the five basic process states?
New, Ready, Running, Waiting/Blocked, and Terminated.
What does Ready mean?
The process is runnable and waiting for CPU time.
What does Running mean?
The process is currently executing on a CPU core.
What does Waiting/Blocked mean?
The process cannot run until an event such as I/O completion occurs.
Why does a waiting process usually return to Ready instead of directly to Running?
The scheduler must select it again before it can use the CPU.
What is Ready Suspended?
A logically runnable process that is suspended/not resident in main memory and must be restored before dispatch.
What is Blocked Suspended?
A suspended process that is still waiting for an event and may also be outside main memory.
What is a PCB?
The Process Control Block: the kernel's protected record containing the information needed to manage and resume a process.
What information is stored in a PCB?
Identity, CPU context (PC/registers), state, scheduling data, memory information, and accounting data.
Why must the PC and CPU registers be saved during a context switch?
So a preempted process can later resume exactly where it stopped with its working state restored.
What is in the ready queue?
Runnable processes waiting to be dispatched to a CPU.
What is in a device queue?
Processes blocked while waiting for a specific I/O operation to complete.
What steps occur during process creation?
Allocate PID/PCB, initialize address space/state, inherit selected files/attributes, and enqueue the child in the ready queue.
What does fork() do?
Creates a child process that begins from the same logical point; fork returns different values to parent and child.