CS6200 Flashcards
What is an operating system?
A special piece of software that abstracts and arbitrates the use of a computer system.
It’s a layer of systems software that:
* directly has privileged access to the underlying hardware
* hides the hardware complexity
* manages hardware on behalf of one or more applications according to some predefined policies
* in addition, it ensures that applications are isolated and protected from one another
____ operates in kernel mode to access underlying hardware.
The operating system
____ operates in user level mode
Application software
T/F? kernel-level mode and user-level mode are supported by hardware
True
Attempts to directly access hardware by software running in user-level mode can activate a ____ which interrupts the program and hands control to the OS to determine if it should get access
trap
Applications can use _____ to interact with underlying hardware
System calls
T/F? User/Kernel transitions have a negligent impact on the performance of applications
No, it can have an impact on cache hit frequency after the transition
What are some benefits of a monolithic OS?
* Everything is included
* You can use inlining and compile-time optimizations
What are some drawbacks of a Monolithic OS?
* customization is harder
* portability is harder
* manageability is harder
* larger memory footprint
* harder to optimize performance for different use cases (e.g. using different file systems for different access patterns)
Is linux a monolithic, modular, or microkernel os?
Modular
What are benefits of a modular OS?
* Easier to maintain and upgrade
* Smaller footprint
* Less resource needs
What are the drawbacks of a modular OS?
* indirection can impact performance
* maintenance can still be an issue, because modules can introduce bugs
In a microkernel, system services like the filesystem and disk driver run in ____ level
User level (as opposed to privileged)
What are the benefits of a microkernel?
* Small size
* Easy to verify because it’s small
What are the downsides of a microkernel?
* Poor portability, typically customized for target hardware
* More complex to develop software for
* Cost of user/kernel transitions
What is a process?
An executing program
What is the difference between an application and a process?
Application is a program on disk (static entity), whereas a process is a program that has been loaded in memory and is in the state of execution (active entity).
What does a process store in memory?
- Stack
- Heap
- Data
- Text
What is “address space”?
The “in memory” representation of a process.
What are “virtual addresses”?
The abstracted addresses used by a process.
What are “physical addresses”?
The actual physical locations in memory.
Where is the mapping of virtual addresses to physical addresses stored?
In the Page Table
How does an OS keep track of the state of a process?
Via the Process Control Block
A Process Control Block contains the state of CPU registers. Since register contents can change much faster than they can be updated in memory (where the PCB is stored), how does the OS make sure those are updated for later use?
By setting the values in the PCB when stopping the process on the CPU.
This is called a context switch.
What is a “context switch”?
Switching the CPU from the context of one process to the context of another.
Is a context switch computationally expensive?
Yes. It takes CPU cycles to store the old context and load the new one, and caches on the CPU become invalid for the new process.
What states can a process be in?
- New
- Ready
- Running
- Waiting
- Terminated
What state does a process start in?
New
What state does a process end in?
Terminated
How does a process transition from New to Ready state?
Admitted
How does a process transition from Ready to Running state?
A scheduler dispatch
How does a process transition from Running to Ready state?
An interrupt
How does a process transition from Running to Waiting state?
I/O or event wait
How does a process transition from Waiting to Ready state?
I/O or event completion