Virtual Memory Flashcards
Learn about virtual memory
Explain the banker’s algorithm
Thought experiment, try to give a resource to thread A, then B and check if threads could run without deadlocking, if there is a potential deadlock, put thread B to sleep
What is the cause of a deadlock
A deadlock occurs when there is a circular dependency of resources between two threads
How is an address space defined?
It’s the set of memory addresses accessible to a program (for read or write)
What is a process in essence?
Instance of a running program + one or more threads
What is a trap?
A kind of interrupt that gives execution control to the kernel.
How does the OS protect from errors in user processes?
Using a mode bit: 0 is kernel mode and 1 is user mode
What syscall is used to allocate space into the heap?
The sbrk syscall
What hardware is between CPU address references and physical addresses?
Memory Management Unit
How does the CPU check if a memory reference is valid for a program
It uses the base and bound registers and performs hardware aided arithmetic