Os Midterms Reviewer
Os Midterms Reviewer
1960’s definition, the software that controls the hardware. Privileged State – an execution context that allows all hardware
The programs that make the hardware usable. instructions to be executed.
EXAMPLES OF OS: OS are resource managers. The main resource are processors, storage, I/O
devices, communication devices, and data.
UNIX
MACH MULTIPROCESSING – running of two or
MS-DOS more programs simultaneously by a
MS-WINDOWS computer
WINDOWS/NT FUNCTIONS OF OS:
CHICAGO
implementing user interface
OS/2
sharing hardware among users
MacOS
allowing users to share data among themselves
VMS
preventing users from interfering with one another
MVS
scheduling resources among users
VM
facilitating input/output
LEVELS OF OS: recovering from errors
accounting for resource usage
KERNEL SERVICES
facilitating parallel operations
LIBRARY SERVICES
organizing data for secure and rapid access
APPLICATION-LEVEL SERVICES
handling network communications
KERNEL SERVICES:
3 GOALS OF MODERN OS:
Supports the processes by providing path to peripheral devices.
To hide details of hardware by creating abstraction.
It responds to service calls from processes and interrupts from the
To allocate resources to processes.
devices.
To provide a pleasant and effective user interface.
ABSTRACTION – a software that hides lower level details and provides a set 1950’s or Second Generation:
of higher-level functions
Punch cards are introduced in this generation.
REASONS FOR ABSTACTION: The first OS is implemented by General Motors Research
Laboratories for their project IBM 701.
FIRST – the code to control peripheral devices is not standardized.
The system in this generation ran one job at a time.
SECOND – the OS introduces new functions as it abstracts the hardware. The single-stream batch processing systems existed in this time.
THIRD – the OS transforms computer hardware to multiple virtual 1960’s or Third Generation:
computers, each belonging to different program. Each running program is
This generation have better batch processing systems.
called a process.
The computer’s resources can run several jobs at once.
FOURTH – the OS can enforce security through abstraction. The developers developed the concept of multiprogramming
wherein several jobs are in main memory at once.
2 POV of OS:
The feature SPOOLING was also created in this generation where
RESOURCE MANAGER programs can run to completion faster and other programs will be
EXTENDED MACHINES able to run once the printer becomes available.
Another feature existed in this time is time-sharing technique where
BASIC CONCEPTS OF OS:
the user is directly connected to the terminal, helping the user to be
Processes, Memory Management, I/O Management, File Systems able to communicate with the computer system.
and Security.
1940’s or First Generation: This generation developed the LSI or Large-Scale Integration.
Microprocessor evolved significantly in this period making it possible
The earliest generation for electronic digital computers.
to build desktop computers as powerful as the mainframes from
There are no operating systems existing in this generation.
1970s.
Machines are primitive.
There are two competing operating system and these are MS-DOS
Programs are entered one bit at a time on rows of mechanical
by Microsoft and UNIX.
switches.
No programming languages SPOOLING:
Simultaneous Peripheral Operations On Line - a program in execution.
A high-speed device like a disk interposed between a running - an asynchronous activity.
program and low speed device in the program Input/Output. - The ‘animated spirit’ of a procedure in execution.
Example is instead of writing to a printer, outputs are written to the - The entity to which processors are assigned.
disk - The ‘dispatchable’ unit.
Programs run faster and other programs can be used once the - ‘Active Entity’
printer becomes available. - Is the unit of work in a system
This technique is like a thread being spun to a spool so it may be
Program:
unwound when needed.
- ‘Passive Entity’
TIME-SHARING TECHNIQUE:
- Just a collection of code
a variant of multiprogramming, - An algorithm expressed in suitable notation (programming
user has an on-line terminal (directly connected to terminal). language).
Timesharing systems were developed to multiprogram large - Is only part of a process.
number of simultaneous interactive users.
A process includes:
MS-DOS:
Current value of program counter (PC)
Written by Microsoft Incorporation for the IBM PC and other Contents of the processors registers
machines using Intel 8088 CPU and its successors. Value of the variables
Process Stack (SP) which contains temporary data
UNIX:
Data section that contains global variables.
A dominant on the large personal computers using MOTOROLA 6899
PROCESS STATE – consists of everything necessary to resume the process
CPU family.
execution if it is put aside temporarily.
- First used by designers of MULTICS in 1960’s. 2. RUUNNING STATE – The process is using the CPU at that particular
- interchangeably with ‘task’ or ’job’. moment.
3.BLOCKED or WAITING STATE – The process is waiting for some event to - Some program starts another process
happen before it can proceed.
PROCESS TERMINATION:
4. READY STATE – the process is ready to use the CPU again.
- a process terminated when it finishes executing its last statement.
5. TERMINATED STATE – the process has finished execution. - Resources are returned to the system and purged from any system
list or tables.
PROCESS OPERATION:
- The Process Control Block (PCB)is erased.
System initialization - The new process terminates the existing process.
Execution of a process
REASON FOR NEW PROCESS TERMINATING EXISTING PROCESS:
Creation system calls by a running process
User request to create new process NORMAL EXIST – processes are terminated bc they have done their job.
Initialization of a batch job. Also known as ‘exist’ in UNIX.
FOREGROUND PROCESSES – interact with users ERROR EXIST – when process discovers a fatal error.
BACKGROUND PROCESSES – inactive but spring to life to handle activity FATAL ERROR – error caused by process due to a bug in program
such as email, webpage, printing, etc.
KILLED BY ANOTHER PROCESS – a process executes a system call telling the
DAEMONS – other term for background processes. Creates an exact clone OS to terminate other process. UNIX = kill.
of the calling process
PROCESS STATE TRANSITION:
FORK – a way for a process to create new process.
- User logs on
- User starts a program
- OS creates process to provide service
PROCESS CONTROL BLOCK – a process in OS represented by a data
structure. It contains important information about the process. It defines a
process to the Operating Systems.
OS MODULE 3:
CPU SCHEDULING – it determines when processors should be assigned and
to which process it will be assigned. Also referred as Processor Scheduling.
GOALS OF SCHEDULING:
FAIRNESS – a scheduler makes sure that each process gets its fair share of
the CPU and no process can suffer indefinite postponement.
TRANSITION 1: Occurs when a process discovers it cannot continue. POLICY ENFORCEMENT – the scheduler makes sure that system’s policy is
State: Block. Running Block enforces.
TRANSITION 2: Occurs when a scheduler decided that the running process EFFICIENCY – scheduler should keep the system busy all the time when
has run long enough and its time to let other process have CPU time. possible. If the CPU and all the I/O devices are kept running all the time, more
State: Time-Run-Out. Running Ready work gets done.
TRANSITION 3: Occurs when other processes have had their share and its RESPONSE TIME – a scheduler should minimize the response time for
time for first process to run again. State: Dispatch. Ready interactions to the user.
Running
TURNAROUND – a scheduler should maximize the number of jobs process
TRANSITION 4: Occurs when external event happens for a waiting process. per unit of time.
State: Wakeup. Blocked Ready
SCHEDULING ALGORITHMS CATEGORIES:
TRANSITION 5: Occurs when a process is created.
NONPREEMPTIVE SCHEDULING
State: Admitted. New Ready
PREEMPTIVE SCHEDULING
TRANSITION 6: Occurs when process has finished execution.
NONPREEMPTIVE SCHEDULING – a process has been give the CPU and the
State: Exit. Running Terminated
CPU cannot taken away from that process.
PREEMPTIVE SCHEDULING – the CPU in the process can be taken away The longer the CPU burst time, the lower the priority and vice versa.
anytime.
SCHEDULING ALGORITHM:
FCFS SCHEDULING
SJF SCHEDULING
ROUND ROBIN SCHEDULING
PRIORITY SCHEDULING
FIRST-COME-FIRST-SERVE SCHEDULING:
First-In-First-Out
Run to Completion
Run-Until-Done
The simplest scheduling algorithm.
Processes are dispatched according to their arrival time on the
ready queue.
It is more predictable compared to other scheduling algorithms.
SHORTST-JOB-FIRST SCHEDULING:
PRIORITY SCHEDULING: