Operating Systems Flashcards
What is software?
- A collection of electronically stored instructions
(i. e., a program) that allows one to interact with a computer
What are the two categories software can be categorized into?
- Application Software
2. System Software
What is application software?
- A computer program designed to help people perform
an activity
What is system software?
- A type of computer program that is designed to run a computer’s hardware and application programs.
Examples of application software
- Office suites (e.g., Office 2016)
- Image editors (e.g., GIMP)
- Web browsers (e.g., Chrome)
- Video conferencing (e.g., Zoom, Skype)
- Acrobat reader …
Examples of system software
- Operating systems (e.g., macOS, Windows, Linux)
2. Anti-malware (e.g., Trend Micro Anti-Virus )
Three Roles of an Operating System
1) Process management
- Manage numerous,
concurrently running programs
2) Memory management
- Allocate and track efficiently
3) Device management
- Grant and share access to computer’s hardware
Recall that a process is a program in ———
exceution
How many processes can a CPU process at one time?
-one
Kernel
- Core of a computer’s operating system and generally has complete control over everything in the system.
GUI
Graphic User Interface: Type of user interface through which users interact with electronic devices via visual indicator representations (icons, mouses, menus)
CMD: Command for Microsoft windows
- Used to execute entered commands and perform advanced administrative functions.
What are the five stages of processing?
- New
- Ready
- Waiting
- Running
- Terminated
- New - State of Processing
- New process that has been created but has not yet been admitted by the OS for its execution.
- A new process is not loaded into the main memory, but its process control block (PCB) has been created
- Ready-State of Processing
- A process that is prepared to execute when given the opportunity by the OS.
- Waiting-/Blocked State of Processing
- A process cannot continue executing until some event occurs like for example, the completion of an input-output operation.
- Running-State of Processing
- The process is currently being executed.
- Terminated- State of Processing
- A process or job that has been released by the OS, either because it is completed or is aborted for some issue.
What can cause a process to move into a waiting state?
- If it needs more data or information from the user in order to complete it
- if it needs to wait for a resource, such as waiting for user input, or waiting for a file to become available.
What is data structure?
- Used by the OS to manage information
about a process
What current values are managed by the data structure?
1) The program counter (where the execution should
start/resume)
2) All CPU registers for the process (CPU state)
3) base and bound registers or page-map tables (memory management info, see later)
4) Accounting information (owner, priority, files and network connections open)
What does each state contain?
- Each state contains a list of PCBs, one for each process in that state
What is a new PCB first created?
- When the process is first created and persists until the process terminates
What happens to the corresponding PCB when the process moves from one state to another?
- Moves from one state list in the operating system
What happens each time a process is moved to the running state?
- Register values for the currently running process
are stored into its PCB - Its PCB is moved to the list of the state into which it goes
- Register values of the new process moving into the running state are loaded into the CPU
What is a context switch?
- Exchange of register information
What is used to determine which processes move from ready to run?
- CPU Scheduling Algorithms
Types of CPU Scheduling Algorithms? (3)
- Non-preemptive scheduling
- Preemptive scheduling
- Turn-around time
Why is the PCB needed?
- Needed in order to know what has happened and what needs to happen next
Non-preemptive Scheduling
- The currently executing process gives up the CPU voluntarily
When can non-preemptive scheduling be used?
-When a process terminates or switches from a running to a waiting state.
Preemptive scheduling
- Method where the tasks are mostly assigned with their priorities.
Turn Around Time
- The amount of time between when a process arrives in the ready state the first time and when it exits the running state for the last time
When can pre-emptive scheduling be used?
- Used when a process switches from running state to ready state or from the waiting state to ready state.
Service Time
- The amount of CPU time that a process will need before it either finishes or voluntarily exits the CPU
Types of Non-Preemptive Scheduling
- First-Come, First-Served
2. Shortest Job Next
First-Come, First-Served (Non-Prem)
- Processes are moved to the CPU in the order in which they arrive in the ready state
Shortest Job Next (non-prem)
- Process with shortest estimated running time in the ready state is moved into the running state first
Round Robin (prem)
- Each process runs for a specified time slice and moves from the running state to the ready state to await its next turn if not finished
Difference between logical vs physical address
- The logical address is generated by CPU during a program execution whereas, the physical address refers to a location in the memory unit.
Logical Address
- Reference to a stored value relative to the program
making the reference - Virtual address that can be viewed by the user, not a real address
Physical Address
- Actual address in the main memory
Three types of memory management
- Single Contiguous MM
- Partition Memory Management
- Paged Memory Management
what two programs are in single continuous MM?
- Operating System
2. Application Program
Partition Memory Management
- Has the OS and any number of other programs in the memory at the same time
What does the OS of the Single Partian MM have at the same time?
- Has only the OS and one anther program in the memory at the same time
What are the two schemes for dividing up memory among programs:
- Fixed Partition
2. Dynamic Partition
Fixed Partition
- Main memory is divided into a fixed number of partitions into which programs can be loaded
Dynamic Partitions
- Such partitions are created as needed to fit the programs waiting to be loaded
Base Register
- A register that holds the beginning address of the current partition (the one that is running)
Bounds Register
- A register that holds the length of the current partition
Partition Selection Algorithms
1 Best Fit
- First Fit
- Worst Fit
First Fit
- Allocate the program to the first partition
big enough to hold it
Best Fit
- Allocate program to the smallest partition
big enough to hold it
Worst Fit
- Allocate program to the largest partition
big enough to hold it
Paged Memory Technique
- A technique in which processes are divided into fixed-size pages and stored in memory frames when loaded
Frame
- A fixed-size portion of main memory that holds a process page
Page
- A fixed-size portion of a process that is stored into a
memory frame
What information does the Page-program hold?
- Information about the address of the process
What info does the frame main memory have?
- Information about where the process is in the main memory
Demand paging
- An extension of paged memory management in
which pages are brought into memory on demand
Page Swap
-The act of bringing in a page from secondary
memory, which often causes another page to be
written back to secondary memory
Virtual Memory
- The illusion that there are no restrictions on the size
of a program because an entire process doesn’t have
to be in memory at the same time
Thrashing
- Inefficient processing caused by constant page swaps
Device drivers
Software that instructs the OS on how to
communicate with a piece of hardware
Examples of drivers are required for hardware
I/O ports (e.g., USB), printers, video hardware, audio
hardware, storage devices, wireless network adapters, webcams
What does virtualization allow for?
- Allows a guest OS, as a virtual machine app,
to run inside the host OS
1. The guest OS communicate with virtual hardware
2. The virtual machine then translates this to calls to the
actual hardware
Virtualization Benefits
- Reduced costs of hardware and power consumption
- Reduced costs for software licenses
- Software can be tested on multiple virtualized
environments before being released - Development of software can happen using another OS
Virtualization Drawbacks
- Host machine requires more resources
- Host machine suffers more wear and tear
- Might not be able to virtualize specialized hardware
- Problems more difficult to diagnose