UU BBA SEM 1 Fundamentals of Computing Unit 5

Download as pdf or txt
Download as pdf or txt
You are on page 1of 24

UNIT V OPERATING SYSTEM

Structure

5.1 Functions
5.2 Measuring System Performance Assemblers
5.3 Compilers and Interpreters Batch Processing
5.4 Multiprogramming
5.5 Multitasking
5.6 Multiprocessing
5.7 Time Sharing
5.8 DOS
5.9 Windows
5.10 Unix/Linux
5.11 Let's Sum Up
5.12 Keywords
5.13 Some Useful Books
5.14 Answer to Check your Progress
5.15 Terminal Questions

5.0 OBJECTIVES

The operating system (OS) manages all of the software and hardware on
the computer. It performs basic tasks such as file, memory and process
management, handling input and output, and controlling peripheral
devices such as disk drives and printers.
At the end of this unit, the student will be able to:
• Identify the Role of Windows.
• Understanding Multiprocessing.
• Illustrate the role of the Time sharing,
• Identify the types of DOS

5.1 INTRODUCTION
Fundamentals of Computing
An Operating System (OS) is a software that acts as an interface between
computer hardware components and the user. Every computer system
must have at least one operating system to run other programs.
Applications like Browsers, MS Office, Notepad Games, etc., need some
environment to run and perform its tasks.

The OS helps you to communicate with the computer without knowing


how to speak the computer’s language. It is not possible for the user to use
any computer or mobile device without having an operating system.

5.2 FUNCTIONS

Security –
The operating system uses password protection to protect user data and
similar other techniques. it also prevents unauthorized access to programs
and user data.

Control over system performance –


Monitors overall system health to help improve performance. records the
response time between service requests and system response to having a
complete view of the system health. This can help improve performance
by providing important information needed to troubleshoot problems.
Job accounting –
Operating system Keeps track of time and resources used by various tasks
and users, this information can be used to track resource usage for a
particular user or group of users.

Error detecting aids –


The operating system constantly monitors the system to detect errors and
avoid the malfunctioning of a computer system.

Coordination between other software and users –


Fundamentals of Computing
Operating systems also coordinate and assign interpreters, compilers,
assemblers, and other software to the various users of the computer
systems.

Memory Management –
The operating system manages the Primary Memory or Main Memory.
Main memory is made up of a large array of bytes or words where each
byte or word is assigned a certain address. Main memory is fast storage
and it can be accessed directly by the CPU. For a program to be executed,
it should be first loaded in the main memory. An Operating System
performs the following activities for memory management:
It keeps track of primary memory, i.e., which bytes of memory are used
by which user program. The memory addresses that have already been
allocated and the memory addresses of the memory that has not yet been
used. In multiprogramming, the OS decides the order in which processes
are granted access to memory, and for how long. It Allocates the memory
to a process when the process requests it and deallocates the memory when
the process has terminated or is performing an I/O operation.

Processor Management –
In a multi-programming environment, the OS decides the order in which
processes have access to the processor, and how much processing time
each process has. This function of OS is called process scheduling. An
Operating System performs the following activities for processor
management.
Keeps track of the status of processes. The program which performs this
task is known as a traffic controller. Allocates the CPU that is a processor
to a process. De-allocates processor when a process is no more required.

Device Management –
An OS manages device communication via their respective drivers. It
performs the following activities for device management. Keeps track of
all devices connected to the system. designates a program responsible for
every device known as the Input/Output controller. Decides which process
gets access to a certain device and for how long. Allocates devices in an
effective and efficient way. Deallocates devices when they are no longer
required.

File Management –
A file system is organized into directories for efficient or easy navigation
and usage. These directories may contain other directories and other files.
An Operating System carries out the following file management activities.
It keeps track of where information is stored, user access settings and
status of every file, and more… These facilities are collectively known as
the file system.
Moreover, Operating System also provides certain services to the
computer system in one form or the other.
The Operating System provides certain services to the users which can be
listed in the following manner:

Program Execution: The Operating System is responsible for the execution


