Sunteți pe pagina 1din 16

UNIT 1 - OPERATING SYSTEM

Definition of Operating system or what is Operating system ?

 An operating system is a set of programs.

 Operating System acts as an interface between the user and the


computer hardware.

 Operating system manages the computer hardware resources (CPU,


Memory, I/O devices…).

 It helps the user to execute programs in a convenient and efficient


manner.

Explain the various types of Operating systems.

1. Mainframe systems
I. Batch Systems
II. Multiprogrammed Systems
III. Time-Sharing Systems
2. Desktop systems
3. Multiprocessor systems
4. Distributed systems
5. Clustered systems
6. Real Time systems
7. Handheld systems

Mainframe System:

Mainframe system is used to handle many commercial applications and


scientific applications.

i. Batch System
ii. Multiprogrammed Systems
iii. Time-sharing systems

I. Batch System
 Punch card is used to give the input in Batch System

 Batch System executes the jobs one by one.

1
 To increase the speed, jobs with similar types are grouped for
execution (Example: Payroll Jobs, Leave Jobs, Accounts Job).

 The operating system always resides in the memory.

 Computer Operator handles the system.

 The users do not interact with the computer directly.

Disadvantage of Batch System.

I. Lack of interaction between the user and the job.

II. CPU is often idle, because the speed of the mechanical I/O
devices is slower than the CPU.

Figure 1: Memory layout for a simple batch system.

II. Multiprogramming Systems


 Multiprogramming operating system selects and executes the jobs
from memory.
 If a job needs an I/O operation (input), then operating system simply
switches to the another job (CPU and OS always busy).
 So CPU never sits idle.

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 (What is CPU
Scheduling).

2
 Job Pool / Job Queue Stores all the Jobs. The operating system keeps
several jobs in memory simultaneously as shown in below Figure 2.

Figure 2: Memory layout for a multiprogramming system

III. Time-sharing systems or Multitasking System

 Time sharing systems or Multitasking System is a logical extension of


multiprogramming systems.
 Time sharing system allows many users to use the computer
simultaneously as shown in Figure 3.
 User can directly interact with system.
 The OS allocates the set of CPU time to each user. This CPU
allocation time is called time slice or a Quantum.
 When the allocated time is expired, then OS passes control to the
next user.

3
Figure 3: Time-sharing systems or Multitasking System

2. Desktop Systems ( Personal Computers / Micro Computers)

 Desktop Systems introduced in 1970‘s.


 The goal of this Desktop system is to maximize user convenience and
responsiveness.
 They are Microcomputers ie. Smaller in Size and less expensive such
as Windows and Apple systems.
 The hardware cost is sufficiently low.

3. Multiprocessor Systems (Also known as Parallel Systems or


tightly Coupled Systems)

 A Multiprocessor system contains two or Many Processors.


 These Processors share the Computer Clock, Memory, bus &
peripheral device.
 In multiprocessor system, all processors operate under single
operating system.
 The other name of Multiprocessor Systems is parallel systems or
tightly coupled systems.
Multiprocessor Systems have 3 main advantages.
a. Increased throughput: Multiprocessor System has more processors.
So More work can be done in less time.

b. Increased Reliability: workload is distributed between the several


processors and the failure of one processor will not halt the system, but
slow it down.

c. Cost Saving / Economic scale: Multiprocessor systems can save


money because they can share peripherals, storage & power supplies.
Graceful Degradation
The failure of one processor will not halt the system, but slow it down.

4
This ability to continue providing service to the level of surviving hardware
is called Graceful Degradation (What is Graceful Degradation).

(What is Fault Tolerant).


Systems designed for graceful degradation are also called Fault Tolerant

Types of Multiprocessing System (Two Types)


i. Symmetric Multiprocessing (SMP): Each processor runs an
identical copy of the operating system & these copies communicate
with one another as required. Ex: Windows NT

Figure 4 : Symmetric multiprocessing architecture.

ii. Asymmetric Multiprocessing (Master – Slave Processors):


Each processor has a specific task (Master processor & Slave
Processor). A master processor controls the system and allocates
work to the slave processors. Ex- SUNOS version 4.

4. Distributed System / Loosely Coupled Systems:

 In distributed system, the processors do not share memory or a


clock.
 In Distributed System, each processor has its own local memory.
 The processors communicate with each other through communication
lines such as high speed buses or telephone lines.
 Distributed systems are able to share computational tasks through
communication network.

5
Types of Distributed Systems (Two Types)

i. Client-Server Systems
ii. Peer-to-Peer Systems

