0% found this document useful (0 votes)
34 views14 pages

Os101 Reviewer

Uploaded by

esmoothgaming99
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views14 pages

Os101 Reviewer

Uploaded by

esmoothgaming99
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

MODULE 1: INTRODUCTION TO OPERATING

SYSTEM Following are some of the important functions of an


operating System:
Operating System (OS)  Memory Management
- a collection of software that manages computer  Processor Management
hardware resources and provides common services  Device Management
for computer programs.  File Management
 Security
Why learn an Operating System?  Control over system performance
- is an interface between a computer user and  Job accounting
computer hardware.  Error detecting aids
- software that performs all the basic tasks like  Coordination between other software and users
file management, memory management,
process management, handling input and  MEMORY MANAGEMENT
output, and controlling peripheral devices - refers to management of Primary Memory or
such as disk drives and printers. Main Memory.
 MAIN MEMORY
EXAMPLE OF OPERATING SYSTEM: - provides a fast storage that can be
- WINDOWS accessed directly by the CPU.
- Apple macOS - is a large array of words or bytes where
- Google's Android OS each word or byte has its own address.
- Apple iOS
- Linux Operating System An Operating System does the following activities for
memory management:
- Keeps tracks of primary memory, i.e., what
part of it are in use by whom, what part are
not in use.
- In multiprogramming, the OS decides which
process will get memory when and how
much.
- Allocates the memory when a process
requests it to do so.
- De-allocates the memory when a process no
longer needs it or has been terminated.

 PROCESSOR MANAGEMENT
- In multiprogramming environment, the OS
decides which process gets the processor
when and for how much time. This function
called Process scheduling
2. Control over system performance −
An Operating System does the following activities for
processor management: Recording delays between request for a
- Keeps tracks of processor and status of service and response from the system.
process. The program responsible for this
task is known as traffic controller.
- Allocates the processor (CPU) to a process. 3. Job accounting − Keeping track of time and
- De-allocates processor when a process is no resources used by various jobs and users.
longer required.

 DEVICE MANAGEMENT 4. Error detecting aids − Production of dumps,


- manages device communication via their traces, error messages, and other debugging
respective drivers.
and error detecting aids
It does the following activities for device
management: 5. Coordination between other software’s and
- Keeps tracks of all devices. Program
responsible for this task is known as the users − Coordination and assignment of
I/O controller. compilers, interpreters, assemblers and other
- Decides which process gets the device when
and for how much time. software to the various users of the computer
- Allocates the device in the efficient way. systems.
- De-allocates devices.

 FILE MANAGEMENT
- normally organized into directories for easy
navigation and usage.

An Operating System does the following activities for


file management:
- Keeps track of information, location, uses,
status etc. The collective facilities are often
known as file system.
- Decides who gets the resources.
- Allocates the resources.
- De-allocates the resources.

APPLICATIONS OF OPERATING SYSTEM


Following are some of the important activities that an
Operating System performs:

1. Security − By means of password and similar


other techniques, it prevents unauthorized
access to programs and data.
- The processors communicate with one
another through various communication lines
(such as high-speed buses or telephone
lines).
- Processor - sites, nodes, computers and so
on.

MODULE 2: TYPES OF OPERATING SYSTEM


The advantages of distributed systems are as
OPERATING SYSTEMS follows:
- are there from the very first computer - Better service to the customers.
generation and they keep evolving with time. - With resource sharing facility, a user at one
site may be able to use the resources
TYPES OF OPERATING SYSTEM available at another.
- Speedup the exchange of data with one
 TIME-SHARING / MULTITASKING another via electronic mail.
- a technique which enables many people, - If one site fails in a distributed system, the
located at various terminals, to use a remaining sites can potentially continue
particular computer system at the same time. operating.
- Is a logical extension of multiprogramming. - Better service to the customers.
- Processor’s time is shared among multiple - Reduction of the load on the host computer.
users. - Reduction of delays in data processing.

Advantages of Timesharing operating systems are  NETWORK OPERATING SYSTEM


as follows: - runs on a server and provides the server the
- Reduces CPU idle time. capability to manage data, users, groups,
- Avoids duplication of software security, applications, and other networking
- Provides the advantage of quick response. functions.

Disadvantages of Time-sharing operating systems The advantages of network operating systems are as
are as follows: follows:
- Problem of reliability. - Security is server managed.
- Security and integrity of user program and
data. The disadvantages of network operating systems are
- Data communication as follows:
- High cost of buying and running a server.
 DISTRIBUTED OPERATING SYSTEM
