You are on page 1of 33

Unit 1

Operating system
What is an Operating System?
• What is an Operating system?
– A program that acts as an intermediate/ interface between a user of a
computer and the computer hardware.
– Resource allocator (Managing the resources efficiently)
– Control Program

• Operating system goals:


– Execute user programs and make problem solving easier.
– Make the computer system convenient to use
– Efficiently use available resources

• An operating system is the one program that is running at all the times on
the computer- usually called the kernel.
• Kernel is a program that (allow) let the hardware to recognize and read
the program/process.
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 resources among various applications
and users
– System/Application programs – define the ways in which the system
resources are used to solving user problems
• Word processors, compilers, web browsers, database systems, video
games
– Users
• People, machines, other computers
Four Components of a Computer System
Computer System Organization
• Computer-system operation
– One or more CPUs, device controllers connect through common bus providing
access to shared memory
– Concurrent execution of CPUs and devices competing for memory cycles
TYPES OF OS
Batch Systems
“Batch operating system. The users of a batch operating system
do not interact with the computer directly.
Each user prepares his job on an off-line device like punch cards
and submits it to the computer operator.
To speed up processing, jobs with similar needs are batched
together and run as a group”.

*[https://www.tutorialspoint.com/operating_system/os_types.htm]
TYPES OF OS: Batch Systems
• There is no direct interaction between user and the computer.
• The user has to submit a job (written on cards or tape) to a computer
operator.
• Then computer operator places a batch of several jobs on an input device.
• Jobs are batched together by type of languages and requirements.

Disadvantages:
• No interaction between user and computer.
• No mechanism to prioritize the processes
TYPES OF OS: Batch Systems

• The common input devices were card readers and tape drives.
• The common output devices were line printers, tape drives, and card
punches.

• https://www.youtube.com/watch?v=sq2SE_GbZ34
Multiprogrammed OS
Multiprogramming: When 2 or more processes reside in memory at
the same time
– Single user processes cannot keep CPU and I/O devices busy at all
times
– Multiprogramming organizes jobs (code and data) so CPU always
has one to execute
– Multiprogramming assumes a single shared processor. One job
selected and run via job scheduling
– Multiprogramming increases CPU utilization.
– It is mixture of I/O bound and CPU bound processes
Multiprogrammed OS
• 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).
Multiprogrammed OS
• 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.
Multitasking/Timesharing OS
• Timesharing (multitasking) when multiple jobs are executed
by the CPU simultaneously by switching between them.
– There is at least one program is 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
– Only one CPU is involved, but it switches from one
process to another so quickly that it gives the appearance
of executing all of the processes at the same time.
Multiprocessing OS
• A multiprocessor system consists of several processors
that share a common physical memory.
• Multiprocessor system provides higher computing power
and speed.
• In multiprocessor system all processors operate under
single operating system.
Multiprocessing OS

• Multi-processor systems; that is, they have multiple CPU.

• Also known as parallel systems or tightly coupled systems

• Such systems have more than one processor in close communication,


sharing the computer bus, the clock, and sometimes memory and
peripheral devices.
Distributed Systems
• A network is a communication path between two or more
systems.
• Each system over the network keeps copy of the data, and
this leads to Reliability (Because if one system crashes , data
is not lost).

• CLIENT SERVER SYSTEMS


• PEER TO PEER SYSTEMS
Real Time Systems
• Time bound systems
• Real time systems are of 2 types:

• 1. Soft Real time Systems: Process should complete in specific time but
May have some delay (Positive delay) and will not harm the system.
Exp: Session expires but can be re-logged in.

• 2. Hard Real Time Systems: Each process is assigned a specific time


instance, and Process must complete in that time otherwise system will
crash.
Real Time Embedded Systems

• It is a computing environment that reacts to input within a


specific time period.

• Time Driven

• Task specific

• Exp: Microwave, Washing Machine…


• Network Operating System (NOS): An operating system designed to support networked
computing. It includes features for file sharing, printer sharing, and communication between
computers in a network.
• Embedded Operating System: An operating system designed to run on embedded systems,
which are specialized computing devices with a dedicated function. Examples include
operating systems for smartphones, IoT devices, and industrial machines.
• Mobile Operating System: An operating system specifically designed for mobile devices such
as smartphones and tablets. It provides features like touch input, application management,
and wireless communication.
• Single-User Operating System: An operating system designed for a single user at a time. It is
common in personal computers and provides a straightforward interface for individual tasks.
• Multi-User Operating System: An operating system that allows multiple users to access the
computer system concurrently. It provides features for user authentication, resource sharing,
and access control.
Operating Systems Interview
preparation
Prepared by
Pushpendra Kumar Pateriya
HoD, System Programming Domain
General
20
What is Operating System?
An Operating System is a software between
computer hardware and the user of the computer.
The primary objective of an operating system is to
offer an environment to enable end user execute
programs conveniently and proficiently. An
operating system is also responsible for managing
computer hardware.

