2. What is an Operating System?
⢠A program that acts as an intermediary
between a user of a computer and the
computer hardware
⢠Operating system goals:
⍠Execute user programs and make solving
user problems easier
⍠Make the computer system convenient to
use
⍠Use the computer hardware in an efficient
manner
3. Computer System Structure
⢠Computer system can be divided into four
components:
⍠Hardware â provides basic computing resources
ď CPU, memory, I/O devices
⍠Operating system
ď Controls and coordinates use of hardware among
various applications and users
⍠Application programs â define the ways in which
the system resources are used to solve the
computing problems of the users
ď Word processors, compilers, web browsers, database
systems, video games
⍠Users
ď People, machines, other computers
5. Advantages of OS
⢠Users want convenience, ease of use and good
performance
⍠Donât care about resource utilization
⍠Operating system is a resource allocator and control
program making efficient use of HW and managing
execution of user programs
⢠Offers an environment in which a user may execute
programs/applications
⢠Mobile devices like smartphones and tables are
resource poor, optimized for usability and battery life
⍠Mobile user interfaces such as touch screens, voice
recognition
⍠Easy to use with a GUI
⢠Disadvantages of using Operating System
⢠If any issue occurs in OS, you may lose all the contents
which have been stored in your system
⢠Operating system'
6. History of OS
⢠Operating systems were first developed in the late 1950s
to manage tape storage
⢠The General Motors Research Lab implemented the first
OS in the early 1950s for their IBM 701
⢠In the mid-1960s, operating systems started to use disks
⢠In the late 1960s, the first version of the Unix OS was
developed
⢠The first OS built by Microsoft was DOS. It was built in
1981 by purchasing the 86-DOS software from a Seattle
company
⢠The present-day popular OS Windows first came to
existence in 1985 when a GUI was created and paired
with MS-DOS.
7. Operating System Definition
⢠âThe one program running at all times on the
computerâ is the kernel, part of the operating system
⢠Everything else is either
⍠A system program (ships with the operating system, but
not part of the kernel) , or
⍠An application program, all programs not associated
with the operating system
⢠Todayâs OSes for general purpose and mobile
computing also include middleware â a set of software
frameworks that provide additional services to
application developers such as databases, multimedia,
graphics
8. Features of OS
⢠Protected and supervisor mode
⢠Allows disk access and file systems Device drivers
Networking Security
⢠Program Execution
⢠Memory management Virtual Memory Multitasking
⢠Handling I/O operations
⢠Manipulation of the file system
⢠Error Detection and handling
⢠Resource allocation
⢠Information and Resource Protection
10. Simple Batch system
⢠Single user cannot always keep CPU and I/O devices busy
⢠Multiprogramming organizes jobs (code and data) so CPU
always has one to execute
⢠A subset of total jobs in system is kept in memory
⢠no direct interaction between user and the computer
⢠One job selected and run via job scheduling
⢠When job has to wait (for I/O for example), OS switches to
another job
11. ⢠Advantages of Batch Operating System:
⢠Processors of the batch systems knows how long the job would
be when it is in queue.
⢠Multiple users can share the batch systems.
⢠The idle time batch system is very less.
⢠It is easy to manage large work repeatedly in batch systems
⢠The overall time taken by the system to execute all the
programs will be reduced.
⢠Disadvantages of Batch Operating System:
⢠The computer operators should be well known with batch
systems.
⢠Batch systems are hard to debug.
⢠The other jobs will have to wait for an unknown time if any
job fails
⢠Lack of interaction between user and the job
⢠Examples of Batch based Operating System: Payroll
System, Bank Statements
12. Spooling and Buffering
⢠In order to process tasks most efficiently, computer systems use
various methods.
⢠There are two ways by which Input/output subsystems can improve
the performance
⢠Spooling and buffering are the two ways by which I/O subsystems
improve the performance and efficiency of the computer by using a
storage space in main memory or on the disk.
⢠Spooling stands for Simultaneous peripheral operation online. A
spool is similar to buffer as it holds the jobs for a device until the
device is ready to accept the job.
⢠Buffering is an act of storing data temporarily in the buffer. It
helps in matching the speed of the data stream between the sender
and the receiver.
⢠The basic difference between Spooling and Buffering is that
Spooling overlaps the input/output of one job with the execution of
another job while the buffering overlaps the input/output of one job
with the execution of the same job.
13. Multi-programmed Systems
⢠In this the operating system picks up and begins to
execute one of the jobs from memory.
⢠Once this job needs an I/O operation operating system
switches to another job (CPU and OS always busy).
⢠Jobs in the memory are always less than the number of
jobs on disk (Job Pool).
⢠If several jobs are ready to run at the same time, then the
system chooses which one to run through the process
of CPU Scheduling.
⢠In Non-multiprogrammed system, there are moments
when CPU sits idle and does not do any work.
⢠In Multiprogramming system, CPU will never be idle and
keeps on processing.
⢠In multiprogramming system the CPU
utilization is more and CPU is not idle
14. Multitasking or Timesharing
⢠A logical extension of Batch systemsâ the CPU switches jobs so
frequently that users can interact with each job while it is
running, creating interactive computing
⢠more than one processes are being executed at a particular time
with the help of the time-sharing concept.
⍠Response time should be < 1 second
⍠Each user has at least one program executing in memory ď
process
⍠If several jobs ready to run at the same time ď CPU
scheduling
⍠If processes donât fit in memory, swapping moves them in and
out to run
⍠Virtual memory allows execution of processes not completely
in memory
15. ⢠Advantages:
⢠Since equal time quantum is given to each
process, so each process gets equal opportunity
to execute.
⢠The CPU will be busy.
⢠Disadvantages:
⢠Process having higher priority will not get the
chance to be executed first because the equal
opportunity is given to each process.
16. Personal computer system
⢠Personal computer operating system provides a good
interface to a single user.
⢠Personal computer operating systems are widely used for
word processing, spreadsheets and Internet access.
⢠Personal computer operating system are made only for
personal.
⢠laptops, computer systems, tablets etc. are your personal
computers and the operating system such as windows 7,
windows 10, android, etc. are your personal computer
operating system.
⢠Aim is to maximize user convenience and responsiveness
17. Distributed systems
⢠systems have their own CPU, main memory, secondary memory, and
resources, These are referred to as loosely coupled systems
⢠These systems are connected to each other using a shared communication
network.
⢠Each system can perform its task individually.
⢠Distributed Operating System has remote access i.e. one user can access the
data of the other system and can work accordingly.
18. ⢠There are mainly two types of distributed systems
⢠1. Client/Server Systems
⢠The client requests the server for a resource. On the other hand, the server
provides this resource to the client.
⢠One client contacts only a single server at a time. Whereas a single server
can deal with multiple clients simultaneously.
⢠The clients and servers connect through a computer network in the system.
⢠2. Peer to Peer Systems
⢠In this system, the nodes play an important role.
⢠All the work equally divides among the nodes. Furthermore, these nodes
can share data or resources as per the requirement, they require a network
to connect.
⢠Nodes in peer to peer networks act as both clients and servers
⢠The nodes in peer to peer networks both use resources and provide
resources.
19. ⢠Advantages:
⢠Since the systems are connected with each other so, the failure
of one system can't stop the execution of processes because
other systems can do the execution.
⢠Resources are shared between each other.
⢠The load on the host computer gets distributed and this, in
turn, increases the efficiency.
⢠Since resources are being shared, computation is highly fast
and durable
⢠Load on host computer reduces
⢠Disadvantages:
⢠Since the data is shared among all the computers, so to make
the data secure and accessible to few computers, you need to
put some extra efforts.
⢠If there is a problem in the communication network then the
whole communication will be broken.
20. Real time systems
⢠These types of OSs serve real-time systems. The time interval
required to process and respond to inputs is very small. This time
interval is called response time.
⢠Real-time systems are used when there are time requirements
that are very strict like missile systems, air traffic control systems,
robots, etc.
⢠Two types of Real-Time Operating System which are as
follows:
⢠Hard Real-Time Systems:
These OSs are meant for applications where time constraints are
very strict and even the shortest possible delay is not acceptable.
These systems are built for saving life like automatic parachutes or
airbags which are required to be readily available in case of any
accident. Virtual memory is rarely found in these systems.
⢠Soft Real-Time Systems:
These OSs are for applications where for time-constraint is less
strict.
21. The advantages of real-time operating systems are as follows-
⢠Maximum consumption â Maximum utilization of devices and systems.
Thus more output from all the resources.
⢠Task Shifting â Time assigned for shifting tasks in these systems is very
less.
⢠Focus On Application â Focus on running applications and less
importance to applications that are in the queue.
⢠Error Free â These types of systems are error-free.
⢠Memory Allocation â Memory allocation is best managed in these types
of systems.
The disadvantages of real-time operating systems are as follows-
⢠Limited Tasks â Very few tasks run simultaneously
⢠Use Heavy System Resources â Sometimes the system resources are
not so good and they are expensive as well.
⢠Complex Algorithms â The algorithms are very complex and difficult for
the designer to write on.
22. Operating system structure
⢠Simple structure:
⢠The interfaces and levels of functionality are not well separated. MS-DOS is
an example of such operating system
⢠In MS-DOS application programs are able to access the basic I/O routines.
⢠These types of operating system cause the entire system to crash if one of
the user programs fails.
⢠Easy for kernel developers to develop such an operating system.
⢠The structure is very complicated as no clear boundaries exists between
modules.
⢠It does not enforce data hiding
in the operating
23. ⢠Layered structure:
⢠structure the OS is broken into number of layers (levels).
⢠The bottom layer (layer 0) is the hardware and the topmost layer (layer N)
is the user interface.
⢠These layers are so designed that each layer uses the functions of the lower
level layers only.
⢠This simplifies the debugging process
⢠The main disadvantage of this
structure is that at each layer, the
data needs to be modified and passed on
which adds overhead to the system.
⢠It requires careful planning for designing the
layers as higher layers use the functionalities of only
the lower layers.
⢠UNIX is an example of this structure.
24. Microkernels
⢠This structures the operating system by removing all nonessential portions of
the kernel and implementing them as system and user level programs.
⢠Generally they provide minimal process and memory management, and a
communications facility.
⢠Communication between components of the OS is provided by message
passing.
⢠The microkernel also provides more security and reliability.
⢠Main disadvantage is poor performance due to increased system overhead
from message passing.
26. ⢠User Interfaces - Means by which users can issue commands to the system.
Depending on the system these may be a command-line interface ( e.g. sh, csh, ksh,
tcsh, etc. ), a GUI interface ( e.g. Windows, X-Windows, KDE, Gnome, etc. ), or a
batch command systems
⢠Program Execution - The OS must be able to load a program into RAM, run the
program, and terminate the program, either normally or abnormally.
⢠I/O Operations - The OS is responsible for transferring data to and from I/O
devices, including keyboards, terminals, printers, and storage devices.
⢠File-System Manipulation - In addition to raw data storage, the OS is also
responsible for maintaining directory and subdirectory structures
⢠Communications - Inter-process communications, IPC, either between processes
running on the same processor, or between processes running on separate processors
or separate machines.
⢠Error Detection - Both hardware and software errors must be detected and
handled appropriately, with a minimum of harmful repercussions.
⢠Resource Allocation - E.g. CPU cycles, main memory, storage space, and
peripheral devices.
⢠Accounting - Keeping track of system activity and resource usage.
⢠Protection and Security - Preventing harm to the system and to resources, either
through wayward internal processes or malicious outsiders.
27. System call
⢠The interface between a process and an operating system is
provided by system calls.
⢠System calls are usually made when a process in user mode requires
access to a resource. Then it requests the kernel to provide the
resource via a system call.
28. ⢠The processes execute normally in the user mode until a
system call interrupts this. Then the system call is executed on
a priority basis in the kernel mode. After the execution of the
system call, the control returns to the user mode and
execution of user processes can be resumed.
⢠In general, system calls are required in the following
situations â
⢠If a file system requires the creation or deletion of files.
Reading and writing from files also require a system call.
⢠Creation and management of new processes.
⢠Network connections also require system calls. This includes
sending and receiving packets.
⢠Access to a hardware devices such as a printer, scanner etc.
requires a system call.
29. Types of System Calls
⢠Process Control
⢠These system calls deal with processes such as process creation,
process termination etc.
⢠File Management
⢠These system calls are responsible for file manipulation such as
creating a file, reading a file, writing into a file etc.
⢠Device Management
⢠These system calls are responsible for device manipulation such as
reading from device buffers, writing into device buffers etc.
⢠Information Maintenance
⢠These system calls handle information and its transfer between the
operating system and the user program.
⢠Communication
⢠These system calls are useful for interprocess communication. They
also deal with creating and deleting a communication connection.
30. System Programs
⢠System programs provide OS functionality
through separate applications, which are not part
of the kernel or command interpreters
31. ⢠File Management: File management is defined as the process of
manipulating files in the computer system, its management includes the
process of creating, modifying and deleting files.
⢠Status Information â
Information like date, time amount of available memory, or disk space .
Terminal or other output devices or files or a window of GUI is used for
showing the output of programs.
⢠File Modification â
For modifying the contents of files
⢠Programming-Language support â
For common programming languages, we use Compilers, Assemblers,
Debuggers, and interpreters which are already provided to users.
⢠Program Loading and Execution â
When the program is ready after Assembling and compilation, it must be
loaded into memory for execution. A loader is part of an operating system
that is responsible for loading programs and libraries.
⢠Communications â
Virtual connections among processes, users, and computer systems are
provided by programs. Users can send messages to another user on their
screen, User can send e-mail, browsing on web pages