1 Flashcards
(37 cards)
Q: What are the main elements of a computer system?
A: Users (humans and machines), software (application programs, OS, system programs), and hardware (CPU, memory, battery, input/output devices).
Q: Why is a mediator needed between hardware and user programs?
A: Hardware operates at a very low abstraction level compared to user programs, and a mediator is needed to optimize resource sharing and simplify hardware access.
Q: What is the OS kernel?
A: The kernel is the one program that always runs in the OS. Everything else is either a system program or an application program.
Q: What is the informal definition of an operating system?
A: A piece of software that acts as an intermediary between users/applications and hardware, provides abstraction, organizes hardware resource sharing, and maximizes performance.
Q: How does the CPU handle I/O operations concurrently?
A: The CPU moves data between main memory and device controller buffers, while the device controller performs I/O operations and signals readiness via an interrupt.
Q: What is Direct Memory Access (DMA)?
A: DMA allows devices to transfer data directly to/from main memory without involving the CPU for each transfer, improving efficiency.
Q: What is an interrupt?
A: An interrupt is a signal to the CPU from hardware, transferring control to an interrupt service routine. It helps coordinate between the CPU and devices.
Q: What is the role of the interrupt vector?
A: The interrupt vector contains addresses of all interrupt service routines, directing the CPU to the appropriate handler when an interrupt occurs.
Q: What is a trap or exception?
A: A trap or exception is a software-generated interrupt caused by either a program error or a system call.
Q: What is dual-mode operation in an OS?
A: Dual-mode operation uses a mode bit to distinguish between user mode (restricted privileges) and kernel mode (full privileges), protecting the OS and hardware.
Q: How does a system call change the mode of operation?
A: A system call switches the CPU from user mode to kernel mode, and returning from the call resets it back to user mode.
Q: What happens when requested data is not available in system buffers during a read operation?
A: The calling process is suspended until the data is available.
Q: What happens when a process consumes its allotted CPU time?
A: The process is suspended, and the CPU switches to another process.
Q: What does the OS file system do when data is already available in system buffers?
A: The OS retrieves the data directly from the buffers, bypassing the need for a disk access operation.
Q: What is the benefit of abstraction provided by an OS?
A: It hides the complexity of hardware architecture from applications, making it easier for programs to interact with hardware.
Q: How does the OS optimize the use of hardware resources?
A: By organizing resource sharing and managing access efficiently through scheduling and resource allocation.
Q: Why are interrupts essential for an OS?
A: Interrupts allow the OS to handle asynchronous events, like device readiness or errors, while ensuring efficient CPU utilization.
Q: What is stored by the OS when an interrupt occurs?
A: The OS saves the CPU state, including registers and the program counter, to resume execution after handling the interrupt.
Q: What is a policy in the context of operating systems?
A: A policy defines what you want a system to do.
Q: What is a mechanism in the context of operating systems?
A: A mechanism defines how to achieve the policy.
Q: What is the relationship between policies and mechanisms?
A: Policies need appropriate mechanisms for their realization.
Q: What is virtualization in operating systems?
A: Virtualization provides a simple, abstract, logical model of the system by virtualizing hardware.
Q: What is transparency in operating systems?
A: Transparency hides details with respect to a given issue, simplifying system interaction.
Q: What is the main motivation for an operating system?
A: To deal with diversity, provide transparency, virtualization, shared functionality, and concurrency.