of all types of programs whether it be user programs or system programs.
The Operating System utilizes various resources available for the efficient
running of all types of functionalities.
Handling Input/Output Operations: The Operating System is responsible
for handling all sorts of inputs, i.e, from the keyboard, mouse, desktop,
etc. The Operating System does all interfacing in the most appropriate
manner regarding all kinds of Inputs and Outputs.
For example, there is a difference in the nature of all types of peripheral
devices such as mice or keyboards, the Operating System is responsible
for handling data between them.
Manipulation of File System: The Operating System is responsible for
making decisions regarding the storage of all types of data or files, i.e,
floppy disk/hard disk/pen drive, etc. The Operating System decides how
the data should be manipulated and stored.
Error Detection and Handling: The Operating System is responsible for
the detection of any type of error or bugs that can occur while any task.
The well-secured OS sometimes also acts as a countermeasure for
preventing any sort of breach to the Computer System from any external
source and probably handling them.
Fundamentals of Computing
Resource Allocation: The Operating System ensures the proper use of all
the resources available by deciding which resource to be used by whom
for how much time. All the decisions are taken by the Operating System.
Accounting: The Operating System tracks an account of all the
functionalities taking place in the computer system at a time. All the details
such as the types of errors that occurred are recorded by the Operating
System.
Information and Resource Protection: The Operating System is
responsible for using all the information and resources available on the
machine in the most protected way. The Operating System must foil an
attempt from any external resource to hamper any sort of data or
information.
All these services are ensured by the Operating System for the
convenience of the users to make the programming task easier. All
different kinds of Operating systems more or less provide the same
services.

5.3 MEASURING SYSTEM PERFORMANCE

Security –
The operating system uses password protection to protect user data and
similar other techniques. it also prevents unauthorized access to programs
and user data.

Control over system performance –


Monitors overall system health to help improve performance. records the
response time between service requests and system response to having a
complete view of the system health. This can help improve performance
by providing important information needed to troubleshoot problems.

Job accounting –
Operating system Keeps track of time and resources used by various tasks
and users, this information can be used to track resource usage for a
particular user or group of users.

Error detecting aids –


The operating system constantly monitors the system to detect errors and
avoid the malfunctioning of a computer system.

Coordination between other software and users –


Operating systems also coordinate and assign interpreters, compilers,
assemblers, and other software to the various users of the computer
systems.

Memory Management –
The operating system manages the Primary Memory or Main Memory.
Main memory is made up of a large array of bytes or words where each
byte or word is assigned a certain address. Main memory is fast storage
and it can be accessed directly by the CPU. For a program to be executed,
it should be first loaded in the main memory. An Operating System
performs the following activities for memory management:
It keeps track of primary memory, i.e., which bytes of memory are used
by which user program. The memory addresses that have already been
allocated and the memory addresses of the memory that has not yet been
used. In multiprogramming, the OS decides the order in which processes
are granted access to memory, and for how long. It Allocates the memory
to a process when the process requests it and deallocates the memory when
the process has terminated or is performing an I/O operation.

Processor Management –
In a multi-programming environment, the OS decides the order in which
processes have access to the processor, and how much processing time
each process has. This function of OS is called process scheduling. An
Operating System performs the following activities for processor
management.
Keeps track of the status of processes. The program which performs this
task is known as a traffic controller. Allocates the CPU that is a processor
to a process. De-allocates processor when a process is no more required.

Device Management –
Fundamentals of Computing
An OS manages device communication via their respective drivers. It
performs the following activities for device management. Keeps track of
all devices connected to the system. designates a program responsible for
every device known as the Input/Output controller. Decides which process
gets access to a certain device and for how long. Allocates devices in an
effective and efficient way. Deallocates devices when they are no longer
required.

File Management –
A file system is organized into directories for efficient or easy navigation
and usage. These directories may contain other directories and other files.
An Operating System carries out the following file management activities.
It keeps track of where information is stored, user access settings and
status of every file, and more… These facilities are collectively known as
the file system.
Moreover, Operating System also provides certain services to the
computer system in one form or the other.
The Operating System provides certain services to the users which can be
listed in the following manner:

Program Execution: The Operating System is responsible for the execution


