0% found this document useful (0 votes)
57 views

Introduction To Computers Lesson 3

There are several types of operating systems. Batch operating systems group similar jobs together in batches to be processed without direct user interaction. Time-sharing systems allow multiple users to access a single system simultaneously by rapidly switching between tasks. Distributed systems connect independent computers over a network so resources can be shared. Network operating systems manage data, users and security across private networks. Real-time operating systems have very strict time constraints for processing inputs. An operating system manages memory, hardware devices, error messages and parallel processing to allow applications to run smoothly.

Uploaded by

kosgei
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
57 views

Introduction To Computers Lesson 3

There are several types of operating systems. Batch operating systems group similar jobs together in batches to be processed without direct user interaction. Time-sharing systems allow multiple users to access a single system simultaneously by rapidly switching between tasks. Distributed systems connect independent computers over a network so resources can be shared. Network operating systems manage data, users and security across private networks. Real-time operating systems have very strict time constraints for processing inputs. An operating system manages memory, hardware devices, error messages and parallel processing to allow applications to run smoothly.

Uploaded by

kosgei
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 28

OPERATING SYSTEMS

In summary: Types of Operating Systems

Types of Operating Systems: Some of the widely used operating systems are as follows:

1. Batch Operating System –


This type of operating system does not interact with the computer directly. There is an operator
which takes similar jobs having same requirement and group them into batches. It is the
responsibility of operator to sort the jobs with similar needs.

Advantages of Batch Operating System:


 It is very difficult to guess or know the time required by any job to complete. Processors of
the batch systems know how long the job would be when it is in queue
 Multiple users can share the batch systems
 The idle time for batch system is very less
 It is easy to manage large work repeatedly in batch systems
Disadvantages of Batch Operating System:
 The computer operators should be well known with batch systems
 Batch systems are hard to debug
 It is sometime costly
 The other jobs will have to wait for an unknown time if any job fails

Examples of Batch based Operating System: Payroll System, Bank Statements etc.

HP 1
OPERATING SYSTEMS

2. Time-Sharing Operating Systems –


Each task is given some time to execute, so that all the tasks work smoothly. Each user gets time
of CPU as they use single system. These systems are also known as Multitasking Systems. The
task can be from single user or from different users also. The time that each task gets to execute
is called quantum. After this time interval is over OS switches over to next task.

Advantages of Time-Sharing OS:


 Each task gets an equal opportunity
 Less chances of duplication of software
 CPU idle time can be reduced
Disadvantages of Time-Sharing OS:
 Reliability problem
 One must have to take care of security and integrity of user programs and data
 Data communication problem
Examples of Time-Sharing OSs are: Multics, Unix etc.

3. Distributed Operating System –


These types of operating system is a recent advancement in the world of computer technology
and are being widely accepted all-over the world and, that too, with a great pace. Various
autonomous interconnected computers communicate each other using a shared communication
network. Independent systems possess their own memory unit and CPU. These are referred
as loosely coupled systems or distributed systems. These system’s processors differ in size and
function. The major benefit of working with these types of operating system is that it is always
possible that one user can access the files or software which are not actually present on his

HP 2
OPERATING SYSTEMS

system but on some other system connected within this network i.e., remote access is enabled
within the devices connected in that network.

Advantages of Distributed Operating System:


 Failure of one will not affect the other network communication, as all systems are
independent from each other
 Electronic mail increases the data exchange speed
 Since resources are being shared, computation is highly fast and durable
 Load on host computer reduces
 These systems are easily scalable as many systems can be easily added to the network
 Delay in data processing reduces
Disadvantages of Distributed Operating System:
 Failure of the main network will stop the entire communication
 To establish distributed systems the language which are used are not well defined yet
 These types of systems are not readily available as they are very expensive. Not only that
the underlying software is highly complex and not understood well yet
Examples of Distributed Operating System are- LOCUS etc.
4. Network Operating System –
These systems run on a server and provide the capability to manage data, users, groups, security,
applications, and other networking functions. These types of operating systems allow shared

HP 3
OPERATING SYSTEMS

