01. OS- Introduction
01. OS- Introduction
INTRODUCTION **
Syllabus:
1. Introduction and Operating system structures: Definition, Types of Operating system, Real-Time operating
system,
2. System Components: System Services, Systems Calls, System Programs, System structure, Virtual
Machines, System Design and Implementation, System Generations.
1. Introduction/Overview .
1.1. What Is An Operating System
An operating system (OS) acts as an interface between the user and the computer hardware. The purpose of an
OS is to provide an environment in which a user can execute programs in a convenient and efficient manner.
Computer = Hardware + Operating System + Application programs + Users
OS serves as interface between Hardware and ( Application programs & Users ). OS provides services for
Apps & Users
OS manages resources ( Government model, it doesn't produce anything. )
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.
Operating System acts as:
1. OS is a resource allocator
o Manages all resources
o Decides between conflicting requests for efficient and
fair resource use
2. OS is a control program
o Controls execution of programs to prevent errors and
improper use of then computer
o Concerned with the operation & control of I/O devices
o Kernel – one program running at all times on the computer.
F
igure 1: Components of Computer System
Figure - Batch OS
Operating system: Unit I- Introduction 2
For overcoming this problem use the Spooling Technique. Spool is a buffer that holds output for
a device, such as printer, that can not accept interleaved data streams. That is when the job
requests the printer to output a line, that line is copied into a system buffer and is written to the
disk. When the job is completed, the output is printed. Spooling technique can keep both the
CPU and the I/O devices working at much higher rates.
The problems with Batch Systems are:
Lack of interaction between the user and job.
CPU is often idle, because the speeds of the mechanical I/O devices are slower than CPU.As jobs get
executed in batch, turnaround time is more
Debugging is not easier as it is to be done after completion of jobs by checking memory location.
For Example:
Disadvantages
CPU scheduling is compulsory because lots of jobs are ready to run on CPU simultaneously.
Overhead of context switch
Early operating system could execute various programs at the same time, although multitasking was not fully
supported. As a result, a single software could consume the entire CPU of the computer while completing a certain
activity. Basic operating system functions, such as file copying, prevented the user from completing other tasks,
such as opening and closing windows. Fortunately, because modern operating systems have complete multitasking
capability, numerous programs can run concurrently without interfering with one other. In addition, many
operating system processes can run at the same time.
Definition: A Multi-user operating system is a computer operating system which allows multiple users to access
the single system with one operating system on it. It is generally used on large mainframe computers.
Example: Linux, Unix, Windows 2000, Ubuntu, Mac OS etc.,
In the multi-user operating system, different users connected at
different terminals and we can access, these users through the network
as shown in the diagram.
Advantages –
- It provides the advantage of quick response.
- It reduces CPU idle time.
Disadvantages
- Time sharing has problem of reliability.
- Question of security and integrity of user programs and data can be raised.
These systems are Single-user and dedicated systems. Previously thought as individuals have sole use of
computer, do not need advanced CPU utilization, protection features.
It may run several different types of OS (Windows, Mac OS X, UNIX, Linux) which offer multitasking and
virtual memory on PC hardware.
It has I/O devices like – keyboards, mouse, display screens, printers etc.
The goal of this O.S. is User convenience and responsiveness so these are neither multi-user nor multitasking
systems.
PCs contain a microprocessor in the keyboard to convert the keystrokes into codes to be sent to the CPU.
A disk-controller microprocessor receives a sequence of requests from the main CPU and implements its own
disk queue and scheduling algorithm.
This arrangement relieves the main CPU of the overhead of disk scheduling.•
The use of special-purpose microprocessors is common and does not turn a single-processor system into a
multiprocessor.
They can adopt technology developed for larger operating system, often individuals have sole use of computer
and do not need advanced CPU utilization of protection features
If there is only one general-purpose CPU, then the system is a single-processor system.
5) Multiprocessor system
A multiprocessor system is a collection of a number of standard processors put together in an innovative way
to improve the performance / speed of computer hardware.
The main feature of this architecture is to provide high speed at low cost in comparison to uniprocessor.
Multiprocessor operating systems aim to support high performance through multiple CPUs.
Multiprocessor systems have more than one processing unit sharing memory/peripheral devices. They have
greater computing power, and higher reliability.
Multiprocessor systems are classified into two:
1.Parallel systems (Tightly-coupled )
2.Distributed Systems (Loosely-coupled)
2. Asymmetric multiprocessing
Each processor is assigned a specific task. This scheme have master – slave relationship.
A master processor controls the system and other processors either look to the master for
instructions or have predefined tasks.
Master processor schedules and allocate work to slave processors.
More common in extremely large systems. Virtually all modern OSs-including Windows,
Windows XP, Mac OS x, and Linux-now provide support for SMP
Advantages:
Increased throughput
By increasing number of processors, we get more work in less time. The speed-up ratio with N
processors is not N, rather it is less than N.
Economical
Multiprocessor systems can cost less than equivalent multiple single processor systems, because they
can share peripherals, mass storage and power supplies. If several programs operate on same set of
data, it is cheaper to store those data on one disk and to have all the processors share them than to have
many computers with local disks and many copies of data.
Increased reliability
If functions are distributed properly among several processors , then the failure of one processor will
not halt the system, only slow it down because the remaining systems picks up the load of failure
system.
The ability of providing service proportional to the level of surviving hardware is called as graceful
degradation. Systems designed for graceful degradation are called as fault tolerant systems
Figure: Client-Server.
Operating system: Unit I- Introduction 8
The processors in distributed systems may vary in size and function. They may include small
microprocessors, workstations, minicomputers and large general purpose computer systems.
Processors communicate with one another through various communications lines, such as high speed buses
or telephone lines.
In this system, the user can access to the resources maintained by the system and thereby speeding up
computation and data availability and reliability.
Distributed systems require networking infrastructure and can distribute the computation among several
physical processors.
Local area networks (LAN) or Wide area networks (WAN) are examples of distributed systems
They May be either client-server or peer-to-peer systems. Many of today’s systems act as server systems
to satisfy requests generated by client systems. This form of specialized distributed system, called client-
server system, A server running a database that responds to client requests for data is an example of such a
system
Advantages:
Resources Sharing: If number of machines is connected then user at one site can share files at remote
sites, process information in a database, print files at remote site etc.
Computation speed up – load sharing: If any computation can be partitioned into sub computations that
can run concurrently, then a distributed system allow us to distribute the sub computation among the
various sites which can run simultaneously thus provide computation speedup.
Reliability: If one site fails in a distributed system, the remaining sites can continue operating, giving the
system better reliability.
Communications: Communication among different system is possible by using electronic messaging, or
file transfer or exchange of program or data.
A real-time system is defined as a data processing system in which the time interval required to process and
respond to inputs is very small.
The time taken by the system to respond to an input and display of required updated information is termed
as the response time. So in this method, the response time is very less
Real-time systems are used when there are rigid time requirements on the operation of a processor or the
flow of data and real-time systems can be used as a control device in a dedicated application.
The primary objective of Real time systems is to provide quick event response times.
Real time system should process thousands of interrupts per second without missing a single event.
Real time systems used in application such as controlling scientific experiments, medical imaging systems,
industrial control systems, telephone switching equipment, flight control and some display systems.
Characteristics of real time system:
- single purpose
- small size
- critical time requirements
In real time system programmer defined and controlled processes are already stored and a separate process
is there for handling a single external event.
Whenever an external event occurs, it is signaled by an interrupt which activate the necessary processes.
Multitasking operation is accomplished by scheduling processes for execution independently of each other
to get an output.
Memory management is less demanding here as many processes permanently reside in memory in order to
provide quick response time.
2 System Components: .
1. Process Management
• A process is program in execution. A process needs certain resources including CPU time, Memory, Files,
and I/O devices to accomplish its task. The process management component manages the multiple
processes running simultaneously on the Operating System.
• The operating system is responsible for the following activities in connection with process management:
o Create, load, execute, suspend, resume, and terminate processes.
o Switch system among multiple processes in main memory.
o Provides communication mechanisms so that processes can communicate with each others
o Provides synchronization mechanisms to control concurrent access to shared data to keep shared data
consistent.
o Allocate/de-allocate resources properly to prevent or avoid deadlock situation.
3. File Management
• File management is one of the most visible services of an operating system. Computers can store
information in several different physical forms; magnetic tape, disk, and drum are the most common forms.
• A files is a sequence of bits, bytes, lines or records whose meaning is defined by its creator and user.
• The operating system implements the abstract concept of the file by managing mass storage device, such as
types and disks. Also files are normally organized into directories to ease their use. These directories may
contain files and other directories and so on.
• The operating system is responsible for the following activities in connection with file management:
o File creation and deletion
o Directory creation and deletion
o The support of primitives for manipulating files and directories
o Mapping files onto secondary storage
o File backup on stable (nonvolatile) storage media
4. Network Management
• Network management is the process of managing and administering a computer network. A computer
network is a collection of various types of computers connected with each other.
• Network management comprises fault analysis, maintaining the quality of service, provisioning of
networks, and performance management.
• Following are the features of network management:
o Network administration
o Network maintenance
o Network operation
o Network provisioning
o Network security
7. Security Management
• The operating system is primarily responsible for all task and activities happen in the computer system.
The various processes in an operating system must be protected from each other’s activities. For that
purpose, various mechanisms which can be used to ensure that the files, memory segment, cpu and other
resources can be operated on only by those processes that have gained proper authorization from the
operating system.
• Security Management refers to a mechanism for controlling the access of programs, processes, or users to
the resources defined by a computer controls to be imposed, together with some means of enforcement.
• For example, memory addressing hardware ensure that a process can only execute within its own address
space. The timer ensure that no process can gain control of the CPU without relinquishing it. Finally, no
process is allowed to do it’s own I/O, to protect the integrity of the various peripheral devices.
Figure: The handling of a user application invoking the open() system call.
• An operating system is a design that enables user application programs to communicate with the hardware
of the machine. The operating system should be built with the utmost care because it is such a complicated
structure and should be simple to use and modify.
• We want a clear structure to let us apply an operating system to our particular needs because operating
systems have complex structures.
• It is easier to create an operating system in pieces, much as we break down larger issues into smaller, more
manageable sub problems. Every segment is also a part of the operating system.
• Operating system structure can be thought of as the strategy for connecting and incorporating various
operating system components within the kernel.
• Operating systems are implemented using many types of structures, as given below:
o Simple Structure
o Monolithic Structure
o Layered Approach Structure
o Micro-Kernel Structure
o Modules
o Hybrid Structure
1) SIMPLE STRUCTURE
It is the most straightforward operating system structure, but it lacks definition and is only appropriate for usage
with tiny and restricted systems. Since the interfaces and degrees of functionality in this structure are clearly
defined, programs are able to access I/O routines, which may result in unauthorized access to I/O procedures.
Example: MS-DOS.
In MS-DOS, the interfaces and levels of functionality are not well separated.
In MS-DOS application programs are able to access the basic I/O routines. This causes the entire
systems to be crashed when user programs fail.
3) LAYERED STRUCTURE
The OS is separated into layers or levels in this kind of arrangement. Layer 0 (the lowest layer) contains the
hardware, and layer 1 (the highest layer) contains the user interface (layer N). These layers are organized
hierarchically, with the top-level layers making use of the capabilities of the lower-level ones.
The functionalities of each layer are separated in this method, and abstraction is also an option. Because layered
structures are hierarchical, debugging is simpler, therefore all lower-level layers are debugged before the upper
layer is examined. As a result, the present layer alone has to be reviewed since all the lower layers have already
been examined.
The image below shows how OS is organized into layers:
4) MICRO-KERNEL STRUCTURE
• 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 and 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.
• Windows NT was originally microkernel, but suffered from performance problems relative to Windows
95. NT 4.0 improved performance by moving more services into the kernel, and now XP is back to being
more monolithic.
• Another microkernel example is QNX, a real-time OS for embedded systems.
• 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 and 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.
• Windows NT was originally microkernel, but suffered from performance problems relative to
Windows 95. NT 4.0 improved performance by moving more services into the kernel, and now XP is
back to being more monolithic.
• Another microkernel example is QNX, a real-time OS for embedded systems.
• For example : The Solaris operating system structure is organized around a core kernel with seven
types of loadable kernel modules:
6) HYBRID SYSTEMS:
• The Operating System combines different structures, resulting in hybrid systems that address performance,
security, and usability issues.
• They are monolithic, because having the operating system in a single address space provides very efficient
performance.
• However, they are also modular, so that new functionality can be dynamically added to the kernel.
• Example: Linux and Solaris are monolithic (simple) and also modular, IOS.
2 Marks
3/4 Marks
1. What are the various objectives and functions of Operating systems?
2. What are the major activities of an operating systems with regard to process management?
3. Differentiate distributed systems from multiprocessor system?
4. Explain OS structure?
5. Explain about multiprogramming and time sharing operating system?
6. Explain computer system architecture?
7. Explain about system calls?
8. What is os user interface?