1. An Operating system is basically a intermediary agent between the user and the
computer hardware.
Manages the computer’s resources (hardware, abstract resources,
software)
It’s a resource allocator.
It is also used to control programs to prevent errors and improper
computer use.
It is interrupt driven.
Definition
An operating systemis a group of computer programs that coordinates all the
activities among computer hardware devices. It is the first program loaded into the
computer by a boot program and remains in memory at all times.
2. Figure- Diagrammatical Definition Of Os
Operating System Benefits
Simplifies hardware control for applications
Enforcer of sharing, fairness and security with the goal of better overall performance
o Trade-off between fairness and performance
o Trade-off between optimal algorithms and lean algorithms – OS is
overhead.
Provides abstract resources
o Sockets
o Inter-process communication
Functions of an operating system
The basic functions of an operating systemare:
i. Booting the computer
ii. Performs basic computer tasks Example managing the various peripheral devices eg
mouse, keyboard
iii. Provides a user interface, e.g. command line, graphical user interface (GUI)
iv. Handles systemresources such as computer's memory and sharing of the
central processing unit (CPU) time by various applications or peripheral devices
3. v. Provides file management which refers to the way that the operating system
manipulates, stores, retrieves and saves data.
Booting the computer
The process of starting or restarting the computer is known as booting. A cold boot is when
you turn on a computer that has been turned off completely. A warm boot is the process of
using the operating system to restart the computer.
Performs basic computer tasks
The operating systemperforms basic computer tasks, such as managing the various
peripheral devices such as the mouse, keyboard and printers. For example, most operating
systems now are plug and play which means a device such as a printer will automatically be
detected and configured without any user intervention.
Provides a user interface
A user interacts with software through the user interface. The two main types of user
interfaces are: command line and a graphical user interface (GUI). With a command line
interface, the user interacts with the operating systemby typing commands to perform
specific tasks. An example of a command line interface is DOS (disk operating system). With
a graphical user interface, the user interacts with the operating systemby using a mouse to
access windows, icons, and menus. An example of a graphical user interface is Windows Vista
or Windows 7.
The operating systemis responsible for providing a consistent application program interface
(API) which is important as it allows a software developer to write an application on one
computer and know that it will run on another computer of the same type even if the amount
of memory or amount of storage is different on the two machines.
Handles system resources
The operating systemalso handles systemresources such as the computer's memory and
sharing of the central processing unit (CPU) time by various applications or peripheral
devices. Programs and input methods are constantly competing for the attention of the CPU
and demand memory, storage and input/output bandwidth. The operating systemensures
that each application gets the necessary resources it needs in order to maximise the
functionality of the overall system.
Provides file management
The operating systemalso handles the organisation and tracking of files and directories
(folders) saved or retrieved from a computer disk. The file management system allows the
user to perform such tasks as creating files and directories, renaming files, coping and
moving files, and deleting files. The operating systemkeeps track of where files are located
on the hard drive through the type of file system. The type two main types of file systemare
File Allocation table (FAT) or New Technology File system(NTFS).
Types of file system
File Allocation table (FAT)
New Technology file system(NTFS)
File Allocation table (FAT) uses the file allocation table which records, which clusters are used
and unused and where files are located within the clusters.
4. NTFS is a file systemintroduced by Microsoft and it has a number of advantages over the
previous file system, named FAT32 (File Allocation Table).
One major advantage of NTFS is that it includes features to improve reliablity. For example,
the new technology file systemincludes fault tolerance, which automatically repairs hard
drive errors without displaying error messages. It also keeps detailed transaction logs, which
tracks hard drive errors. This can help prevent hard disk failures and makes it possible to
recover files if the hard drive does fail.
NTFS also allows permissions (such as read, write, and execute) to be set for individual
directories and files.
Operating System – Properties
Following are few of very importanttasks thatOperating System handles
Batch processing
Batch processing is a technique in which Operating System collects one programs and data together in a batch
before processing starts.Operating system does the following activities related to batch processing.
OS defines a job which has predefined sequence ofcommands,programs and data as a single unit.
OS keeps a number a jobs in memoryand executes them withoutany manual information.
Jobs are processed in the order of submission i.e firstcome firstserved fashion.
When job completes its execution, its memory is released and the output for the job gets copied into an output
spool for later printing or processing.
ADVANTAGES
Batch processing takes much of the w orkof the operator to the computer.
Increased performance as a new job get started as soon as the previous job finished w ithout any manual intervention.
5. DISADVANTAGES
Difficult to debug program.
A job could enter an infinite loop.
Due to lack of protection scheme, one batch job can affect pending jobs.
Multitasking
Multitasking refers to term where multiple jobs are executed by the CPU simultaneously by switching between
them. Switches occur so frequently that the users may interact with each program while it is running. Operating
system does the following activities related to multitasking.
The user gives instructions to the operating system or to a program directly, and receives an immediate
response.
Operating System handles multitasking in the way that it can handle multiple operations / e xecutes multiple
programs ata time.
Multitasking Operating Systems are also known as Time-sharing systems.
These Operating Systems were developed to provide interactive use of a computer system ata reasonable cost.
A time-shared operating system uses concept of CPU scheduling and multiprogramming to provide each user
with a small portion ofa time-shared CPU.
Each user has atleastone separate program in memory.
A program that is loaded into memoryand is executing is commonlyreferred to as a process.
When a process executes, it typically executes for only a very short time before it either finishes or needs to
perform I/O.
Since interactive I/O typically runs at people speeds, it may take a long time to completed. During this time a
CPU can be utilized by another process.
Operating system allows the users to share the computer simultaneously. Since each action or command in a
time-shared system tends to be short,only a little CPU time is needed for each user.
6. As the system switches CPU rapidly from one user/program to the next, each user is given the impression that
he/she has his/her own CPU,whereas actuallyone CPU is being shared among manyusers.
Multiprogramming
When two or more programs are residing in memory at the same time, then sharing the processor is referred to
the multiprogramming. Multiprogramming assumes a single shared processor. Multiprogramming increases CPU
utilization by organizing jobs so that the CPU always has one to execute.
Following figure shows the memorylayout for a multiprogramming system.
Operating system does the following activities related to multiprogramming.
The operating system keeps several jobs in memoryata time.
This setof jobs is a subsetofthe jobs kept in the job pool.
The operating system picks and begins to execute one of the job in the memory.
Multiprogramming operating system monitors the state of all active programs and system resources using
memorymanagementprograms to ensures thatthe CPU is never idle unless there are no jobs
ADVANTAGES
High and efficient CPU utilization.
User feels that manyprograms are allotted CPU almostsimultaneously.
DISADVANTAGES
CPU scheduling is required.
7. To accommodate manyjobs in memory,memorymanagementis required.
Spooling
Spooling is an acronym for simultaneous peripheral operations on line. 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.
Operating system does the following activities related to distributed environment.
OS handles I/Odevice data spooling as devices have differentdata access rates.
OS maintains the spooling buffer which provides a waiting station where data can rest while the slower device
catches up.
OS maintains parallel computation because of spooling process as a computer can perform I/O in parallel fashin.
It becomes possible to have the computer read data from a tape, write data to disk and to write out to a tape
printer while it is doing its computing task.
ADVANTAGES
The spooling operation uses a disk as a very large buffer.
Spooling is capable ofoverlapping I/O operation for one job with processor operations for another job.
Real Time System
Real time systems represents are usually dedicated, embedded systems. Operating system does the following
activities related to real time system activity.
In such systems,Operating Systems typicallyread from and react to sensor data.
The Operating system must guarantee response to events within fixed periods of time to ensure correct
performance.
Distributed Environment
Distributed environment refers to multiple independent CPUs or processors in a computer system. Operating
system does the following activities related to distributed environment.
OS Distributes computation logics among several physical processors.
The processors do notshare memoryor a clock.
8. Instead,each processor has its own local memory.
OS manages the communications between the processors. They communicate with each other through various
communication lines.
Personal Computers
A personal computer is a general-purpose computer whose
size, capabilities and original sale price make it useful for
individuals, and is intended to be operated directly by an
end-user with no intervening computer operator. This
contrasts with the batch processing or time-sharing models
that allowed larger, more expensive minicomputer and
mainframe systems to be used by many people, usually at
the same time. A related term is "PC" that was initially an
acronym for "personal computer", but later became used
primarily to referto the ubiquitous Wintel platform.
9. Parallel System
Parallel operating systems are used to interface multiple
networked computers to complete tasks in parallel. The
architecture of the software is often a UNIX-based platform,
which allows it to coordinate distributed loads between
multiple computers in a network. Parallel operating systems
are able to use software to manage all of the different
resources of the computers running in parallel, such as
memory, caches, storage space, and processing power.
Parallel operating systems also allow a user to directly
interface with all of the computers in the network.
A parallel operating system works by dividing sets of
calculations into smaller parts and distributing them between
the machines on a network. To facilitate communication
between the processor cores and memory arrays, routing
software has to either share its memory by assigning the
same address space to all of the networked computers, or
distribute its memory by assigning a different address space
to each processing core. Sharing memory allows the
operating system to run very quickly, but it is usually not as
powerful. When using distributed shared memory,
processors have access to both their own local memory and
the memory of other processors; this distribution may slow
the operating system, but it is often more flexible and
efficient.
10. Process Concepts
Process -- The fundamental concept of multiprogramming operating
systems. A process is
An abstraction representing a program executing on a CPU
An abstraction representing a virtual CPU executing a program
Processes run concurrently. (This can be accomplished with true
concurrency on a computer with more than one CPU, or by rapid
switching among processes on a single-CPU computer.)
Processes compete with each other for CPU time and other resources.
Process states
A convenient way to model the changes that a process undergoes
during its lifetime is through the state of a process. A process is
always in one of a finite set of states.
Running -- executing instructions on a CPU.
Ready -- waiting for CPU time; otherwise able to run
Blocked -- waiting for some event to occur; e.g. I/O completion,
resource availability
11. Threads-
A thread is a basic unit of CPU utilization, consisting of a programcounter, a
stack, and a set of registers, ( and a thread ID. )
Traditional ( heavyweight) processes havea single thread of control - There is
one programcounter, and one sequence of instructions that can be carried out
at any given time.
As shown in Figure4.1, multi-threaded applications have multiple threads
within a single process, each having their own programcounter, stack and set
of registers, butsharing common code, data, and certain structures such as
open files.