access of files, printers, security, applications, and other networking functions over a small
private network. One more important aspect of Network Operating Systems is that all the users
are well aware of the underlying configuration, of all other users within the network, their
individual connections etc. and that’s why these computers are popularly known as tightly
coupled systems.

Advantages of Network Operating System:


 Highly stable centralized servers
 Security concerns are handled through servers
 New technologies and hardware up-gradation are easily integrated to the system
 Server access are possible remotely from different locations and types of systems
Disadvantages of Network Operating System:
 Servers are costly
 User has to depend on central location for most operations
 Maintenance and updates are required regularly
Examples of Network Operating System are: Microsoft Windows Server 2003, Microsoft
Windows Server 2008, UNIX, Linux, Mac OS X, Novell NetWare, and BSD etc.

5. Real-Time Operating System –


These types of OSs serve the real-time systems. The time interval required to process and
respond to inputs is very small. This time interval is called response time.

HP 4
OPERATING SYSTEMS

Real-time systems are used when there are time requirements are very strict like missile
systems, air traffic control systems, robots etc.
Two types of Real-Time Operating System which are as follows:
 Hard Real-Time Systems:
These OSs are meant for the applications where time constraints are very strict and even
the shortest possible delay is not acceptable. These systems are built for saving life like
automatic parachutes or air bags which are required to be readily available in case of any
accident. Virtual memory is almost never found in these systems.
 Soft Real-Time Systems:
These OSs are for applications where for time-constraint is less strict.

Advantages of RTOS:
 Maximum Consumption: Maximum utilization of devices and system,thus more output
from all the resources
 Task Shifting: Time assigned for shifting tasks in these systems are very less. For example
in older systems it takes about 10 micro seconds in shifting one task to another and in latest
systems it takes 3 micro seconds.
 Focus on Application: Focus on running applications and less importance to applications
which are in queue.
 Real time operating system in embedded system: Since size of programs are small,
RTOS can also be used in embedded systems like in transport and others.
 Error Free: These types of systems are error free.
 Memory Allocation: Memory allocation is best managed in these types of systems.
Disadvantages of RTOS:

HP 5
OPERATING SYSTEMS

 Limited Tasks: Very few tasks run at the same time and their concentration is very less on
few applications to avoid errors.
 Use heavy system resources: Sometimes the system resources are not so good and they
are expensive as well.
 Complex Algorithms: The algorithms are very complex and difficult for the designer to
write on.
 Device driver and interrupt signals: It needs specific device drivers and interrupt signals
to response earliest to interrupts.
 Thread Priority: It is not good to set thread priority as these systems are very less prone to
switching tasks.
Examples of Real-Time Operating Systems are: Scientific experiments, medical imaging
systems, industrial control systems, weapon systems, robots, air traffic control systems, etc.

Services Provided by An Operating System


 An operating system performs these services for applications:
In a multitasking operating system where multiple programs can be running at the same
time, the operating system determines which applications should run in what order and
how much time should be allowed for each application before giving another application
a turn.
 It manages the sharing of internal memory among multiple applications
 It handles input and output to and from attached hardware devices, such as hard disks,
printers, and dial-up ports.
 It sends messages to each application or interactive user (or to a system operator) about
the status of operation and any errors that may have occurred.
 It can offload the management of what are called batch jobs (for example, printing) so
that the initiating application is freed from this work.
 On computers that can provide parallel processing, an operating system can manage how
to divide the program so that it runs on more than one processor at a time.

HP 6
OPERATING SYSTEMS

Job Control
Job control language (JCL) is a scripting language executed on an IBM mainframe
operating system. It consists of control statements that designate a specific job for the
operating system.

JCL provides a means of communication between the application program, operating


system and system hardware. there are two distinct IBM Job Control languages:
 one for the operating system lineage that begins with DOS/360 and whose latest
member is z/VSE; and
 the other for the lineage from OS/360 to z/OS, the latter now
including JES extensions, Job Entry Control Language (JECL).

Application of JCL:

Here is a list of examples of some of the implications.

1. Program control: To control the execution of the command file, we shall require the
usual control structures we find in high-level programming languages – conditional
execution, iteration, composition of instructions, etc.
2. Communication with programs: We require access to the current state of a process, and
to its recent output, and we must be able to set parameters for processes. It is particularly
important to be able to determine why a process stopped.
3. Communication with the system: We must be able to determine normally accessible
facts about the state of the system – are certain files present, what time it is, etc.

Features common to DOS and OS JCL

Jobs, steps and procedures

For both DOS and OS JCL, the unit of work is the job.

HP 7
OPERATING SYSTEMS

A job consists of one or several steps, each of which is a request to run one specific program. For
example, before the days of relational databases, a job to produce a printed report for
management might consist of the following steps:

 a user-written program to select the appropriate records and copy them to a temporary
file; 
 sort the temporary file into the required order, usually using a general-purpose utility;
 a user-written program to present the information in a way that is easy for the end-users
to read and includes other useful information such as sub-totals;
 and a user-written program to format selected pages of the end-user information for
display on a monitor or terminal.

In both DOS and OS JCL, the first "card" must be the JOB card, which:

 Identifies the job.


 Usually provides information to enable the computer services department to bill the
appropriate user department.
 Defines how the job as a whole is to be run, e.g. its priority relative to other jobs in the
queue.

Procedures (commonly called procs) are pre-written JCL for steps or groups of steps, inserted
into a job. Both JCLs allow such procedures. Procs are used for repeating steps which are used
several times in one job, or in several different jobs. They save programmer time and reduce the
risk of errors. To run a procedure, one simply includes in the JCL file a single "card" which
copies the procedure from a specified file, and inserts it into the job stream. Also, procs can
include parameters to customize the procedure for each use.

Operating Systems Structures

The design of an operating system architecture traditionally follows the separation of


concerns principle. This principle suggests structuring the operating system into relatively
independent parts that provide simple individual features, thus keeping the complexity of the
design manageable.

HP 8
OPERATING SYSTEMS

Besides managing complexity, the structure of the operating system can influence key features
such as robustness or efficiency:

 The operating system possesses various privileges that allow it to access otherwise
protected resources such as physical devices or application memory. When these
privileges are granted to the individual parts of the operating system that require them,
rather than to the operating system as a whole, the potential for both accidental and
malicious privileges misuse is reduced.

 Breaking the operating system into parts can have adverse effect on efficiency because of
the overhead associated with communication between the individual parts. This overhead
can be exacerbated when coupled with hardware mechanisms used to grant privileges.

The following sections outline typical approaches to structuring the operating system.

Definition of monolithic operating system

The monolithic operating system is a very basic operating system in which file management,
memory management, device management, and process management is directly controlled
within the kernel. All these components like file management, memory management etc. are
located within the kernel.

Monolithic architecture diagram

HP 9
OPERATING SYSTEMS

OR

History of monolithic operating


system

The monolithic operating system is


also known as the monolithic
kernel. This is an old type of
operating system. They were used
to perform small tasks like batch
processing, time sharing tasks in
banks. Monolithic kernel acts as a
virtual machine which controls all hardware parts. It is different than microkernel which has
limited tasks. A microkernel is divided into two parts i.e. kernel space and user space. Both
these parts communicate with each other through IPC (Inter-process communication).
Microkernel advantage is that if one server fails then other server takes control of it.  Operating
systems which use monolithic architecture were first time used in the 1970’s.

1
HP
0
OPERATING SYSTEMS

Features of the monolithic operating system

Simple structure:

This type of operating system has a simple structure. All the components needed for processing
are embedded into the kernel.

Works for smaller tasks:

It works better for performing smaller tasks as it can handle limited resources.

Communication between components:

All the components can directly communicate with each other and also with the kernel.

Fast operating system:

The code to make monolithic kernel is very fast and robust.

Limitations of a monolithic operating system

 Code written in this operating system (OS) is difficult to port.


 Monolithic OS has more tendency to generate errors and bugs. The reason is that user
processes use same address locations as the kernel.
 Adding and removing features from monolithic OS is very difficult. All the code needs to
be rewritten and recompiled to add or remove any feature.

Examples of monolithic operating system

 VMS
 Linux
 OS/360
 OpenVMS
 Multics

1
HP
1
OPERATING SYSTEMS

 AIX
 BSD

Layered Architecture of Operating System


A layered operating system is an operating system that groups related functionality together,
and separates it from the unrelated. Its architectural structure resembles a layer cake. It starts at
level 0, or the hardware level and works its way up to the operator, or user.
This is an important architecture of operating system which is meant to overcome the
disadvantages of early monolithic systems. In this approach, OS is split into various layers such
that all the layers perform different functionalities.

Each layer can interact with the one just above it and the one just below it. Lowermost layer
which directly deals with the bare hardware is mainly meant to perform the functionality of I/O
communication and the uppermost layer which is directly connected with the application
program acts as an interface between user and operating system.

This is highly advantageous structure because all the functionalities are on different layers and
hence each layer can be tested and debugged separately.

The Microsoft Windows Operating System is a good example of the layered structure.

1
HP
2
OPERATING SYSTEMS

Fig. Layered Architecture of Operating System

Advantages of Layered architecture:


1. Dysfunction of one layer will not affect the entire operating system
2. Easier testing and debugging due to isolation among the layers.
3. Adding new functionalities or removing the obsolete ones is very easy.

Micro-Kernel

A microkernel is the minimum software that is required to correctly implement an operating


system. This includes memory, process scheduling mechanisms and basic inter-process
communication.

A diagram that demonstrates the architecture of a microkernel is as follows:

1
HP
3
OPERATING SYSTEMS

In the above diagram, the microkernel contains basic requirements such as memory, process
scheduling mechanisms and basic inter-process communication. The only software executing at
the privileged level i.e. kernel mode is the microkernel. The other functions of the operating
system are removed from the kernel mode and run in the user mode. These functions may be
device drivers, file servers, application inter-process communication etc.

The microkernel makes sure that the code can be easily managed because the services are
divided in the user space. This means that there is less code running in the kernel mode which
results in increased security and stability.

Essential Components in a Microkernel

A microkernel contains only the core functionalities of the system. A component is included in
the microkernel only if putting it outside would disrupt the functionality of the system. All the
other non-essential components are put in the user mode.

The minimum functionalities included in the microkernel are:

1
HP
4
OPERATING SYSTEMS

 Memory management mechanisms like address spaces are included in the microkernel.
This also contains memory protection features.
 Processor scheduling mechanisms are also necessary in the microkernel. This contains
process and thread schedulers.
 Inter-Process Communication (IPC) is important as it is needed to manage the servers
that run their own address spaces.

Performance of a Microkernel System

Providing services in a microkernel system are much more expensive than in a normal
monolithic system. The service is obtained by sending an inter-process communication message
to the server and getting one in return. This means a context switch or a function call if the
drivers are implemented as processes or procedures respectively.

Performance therefore can be complicated in microkernel systems and may lead to some
problems. However, this issue is reducing in the modern microkernel systems created such as L4
microkernel systems.

Benefits of Microkernels

Some of the benefits of microkernels are:

 Microkernels are modular and the different modules can be replaced, reloaded, modified,
changed etc. as required. This can be done without even touching the kernel.
 Microkernels are quite secure as only those components are included that would disrupt
the functionality of the system otherwise.

 Microkernels contain fewer system crashes as compared to monolithic systems. Also, the
crashes that do occur can be handled quite easily due to the modular structure of
microkernels.

1
HP
5
OPERATING SYSTEMS

CHAPTER TWO

PROCESS MANAGEMENT.

PROCESS CONCEPTS.

Definition of terms.

i. PROCESS
A process is a program in execution. The execution of a process must progress in a sequential
fashion.

It can also be defined as;


A process is defined as an entity which represents the basic unit of work to be implemented in
the system.

ii. PROGRAM
A prog ram by itself is not a process. It is a static entity made up of prog ram statement while
process is a dynamic entity. Prog ram contains the instructions to be executed by processor.

A prog ram takes a space at sing le place in main memory and continues to stay there. A prog
ram does not perform any action by itself.

ii. THREAD.

A thread is also called a light weight process. It is a flow of execution through the process code,
with its own prog ram counter, system registers and stack. Threads provide a way to improve
application performance through parallelism. Threads represent a software approach to
improving performance of operating system by reducing the overhead thread is equivalent to a
classical process.