of all types of programs whether it be user programs or system programs.
The Operating System utilizes various resources available for the efficient
running of all types of functionalities.
Handling Input/Output Operations: The Operating System is responsible
for handling all sorts of inputs, i.e, from the keyboard, mouse, desktop,
etc. The Operating System does all interfacing in the most appropriate
manner regarding all kinds of Inputs and Outputs.
For example, there is a difference in the nature of all types of peripheral
devices such as mice or keyboards, the Operating System is responsible
for handling data between them.
Manipulation of File System: The Operating System is responsible for
making decisions regarding the storage of all types of data or files, i.e,
floppy disk/hard disk/pen drive, etc. The Operating System decides how
the data should be manipulated and stored.
Error Detection and Handling: The Operating System is responsible for
the detection of any type of error or bugs that can occur while any task.
The well-secured OS sometimes also acts as a countermeasure for
preventing any sort of breach to the Computer System from any external
source and probably handling them.
Resource Allocation: The Operating System ensures the proper use of all
the resources available by deciding which resource to be used by whom
for how much time. All the decisions are taken by the Operating System.
Accounting: The Operating System tracks an account of all the
functionalities taking place in the computer system at a time. All the details
such as the types of errors that occurred are recorded by the Operating
System.
Information and Resource Protection: The Operating System is
responsible for using all the information and resources available on the
machine in the most protected way. The Operating System must foil an
attempt from any external resource to hamper any sort of data or
information.
All these services are ensured by the Operating System for the
convenience of the users to make the programming task easier. All
different kinds of Operating systems more or less provide the same
services.

5.4 ASSEMBLERS

An assembly language is a low-level language. It gives instructions to the


processors for different tasks. It is specific for any processor. The machine
language only consists of 0s and 1s therefore, it is difficult to write a
program in it. On the other hand, the assembly language is close to a
machine language but has a simpler language and code.

We can create an assembly language code using a compiler or, a


programmer can write it directly. Mostly, programmers use high-level
languages but, when more specific code is required, assembly language is
used. It uses opcode for the instructions. An opcode basically gives
Fundamentals of Computing
information about the particular instruction. The symbolic representation
of the opcode (machine level instruction) is called mnemonics.
Programmers use them to remember the operations in assembly language.

For example ADD A,B

Here, ADD is the mnemonic that tells the processor that it has to perform
additional function. Moreover, A and B are the operands. Also, SUB,
MUL, DIVC, etc. are other mnemonics.
Types of Assembler
Assemblers generate instruction. On the basis of a number of phases used
to convert to machine code, assemblers have two types:

1. One-Pass Assembler
These assemblers perform the whole conversion of assembly code to
machine code in one go.

2. Multi-Pass/Two-Pass Assembler
These assemblers first process the assembly code and store values in the
opcode table and symbol table. And then in the second step, they generate
the machine code using these tables.

a) Pass 1
Symbol table and opcode tables are defined.
keep the record of the location counter.
Also, processes the pseudo instructions.
b) Pass 2
Finally, converts the opcode into the corresponding numeric opcode.
Generates machine code according to values of literals and symbols.
Some Important Terms
Opcode table: They store the value of mnemonics and their corresponding
numeric values.
Symbol table: They store the value of programming language symbols
used by the programmer, and their corresponding numeric values.
Location Counter: It stores the address of the location where the current
instruction will be stored.
Browse more Topics under System Software
 Operating System
 Compiler
 Interpreter

5.5 COMPILERS AND INTERPRETERS BATCH


PROCESSING

When choosing a programming language, two things in particular need to


be taken into consideration: the language needs to provide all the necessary
building blocks for the planned software project, and programming and
implementing the project should be as simple as possible. Being easy to
read and having simple code are essential to ensuring the latter because
these characteristics make it easier to get started with and learn a
programming language, as well as to use it on a daily basis.
Fundamentals of Computing
5.6 MULTIPROGRAMMING

A multiprogramming operating system may run many programs on a


single processor computer. If one program must wait for an input/output
transfer in a multiprogramming operating system, the other programs are
ready to use the CPU. As a result, various jobs may share CPU time.
However, the execution of their jobs is not defined to be at the same time
period.

