OS1 introduction Flashcards
What is an operating system
- first program that hardware runs
- program that runs other programs
- acts as middle man between user and hardware
- coordinates use of hardware amongst different programs
goals of the OS (3)
execute user programs, make computer systems and convenient to use, use hardware efficiently
Explain the analogy of the OS being a government
protects user from each other - one cannot overwrite another
allocates resources efficiently and fairly
Key function of the OS
provide computational environment within which other programs can do useful work
Name and explain the two different OS views from a systems perspective
First view - resource allocator that manages system resources and decides between conflicting requests for efficient and fair resource use
Second - control program that controls execution of programs - prevent errors and improper use of computer
Explain how the OS is an abstraction f the workings of a computer system. Give an example
OS is an interface between users and hardware.
OS can share resources between user programs and system applications thus is able to concurrently process the running of multiple programs.
What is the OS user level?
part of the OS that the user directly interacts with - consists of programs that the user creates or imports, libraries, system application programs
OS kernel level
Core of the OS, kept in main memory at all times.
Ensures that essential OS operations are kept running
Runs device drivers - enable OS to interact with hardware
name 2 essential OS operations
File management and storage in secondary memory (hard-disk)storage
process control (scheduling and executing programs) to run in main memory and to allocate each process appropriate computational resources
OS hardware level
Physical devices that the OS uses e.g. CPU, HDD, keyboards etc
Why have abstractions
Reduce complexity expected from user
reduce program design complexity
Name 3 examples of abstraction
User
Disk
Process
File
What is multi-programming abstraction
rapid switching between the running of programs and keeping all programs partially loaded into memory
Issues with file abstraction
files need unique names and addresses in phys mem
Efficiently organized in phys mem for quick retrieval
Eventually more files than phys mem space
Why is it not possible to store programs and data in main memory permanently? What is a fix for this?
Too small
Volatile (loses contents when power off)
secondary storage (typically magnetic HDD)
Virtual memory allows the execution…
of programs that are not completely in memory
What does virtual memory allow programs to do?
use more memory than available in phys memory, share files and data easily (implements shared memory)
by abstracting main memory to large, uniform memory array that uses second storage to temporary hold programs that must eventually be put into main mem for execution
Benefits of using VMemory
- programs no longer constrained by amount of phys mem
- each user program takes less physical memory: more programs can run at same time therefore increasing CPU use and program throughput (with no increase in run time)
What is Multiplexing (OS - RAM)
resource abstraction means that these N programs use virtual memory to share the space of limited main memory. This sharing of main memory by multiple programs is known as multiplexing
Explain how multiplexing occurs on the CPU
CPU - can only execute one program at a time but N programs run concurrently on OS. N programs execute in chunks with rapid switching between them
Explain how the OS is a type of virtual machine
Each process seems to execute on own processor - OS mandates that resources of physical machine must be shared.
Function of a VMachine
provides interface to application layer
Purpose of the Java VMachine
allows java code to be portable between different OS and hardware
enables a computer to run Java programs that are compiled into Javabyte-code
Abstraction so that java devs dont need to worry about underlying hardware platform and OS
Concurrency vs parallelism
Concurrency - same cpu multiple programs at same time
Parallel - multiple programs, multiple CPU at same time
Key problem with concurrency at OS level
multiple processes must safely interact (e.g. not over-write each other)