1
HP
6
OPERATING SYSTEMS

Each thread belongs to exactly one process and no thread can exist outside a process. Each
thread represents a separate flow of control. Threads have been successfully used in
implementing network servers and web
server. They also provide a suitable foundation for parallel execution of applications on shared
memory
multiprocessors. Folowing fig ure shows the working of the sing le and multithreaded processes.

Difference between Process and Thread

PROCESS THREAD
1 Process is heavy weight or resource Thread is light weight taking lesser
intensive resources
than a process.
2 Process switching needs interaction with Thread switching does not need to interact
operating system. with
operating system.
3 In multiple processing environments each All threads can share same set of open files,
process executes the same code but has its child
own memory and file resources processes.
If one process is blocked then no other While one thread is blocked and waiting,
4 process can execute until the first process second
is thread in the same task can run.
unblocked.
5 Multiple processes without using threads Multiple threaded processes use fewer
use resources.
more resources.
6 In multiple processes each process operates One thread can read, write or change
another
thread's data.

1
HP
7
OPERATING SYSTEMS

1
HP
8
OPERATING SYSTEMS

Advantages of Threads

 Thread minimize context switching time.


 Use of threads provides concurrency within a process.
 Efficient communication.
 Economy- It is more economical to create and context switch threads.
 Utilization of multiprocessor architectures to a greater scale and efficiency.

Types of Thread
Threads are implemented in following two ways
 User Level Threads -- User managed threads
 Kernel Level Threads -- Operating System managed threads acting on kernel, an
operating system core.

User Level Threads


In this case, application manages thread management kernel is not aware of the existence of
threads. The thread library contains code for creating and destroying threads, for passing
message and data between threads, for scheduling thread execution and for saving and restoring
thread contexts. The application begins with a sing le thread and beg ins running in that thread.

1
HP
9
OPERATING SYSTEMS

Kernel Level Threads

 In this case, thread management is done by the Kernel. There is no thread management
code in the application area. Kernel threads are supported directly by the operating
system. Any application can be programmed to be multithreaded. All of the threads
within an application are supported within a single process. Operating System managed
threads acting on kernel, an operating system core.

The Kernel maintains context information for the process as a whole and for individuals threads
within the process. Scheduling by the Kernel is done on a thread basis. The Kernel performs
thread creation, scheduling and management in Kernel space. Kernel threads are generally
slower to create and manage than the user threads.

2
HP
0
OPERATING SYSTEMS

Advantages

Kernel can simultaneously schedule multiple threads from the same process on multiple

processes.
 If one thread in a process is blocked, the Kernel can schedule another thread of the same
process.
 Kernel routines themselves can be multithreaded.
Disadvantages

 Kernel threads are generally slower to create and manage than the user threads.
 Transfer of control from one thread to another within the same process requires a mode
switch to the Kernel.

Difference between User-Level & Kernel-Level Thread

S.N. User-Level Threads Kernel-Level Thread

1 User-level threads are faster to create and manage. Kernel-level threads are slower to
create and manage.

2 Implementation is by a thread library at the user Operating system supports creation of


level. Kernel threads.

3 User-level thread is generic and can run on any Kernel-level thread is specific to the
operating system. operating system.

4 Multi-threaded applications cannot take advantage Kernel routines themselves can be


of multiprocessing. multithreaded.

2
HP
1
OPERATING SYSTEMS

4. PROCESS CONTROL BLOCK (PCB)

Each process is represented in the operating system by a process control block (PCB) also called
a task control block. PCB is the data structure used by the operating system. Operating system
groups all information that needs about particular process.
PCB contains many pieces of information associated with a specific process which are described
below.

Process Control Block is a data structure that contains information of the process related to it.
The process control block is also known as a task control block, entry of the process table, etc.

It is very important for process management as the data structuring for processes is done in terms
of the PCB. It also defines the current state of the operating system.

Process control block includes CPU scheduling, I/O resource management, file management
information etc. The PCB serves as the repository for any information which can vary from
process to process. Loader/linker sets flag s and registers when a process is created. If that
process g et suspended, the contents of the registers are saved on a stack and the pointer to the
particular stack frame is stored in the PCB. By this technique, the hardware state can be restored
so that the process can be scheduled to run again.

