Chapter 1introduction
Chapter 1introduction
Chapter 1introduction
Introduction
By: Mrs.Ashwini Pawar
Chapter 1: Introduction
What is os?
• Operating System:
Operating System lies in the category of system software. It basically manages all
the resources of the computer. An operating system acts as an interface between
the software and different parts of the computer or the computer hardware. The
operating system is designed in such a way that it can manage the overall
resources and operations of the computer.
Operating System is a fully integrated set of specialized programs that handle all
the operations of the computer. It controls and monitors the execution of all other
programs that reside in the computer, which also includes application programs
and other system software of the computer. Examples of Operating Systems are
Windows, Linux, Mac OS, etc.
An Operating System (OS) is a collection of software that manages computer
hardware resources and provides common services for computer programs. The
operating system is the most important type of system software in a computer
system.
Functions Of OS
Security – For security, modern operating systems employ a firewall. A firewall is a
type of security system that monitors all computer activity and blocks it if it detects
a threat.
Job Accounting – As the operating system keeps track of all the functions of a
computer system. Hence, it makes a record of all the activities taking place on the
system. It has an account of all the information about the memory, resources, errors,
etc. Therefore, this information can be used as and when required.
Control over system performance – The operating system will collect
consumption statistics for various resources and monitor performance indicators
such as reaction time, which is the time between requesting a service and receiving a
response from the system.
Error detecting aids – While a computer system is running, a variety of errors
might occur. Error detection guarantees that data is delivered reliably across
susceptible networks. The operating system continuously monitors the system to
locate or recognize problems and protects the system from them.
Coordination between other software and users – The operating system (OS)
allows hardware components to be coordinated and directs and allocates assemblers,
interpreters, compilers, and other software to different users of the computer system.
Continue..
Booting process – The process of starting or restarting a computer is referred to as
Booting. Cold booting occurs when a computer is totally turned off and then turned
back on. Warm booting occurs when the computer is restarted. The operating system
(OS) is in charge of booting the computer.
Evaluation Of OS
First Generation (1945-1955):
It is the beginning of the development of electronic computing systems which are
substitutes for mechanical computing systems. Because of the drawbacks in
mechanical computing systems like, the speed of humans to calculate is limited and
humans can easily make mistakes. In this generation there is no operating system, so
the computer system is given instructions which must be done directly.
Example − Type of operating system and devices used is Plug Boards.
Second Generation (1955-1965):
The Batch processing system was introduced in the second generation, where a job
or a task that can be done in a series, and then executed sequentially. In this
generation, the computer system is not equipped with an operating system, but
several operating system functions exist like FMS and IBSYS.
Example − Type of operating system and devices used is Batch systems.
Continue..
Third Generation (1965-1980):
The development of the operating system was developed to serve multiple users at
once in the third generation. Here the interactive users can communicate through an
online terminal to a computer, so the operating system becomes multi-user and
multiprogramming.
Example − Type of operating system and devices used is Multiprogramming.
Fourth Generation (1980-Now):
In this generation the operating system is used for computer networks where users
are aware of the existence of computers that are connected to one another.
At this generation users are also comforted with a Graphical User Interface (GUI),
which is an extremely comfortable graphical computer interface, and the era of
distributed computing has also begun.
With the occurrence of new wearable devices like Smart Watches, Smart Glasses,
VRGears, and others, the demand for conventional operating systems has also
increased.
And, with the onset of new devices like wearable devices, which includes Smart
Watches, Smart Glasses, VR gears etc, the demand for unconventional operating
systems is also rising.
Example − Type of operating system and devices used is personal computers
Types of OS
1. Batch OS: Explain types of os.
In this system, the OS does not forward the jobs/tasks directly to the CPU. It works
by grouping together similar types of jobs under one category. Further, we name this
group as a ‘batch’. Hence, the name batch OS.
Examples are the payroll system, bank statement, etc.
2. Time-Shared OS:
When more than one task takes place on the system it is called time-shared OS. As
multiple tasks can run at the system at a time as per requirement. Hence, they all
share the CPU time one by one. Therefore, we also name it multitasking. The time
that each task gets is called quantum.
A fixed interval of time is decided for each task. When the first task executes for that
period of time, the second task executes, and so on.
Examples are UNIX etc.
3. Distributed OS:
In this system, there is more than one CPU present. The OS distributes the tasks
among all the processors. The processors do not share any memory or clock time.
OS handles all communication between them through various communication lines.
Examples are LOCUS etc.
Continue..
4. Network OS:
In these OS various systems are connected to a server. It allows the system to share
resources such as files, printers, applications, etc. Moreover, it gives the capability to
serve to manage these resources.
Examples are UNIX, LINUX, Microsoft Windows Server 2008, etc.
5. Real-Time OS (RTOS):
In these systems, the time interval for processing and responding to inputs is very
small. Therefore, due to this quality, these are used in real-time situations. For
example in missile systems, robots, etc.
They have two categories as follows:
a) Hard Real-Time Systems
In this, the time constraint is very short and strict. Even seconds of delay is not
acceptable.
b) Soft Real-Time Systems
In this, the time constraint is not so short and strict.
Multiprogramming
explain multiprogramming OS.
OS
An operating system that allows multiple programmes to run simultaneously on a
single processor machine is known as a multiprogramming operating system. The
other programmes are prepared to use the CPU while one programme waits for an
input/output transfer.
Imagine that I/O is a part of the process that is currently running (which, by
definition, does not need the CPU to be accomplished). The OS might then
terminate that process and hand off the command to another ready-to-run in-memory
programme (i.e., context switching). This keeps the system from idly waiting for the
I/O work to finish, wasting CPU time. A process that is currently running keeps
going until it either releases the CPU voluntarily or blocks for an I/O operation.
Therefore, the primary goal of multiprogramming is to keep the CPU active for as
long as there are active processes. The CPU won't be idle in a multiprogramming
OS, so it'll always be active.
Continue..
Examples Of Multiprogramming
Desktop operating systems, including Windows, macOS, and various Linux
distributions. These are contemporary operating systems that make use of a variety
of multiprogramming concepts. A system running one of these (or more) operating
systems allows a user to run multiple jobs at once. For instance, many games have
been developed to utilize just one processor core.
One can send and receive text messages while simultaneously listening to music on
a phone running Android, iOS, or another mobile operating system.
Types Of Multiprogramming:
Multitasking Operating System
Multiuser Operating System
Continue..
Multitasking Operating System
A multitasking OS enables the simultaneous operation of two or more programmes.
The operating system does this by moving each programme into or out of memory
one at a time. A programme that has been switched out of memory is temporarily
saved on the disc until it is required once more.
Continue..
Multiuser Operating System
A powerful central computer can be shared by many users from various terminals
thanks to a multiuser operating system. This is done by the operating system quickly
switching between terminals, each of which is allotted a certain amount of processor
time on the main computer. Each user appears to have continuous access to the main
computer because the operating system changes between terminals so quickly. On a
system like this, the number of users increases the likelihood that the response time of
the central computer will be more noticeable.
Desktop System
A desktop system refers to a personal computer setup that is typically used on a
desk or table. It consists of various hardware components and an operating system
that enables users to perform a wide range of tasks such as document editing, web
browsing, gaming, multimedia consumption, and more.
Components of Desktop System:
Central Processing Unit (CPU): The CPU is the brain of a desktop system,
responsible for executing instructions and performing calculations. It processes data
and carries out tasks based on the instructions provided by software programs. The
CPU’s performance is measured by its clock speed, number of cores, and cache size.
Random Access Memory (RAM): RAM is a type of volatile memory that
temporarily stores data and instructions for the CPU to access quickly. It allows for
efficient multitasking and faster data retrieval, significantly impacting the overall
performance of the system. The amount of RAM in a desktop system determines its
capability to handle multiple programs simultaneously.
Storage Devices: Desktop systems utilize various storage devices to store and
retrieve data. Hard Disk Drives (HDDs) are the traditional storage medium, offering
large capacities but slower read/write speeds. Solid-State Drives (SSDs) are a newer
technology that provides faster data access, enhancing the system’s responsiveness
and reducing loading times.
Continue..
Graphics Processing Unit (GPU): The GPU is responsible for rendering images,
videos, and animations on the computer screen. It offloads the graphical processing
tasks from the CPU, ensuring smooth visuals and enabling resource-intensive
applications such as gaming, video editing, and 3D modeling. High-performance
GPUs are essential for users who require demanding graphical capabilities.
Input and Output Devices: Desktop systems are equipped with various input and
output devices. Keyboards and mice are the primary input devices, allowing users to
interact with the system and input commands. Monitors, printers, speakers, and
headphones serve as output devices, providing visual or auditory feedback based on
the system’s output.
Continue..
Continue..
Popular Desktop Operating Systems:
When DOS was originally written its developers had no idea how big and
important it would eventually become.
It was written by a few programmers in a relatively short amount of time,
without the benefit of modern software engineering techniques, and then
gradually grew over time to exceed its original expectations.
It does not break the system into subsystems, and has no distinction
between user and kernel modes, allowing all programs direct access to the
hardware.
MS-DOS – written to provide the most functionality in the least space
Not divided into modules
Although MS-DOS has some structure, its interfaces and levels of
functionality are not well separated
MS-DOS Layer Structure
written for intel 8088
Provides no dual
mode and no
hardware protection
Layered structure UNIX O.S
The original UNIX OS used a simple layered approach, but almost all the
OS was in one big layer, not really breaking the OS down into layered
subsystems:
UNIX – limited by hardware functionality, the original UNIX operating
system had limited structuring. The UNIX OS consists of two separable
parts
Systems programs (system utilities or system applications.)
The kernel
Kernel is further divided into a series of interfaces and device drivers.
Kernel provides the functions such as
- CPU scheduling
- memory mgmt
- File mgmt
- Paging etc
Traditional UNIX System Structure
OR
User
Shell
Kernel
Device Controllers
Layered Approach
The operating system is divided into a number of layers (levels), each built on top
of lower layers.
The bottom layer (layer 0), is the hardware
The highest (layer N) is the user interface.
OS into a number of smaller layers, each of which rests on the layer below it, and
relies solely on the services provided by the next lower layer.
This approach allows each layer to be developed and debugged independently, with
the assumption that all lower layers have already been debugged and are trusted to
deliver proper services.
The problem is deciding what order in which to place the layers, as no layer can call
upon the services of any higher layer.
Layered Operating System
Advantages of Layered approach
• Simplicity in design and implementation
• Debugging is easy. Debugging is done from layer 0 to layer N
• Once the first layer debugging is done, then second layer is debugged and so on.
• When the error is found, the error is only of that layer because bottom layers are
already debugged.
• Each layer is implemented with only those operations provided by lower level layers.
• A layer does not need to know how these operations are implemented it needs to
know only what these operations do.
• Each layer hides the existence, hardware from higher level layer.
Disadvantages of Layered approach
• A layer can use only lower level layers, so careful planning is
necessary.
• e.g: Device driver for the backing store must be also at a lower level
than the memory mgmt routines, because memory mgmt requries the
ability to use the backing stores.
• Efficiency is less than other type.
Microkernel System Structure
• The basic idea behind micro kernels is to remove all non-essential services from the
kernel, and implement them as system applications instead, there by making the
kernel as small and efficient as possible.
• The result is smaller kernel
• It provides minimal process and memory mgmt in addition to the communication
facility
• The main function is to provide a communication facility between the client program
and the various services that are also running in user space.
• Communication is provided by message passing
• If the client program wishes to access a file it must interact with the file system
• The client program and service never interact with the file server.
• Rather they communicate indirectly by exchanging messages with the
microkernel
Continue..
Microkernel System Structure
Benefits:
Easier to extend a microkernel
All new services are added to user space without modifying the kernel
Easier to port the operating system to new architectures
More reliable (less code is running in kernel mode)
More secure
Disadvantages
The performance of microkernel decreases due to increased function overheads
User mode and Kernel Mode
The system is in user mode when the operating system is running a user application
such as handling a text editor. The transition from user mode to kernel mode occurs
when the application requests the help of operating system or an interrupt or a system
call occurs. The mode bit is set to 1 in the user mode.
The User mode is normal mode where the process has limited access. While the Kernel
mode is the privileged mode where the process has unrestricted access to system
resources like hardware, memory, etc. A process can access I/O Hardware registers to
program it, can execute OS kernel code and access kernel data in Kernel mode.
Anything related to Process management, IO hardware management, and Memory
management requires process to execute in Kernel mode.
Continue..
Whenever you run an application in your computer system, it runs in the user mode. For
example, if you are running MS Word, or watching some video using the VLC Player,
all these software applications are running in the user mode. When opening the program
in user mode, it is not allowed to access the RAM and hardware directly.
If an application running under user mode and it wants to access system resources and
hardware, it will have to first go through the Operating system Kernel by
using syscalls (system calls). The mode bit is set to 1 in user mode and while switching
from user mode to kernel mode, this mode bit is set to 0.
Continue..
When we start our system, it boots in Kernel mode. The kernel can access the hardware
and RAM of the system directly. There are some privileged instructions that can run in
the kernel mode only.
In kernel mode, the mode bit is set to 0. And when switching from kernel mode to user
mode, the bit mode is changed from 0 to 1. When the mode changes from user mode to
kernel mode or vice-versa, it is known as Context Switching. Kernel is the central
module of the operating system and it works as the middle layer between the operating
system and the hardware of a system. Operating systems maintain control over the
computer system by utilizing the kernel of an operating system as a means of
communication. The kernel handles the remaining system functions on behalf of the
operating system, hence it is the first software to load into memory when a system boots
up after the bootloader. The kernel is in the memory of the system until the operating
system shuts down the system.
Continue..
System Call
system call is the programmatic way in which a computer program requests a service from
the kernel of the operating system it is executed on. A system call is a way for programs
to interact with the operating system. A computer program makes a system call when it
makes a request to the operating system’s kernel. System call provides the services of the
operating system to the user programs via Application Program Interface(API). It provides
an interface between a process and operating system to allow user-level processes to
request services of the operating system. System calls are the only entry points into the
kernel system. All programs needing resources must use system calls.
Services Provided by System Calls :
Process creation and management
Main memory management
File Access, Directory and File system management
Device handling(I/O)
Protection
Networking, etc.
Architecture of a typical microkernel
Modules
Most modern operating systems implement kernel modules
Uses object-oriented approach
Each core component is separate
Each talks to the others over known interfaces
Each is loadable as needed within the kernel
Such type of design is combination of layered structure and microkernel approach
But it is flexible than layered system as any module can call any other modules.
It is also efficient than microkernel approach because modules do not need to invoke
message passing in order to communicate.
E.g
Solaris, linux and Mac OS X
Solaris Modular Approach
Virtual Machines
A virtual machine takes the layered approach to its logical conclusion. It treats
hardware and the operating system kernel as though they were all hardware
A virtual machine provides an interface identical to the underlying bare
hardware
The operating system host creates the illusion that a process has its own
processor and (virtual memory)
Each guest provided with a (virtual) copy of underlying computer
Virtual Machines History and
Benefits
• First appeared commercially in IBM mainframes in 1972
• The concept of a virtual machine is to provide an interface that looks like
independent hardware, to multiple different OS running simultaneously on the
same physical hardware. Each OS believes that it has access to and control over
its own CPU, RAM, I/O devices, hard drives, etc.
• By using VM user can run any of the O.S or any S/W available o the M/C
• Examples
• Vmware
• The Java Virtual Machine
Benefits
Each OS runs independently of all the others, offering protection and security
benefits.
Virtual machines are a very useful tool for OS development, as they allow a user full
access to and control over a virtual machine, without affecting other users operating
the real machine.
This approach can also be useful for product development and testing of SW that
must run on multiple OSes / HW platforms.
Virtual Reality (VR)
Virtual Machines (Cont)