1/587
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 is a process?
An abstraction of a program in execution.
What is a program?
A set of instructions stored on disk that is not actively executing.
What is the difference between a program and a process?
A program is a passive entity stored on disk; a process is an executing instance of a program.
What resources does a process need?
CPU time, main memory, and input/output (I/O) devices.
What is the purpose of the CPU for a process?
To decode and execute instructions.
What is the purpose of main memory for a process?
To store the instructions and data needed while the process executes.
What is the purpose of I/O devices for a process?
To allow interaction with the outside world.
What does CPU stand for?
Central Processing Unit.
What information does the CPU maintain about the process it is executing?
Execution information such as the program counter, instruction register, general-purpose registers, condition codes, and stack pointer.
What is the program counter (PC)?
A CPU register that stores the address of an instruction associated with the current execution.
What is the instruction register (IR)?
A CPU register that stores the instruction being executed.
What are general-purpose registers?
CPU registers used to temporarily store operands and other working data.
What is an operand?
A value or data item that an instruction operates on.
What is the arithmetic logic unit (ALU)?
The CPU component that performs arithmetic and logical operations on data in CPU registers.
What is the condition code register (CCR)?
A register that stores the result status of an operation.
What are other names for the condition code register (CCR)?
Status register or flag register.
What is the stack pointer (SP)?
A CPU register used to support function calls by tracking the stack.
Why does a process need main memory?
Its instructions and data need to reside in main memory while it runs.
Can the CPU directly access data stored on a hard disk drive?
No. The data must be brought into main memory before the CPU can use it.
How does the speed of main memory compare with the CPU?
Main memory is much slower than the CPU.
What is latency?
The delay involved in accessing a resource or completing an operation.
What is the latency gap between the CPU and main memory?
The CPU can operate faster than main memory can supply instructions and data, potentially leaving the CPU waiting.
What is caching?
Storing frequently or usefully needed information in faster memory so it can be accessed more quickly.
Why is caching used between the CPU and main memory?
To help hide the latency gap between the CPU and main memory.
What can happen if the CPU frequently waits for main memory?
The CPU may remain idle instead of executing useful work.
What types of caches are mentioned in the PowerPoint?
Address translation caches, instruction caches, and data caches.
What cache levels are mentioned in the PowerPoint?
L1, L2, L3, and L4.
Is caching alone sufficient to keep the CPU busy?
No. Other techniques are also needed to improve CPU utilization.
What is CPU utilization?
The proportion of time the CPU is busy performing work.
What are I/O devices?
Devices used by a computer to interact with the outside world.
What are examples of I/O devices?
Keyboard, display or monitor, mouse, touchscreen, hard disk, printer, and webcam.
How does the speed of a typical I/O device compare with main memory?
A typical I/O device is much slower than main memory.
What is the I/O latency gap?
The delay caused by I/O devices operating much more slowly than the CPU or main memory.
Why is I/O latency a problem for CPU utilization?
A process may have to wait for an I/O operation to complete, leaving the CPU unable to make progress on that process.
What is the main idea behind realizing the process abstraction?
A running process requires more than program instructions on disk; it needs CPU execution, memory, and I/O resources.
What is multiprogramming?
The ability of an operating system to execute more than one program using a single-processor machine.
How does multiprogramming work?
The OS repeatedly switches to another process after executing the current process for some time.
Can multiple processes make progress without any one process completing?
Yes. Multiprogramming allows multiple processes to make progress over time.
Why can multiprogramming make a single CPU appear to run multiple processes simultaneously?
Rapid switching creates the illusion of simultaneous execution.
What is required for true simultaneous execution of multiple processes?
Multiple CPUs or processor cores capable of executing them at the same time.
What are the two types of process switching triggers described in the slides?
Event-based switching and time-based switching.
What is event-based switching?
Switching when an event occurs, such as a process waiting for an I/O operation to complete.
What is time-based switching?
Switching after a process has used the CPU for a sufficiently long time.
What are the three requirements for supporting multiprogramming?
The OS must stop and resume processes, share resources fairly, and protect processes from one another.
Why must the OS be able to stop and resume a process?
So it can switch between processes without changing their correct outcomes, apart from delaying completion.
What does seamless process switching mean?
Switching should not affect a process's outcome; its only effect should be a possible delay in completion.
What resources must be shared fairly among processes?
CPU time, memory, and I/O devices.
Why is fair resource sharing important?
It prevents one process from monopolizing system resources.
What does process protection mean?
Preventing one process from improperly reading or modifying another process's data.
What is a process control block (PCB)?
An OS bookkeeping record for a process, used to save its execution context when it is interrupted.
What is a process table?
A table maintained by the OS that stores the records or PCBs of processes.
What is the degree of multiprogramming?
The maximum number of processes that can run concurrently.
What limits the degree of multiprogramming?
The size of the process table and factors such as the memory used by current processes.
What information is stored in a PCB?
Process identifier, CPU register contents, process state, scheduling information, memory-management information, accounting information, and I/O status information.
What is a process identifier (PID)?
A unique identifier for a process.
What CPU information is stored in a PCB?
Register contents such as the program counter, stack pointer, and condition register.
What process state information is stored in a PCB?
The process's current execution state, such as new, ready, running, waiting, or terminated.
What CPU scheduling information is stored in a PCB?
Process priority, scheduling queue information, and other scheduling parameters.
What memory-management information is stored in a PCB?
Information such as base and limit registers, page tables, and segment tables.
What accounting information is stored in a PCB?
Information such as CPU time used, time limits, account numbers, and job or process numbers.
What I/O status information is stored in a PCB?
Information about allocated I/O devices and open files.
What is a system call?
A request by a process for an operating-system service or resource.
Why does a process use a system call to request a resource?
Processes cannot manage resources directly; the OS handles the request.
What happens when a process invokes a system call?
Execution control transfers to the OS, which executes the code needed to service the request.
What are the five broad categories of system calls?
Process control, file management, device management, information maintenance, and communications.
Which Unix/Linux system call creates a new process?
fork()
Which Unix/Linux system call terminates a process?
exit()
Which Unix/Linux system call waits for another process?
wait()
Which Unix/Linux system calls are used to open, read, write, and close files?
open(), read(), write(), and close().
Which Unix/Linux system call can set the input/output mode of an I/O device?
ioctl()
Which Unix/Linux system call retrieves a process identifier?
getpid()
Which Unix/Linux system call retrieves the system time?
time()
Which Unix/Linux system call obtains file attributes?
stat()
Which Unix/Linux system call creates a pipe?
pipe()
Which Unix/Linux system calls can send and receive messages?
sendmsg() and recvmsg().
What is user mode?
A restricted CPU execution mode in which only a limited set of instructions can be executed.
What is kernel mode?
A privileged CPU execution mode in which any instruction from the instruction set can be executed.
What are other names for kernel mode?
Privileged mode, unrestricted mode, or supervisory mode.
What is a privileged instruction?
An instruction that can only be executed in kernel mode because it can affect protected resources or system operation.
Why must privileged instructions be restricted?
They could be misused to access another process's data or monopolize system resources.
What are examples of privileged instructions?
Instructions for I/O, interrupt handling, timer control, processor status settings, and storage protection settings.
What enforces the restriction on privileged instructions?
Hardware enforces that privileged instructions can only execute in kernel mode.
Why is trusted code required in kernel mode?
Kernel-mode code can perform powerful operations that affect the system and other processes.
What is a mode switch?
A change in CPU execution mode, such as switching from user mode to kernel mode or back.
What instruction causes a switch from user mode to kernel mode when requesting an OS service?
A trap instruction.
What is another name for a trap instruction in the slides?
A software interrupt.
How is a hardware interrupt different from a trap?
A hardware interrupt is typically generated by a hardware device, while a trap is used to transfer control to the kernel for a software request.
What happens when a trap instruction executes?
Control transfers to a predefined entry point in kernel code.
What happens during a system call's mode-switch sequence?
User code invokes a system call, the CPU switches to kernel mode to execute OS code, and then switches back to user mode when the call returns.
Is a mode switch the same as a process switch?
No. A mode switch changes the CPU's privilege mode; a process switch changes which process is executing.
Why does the OS need protection between processes?
So one process cannot improperly access or modify another process's data.
What is a process address space?
The memory space associated with a process, containing the portion of its process image stored in memory.
What is a logical address?
An address generated by a program within its own address space.
What is a physical address?
The actual location in physical memory where data or instructions reside.
What is address translation?
The conversion of a logical address generated by a process into a physical memory address.
Why is address translation necessary?
It maps process-generated logical addresses to physical memory locations and helps validate that the access belongs to the current process.
What hardware performs address translation and validation?
Special memory-management hardware.
What are two forms of address-translation data mentioned in the slides?
Base and limit registers, and page tables.
What are base and limit registers used for?
They provide information used to translate and validate a process's memory addresses.
What is a page table?
A data structure used in address translation to map a process's logical pages to physical memory.