When a program is being performed, it is known as a "Task", "Process",


and "Job". Concurrent program executions improve system resource
consumption and throughput as compared to serial and batch processing
systems.

The primary goal of multiprogramming is to manage the entire system's


resources. The key components of a multiprogramming system are the file
system, command processor, transient area, and I/O control system. As a
result, multiprogramming operating systems are designed to store different
programs based on sub-segmenting parts of the transient area. The
resource management routines are linked with the operating system core
functions.

Types of the Multiprogramming Operating System


There are mainly two types of multiprogramming operating systems.
These are as follows:

Multitasking Operating System


Multiuser Operating System
Multitasking Operating System
A multitasking operating system enables the execution of two or more
programs at the same time. The operating system accomplishes this by
shifting each program into and out of memory one at a time. When a
program is switched out of memory, it is temporarily saved on disk until
it is required again.
Multiuser Operating System
A multiuser operating system allows many users to share processing time
on a powerful central computer from different terminals. The operating
system accomplishes this by rapidly switching between terminals, each of
which receives a limited amount of processor time on the central
computer. The operating system changes among terminals so quickly that
each user seems to have continuous access to the central computer. If there
are many users on a system like this, the time it takes the central computer
to reply can become more obvious.

Working of the Multiprogramming Operating System


Multiple users can accomplish their jobs simultaneously in the
multiprogramming system, and it can be stored in the main memory. When
one program is engaged in I/O operations, the CPU may deliver time to
various programs while sitting in idle mode.

When one application is waiting for an I/O transfer, another is ready to use
the processor at all times, and numerous programs may share CPU time.
All jobs are not run simultaneously, but there could be numerous jobs
running on the processor at the same time, and parts of other processes
being executed first, then another segment, etc. As a result, the overall goal
of a multiprogramming system is to keep the CPU busy until some tasks
are available in the job pool. Thus, the numerous programs can run on a
single processor computer, and the CPU is never idle.

Examples of Multiprogramming Operating System


There are various examples of multiprogramming operating systems,
including download apps, transfer data, MS-Excel, Google Chrome,
Firefox browser, and many more apps. Other examples are Windows O/S,
UNIX O/S, Microcomputers such as XENIX, MP/M, and ESQview.

Advantages and Disadvantages of Multiprogramming Operating System


There are various advantages and disadvantages of the multiprogramming
operating system. Some of the advantages and disadvantages are as
follows:
Fundamentals of Computing
Advantages
There are various advantages of the multiprogramming operating system.
Some of the advantages are as follows:

It provides less response time.


It may help to run various jobs in a single application simultaneously.
It helps to optimize the total job throughput of the computer.
Various users may use the multiprogramming system at once.
Short-time jobs are done quickly in comparison to long-time jobs.
It may help to improve turnaround time for short-time tasks.
It helps in improving CPU utilization and never gets idle.
The resources are utilized smartly.
Disadvantages
There are various disadvantages of the multiprogramming operating
system. Some of the disadvantages are as follows:

It is highly complicated and sophisticated.


The CPU scheduling is required.
Memory management is needed in the operating system because all types
of tasks are stored in the main memory.
The harder task is to handle all processes and tasks.
If it has a large number of jobs, then long-term jobs will require a long
wait.

5.7 MULTITASKING

Multitasking is when 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. An OS
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.

The OS handles multitasking in the way that it can handle multiple


operations/executes multiple programs at a time.
Multitasking Operating Systems are also known as Time-sharing systems.

These Operating Systems were developed to provide interactive use of a


computer system at a reasonable cost.

A time-shared operating system uses the concept of CPU scheduling and


multiprogramming to provide each user with a small portion of a time-
shared CPU.

Each user has at least one separate program in memory.

A program that is loaded into memory and is executing is commonly


referred 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 slower speeds, it may take a


long time to complete. During this time, a CPU can be utilized by
another process.

 The operating system allows the users to share the computer


simultaneously. Since each action or command in a time-shared
Fundamentals of Computing
system tends to be short, only a little CPU time is needed for each
user.

 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 actually one CPU is being shared among many
users.

