Unit 01

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 65

UNIT 01

FUNDAMENTALS OF OPERATING
SYSTEMS
Contents
• OS Services and components
• Multitasking
• Multiprogramming
• Multiprocessing time sharing
• Buffering
• Spooling
• Distributed OS
Operating System
• An Operating System(OS) is software that
manages and handles the hardware and software
resources of a computer system.
• It provides interaction between users of computers
and computer hardware.
• An operating system is responsible for managing
and controlling all the activities and sharing of
computer resources.
• An operating system is a low-level Software that
includes all the basic functions like processor
management, memory management, Error
detection, etc.
• No matter its size and application, every computer
needs an operating system to make it functional and
useful.
• The operating system is an integral part of modern
computer systems.
• It is a well-organized collection of programs that
manages the hardware.
• An Operating System provides an interaction between
the users and computer hardware.
• A user is a person sitting at the computer terminal
concerned about the application rather than the
architecture of the computer.
• The user never interacts with the hardware directly. To
get the services of the hardware, he has to request
through the operating system.
• The operating system is a primary resource
manager.
• It manages the hardware, including processors,
memory, Input-Output devices, and
communication devices.
• The operating system operates either in kernel
mode or user mode.
• Compilers and editors run in user mode, whereas
operating system code runs in kernel mode.
Operating system services

• The operating system provides the programming


environment in which a programmer works on a
computer system.
• The user program requests various resources through
the operating system.
• The operating system gives several services to utility
programmers and users.
• Applications access these services through application
programming interfaces or system calls.
• By invoking those interfaces, the application can
request a service from the operating system, pass
parameters, and acquire the operation outcomes.
• Following are the services provided by an
operating system -

o Program execution
o Control Input/output devices
o Program creation
o Error Detection and Response
o Accounting
o Security and Protection
o File Management
o Communication
 Program execution

• To execute a program, several tasks need to be


performed.
• Both the instructions and data must be loaded into
the main memory. In addition, input-output
devices and files should be initialized, and other
resources must be prepared.
• The Operating structures handle these kinds of
tasks.
 Control Input/output devices

• As there are numerous types of I/O devices within


the computer system, and each I/O device calls
for its own precise set of instructions for the
operation.
• The Operating System hides that info with the aid
of presenting a uniform interface.
• Thus, it is convenient for programmers to access
such devices easily.
 Program Creation
• The Operating system offers the structures and
tools, including editors and debuggers, to help the
programmer create, modify, and debug programs.
 Error Detection and Response
• An Error in a device may also cause
malfunctioning of the entire device.
• These include hardware and software errors such
as device failure, memory error, division by zero,
attempts to access forbidden memory locations,
etc.
• To avoid error, the operating system monitors the
system for detecting errors and takes suitable
action with at least impact on running applications.
• While working with computers, errors may occur
quite often. Errors may occur in the:
• Input/ Output devices: For example, connection
failure in the network, lack of paper in the printer, etc.
• User program: For example: attempt to access illegal
memory locations, divide by zero, use too much CPU
time, etc.
• Memory hardware: For example, Memory error, the
memory becomes full, etc.
• To handle these errors and other types of possible
errors, the operating system takes appropriate action
and generates messages to ensure correct and
consistent computing.
• Accounting

• An Operating device collects utilization records


for numerous assets and tracks the overall
performance parameters and responsive time to
enhance overall performance.
• These personal records are beneficial for
additional upgrades and tuning the device to
enhance overall performance.
• Security and Protection

• Operating device affords safety to the statistics


and packages of a person and protects any
interference from unauthorized users.
• The safety feature counters threats, which are
published via way of individuals out of doors the
manage of the running device.
• For example When a user downloads something from
the internet, that program may contain malicious code
that may harm the already existing programs.
• The operating system ensures that proper checks are
applied while downloading such programs.
• If one computer system is shared amongst a couple of
users, then the various processes must be protected
from another intrusion.
• For this, the operating system provides various
mechanisms that allow only those processes to use
resources that have gained proper authorization from
the operating system.
• The mechanism may include providing unique users
ids and passwords to each user.
• File management
• Computers keep data and information on secondary
storage devices like magnetic tape, magnetic disk,
optical disk, etc. Each storage media has its
capabilities like speed, capacity, data transfer rate, and
data access methods.
• For file management, the operating system must know
the types of different files and the characteristics of
different storage devices. It has to offer the proportion
and safety mechanism of documents additionally.
• Communication
• The operating system manages the exchange of data
and programs among different computers connected
over a network. This communication is accomplished
using message passing and shared memory.
Components of OS
• An operating system is a large and complex system
that can only be created by partitioning into small
parts.
• These pieces should be a well-defined part of the
system, carefully defining inputs, outputs, and
functions.
• Although Windows, Mac, UNIX, Linux, and other
OS do not have the same structure, most operating
systems share similar OS system components, such
as file, memory, process, I/O device management.
• The components of an operating system play a
key role to make a variety of computer system
parts work together. There are the following
components of an operating system, such as:
1. Process Management
• The process management component is a procedure for
managing many processes running simultaneously on
the operating system.
• Every running software application program has one or
more processes associated with them.
• For example, when you use a search engine like
Chrome, there is a process running for that browser
program.
• Process management keeps processes running
efficiently. It also uses memory allocated to them and
shutting them down when needed.
• The execution of a process must be sequential so, at
least one instruction should be executed on behalf of
the process.
 Functions of process management