2
HP
2
OPERATING SYSTEMS

Structure of the Process Control Block

The process control stores many data items that are needed for efficient process management.
Some of these data items are explained with the help of the given diagram

The following are the data items and their functions.

Process State

This specifies the process state i.e. new, ready, running, waiting or terminated.

Process Number

This shows the number of the particular process.

Program Counter

This contains the address of the next instruction that needs to be executed in the process.

Registers

This specifies the registers that are used by the process. They may include accumulators, index
registers, stack pointers, general purpose registers etc.

List of Open Files

2
HP
3
OPERATING SYSTEMS

These are the different files that are associated with the process

CPU Scheduling Information

The process priority, pointers to scheduling queues etc. is the CPU scheduling information that is
contained in the PCB. This may also include any other scheduling parameters.
Memory Management Information

The memory management information includes the page tables or the segment tables depending
on the memory system used. It also contains the value of the base registers, limit registers etc.

I/O Status Information

This information includes the list of I/O devices used by the process, the list of files etc.

Accounting information

The time limits, account numbers, amount of CPU used, process numbers etc. are all a part of the
PCB accounting information.

Location of the Process Control Block

The process control block is kept in a memory area that is protected from the normal user access.
This is done because it contains important process information. Some of the operating systems
place the PCB at the beginning of the kernel stack for the process as it is a safe location.

IV. PROCESS STATES

In the Operating System, a Process is something that is currently under execution. So, an
active program can be called a Process. For example, when you want to search something on
web then you start a browser. So, this can be process. Another example of process can be
starting your music player to listen to some cool music of your choice.

2
HP
4
OPERATING SYSTEMS

A Process has various attributes associated with it. Some of the attributes of a Process are:

 Process Id: Every process will be given an id called Process Id to uniquely identify


that process from the other processes.

 Process state: Each and every process has some states associated with it at a particular
instant of time. This is denoted by process state. It can be ready, waiting, running, etc.

 CPU scheduling information: Each process is executed by using some process


scheduling algorithms like FCSF, Round-Robin, SJF, etc.

 I/O information: Each process needs some I/O devices for their execution. So, the
information about device allocated and device need is crucial.

States of a Process
During the execution of a process, it undergoes a number of states.

New

This is the state when the process has just been created. It is the initial state in the process life
cycle.

Ready

In the ready state, the process is waiting to be assigned the processor by the short term scheduler,
so it can run. This state is immediately after the new state for the process.

Ready Suspended

The processes in ready suspended state are in secondary memory. They were initially in the
ready state in main memory but lack of memory forced them to be suspended and gets placed in
the secondary memory.

Running

2
HP
5
OPERATING SYSTEMS

The process is said to be in running state when the process instructions are being executed by the
processor. This is done once the process is assigned to the processor using the short-term
scheduler.

Blocked

The process is in blocked state if it is waiting for some event to occur. This event may be I/O as
the I/O events are executed in the main memory and don't require the processor. After the event
is complete, the process again goes to ready state.

Blocked Suspended

This is similar to ready suspended. The processes in blocked suspended state are in secondary
memory. They were initially in the blocked state in main memory waiting for some event but
lack of memory forced them to be suspended and gets placed in the secondary memory. A
process may go from blocked suspended to ready suspended if its work is done.

Terminated

The process is terminated once it finishes its execution. In the terminated state, the process is
removed from main memory and its process control block is also deleted.

2
HP
6
OPERATING SYSTEMS

2
HP
7
OPERATING SYSTEMS

Difference Between Process And Program

Process Program
A process is program in execution A program is set of instructions
A process is an active/dynamic entity A program is a passive/static entity
A process has a limited life span.It is created
A program has a longer life span. It is stored
when execution starts and terminated as
on disk forever
execution is finished
A process contains various resources like
A program is stored on disk in some file. It
memory address,disk,printer etc as per
does not conatin any other resource
requirement
A process contains memory address which is A program requires memory space on disk to
called address space store all instructions

V. CONCURRENCY CONTROL

Concurrent control is the process of managing simultaneous operations in a process without


having them interfere with one another.

2
HP
8

You might also like