comsci Flashcards
(25 cards)
define interrupts
-CPU is fast, IO device and other services are slow
-CPU doesnt stop and wait
-When IO services are finished use interrupt to get CPUS attention
How is the modern OS interrupt Driven?
-With the interrupt vector.
-With the interrupt handler
- with soft interrupts like; traps and system calls
Why cant user interact with HW directly?
because of Mode bit and system calls
What is Mode bit?
-motivation
-user operation and kernel operation seperate but difficult to distinguish user or kernel
-Hardware support for system protection
-1 kernel operation
-0 user operation
What is a system call?
Interface between user and kernel
- All IO, Hardware, System calls are handled by the kernel
-Users must make systems calls to access any system resources
What is the 5 process transition diagram?
- transition from waiting-> running, possible?
- transition from running -> waiting?
-transition from running -> ready?
What are the two types of concurrency?
-interloped which involves time shearing
-parallel which involves multiple CPUs
What is the PCB? WHere is it located?
Process control block located in the kernel
What does the PCB contain/handle?
-process ID
-Register values
-scheduling related info
-page table
-opened file info
What are the two types of scheduling?
Preemptive and non-preemptive
What is preemptive scheduling?
A process can be paused by the scheduler at any time during its execution
What is non-preemptive scheduling?
- The process itself decides to give up the CPU when its computations are in a
stable state - Scheduler doesn’t stop/pause process
What is the duty of the dispatcher?
switch between 2 user processes
What are the 5 scheduling algorithms?
FCFS, SJF, SRFJ, RR, Priority
What is race condition?
Race condition happens when two or more processes access and manipulate the same data concurrently and the outcome depends on the order of access (this is not desirable)
What is spin lock?
Also known as busy waiting, using polling to detect a certain condition even though the process doesnt do a meaningful job it is still in the running state, CPU is busy
what could cause internal and external fragmentation respectivly?
external- “holes” in dynamic contiguous memory allocation(solution is compaction:)
internal - fixed contigous memory allocation, paging internal fragment < page size
What is the dynamic contigous memory allocation strategy?
-first fit(fast)
-Best fit(try to maximize the utilization of free space, but easily create small holes)
-worst fit( try to reduce the small holes)
How do we manage paging?
We keep a page table for each process.
Where is the page table?
In the kernel within the PCB
Does paging have external fragments?
No, paging is a solution to fragmentation.
Does paging have internal fragments
Yes, but it is minimal.
How does the OS keep track of free frames?
with the TlB(translation look aside buffer)
Why does the paging system have a speed issue?
Sometimes it can grow to be too large.