Client-Server Systems (Computer-Server Systems, File-Server


Systems)

In Client-Server System, the Centralized system acts as server to satisfy


the requests generated by the client system. Server system categorized as
Computer Server and File Server.

Figure : General structure of a client-server system

i. Computer-Server Systems :
Computer-Server system receives and executes the client system
requests and send back the results to the client systems.

ii. File-Server Systems :


It provides a file-system interface to the client systems. So the
client system can create the files, update the files, read and delete
the files.

Peer-to-Peer Systems
 It contains collection of processors that do not share memory or a
clock. Instead, each processor has its own local memory.
 The processors communicate with one another through various
communication lines, such as high-speed buses or telephone lines.
 These systems are usually referred to as loosely coupled systems (or
distributed systems).

Network operating system


6
A network operating system is used for file sharing across the network,
In this system, different processes on different computers exchange
messages through the network lines.

Clustered Systems
 In clustered OS, multiple computers are working together and sharing
storage via LAN network OR Storage-Area Network (SAN).
 It provides high availability.
 A layer of cluster software runs on the cluster nodes. Each node can
monitor one or more other nodes.
 If the monitored machine fails, the monitoring machine can take
ownership of its storage, and restart the application.

Types of Clustering:
1 . Asymmetric clustering
2. Symmetric mode

Asymmetric clustering
 In asymmetric clustering, one machine is in hot standby mode
and the other nodes are running the applications.
 The hot standby machine, monitor the Active Server. If the Server
fails, then hot standby host will be become the active server.

Symmetric mode
In symmetric mode, two or more hosts are running applications, and they
are monitoring each other. This mode is more efficient because it uses all
the available hardware.

Parallel Cluster:
Parallel clusters allow multiple hosts to access the same data on the shared
storage example : Oracle Parallel Server.
Distributed Lock Manger (DLM)

7
DLM mechanism is helps to avoid conflicting operations in Cluster systems.

REAL TIME SYSTEM

 The real-time operating system used for a real-time application.

 Example: Flight Control System, Scientific Experiments, Medical


Imaging System.

 In Real time system, Response Time is already fixed.

 ie. Processing must be done within in the fixed time / defined


conditions, otherwise the System will fail.

Types of Real Time System:


1. Hard Real Time System
2. Soft Real Time System

Hard Real Time System


 In hard real-time system, Process should be completed on time,
otherwise, experiment / operation fails.
 In this system, secondary storage is limited or absent. So, data is
stored in the read-only memory (ROM).
 It is used in Atomic Scientific research, aircraft control system.

Soft real time systems


 It is a less restrictive type of real time system.
 The critical task gets priority over other tasks and keeps that priority
until it completes.
 Missing an occasional deadline is acceptable in this system.
Examples are a digital camera, mobile phones, etc.

Handheld systems
 Handheld system is small in size with Internet connection.

8
Example: Cell Phones, personal digital assistants (PDAs) and Palm-
Pilots.
 It contains lower speed processors and less memory ie. Memory size
between 512 KB and 8 MB with the slow processor.
 It has a small display screen and Displaying the content of a web
page in Handheld device is called Web Clipping.

Operating System Components Operating System Services


Process Management Program Execution:
A process is a program in execution.
 Able to load and execute the
Tasks of Process Management of OS Program.
 Process Creation
 Process Deletion  Able to terminate the process
 Process Suspend execution, either normally or
 Process Resume
forcefully.
 Inter-Process Communication (IPC)
 Inter-Process Synchronization

Main Memory Management (RAM): I/O operations (Input Output


Main memory (RAM) is a temporary memory Operations)
and Small in Size.
 I/O operations (read or write
Tasks of Main Memory Management of OS operations) done with the help of
input-output devices like Keyboards,
 Able to load the Process into main mouse.
memory for execution.
 Decide which process should be load into  Some programs may require I/O. So,
9
Main Memory. operating system give the necessary
 Allocate/de-allocate memory as need. access to the I/O devices when it
 Keep the track of the Memory Usage. required.

Secondary-Storage Management (Hard Disk) File System Manipulation


 Secondary Memory (Hard Disk) is big in  The user / program need require
size. access to read and write access on
files.
 It is used to the store the Data  So, operating system gives the below
permanently. required access through interface.

Tasks of Secondary-Storage Management of  The user can create/delete a


OS : files.
– Free space management  The user can create/delete
– Storage allocation directories.
– Disk scheduling  The user can store/backup the
files.

File Management Error Detection