• Here are the following functions of process


management in the operating system, such as:
• Process creation and deletion.
• Suspension and resumption.
• Synchronization process
• Communication proces
2. File Management
• A file is a set of related information defined by its
creator.
• It commonly represents programs (both source and
object forms) and data. Data files can be alphabetic,
numeric, or alphanumeric.
• The operating system has the following important
activities in connection with file management:
 File and directory creation and deletion.
 For manipulating files and directories.
 Mapping files onto secondary storage.
 Backup files on stable storage media.
3. Network Management
• Network management is the process of
administering and managing computer networks.
• It includes performance management, provisioning
of networks, fault analysis, and maintaining the
quality of service.
• A distributed system is a collection of computers or
processors that never share their memory and
clock.
• In this type of system, all the processors have their
local memory, and the processors communicate
with each other using different communication
cables, such as fibre optics or telephone lines.
• The network can fully or partially connect in network
management, which helps users design routing and
connection strategies that overcome connection and
security issues.
• Network management provides the following
functions, such as:
 Distributed systems help you to various computing
resources in size and function. They may involve
minicomputers, microprocessors, and many general-
purpose computer systems.
 A distributed system also offers the user access to the
various resources the network shares.
 It helps to access shared resources that help
computation to speed up or offers data availability and
reliability
4. Main Memory management

• Main memory is a large array of storage or bytes,


which has an address.
• The memory management process is conducted by
using a sequence of reads or writes of specific
memory addresses.
• It should be mapped to absolute addresses and loaded
inside the memory to execute a program.
• The selection of a memory management method
depends on several factors.
• However, it is mainly based on the hardware
design of the system. Each algorithm requires
corresponding hardware support.
• Main memory offers fast storage that can be
accessed directly by the CPU.
• It is costly and hence has a lower storage capacity.
• However, for a program to be executed, it must be
in the main memory.
• An Operating System performs the following
functions for Memory Management in the
operating system:
 It helps you to keep track of primary memory.
 Determine what part of it are in use by whom,
what part is not in use.
 In a multiprogramming system, the OS decides
which process will get memory and how much.
 Allocates the memory when a process requests.
 It also de-allocates the memory when a process
no longer requires or has been terminated.
5. Secondary-Storage Management

• The most important task of a computer system is


to execute programs. These programs help you to
access the data from the main memory during
execution.
• This memory of the computer is very small to
store all data and programs permanently.
• The computer system offers secondary storage to
back up the main memory.
• Here are some major functions of secondary
storage management in the operating system:

 Storage allocation
 Free space management
 Disk scheduling
6. I/O Device Management
• One of the important use of an operating system
that helps to hide the variations of specific
hardware devices from the user.
• The I/O management system offers the following
functions, such as:
 It offers a buffer caching system
 It provides general device driver code
 It provides drivers for particular hardware
devices.
 I/O helps you to know the individualities of a
specific device
7. Security Management
• The various processes in an operating system need
to be secured from other activities.
• Therefore, various mechanisms can ensure those
processes that want to operate files, memory CPU,
and other hardware resources should have proper
authorization from the operating system.
• Security refers to a mechanism for controlling the
access of programs, processes, or users to the
resources defined by computer controls to be
imposed, together with some means of
enforcement.
8. Command Interpreter System

• One of the most important components of an


operating system is its command interpreter.
• The command interpreter is the primary interface
between the user and the rest of the system.
• Many commands are given to the operating
system by control statements.
• A program that reads and interprets control
statements is automatically executed when a new
job is started in a batch system or a user logs in to
a time-shared system.
• This program is variously called.
 The control card interpreter,
 The command-line interpreter,
 The shell (in UNIX), and so on.