21
What are the components of a
computer system?
There are four components of computer system. They are:
1. Computer Hardware – It provides computing resources to a computer
system and is composed of several units including Central Processing Unit
(CPU), Memory and Input / Output devices
2. Application programs – These are the programs which specify the
methods to solve user’s problems. Example of application programs are
word processor, compiler, spreadsheet etc.
3. Operating System – It is a software which controls the usage of
computer hardware among different application programs of different
users
4. User – A user is the person who is using the computer system

22
What is bootstrap program?
A bootstrap program is an initial program which is
started when a computer is powered on or
rebooted. The objective of a bootstrap program is
to initialize the CPU registers, device controllers,
memory contents etc. and to load and start
executing the operating system. Bootstrap
program is typically stored in read - only - memory
(ROM) of a computer system.

23
What is an interrupt?
An interrupt may be defined as an occurrence of
an event which causes the Central Processing Unit
to suspend executing current program, transfer
the control to another program called service
routine and upon completion of service routine,
resume executing the suspended program. An
interrupt may be caused by either hardware or
software.

24
Describe single processor computer
system.
A single process computer system has only one
general purpose microprocessor which can execute a
general - purpose instruction set as well as
instructions from user processes and it may contain
one or more special purpose microprocessors.
Therefore, if a computer system contains a special -
purpose microprocessor such as Input/output
microprocessor in addition to a general - purpose
microprocessor then the computer system is still
considered as a single processor computer system.

25
Describe multiprocessor computer
system.
A multiprocessor computer system contains two
or more general purpose microprocessors which
can communicate with other and share a
computer bus, memory and Input/output devices.
A multiprocessor computer system may contain
one or more special purpose microprocessors.

26
What are advantages of multiprocessor
computer system?
The advantages of multiprocessor computer system are:
●Increased efficiency – The major advantage of multiprocessor computer
system is that efficiency of the system increases because two or more
processors are involved in executing the task and therefore task gets
completed in less amount of time
●Reduced cost – When several programs are required to operate on same
set of data then a multiprocessor system costs less than an equivalent
multiple single processor computer system since a multiprocessor
computer system share peripherals and storage devices
●Increased reliability – If a task is distributed equally among the
microprocessors then failure of one microprocessor does not cause a
multiprocessor system to halt

27
What is multiprogramming?
Multiprogramming is an ability of the operating system to
execute multiple tasks such that the Central Processing Unit
(CPU) remains busy at all the time. The need of
multiprogramming arises because operating system
maintains a set of jobs in memory simultaneously and CPU
executes one task at a time but if the task requires some
I/O operation to be performed in order to be completed
then CPU has to wait until I/O operation finishes. Therefore,
in multiprogramming, instead of waiting for the I/O to
finish, CPU picks up another task from the memory and
starts executing it. In multiprogramming, a user cannot
interact with application while it is running

28
What is multitasking?
Multitasking is a version of multiprogramming
where CPU can execute multiple jobs by switching
among them, but the frequency of switching is so
fast such that a user can interact with application
while it is running. Multitasking system is also
known as a time - sharing system.

29
What is a network operating system?
A network operating system is an operating
system that provides a means of communication
such that different processes on different
machines can able to exchange information and
provides file sharing across the network. A
machine running a network operating system is
considered as an autonomous machine on the
network.

30
What are embedded systems?
Embedded systems are the computer systems
which are meant for a specific task and whose
operating system support only limited features.
These systems are used in car engines,
microwaves, washing machines etc. These systems
generally do not have a user interface and spend
most of the time monitoring and managing
hardware devices.

31
Explain real-time operating system.
Real - time operating system is an operating
system which works under given time constraints
and is used where processing must be done within
defined constraints otherwise system will crash.
Therefore, a real - time operating system is
generally used as a control device in a dedicated
application. Example of real - time operating
system are automobile fuel injection system,
home appliance controller etc.

32
What is compute-server system?
A compute - server system provides a mechanism
where a client can send the request to the server
for an action to be performed and upon receipt of
the request; server executes the action and sends
back the result to the client. An example of such
system is a server running a database that
responds to the queries sent by clients.

33

You might also like