- use multiple central processors to serve  REAL TIME OPERATING SYSTEM
multiple real-time applications and multiple - a data processing system in which the time
users. interval required to process and respond to
inputs is so small that it controls the
LOOSELY COUPLED SYSTEMS environment.
 RESPONSE TIME
- time taken by the system to respond to an An Operating System manages the communication
input and display of required updated between user and device drivers:
information. - I/O operation means read or write operation
There are two types of real-time operating with any file or any specific I/O device.
systems: - Operating system provides the access to the
1. HARD REAL-TIME SYSTEMS required I/O device when required.
- guarantee that critical tasks complete on
time.  FILE SYSTEM MANIPULATION
- a collection of related information.
2. SOFT REAL-TIME SYSTEMS - normally organized into directories for easy
- less restrictive. A critical real-time task gets navigation and usage.
priority over other tasks and retains the
priority until it completes.

An Operating System provides services to both the Following are the major activities of an operating
users and to the programs: system with respect to file management:
- It provides programs an environment to - Program needs to read a file or write a file.
execute.
 COMMUNICATION
Following are a few common services provided by an - In case of distributed systems which are a
operating system: collection of processors that do not share
- Program execution memory, peripheral devices, or a clock, the
- I/O operations operating system manages communications
- File System manipulation between all the processes. Multiple
- Communication processes communicate with one another
- Error Detection through communication lines in the network.
- Resource Allocation
- Protection Following are the major activities of an operating
system with respect to communication:
 PROGRAM EXECUTION - Two processes often require data to be
- Operating systems handle many kinds of transferred between them.
activities from user programs to system
programs like printer spooler, name servers,  ERROR HANDLING
file server, etc. Each of these activities is - Errors can occur anytime and anywhere. An
encapsulated as a process. error may occur in CPU, in I/O devices or in
the memory hardware.
Major activities of an operating system with respect
to program management: Following are the major activities of an operating
- Loads a program into memory. system with respect to error handling:
- Executes the program. - The OS constantly checks for possible errors.
- Handles program's execution.
 RESOURCE MANAGEMENT
 I/O OPERATION - resources such as main memory, CPU cycles
- an I/O subsystem comprises of I/O devices and files storage are to be allocated to each
and their corresponding driver software. user or job.
MULTITASKING / TIME SHARING
Following are the major activities of an operating - multiple jobs are executed by the CPU
system with respect to resource management: simultaneously by switching between them.
- The OS manages all kinds of resources using - Multitasking Operating Systems are also
schedulers. known as Time-sharing systems.

MODULE 3: PROPERTIES OF OPERATING


SYSTEM (FCFS)

BATCH PROCESSING
- collects the programs and data together in a
MULTIPROGRAMMING
batch before processing starts.
- when two or more programs reside in
memory at the same time
An operating system does the following activities
related to batch processing:
An OS does the following activities related to
- Jobs are processed in the order of
multiprogramming:
submission, i.e., first come first served
- The operating system keeps several jobs in
fashion.
memory at a time.

Advantages
- Batch processing takes much of the work of
the operator to the computer.

Disadvantages
- Difficult to debug program.
- putting data of various I/O jobs in a buffer.
- this buffer is a special area in memory or hard
disk which is accessible to I/O devices.

ADVANTAGES
- High and efficient CPU utilization.

DISADVANTAGES
- CPU scheduling is required.

INTERACTIVITY
- ability of users to interact with a computer
system.

DISTRIBUTED ENVIRONMENT
- multiple independent CPUs or processors in
a computer system.

Following activities related to distributed


environment:
- The OS distributes computation logics among
several physical processors.

SPOOLING
- acronym for Simultaneous Peripheral
Operations on Line.
Component & Description

1. Stack - process Stack contains the temporary


data such as method/function parameters,
return address and local variables.
2. Heap - This is dynamically allocated memory
to a process during its run time.
3. Text - This includes the current activity
represented by the value of Program Counter
and the contents of the processor's registers.
4. Data - This section contains the global and
static variables.

MODULE 4: PROPERTIES OF OPERATING


SYSTEM (SJF)

