Chapter 1 Operating System
Chapter 1 Operating System
Operating System
The device that collects the information and sends it to the computer
is called an input device .
Common input devices are the keyboard, mouse, scanner, digital
camera, and micro phone.
The information is sent to an output device , which formats and
presents it.
Common output devices are monitors, printers, and speakers.
Computer Software
System Software
The programs that control and manage the basic operations of a computer are generally
referred to as system software .
1. Operating Systems .
The operating system controls the internal operations of the computer’s
hardware, manages all the devices connected to the computer, allows data to be
saved to and retrieved from storage devices, and allows other programs to run on
the computer.
The OS simply provides an environment within which other programs can do
useful work.
Whether the device is a personal computer, mobile phone, or computerized
aircraft controls, an operating system must provide some way for the user to
interface with the device.
Modern OS use a GUI approach to simplify access to applications and hardware
resources.
Cont’d…
2. Utility Programs
A utility program performs a specialized task that enhances the computer’s
operation or safeguards data.
Examples of utility programs are virus scanners, file-compression programs,
and data-backup programs.
3. Software Development Tools
The software tools that programmers use to create, modify, and test software.
Assemblers, Interpreters, Compilers and integrated development environments
(IDEs), are examples of programs that fall into this category.
A computer’s CPU can only process instructions that are written in machine
language .
Application Software
1. General Purpose Software
General-purpose software refers to computer applications that are not designed for a particular
business, industry or department
Example: Word processing application, Database application, Supply Chain Management
Software, Presentation software, Desktop Publishing Software.
2. Specialist Software
Specialized (Specialist) software is software that is written for a specific task rather for a broad
application area.
Example: mobile software, project management software, project tracking software
3. Customized Software
Customized software is a computer program or web application that is specifically designed for
a particular purpose, department or company.
The software is owned by the customer and can incorporate features from other software
programs.
Example: Online Grading System
Examples of Operating Systems
The most popular is Microsoft Windows, which is the operating system used
on over 90% of the world‘s personal computer systems.
Another popular operating system is Mac OS X, which is the operating
system used for Apple Macintosh computers .
While IMB PCs (mostly Windows) and Mac computers are not directly
compatible, it is possible to use virtualization(virtual box)to run one
operating system on an incompatible computer.
UNIX was a command line interface operating system developed for large
scale computers and networks in the 1960s.
The latest generation of operating systems derived from UNIX is called
Linux.
It is a free, open-source operating system that is supported by most
computer platforms.
Functionality of Typical operating System
Memory Management
It is the management of Primary Memory .
Memory is used by a computer to temporarily hold data and instructions that
are being used by applications, the operating system and hardware devices.
For a program to be executed, it must in the main memory.
It 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
Cont’d…
Process Management
Processes given by the user or system ‘s own process are Handled by the
Operating System .
A process is basically a program in execution.
Most modern CPUs and operating systems can handle multitasking and
multithreading.
That is, they can run more than one application at a time and they can process
threads from more than one device and application at a time
In multiprogramming environment OS decides which process gets the
processor when and for how much time.
OS Keeps tracks of processor and status of process. The program responsible
for this task is known as traffic controller.
Allocates the processor (CPU) to a process.
De-allocates processor when a process is no longer required.
Device Management Cont’d…
Peripheral devices are hardware that are connected to the computer by
connection ports on the motherboard.
E.g. monitor, keyboard, mouse, webcam & printer.
These devices are programmed and controlled using device drivers provided by
the operating system.
When an application needs to use a device it talks to the device drivers.
The device drivers then tell the device what to do
So operating system Keeps tracks of all devices. Program responsible for this
task is known as the I/O controller.
Decides which process gets the device when and for how much time.
Allocates & De-allocates the device in the efficient way.
Cont’d…
File Management
Information is stored on your hard disk, CD/DVD discs, and removable
storage devices.
Your operating system controls the actual physical operation of these storage
devices.
It also helps you to manage the files stored on these devices.
The operating system must perform certain key file management tasks for the
user:
Manage the storage and retrieval of information;
Provide an easy to navigate for viewing and accessing storage devices and the
information.
Keeps track of information, location, uses, status etc. Decides who gets the
resources.
Allocates & De-allocates the resources.
Cont’d…
Other functions
Security − By means of password and similar other techniques, it
prevents unauthorized access to programs and data.
Control over system performance − Recording delays between
request for a service and response from the system.
Types of operating system
Operating systems are there from the very first computer generation .
Following are few of the important types of operating system which are most
commonly used.
1. Batch operating system
The users of 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.
Then computer operator places a batch of several jobs on an input device
To speed up processing, jobs with similar needs are batched together and run as
a group.
Cont’d…
Started with using vacuum tubes as the basic components for memory and
circuitry for CPU.
These tubes like electric bulbs produced a lot of heat and were prone to
frequent fusing of the installations, therefore, were very expensive and
could be afforded only by very large organizations.
In this generation mainly batch processing operating system were used.
In this generation Punched cards, Paper tape, Magnetic tape Input & Output
device were used.
There were Machine code and electric wired board languages used.
The Second Generation ( 1955 - 1965 ): Transistors and Batch Systems
This generation using the transistor were cheaper, consumed less power,
more compact in size, more reliable and faster than the first generation
machines made of vacuum tubes.
In this generation, magnetic cores were used as primary memory and
magnetic tape and magnetic disks as secondary storage devices.
In this generation assembly language and high level programming language
like FORTRAN, COBOL were used.
There were Batch processing and Multiprogramming Operating system
used.
The Third Generation ( 1965 - 1980 ): Integrated
Circuits and Multiprogramming
Until the 1960’s, there were two types of computer systems i.e. the scientific and
the commercial computers.
These were combined by IBM in the System/360.
This used integrated circuits and provided a major price and performance
advantage over the second generation systems.
The third generation operating systems also introduced multiprogramming.
This meant that the processor was not idle while a job was completing its I/O
operation.
Another job was scheduled on the processor so that its time would not be
wasted.
The Fourth Generation ( 1980 - Present):
Personal Computers
The fourth generation of computers is marked by the use of (VLSI) circuits.
VLSI circuits having about 5000 transistors and other circuit elements on a single
chip made it possible to have microcomputers of fourth generation.
Fourth Generation computers became more powerful, compact, reliable, and
affordable.
As a result, it gave rise to personal computer (PC) revolution.
In this generation Time sharing, Real time, Networks, Distributed Operating
System were used.
All the Higher level languages like C and C++, DBASE etc. were used in this
generation.
Fifth Generation(1990-till date)
In the fifth generation, the VLSI technology became ULSI (Ultra Large Scale
Integration) technology, resulting in the production of microprocessor chips
having ten million electronic components.
This generation is based on parallel processing hardware and AI (Artificial
Intelligence) software.
AI is an emerging branch in computer science, which interprets means and
method of making computers think like human beings.
All the Higher level languages like C and C++, Java, .NET etc. are used in this
generation.
AI includes: Robotics ,Neural networks ,Game Playing , Development of
expert systems to make decisions in real life situations & Natural language
understanding and generation.
Operating System Design Issues
Robustness
a system should not break down easily.
a system should recover quickly from any failure.
a system should not wholly affected by a bug in one aspect of it .
Security
preventing users from accessing objects they have no right to access
allowing users to access objects they have every right to access.
especially for multi-user systems with open access (such as Internet-based
applications).
Efficiency
Cont’d…
An OS encourages efficient use of the CPU by suspending programs that are waiting for
I/O operations to complete to make way for programs that can use the CPU more
productively.
Compatibility
The ability of one device or program to work with another device or program.
For example, a printer and a computer are said to be compatible if they can be connected
to each other.
Portability
When used to describe hardware, portable means small and lightweight.
When used to describe software, portable means that the software has the ability to run on
a variety of computers.
Portable and machine independent mean the same thing-that the software does not
depend on a particular type of hardware.
Cont’d…
Flexibility
Flexible operating systems are taken to be those whose designs have been motivated to some
degree by the desire to allow the system to be tailored, either statically or dynamically, to the
requirements of specific applications or application domains.
The use of object orientation is a common feature of many flexible operating systems.
Reliability
In general, reliability is the ability of a person or system to perform and maintain its functions
in routine/repetitive circumstances, as well as hostile or unexpected circumstances.
Reliability is generally considered important by end users.
Scalability
Scalability is a desirable property of a system, a network, or a process, which indicates its ability
to either handle growing amounts of work in a graceful manner, or to be readily enlarged.
A system whose performance improves after adding hardware, proportionally to the capacity
added, is said to be a scalable system
ARCHITECTURE OF OPERATING SYSTEM
What happens if you want to work on applications in two operating systems at the same
time?
What about if you want to run an OS that is not compatible with your computer‘s
hardware?
You can get around these problems by running a virtual computer
A virtual computer is really an application within one operating system that lets you
pretend you have a different operating system installed.
Virtual computer applications like VMWare and Virtual PC act as translators.
They convert instructions from the virtual operating system into instructions from the
real operating system, which then controls your computer ‘s hardware.
Notice that the layers between the virtual computer application and the user are just like
the layers for a single operating system.
System calls
System programs interact with the OS (and ultimately hardware)
through system calls.
Called when a user level program needs a service from the OS.
– Generally written in C/C++
– Execute in kernel mode
– code can access protected hardware.
Types of System Calls
Process control
File management
Device management
Information maintenance
Communications
– Message passing and Shared memory
Protection
Application code generally does not invoke system calls directly.
Programmer calls functions defined by an API.
Operating-System Structure
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
underlying hardware.
( Note that user versus kernel mode was not supported by the 8088 chip set
anyway, so that really wasn't an option back then. )
Cont’d…
In MS-DOS, applications may avoid the operating system.
Operating systems such as MS-DOS and the original UNIX did not have well-
defined structures.
There was no CPU Execution Mode (user and kernel), and so errors in
applications could cause the whole system to crash.
2. Monolithic Structure
To ensure the proper execution of the operating system there are two
modes of operation:
User mode :When the computer system run user application like creating
a text document or using any application program, then the system is in
user mode.
When the user application requests for a service from the operating
system or an interrupt occurs or system call, then there will be a transition
from user to kernel mode to fulfill the requests.
Note: To switch from kernel mode to user mode, mode bit should be 1.
Given below image describes what happen interrupt occurs:
Cont’d…
Cont’d…
Kernel Mode –
When system boots then hardware starts in kernel mode and when operating
system is loaded then it start user application in user mode.
To provide protection to the hardware, we have privileged instructions which
execute only in kernel mode.
If user attempt to run privileged instruction in user mode then it will treat
instruction as illegal and traps to OS.
Some of the privileged instructions are:
Handling Interrupts
To switch from user mode to kernel mode.
Input Output management.
Note: To switch from user mode to kernel mode bit should be 0.
Cont’d…
The basic idea behind micro kernels is to remove all non-essential services
from the kernel, and implement them as system applications instead, thereby
making the kernel as small and efficient as possible.
Most microkernels provide basic process ,memory management, and message
passing between other services, and not much more.
Security and protection can be enhanced, as most services are performed in
user mode, not kernel mode.
System expansion can also be easier, because it only involves adding more
system applications, not rebuilding a new kernel.
Mach was the first and most widely known microkernel, and now forms a
major component of Mac OSX.
Another microkernel example is QNX, a real-time OS for embedded systems.
Cont’d…
The entire operating system works in the kernel space in the monolithic system. This
increases the size of the kernel as well as the operating system.
This is different than the microkernel system where the minimum software that is required
to correctly implement an operating system is kept in the kernel.
A microkernel design of the operating system architecture targets robustness.
microkernel design suggests that only very few individual parts of the operating system
need to have more privileges than common applications.
The microkernel design therefore leads to a small system kernel, accompanied by additional
system applications that provide most of the operating system features.
MACH is a prominent example of a microkernel that has been used in contemporary
operating systems, including the NextStep and OpenStep systems.
Most research operating systems also qualify as microkernel operating systems
Cont’d…
This structure of operating system is 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.
Extending The benefits of the microkernel are as follows:
the operating system becomes much easier.
Any changes to the kernel tend to be fewer, since the kernel is smaller.
The microkernel also provides more security and reliability.
Main disadvantage is poor performance due to increased system overhead from
message passing.
In a microkernel, the user services and kernel services are implemented in different
address space.
The user services are kept in user address space, and kernel services are kept
under kernel address space, thus also reduces the size of kernel and size of
operating system as well.
Cont’d…
5. Modules