5.8 MULTIPROCESSING

In operating systems, to improve the performance of more than one CPU


can be used within one computer system called Multiprocessor operating
system.

Multiple CPUs are interconnected so that a job can be divided among them
for faster execution. When a job finishes, results from all CPUs are
collected and compiled to give the final output. Jobs needed to share main
memory and they may also share other system resources among
themselves. Multiple CPUs can also be used to run multiple jobs
simultaneously.
For Example: UNIX Operating system is one of the most widely used
multiprocessing systems.

To employ a multiprocessing operating system effectively, the computer


system must have the following things:

A motherboard is capable of handling multiple processors in a


multiprocessing operating system.
Processors are also capable of being used in a multiprocessing system.
Advantages of multiprocessing operating system are:
Increased reliability: Due to the multiprocessing system, processing tasks
can be distributed among several processors. This increases reliability as
if one processor fails; the task can be given to another processor for
completion.
Increased throughout: As several processors increase, more work can be
done in less
The economy of Scale: As multiprocessors systems share peripherals,
secondary storage devices, and power supplies, they are relatively cheaper
than single-processor systems.
Disadvantages of Multiprocessing operating System
Operating system of multiprocessing is more complex and sophisticated
as it takes care of multiple CPUs at the same time.
 Types of multiprocessing systems
 Symmetrical multiprocessing operating system
Fundamentals of Computing
 Asymmetric multiprocessing operating system
 Symmetrical multiprocessing operating system:
 In a Symmetrical multiprocessing system, each processor executes
the same copy of the operating system, takes its own decisions, and
cooperates with other processes to smooth the entire functioning
of the system. The CPU scheduling policies are very simple. Any
new job submitted by a user can be assigned to any processor that
is least burdened. It also results in a system in which all processors
are equally burdened at any time.

The symmetric multiprocessing operating system is also known as a


"shared every-thing" system, because the processors share memory and
the Input output bus or data path. In this system processors do not usually
exceed more than 16.

5.9 TIME SHARING

Time-sharing, in data processing, method of operation in which multiple


users with different programs interact nearly simultaneously with the
central processing unit (CPU) of a large-scale digital computer. Because
the CPU operates substantially faster than most peripheral equipment (e.g.,
video display terminals and printers), it has sufficient time to solve several
discrete problems during the input/output process. Even though the CPU
addresses the problem of each user in sequence, access to and retrieval
from the time-sharing system seems instantaneous from the standpoint of
remote terminals since the solutions are available to them the moment the
problem is completely entered.
Time-sharing was developed during the late 1950s and early ’60s to make
more efficient use of expensive processor time. Commonly used time-
sharing techniques include multiprocessing, parallel operation, and
multiprogramming. Also, many computer networks organized for the
purpose of exchanging data and resources are centred on time-sharing
systems.

5.10 DOS

The acronym DOS stands for disk operating system, or an operating


system for devices with disk drives. With the advent of floppy disk
computers, it was convenient to load a command processor and utilities
after the boot-strap cycle.
MS-DOS is one of the oldest and widely used operating system. DOS is a
set of computer programs, the major functions of which are file
management, allocation of system resources, providing essential features
to control hardware devices.
Fundamentals of Computing

DOS commands can be typed in either upper case or lower case.

Features of DOS
Following are the significant features of DOS −

It is a single user system.


It controls program.
It is machine independence.
It manages (computer) files.
It manages input and output system.
It manages (computer) memory.
It provides command processing facilities.
It operates with Assembler.
Types of DOS Commands
Following are the major types of DOS Command −

Internal Commands − Commands such as DEL, COPY, TYPE, etc. are the
internal commands that remain stored in computer memory.

External Commands − Commands like FORMAT, DISKCOPY, etc. are


the external commands and remain stored on the disk.

5.11 WINDOWS

The operating system window is the extension of the disk operating


system.
It is the most popular and simplest operating system; it can be used by any
person who can read and understand basic English, as it does not require
any special training.

However, the Windows Operating System requires DOS to run the various
application programs initially. Because of this reason, DOS should be
installed into the memory and then window can be executed.