Types of OS
• Batch Operating system
• Multitasking
• Multiprogramming
• Multiprocessing
• Time sharing
• Distributed operating System
• Batch Operating System
• In the 1970s, Batch processing was very popular. In
this technique, similar types of jobs were batched
together and executed in time.
• People were used to having a single computer which
was called a mainframe.
• In Batch operating system, access is given to more
than one person; they submit their respective jobs to
the system for the execution.
• The system put all of the jobs in a queue on the basis
of first come first serve and then executes the jobs
one by one.
• The users collect their respective output when all the
jobs get executed.
• The purpose of this operating system was mainly
to transfer control from one job to another as soon
as the job was completed.
• It contained a small set of programs called the
resident monitor that always resided in one part of
the main memory.
• The remaining part is used for servicing jobs.
• Advantages of Batch OS
• The use of a resident monitor improves computer efficiency as
it eliminates CPU time between two jobs.
• Disadvantages of Batch OS
• 1. Starvation
• Batch processing suffers from starvation.
• There are five jobs J1, J2, J3, J4, and J5, present in the batch.
If the execution time of J1 is very high, then the other four
jobs will never be executed, or they will have to wait for a
very long time. Hence the other processes get starved.
• 2. Not Interactive
• Batch Processing is not suitable for jobs that are dependent on
the user's input. If a job requires the input of two numbers
from the console, then it will never get it in the batch
processing scenario since the user is not present at the time of
execution
• Multiprogramming Operating System

• Multiprogramming is an extension to batch


processing where the CPU is always kept busy.
• Each process needs two types of system time:
CPU time and IO time.
• In a multiprogramming environment, when a
process does its I/O, The CPU can start the
execution of other processes.
• Therefore, multiprogramming improves the
efficiency of the system.
• Advantages of Multiprogramming OS
• Throughout the system, it increased as the CPU
always had one program to execute.
• Response time can also be reduced.

• Disadvantages of Multiprogramming OS
• Multiprogramming systems provide an
environment in which various systems resources
are used efficiently, but they do not provide any
user interaction with the computer system.
• Multiprocessing Operating System

• In Multiprocessing, Parallel computing is achieved.


• There are more than one processors present in the
system which can execute more than one process at
the same time.
• This will increase the throughput of the system.
• Advantages
• Increased reliability: Due to the multiprocessing
system, processing tasks can be distributed among
several processors. This increases reliability as if
one processor fails, the task can be given to
another processor for completion.
• Increased throughout: As several processors
increase, more work can be done in less time.
• Disadvantages
• Multiprocessing operating system is more
complex and sophisticated as it takes care of
multiple CPUs simultaneously.
• Multitasking operating system
• The multitasking operating system is a logical
extension of a multiprogramming system that
enables multiple programs simultaneously.
• It allows a user to perform more than one
computer task at the same time.
• Advantages
• This operating system is more suited to
supporting multiple users simultaneously.
• The multitasking operating systems have well-
defined memory management.
• Disadvantages
• The multiple processors are busier at the same
time to complete any task in a multitasking
environment, so the CPU generates more heat.
• Time-Sharing Operating System

• In the Time Sharing operating system, computer


resources are allocated in a time-dependent
fashion to several programs simultaneously.
• Thus it helps to provide a large number of user's
direct access to the main computer.
• It is a logical extension of multiprogramming.
• In time-sharing, the CPU is switched among
multiple programs given by different users on a
scheduled basis.
• A time-sharing operating system allows many users to be
served simultaneously, so sophisticated CPU scheduling
schemes and Input/output management are required.
• Time-sharing operating systems are very difficult and
expensive to build.
• Advantages
• The time-sharing operating system provides effective
utilization and sharing of resources.
• This system reduces CPU idle and response time.
• Disadvantages
• Data transmission rates are very high in comparison to
other methods.
• Security and integrity of user programs loaded in
memory and data need to be maintained as many users
access the system at the same time.
• Distributed Operating System

• The Distributed Operating system is not installed


on a single machine, it is divided into parts, and
these parts are loaded on different machines.
• A part of the distributed Operating system is
installed on each machine to make their
communication possible.
• Distributed Operating systems are much more
complex, large, and sophisticated than Network
operating systems because they also have to take
care of varying networking protocols.
• Advantages of Distributed Operating System
• The distributed operating system provides sharing
of resources.
• This type of system is fault-tolerant.

• Disadvantages of Distributed Operating System


