Tenta Flashcards
What are the main components of a computer system?
CPU, Memory (RAM/ROM), Input/Output Devices, and System Bus
What is the difference between volatile and non-volatile memory?
Volatile memory (e.g., RAM) loses data when powered off; non-volatile memory (e.g., SSD, HDD) retains data.
How does an operating system provide resource abstraction?
It hides the complexity of hardware by providing standardized interfaces (e.g., file systems, virtual memory).
Can a single-core CPU run multiple programs simultaneously?
Yes, via time-sharing. The CPU switches between tasks rapidly.
Name two mechanisms operating systems use to ensure protection in multiprogramming.
1) User and Kernel Modes, 2) Access Control via Permissions.
What are the steps of the processor instruction cycle?
Fetch, Decode, Execute, Store.
Describe the difference between stack-based and register-based architectures.
Stack-based uses a last-in, first-out stack for operations; register-based uses general-purpose register
What are the advantages of a stack-based architecture?
Simplified instruction set and no need to manage register allocation manually.
What is the role of an interrupt in process management?
Interrupts allow the CPU to pause a running process and handle an urgent task (e.g., I/O operation
What is a race condition in synchronization?
A situation where multiple processes access shared resources concurrently, leading to unpredictable results.
Name two techniques to prevent deadlock.
1) Avoiding circular wait, 2) Resource allocation graphs.
In the Five-State Process Model, what happens during a “Blocked to Ready” transition?
A waiting process receives the needed resource or event signal and is ready to execute.
Why would you recommend stack-based architecture for teaching kids?
Simple execution model and less overhead, making it easier to understand basic programming concepts.
Why are smaller unit allocation sizes not always ideal for file storage?
They reduce internal fragmentation but increase metadata overhead.
For a self-driving car, which device communication method should you use?
Interrupt-driven communication for real-time responsiveness to human inputs (e.g., braking).
How would you avoid race conditions in a deposit and withdrawal system?
Use locks to synchronize access and ensure atomic operations. Avoid deadlocks by acquiring locks in a consistent order.
Why is multiprogramming useful in operating systems?
Increases CPU utilization by overlapping I/O-bound and CPU-bound tasks.
What is the role of the operating system?
It interfaces between the user’s program and hardware, providing resource sharing, abstraction, security, and performance optimization
What are the types of instructions in the CPU?
Data Transfer Instructions: Move data between locations.
Data Operation Instructions: Perform operations on data (e.g., add, subtract).
Program Control Instructions: Control program flow (e.g., jumps, interrupts).
Compare Stack-based and General Purpose Register (GPR) architectures.
Stack-based: Smaller code size, automatic register management, good for embedded systems.
GPR: Better performance with compilers, allows explicit register management, used in modern computers.
How does a stack-based architecture handle operands?
Operands are pushed to or popped from the stack, with results also stored on the stack.
How does a GPR architecture handle operands?
Operands are stored in registers specified in the instruction (e.g., ADD r1, r2, r3).
What are the advantages of stack-based architectures?
Compact code size.
Simplifies program design by avoiding manual register allocation.
What are the advantages of GPR architectures?
Higher performance due to compiler optimizations.
Flexible operand handling using registers.