Operating Systems Flashcards
Two Objectives of Operating System
Convenience and Efficiency
What is an Operating System
Program that controls the execution of application programs and acts an interface between applications and the computer hardware
How does an operating system conceal complexity?
Protect users and programmers from having to work with horrendous complexity
How do the OS and hardware work together?
- Protects the programmer and user from the details of the hardware
- Provides a user interface
- Works better if the hardware provides support for the OS
- Developed together
How does the OS do memory management?
- Allocate memory to programs
- Manage Virtual Memory
- Protect against programming errors & malware
How does the OS do Task management?
- Launch processes
- Maintain process table: list of running processes
- Carry out timeslicing and context switching
- Handle interrupts
- Set program privilege levels
How does the OS do File management?
- Respond to program requests to open, read, write and close files
- Set and check permissions
- Handle buffering
How does the OS do Device management?
Use device drivers to respond to requests to open, read, write and close devices
Essential hardware features for an OS
- Memory protection
- Timer
- Privileged instructions
- Interrupts
What is a process?
Running a program
What does a process include?
- Code
- Data
- Resources
- Current state: registers
What is context switching?
The state of a running process is saved, and another process is given processor resources
What is a process control block?
A data structure used by a computer operating system to store all the information about a process
What are the different types of scheduling?
- Long-term scheduling
- Medium-term scheduling
- Short-term scheduling
- I/O scheduling
What is long-term scheduling?
The decision to add to the pool of processes to be executed
What is medium-term scheduling?
The decision to add to the number of processes that are partially or fully in main memory
What is short-term scheduling?
The decision as to which available process will be executed by the processor
What is I/O scheduling?
The decision as to which process’s pending I/O request shall be handled by an available I/O device
What is swapping?
The operating system stores a queue of processes wanting to execute (Processes on the disk, queue in the kernel). As space becomes available, the processes are loaded and when a process finishes it is removed. Stalled processes are swapped out e.g. waiting for I/O
What is partitioning?
A memory management technique that divides a computer’s memory into sections for use by programs
What is the difference between fixed size and variable size partitions?
Fixed size
- Logarithmic distribution of partition sizes
- Easy to administer
Variable size
- Memory is allocated as required
- Fragmentation makes it harder to load incoming processes
What is a logical address?
An address seen by the process and is relative to the programs address space.
What is a physical address?
An actual location in memory
What is a base address?
The current starting location of the process
What is paging?
- Divides the physical memory into small, equal chunks (frames)
- Divides the processes into chunks (pages) of the same size as the memory frames
What is virtual memory?
Allows processes larger than physical memory to be loaded
What is demand paging?
Each page of a process is brought when it is needed
What are the advantages of demand paging?
- More processes can be maintained in memory
- Time is saved because unused pages are not swapped in and out of memory
What are disadvantages of Demand paging?
- When one page is brought in, another must be thrown out
- If the thrown out page was about to be used OS needs to go get it again
- Thrashing
What is segmentation?
- Segmentation allows the programmer to view memory as consisting of multiple address spaces or segments
- Segments are of variable size
What are the advantages of segmentation?
- Simplifies the handling of growing data structures
- It allows programs to be altered ad recompiled independently without requiring that an entire set of programs be relinked and reloaded
- It lends itself to sharing among processes
- It lends itself to protection
Where is Virtual Software placed?
Between hardware and conventional software
What is a Virtual Machine Monitor?
A layer of software emulating hardware of a complete computer system that provides an abstraction called VM. VMM provides the illusion of multiple machines on a single physical machine
What does Binary translation do for VM?
Translates the code to the new code needed for the VM, detecting all the sensitive privileged instructions
What is paravirtualisation?
Changes the guest OS so it cooperates with the VMM, the VMM exposes hypercalls and uses events to trigger interrupts