PROCESS
PROCESS LIFE CYCLE
- basically a program in execution.
- When a process executes, it passes through
- The execution of a process must progress in
different states.
a sequential fashion.
- In general, a process can have one of the
- an entity which represents the basic unit of
following five states at a time;
work to be implemented in the system.
1. Start - the initial state when a process is first - The PCB is identified by an integer Process
started/created. ID (PID).
2. Ready - waiting to be assigned to a
processor. A PCB keeps all the information needed to keep
3. Running - set to running and the processor track of a process as listed below in the table:
executes its instructions.
4. Waiting - moves into the waiting state if it 1. Process State - The current state of the
needs to wait for a resource, such as waiting process i.e., whether it is ready, running,
for user input. waiting, or whatever.
5. Terminated or Exit - Once the process 2. Process privileges - This is required to
finishes its execution, it is moved to the allow/disallow access to system resources.
terminated state where it waits to be removed 3. Process ID - Unique identification for each of
from main memory. the process in the operating system.
4. Pointer - A pointer to parent process.
5. Program Counter - Program Counter is a
pointer to the address of the next instruction
to be executed for this process.
6. CPU registers - Various CPU registers
where process need to be stored for
execution for running state.
7. CPU Scheduling Information - Process
priority and other scheduling information
which is required to schedule the process.

PROCESS SCHEDULING
- activity of the process manager that handles
PROGRAM
the removal of the running process from the
- a piece of code which may be a single line or
CPU.
million of lines.
- essential part of a Multiprogramming
operating systems.
COMPUTER PROGRAM
- collection of instructions that performs a
Process Scheduling Queues:
specific task when executed by a computer.
 Job queue − This queue keeps all the
ALGORITHM processes in the system.
- part of a computer program that performs a
well-defined task.  Ready queue − This queue keeps a set of all
processes residing in main memory, ready
and waiting to execute.
SOFTWARE  Device queues − The processes which are
- collection of computer programs, libraries and
related data. blocked due to unavailability of an I/O device
constitute this queue.
Process Control Block (PCB)
- a data structure maintained by the Operating
System for every process.
When the process is switched, the following
information is stored for later use;
- Program Counter
- Scheduling information
- Base and limit register value

Process Scheduler
- schedules different processes to be assigned
Two-State Process Model to the CPU based on particular scheduling
- running and non-running states which are algorithms.
described below;
1. Running - When a new process is created, it Popular process scheduling algorithms;
enters into the system as in the running state. - First-Come, First-Served (FCFS) Scheduling
2. Not Running - Processes that are not running - Shortest-Job-Next (SJN) Scheduling
are kept in queue, waiting for their turn to execute. - Priority Scheduling
- Shortest Remaining Time
Schedulers - Round Robin(RR) Scheduling
- special system software which handles - Multiple-Level Queues Scheduling
process scheduling in various ways;
- Long-Term Scheduler Algorithms
- Short-Term Scheduler - either non-preemptive or preemptive.
- Medium-Term Scheduler
Non-preemptive algorithms
Long Term Scheduler - designed so that once a process enters the
- also called a job scheduler. running state, it cannot be preempted until it
- determines which programs are admitted to completes its allotted time,
the system for processing.
Preemptive
Short Term Scheduler - based on priority where a scheduler may
- also called as CPU scheduler. preempt a low priority running process
- main objective is to increase system anytime when a high priority process enters
performance in accordance with the chosen into a ready state.
set of criteria.

Medium Term Scheduler Shortest Job Next (SJN)


- a part of swapping. - This is also known as shortest job first, or
- removes the processes from the memory. SJF
- Swapping - said to be swapped out or rolled - This is a non-preemptive, pre-emptive
out. scheduling algorithm.
- Best approach to minimize waiting time.
Context switches
- computationally intensive since register and
memory state must be saved and restored.
MODULE 5: SHORTEST REMAINING TIME AND ROUND ROBIN SCHEDULING

Process Scheduler
- schedules different processes to be assigned to the CPU based on particular scheduling algorithms;
- First-Come, First-Served (FCFS) Scheduling
- Shortest-Job-Next (SJN) Scheduling
- Priority Scheduling
- Shortest Remaining Time
- Round Robin(RR) Scheduling

SRTF: Shortest Remaining Time First Scheduling Algorithm


- used in Operating Systems, which can also be called as the preemptive version of the SJF scheduling
algorithm.
- The process which has the least processing time remaining is executed first. As it is a preemptive type
of schedule, it is claimed to be better than SJF scheduling Algorithm.
ROUND ROBIN SCHEDULING IN OPERATING SYSTEM
- one of the well-known and widely used process scheduling algorithms.

Total Turn-Around Time = 9 + 9 + 3 + 7 = 28 milliseconds


Average Turn-Around Time= Total Turn-Around Time / Total No. of
Processes

= 28 / 4

= 7 milliseconds

Total Waiting Time = 6 + 6 + 1 + 3

= 16 milliseconds

Average Waiting Time = Total Waiting Time / Total No. of Processes

= 16 / 4

= 4 milliseconds

You might also like