A file is a collection of related information
defined by its creator.  The error can occur anytime and
Tasks of File Management of OS: anywhere (in Memory, CPU, I/O
 Creating and Deleting Files devices, Network).
 Creating and Deleting Directories
 Updating or Modifying the files and  So, the operating system constantly
directories checks the possible errors to take the
 Store and Backup the files into storage appropriate action and ensure the and
device consistent computing.
Protection System Resource Allocation:
Protection is mechanism to ensure all system The operating system act as the Resource
access should be authentic, safe and controlled Allocator ie allocating the required resources
manner. to the multiple users or multiple jobs
The protection mechanism must: running at the same time.
– distinguish between authorized and
unauthorized usage.
– specify the controls to be implemented.
I/O Management Communication
Tasks of I/O Management of OS: Communication is the exchange of
 Hide the details of Hardware devices. information between processes on the same
 Includes buffer Cache and spooling computer or on different systems connected

10
components. by a network and implemented via shared
 Includes general device-driver and memory or message passing.
Drivers for specific hardware devices.
Networking Accounting:
In distributed systems, the processors The operating system keep track of users
communicate with one another through network. resource utilization information for
So, The communication-network design must accounting.
consider
 routing and connection strategies
 The problems of contention and security.
Command-Interpreter System: Protection:
Command interpreter is interface between the Protection ensures that all access to system
user and the operating system. is authenticated and controlled.
It gets the input from the user and executes the
given command. The Other names of Command
Line Interpreter is
1. Control Card interpreter
2. Shell in Unix System
Write about the Operating System structure?
There are two main forms to organize the system structure:
1. Simple structure
2. Layered approach

Simple Structure (MS-DOS)


 In Simple structure system is not divided into modules.
ie. Interface and Functionalities are not well sepearated.
 MS-DOS is a simple structured Operating System.
 In MS-DOS interfaces and levels of functionality are not well
separated.
 ie. Application layer can directly interact with the BIOS device drivers.
Disadvantage of Simple Structure Operating System:
Security is a main problem in Simple Operating System.

11
Figure : MS-DOS layer structure.

Simple System Structure (UNIX)

The UNIX OS contains Two Parts: (Systems programs and Kernel)


i. Systems programs:
Systems programs are used to define the User Interface.

ii. The Kernel


 Kernel Consists of everything below the system-call interface and
above the physical hardware.
 Kernel act as the interface between hardware and software.
 Unix Operating system Separated into a series of interfaces and device
drivers and Different components (file system, CPU scheduling,
memory management and other OS functions).

12
Figure: UNIX system structure

Layered approach
In 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 and the highest (layer N) is the user interface. Each layer
uses functions
(operations) and services
of only lower-level layers.
Layered approach is used
for modularization of the
OS. This approach
simplifies the debugging
and system verification.

OS/2 is the example for Layered Structure Operating System.

In OS/2 system, the application layer can not directly access the
bottom layer.
ie. The upper layer only can access the lower layer.

Advantage:
It provides high level security and OS upgrade is easy.
13
Figure : OS/2 layer structure

Microkernels

 Kernel is the collection of the exe. It is used to manage the system


resources.
 In 1980’s, kernel size is reduced by removing all non-essential
components from the kernel. So Kernel size is small.
 Kernel is divided into system kernel and user programs kernel.

Advantages of Microkernels
1. Operating system upgrade process is easy.
2. It provides more security and reliability.

Virtual Machines:

 In virtual Machine, the operating system creates the illusions like each
user or process have their own processor and memory.

14
 A virtual machine has virtual memory, virtual disks, virtual printer,
virtual console, virtual processor and virtual communication network.

Virtual disks (minidisks) are difficult to implement in a virtual machine. A lot


of effort is required to provide an exact duplicate of the underlying machine.
Virtual user mode and virtual monitor mode run in the physical user mode.

Java Virtual Machine (JVM)

Java is very popular Object Oriented language introduced by Sun Micro


Systems in 1995.
Bytecode (.class) is the output of the Java Compiler and it can be executed
by JVM.
The JVM consists of a class loader, a class verifier, and a Java
interpreter that executes the architecture-neutral bytecodes.
The class loader loads .class files from both the Java program and the Java
API for execution by the Java interpreter.
After a class is loaded, the verifier checks that the class file is valid Java
bytecode and does not overflow or underflow the stack. It also ensures that

15
the bytecode does not perform pointer arithmetic, which could potentially
provide illegal memory access. If the class passes verification, it is run by
the Java interpreter. Java Interpreter or Just In Time (JIT) converts the
bytecode into Native Machine Language for host computer.

Figure : The Java Virtual Machine

16

S-ar putea să vă placă și