Elements of Windows OS
Following are the significant element of Windows Operating System
(WOS) −

Graphical User Interface


Icons (pictures, documents, application, program icons, etc.)
Taskbar
Start button
Windows explorer
Mouse button
Hardware compatibility
Software compatibility
Help, etc.

5.12 UNIX/LINUX

The Unix Operating System is the earliest operating system developed in


1970s. Let us consider the following points relating to the Unix Operating
System −

It is an operating system that has multitasking features.

It has multiuser computer operating systems.

It runs practically on every sort of hardware and provides stimulus to the


open-source movement.
Fundamentals of Computing
It has comparative complex functionality and hence an untrained user
cannot use it; only the one who has taken training can use this system.

Another drawback of this system is, it does not give notice or warn about
the consequences of a user’s action (whether user’s action is right or
wrong).

5.13 LET'S SUM UP

1. What is a process scheduler?


2. What is scheduling? What criteria affects the schedulers
performance?
3. Explain time slicing. How its duration affects the overall working
of the system.
4. What is Shortest Remaining Time, SRT scheduling?
5. What is Highest Response Ratio Next (HRN) Scheduling?
6. What are the different principles which must be considered while
selection of a scheduling algorithm?

5.14 KEYWORDS

 The acronym DOS stands for disk operating system , or an


operating system for devices with disk drives
 The operating system window is the extension of the disk operating
system.
 The Unix Operating System is the earliest operating system
developed in 1970s
 Time-sharing, in data processing, method of operation in which
multiple users with different programs interact nearly
simultaneously with the central processing unit (CPU) of a large-
scale digital computer.
 Multiple CPUs are interconnected so that a job can be divided
among them for faster execution
 A motherboard is capable of handling multiple processors in a
multiprocessing operating system.
 Multitasking is when 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
 The primary goal of multiprogramming is to manage the entire
system's resources

5.15 SOME USEFUL BOOKS

 Computer Fundamentals
Goel, Anita Pearson
 Computer Fundamentals: Architecture & Organization
Ram, B. 4th ed New Age
 Computer Fundamentals: Concepts, Systems & Applications
Sinha, P. K. BPB
 Computer Fundamentals: Concepts, Systems & Applications
Sinha, P. K/ Sinha, P. 3rd ed BPB
 Computer Fundamentals: Concepts, Systems & Applications
Sinha, P. K/ Sinha, P. 4th ed BPB

5.16 ANSWER TO CHECK YOUR PROGRESS

1. Scheduling can be defined as a set of policies and mechanisms


which controls the order in which the work to be done is
completed. The scheduling program which is a system software
concerned with scheduling is called the scheduler and the
algorithm it uses is called the scheduling algorithm.
2. Time slicing is a scheduling mechanism/way used in time sharing
systems. It is also termed as Round Robin scheduling. The aim of
Round Robin scheduling or time slicing scheduling is to give all
processes an equal opportunity to use CPU. In this type of
scheduling, CPU time is divided into slices that are to be allocated
to ready processes. Short processes may be executed within a
single time quantum. Long processes may require several quanta.
Fundamentals of Computing
3. Shortest Remaining Time, SRT is a preemptive scheduling. In
SRT, the process with smallest runtime to complete (i.e remaining
time) is scheduled to run next, including new arrivals. In SRT, a
running process may be preempted by new process with shorter
estimated run time. It keeps track of the elapsed service time of the
running process and handles occasional preemption.
4. HRN is non-preemptive scheduling algorithm.
In Shortest Job First scheduling, priority is given to shortest job,
which may sometimes indefinite blocking of longer job.HRN
Scheduling is used to correct this disadvantage of SJF.For
determining priority, not only the job's service time but the waiting
time is also considered.In this algorithm, dynamic priorities are
used instead of fixed priorities.Dynamic priorities in HRN are
calculated asPriority = (waiting time + service time) / service time.
5.
 Fairness
 Maximize throughput
 Predictability
 Maximum resource usage
 Controlled Time

5.17 TERMINAL QUESTIONS

Write a note on Multiprocessing Operating System.


Write a note on DOS.
Explain the features of Time sharing.
What are Assemblers?

You might also like