Describe two general roles of an OS, elaborate why these roles are important. - correct answer
✔✔Provide an abstraction layer for software to run on machine, w/o knowing hardware
implementations.
IMPORTANT:
- Reduces burden on developers.
- Extends hardware w/ added functionality.
- Provides a common base for all applications.
Provide resource management to users by ensuring progress, fairness, and efficient usage of computing
resources.
Name three ways in which the processor can transition from user mode to kernel mode?
Can the user execute arbitrary code after transition? - correct answer ✔✔Trap (system calls)
Interrupt (I / O)
Exception (divide by 0)
Can the user execute arbitrary code after transition? - correct answer ✔✔No, users, can't execute
arbitrary code b/c entry to kernel mode contains a set of restricted routines that ensures only the kernel
is running an not the users.
What is a mutex? - correct answer ✔✔It's a lock, a program object that allows multiple program threads
to share the same resource.
What is a semaphore? - correct answer ✔✔A synchronization tool used to solve complex critical section
problems.
, What is the difference between a mutex and a semaphore? - correct answer ✔✔For mutex, only it's
threads that locked or acquired the mutex can unlock it.
Whereas semaphore, a thread waiting on a semaphore can be signaled by a different thread.
What is context switch? - correct answer ✔✔Is transferring control from one process to another process.
Requires saving the state of old process and loading the saved state for the new process.
Why is switching threads less costly than switching processes? - correct answer ✔✔Less state needs to
be saved and restored when switching threads rather than process;
Switching between threads benefits from cache whereas switching between processes invalidates the
cache and TLB that caches the page table.
Describe how OS deals with a page fault?
You should consider using a workflow map in your answer. - correct answer ✔✔Start from CPU (vpn) ->
What's TLB used for? - correct answer ✔✔Memory cache used to reduce the time taken to access a user
memory location.
The benefits of buying summaries with Stuvia:
Guaranteed quality through customer reviews
Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.
Quick and easy check-out
You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.
Focus on what matters
Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!
Frequently asked questions
What do I get when I buy this document?
You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.
Satisfaction guarantee: how does it work?
Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.
Who am I buying these notes from?
Stuvia is a marketplace, so you are not buying this document from us, but from seller kirus27. Stuvia facilitates payment to the seller.
Will I be stuck with a subscription?
No, you only buy these notes for $11.49. You're not tied to anything after your purchase.