Introduction to OS Flashcards
What is an operating system?
An operating system is the software layer that manages a computer’s resources for its users and their applications.
What are the jobs of an OS?
- Virtualization
○ Taking a possibly limited physical resource(processor,memory,storage) and transforms it into a more general, portable, and easy-to use virtual interface for user applications to use. - Concurrency
○ Acting as a resource manager which supports multiple user applications(and multiple tasks inside one application) to run concurrently and coorindates among running entities, ensuring correct, fair, and efficient sharing of resources. - Persistence
○ Data can be easily lost on volatile devices such as DRAM. An OS allows users to talk to external devices - including persitent storage drives - through input/output
What are the design goals of an operating system?
- Performance:
○ Minimize the overheads brought by the OS - Scalability
○ With multiprocessors, speed up concurrent accesses- Security
○ Protect against bad behaviour - Reliability
○ Properly recover on fail-stops - Connectivity
○ Networking support, connect with the internet
Energy-efficiency, mobility
- Security
What is I/O?
I/O stands for input and output and is reffered to devices connected to a computer. This could be a mouse and keyboard.
What does API stand for?
Application programming interface (API)
Why do we have an API in the OS?
The API in an operating system has system calls like create, wait, and destroy. These calls let apps ask the OS to do special tasks. The API also gives information about app processes and helps different OS services communicate.
What are the roles of an operating system?
Referee: They manage resources used by different apps on one machine, like protecting memory and scheduling tasks.
Illusionist: They create a simpler view of hardware for apps, like using virtual memory and file systems. Glue: They offer common tools for apps to share, such as hardware access (HAL), system calls, and copy-paste.
What is the purpose of dual-mode operation on a CPU?
There are two modes of operation on a CPU: Kernel mode and user mode. The purpose of the two modes is to limit the privileges of a user program, so that it cannot cause harm to the machine, operating system, or other user processes running on the system.
Give two examples of virtualization
CPU| - Memory
Explain the software design principle of separating mechanism from policy.
Separating mechanism and policy means having a basic system that can be used in many situations. Then, we can change how it works without redoing the whole thing. Policies are like decisions on what to do, and mechanisms are how those decisions are carried out.
Classify each of the following as mechanism/policy/neither: Scheduling, Context switching, Limited direct execution, Page replacement, Fragmentation, Address translation, Best/worst fit, Locality.
Scheduling
Policy
Context switching Mechanism Limited direct execution Mechanism Page replacement Policy Fragmentation Neither Address translation Mechanism Best/worst fit Policy Locality Neither
Give examples on policies
Scheduling- Allocation of resources - Page fault handling - Segmentation handling
Give examples on mechanism?
Context switching- Swapping- Authorization