• Protocol overhead can dominate computation
cost.
Buffering in Operating System

• The buffer is an area in the main memory used to


store or hold the data temporarily.
• In other words, buffer temporarily stores data
transmitted from one place to another, either
between two devices or an application.
• The act of storing data temporarily in the buffer is
called buffering.
• A buffer may be used when moving data between
processes within a computer.
• Buffers can be implemented in a fixed memory
location in hardware or by using a virtual data buffer
in software, pointing at a location in the physical
memory.
• In all cases, the data in a data buffer are stored on a
physical storage medium.
• Most buffers are implemented in software, which
typically uses the faster RAM to store temporary
data due to the much faster access time than hard
disk drives.
• Buffers are typically used when there is a
difference between the rate of received data and
the rate of processed data, for example, in a
printer spooler or online video streaming.
• A buffer often adjusts timing by implementing
a queue or FIFO algorithm in memory,
simultaneously writing data into the queue at
one rate and reading it at another rate.
• Purpose of Buffering
• You face buffer during watching videos on YouTube
or live streams. In a video stream, a buffer represents
the amount of data required to be downloaded before
the video can play to the viewer in real-time. A
buffer in a computer environment means that a set
amount of data will be stored to preload the required
data before it gets used by the CPU.
• Computers have many different devices that operate
at varying speeds, and a buffer is needed to act as a
temporary placeholder for everything interacting.
This is done to keep everything running efficiently
and without issues between all the devices,
programs, and processes running at that time.
• Types of Buffering

• There are three main types of buffering in the


operating system, such as:
1. Single Buffer

• In Single Buffering, only one buffer is used to


transfer the data between two devices.
• The producer produces one block of data into the
buffer.
• After that, the consumer consumes the buffer.
• Only when the buffer is empty, the processor
again produces the data.
2. Double Buffer

• In Double Buffering, two schemes or two buffers


are used in the place of one.
• In this buffering, the producer produces one
buffer while the consumer consumes another
buffer simultaneously. So, the producer not needs
to wait for filling the buffer.
• Double buffering is also known as buffer
swapping.
3. Circular Buffer

• When more than two buffers are used, the buffers'


collection is called a circular buffer.
• Each buffer is being one unit in the circular
buffer.
• The data transfer rate will increase using the
circular buffer rather than the double buffering
• Spooling in Operating System
• In Operating System, we had to give the input to
the CPU, and the CPU executes the instructions
and finally gives the output.
• But there was a problem with this approach.
• In a normal situation, we have to deal with many
processes, and we know that the time taken in the
I/O operation is very large compared to the time
taken by the CPU for the execution of the
instructions.
• So, in the old approach, one process will give the
input with the help of an input device, and during
this time, the CPU is in an idle state.
• Then the CPU executes the instruction, and the
output is again given to some output device, and
at this time, the CPU is also in an idle state.
• After showing the output, the next process starts
its execution.
• So, most of the time, the CPU is idle, which is the
worst condition that we can have in Operating
Systems.
• Here, the concept of Spooling comes into play.
• What is Spooling
• Spooling is a process in which data is
temporarily held to be used and executed by a
device, program, or system.
• Data is sent to and stored in memory or other
volatile storage until the program or computer
requests it for execution.
• SPOOL is an acronym for simultaneous
peripheral operations online.
• Generally, the spool is maintained on the
computer's physical memory, buffers, or the
I/O device-specific interrupts.
• The spool is processed in ascending order,
working based on a FIFO (first-in, first-out)
algorithm.
• Spooling refers to 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.
• An operating system does the following activities
related to the distributed environment:
• Handles I/O device data spooling as devices have
different data access rates.
• Maintains the spooling buffer, which provides a
waiting station where data can rest while the
slower device catches up.
• Maintains parallel computation because of the
spooling process as a computer can perform I/O in
parallel order.
• It becomes possible to have the computer read
data from a tape, write data to disk, and write out
to a tape printer while it is doing its computing
task.
• Example of Spooling
• The biggest example of Spooling is printing. The
documents which are to be printed are stored in the
SPOOL and then added to the queue for printing.
During this time, many processes can perform their
operations and use the CPU without waiting while
the printer executes the printing process on the
documents one-by-one.
• Many features can also be added to the Spooling
printing process, like setting priorities or notification
when the printing process has been completed or
selecting the different types of paper to print on
according to the user's choice.
Assignment no: 01

1. Explain advantages and disadvantages of


Buffering.
2. Explain advantages and disadvantages of
spooling.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy