0% found this document useful (0 votes)
60 views21 pages

Os Module 1

Uploaded by

shihankv807
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
60 views21 pages

Os Module 1

Uploaded by

shihankv807
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

1

MODULE 1
INTRODUCTION TO SYSTEM SOFTWARE

SYLLABUS: MODULE I
Introduction to systems software – assembler, loader, compilers, interpreters and their
functions. Operating system – definition - goals of OS - different types of Operating
Systems - batch systems - multiprogramming systems - time sharing - multiprocessor
systems - real time systems. Comparison of DOS, Unix, Windows, and Linux operating
systems - Operating System components

SYSTEM SOFTWARE

It is a set of program to perform a variety of system function as file editing,


resource management, I/O management and store management.
Types of s/m softwares:
 Operating system
 Language Translators
o Compiler
o Interpreters
o Assembler
o Preprocessors
 Loaders
 Linkers
 Macro processors
ASSEMBLER
The Assembler is used to translate the program written in Assembly language into
machine code. The source program is a input of assembler that contains assembly
language instructions. The output generated by assembler is the object code or
machine code understandable by the computer.
2

Assembly language:
Programmers use mnemonics(symbols) for each machine instruction such
mnemonic is called assembly language

COMPILER
The language processor that reads the complete source program written in high level
language as a whole in one go and translates it into an equivalent program in machine
language is called as a Compiler.
Example: C, C++, C#, Java
In a compiler, the source code is translated to object code successfully if it is free of
errors. The compiler specifies the errors at the end of compilation with line numbers
when there are any errors in the source code. The errors must be removed before the
compiler can successfully recompile the source code again.

INTERPRETER
The translation of single statement of source program into machine code is done by
language processor and executes it immediately before moving on to the next line is
called an interpreter. If there is an error in the statement, the interpreter terminates
its translating process at that statement and displays an error message. The
interpreter moves on to the next line for execution only after removal of the error.
3

An Interpreter directly executes instructions written in a programming or scripting


language without previously converting them to an object code or machine code.
Example: Perl, Python and Matlab.

LOADER
A loader is a system program which take the object code of a program as input and
prepares its for execution.
Functions:
o Allocation:
The loader determines and allocates the required memory space for the
program to execute properly.
o Linking:
The loader analyses and resolve the symbolic references made in the
object modules.
o Relocation
The loader maps and relocates the address references to correspond to
the newly allocated memory space during execution.
o Loading
The loader actually loads the machine code corresponding to the object
modules into the allocated memory space and makes the program ready to
execute.
4

Compiler v/s Interpreter


Compiler Interpreter

A compiler is a program which Interpreter takes a source program


coverts the entire source code of a and runs it line by line, translating
programming language into each line as it comes to it.
executable machine code for a CPU.
Compiler takes large amount of time Interpreter takes less amount of time
to analyze the entire source code but to analyze the source code but the
the overall execution time of the overall execution time of the
program is comparatively faster. program is slower.

Compiler generates the error Its Debugging is easier as it


message only after scanning the continues translating the program
whole program, so debugging is until the error is met.
comparatively hard as the error can
be present any where in the program.
Generates intermediate object code. No intermediate object code is
generated.
Examples: C, C++, Java Examples: Python, Perl

OPERATING SYTEM
An operating system is a program that acts as an interface between the user and the
computer hardware and controls the execution of all kinds of programs like file
management, memory management, process management, handling input and
output, and controlling peripheral devices such as disk drives and printers.
5

Following are some of important functions of an operating System.

 Memory Management
 Processor Management
 Device Management
 File Management
 Security
 Control over system performance
 Job accounting
 Error detecting aids
 Coordination between other software and users

Memory Management

Memory management refers to management of Primary Memory or Main Memory.


Main memory is a large array of words or bytes where each word or byte has its
own address.
Main memory provides a fast storage that can be accessed directly by the CPU. For
a program to be executed, it must in the main memory. An Operating System does
the following activities for memory management −
6

 Keeps tracks of primary memory, i.e., what part of it are in use by whom,
what part are not in use.
 In multiprogramming, the OS decides which process will get memory when
and how much.
 Allocates the memory when a process requests it to do so.
 De-allocates the memory when a process no longer needs it or has been
terminated.

Processor Management

In multiprogramming environment, the OS decides which process gets the


processor when and for how much time. This function is called process scheduling.
An Operating System does the following activities for processor management −
 Keeps tracks of processor and status of process. The program responsible for
this task is known as traffic controller.
 Allocates the processor (CPU) to a process.
 De-allocates processor when a process is no longer required.

Device Management

An Operating System manages device communication via their respective drivers.


It does the following activities for device management −
 Keeps tracks of all devices. Program responsible for this task is known as
the I/O controller.
 Decides which process gets the device when and for how much time.
 Allocates the device in the efficient way.
 De-allocates devices.

File Management

A file system is normally organized into directories for easy navigation and usage.
These directories may contain files and other directions.
An Operating System does the following activities for file management −
 Keeps track of information, location, uses, status etc. The collective facilities
are often known as file system.
7

 Decides who gets the resources.


 Allocates the resources.
 De-allocates the resources.

Other Important Activities

Following are some of the important activities that an Operating System performs

 Security − By means of password and similar other techniques, it prevents


unauthorized access to programs and data.
 Control over system performance − Recording delays between request for
a service and response from the system.
 Job accounting − Keeping track of time and resources used by various jobs
and users.
 Error detecting aids − Production of dumps, traces, error messages, and
other debugging and error detecting aids.
 Coordination between other softwares and users − Coordination and
assignment of compilers, interpreters, assemblers and other software to the
various users of the computer systems.

Goals of the Operating System


There are two types of goals of an Operating System i.e. Primary Goals and
Secondary Goal.

 Primary Goal: The primary goal of an Operating System is to provide a


user-friendly and convenient environment. We know that it is not
compulsory to use the Operating System, but things become harder when the
user has to perform all the process scheduling and converting the user code
into machine code is also very difficult. So, we make the use of an Operating
System to act as an intermediate between us and the hardware. All you need
to do is give commands to the Operating System and the Operating System
will do the rest for you. So, the Operating System should be convenient to
use.
8

 Secondary Goal: The secondary goal of an Operating System is efficiency.


The Operating System should perform all the management of resources in
such a way that the resources are fully utilised and no resource should be
held idle if some request to that resource is there at that instant of time.
Different types of os
 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
 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
 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 :Payroll System, Bank Statements etc.
9

 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
 Each task gets an equal opportunity
 Less chances of duplication of software
 CPU idle time can be reduced

Disadvantages
 Reliability problem
 One must have to take care of security and integrity of user programs and data
 data communication problem
Examples: Multics, Unix etc.

 Multiprogramming systems
To overcome the problem of underutilization of CPU and RAM, the
concept of multiprogramming was introduced.
10

In a multiprogramming system, two or more processes execute one after


another or more different independent programs by the same computer
system.

 In this concept, two or more user programs can be in main memory and can
be executed concurrently. The CPU can give time to various programs despite
sitting idle when one is busy with I/O operations.
 When one program is waiting for I/O transfer there is next program ready to
utilize the processor. Therefore, several processes can share the time of the
CPU.
 Execution of jobs at the same instance of time is not referred to as
multiprogramming but it is defined as the number of jobs available to the
processor (placed in main memory) and a portion of another process is
executed then a segment of another and so on.

As shown in fig, at the particular situation, job' A' is not utilizing the CPU
time because it is busy in I/ 0 operations. Hence the CPU becomes busy to
execute the job 'B'. Another job C is waiting for the CPU for getting its
execution time. So in this state the CPU will never be idle and utilizes
maximum of its time.

Advantages:

 Increased Throughput - Throughput is increased by utilizing the idle time


of the CPU by running other programs also that are already available in the
main memory.
11

 Lowered Response Time - Response Time is lowered by identifying the


priority of a job as it enters in the system and by executing jobs on behalf of
their priority.

Drawbacks :

 User cannot interact with any program while that is in execution. So, we have
to perform offline debugging.
 CPU scheduling and memory management are required.

 Multiprocessor Operating System


It refers to the use of two or more central processing units (CPU)
within a single computer system. These multiple CPUs are in a close
communication sharing the computer bus, memory and other peripheral
devices. These systems are referred as tightly coupled systems. These types
of systems are used when very high speed is required to process a large
volume of data. These systems are generally used in environment like satellite
control, weather forecasting etc. The basic organization of multiprocessing
system is shown in fig.

There are mainly two types of multiprocessors i.e. symmetric and asymmetric
multiprocessors. Details about them are as follows:
12

Symmetric Multiprocessors
In these types of systems, each processor contains a similar copy of the operating
system and they all communicate with each other. All the processors are in a peer to
peer relationship i.e. no master - slave relationship exists between them.
An example of the symmetric multiprocessing system is the Encore version of Unix
for the Multimax Computer.
Asymmetric Multiprocessors
In asymmetric systems, each processor is given a predefined task. There is a master
processor that gives instruction to all the other processors. Asymmetric
multiprocessor system contains a master slave relationship.
Asymmetric multiprocessor was the only type of multiprocessor available before
symmetric multiprocessors were created. Now also, this is the cheaper option.

Advantages
 Enhanced performance.
 Multiple applications.
 Multi-tasking inside an application.
 High throughput and responsiveness.
 Hardware sharing among CPUs.

 Real-Time Operating System –


These types of OSs serves the real-time systems. The time interval
required to process and respond to inputs is very small. This time interval is
called response time. 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. A real-time
operating system must have well-defined, fixed time constraints, otherwise
the system will fail.
these 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
 Soft Real-Time Systems
13

 HardReal-TimeSystems:
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.

 SoftReal-TimeSystems:
These OSs are for applications where for time-constraint is less strict. A critical
real-time task gets priority over other tasks and retains the priority until it
completes. Soft real-time systems have limited utility than hard real-time
systems. For example, multimedia, virtual reality, Advanced Scientific Projects
like undersea exploration and planetary rovers, etc.

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 type of
systems.
14

Disadvantages of RTOS:
 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 Scientific experiments, medical imaging systems, industrial control
systems, weapon systems, robots, air traffic control systems, etc.

Distributed operating System


Distributed systems use multiple central processors to serve multiple real-time
applications and multiple users. Data processing jobs are distributed among the
processors accordingly.
The processors communicate with one another through various communication
lines (such as high-speed buses or telephone lines). These are referred as loosely
coupled systems or distributed systems. Processors in a distributed system may
vary in size and function. These processors are referred as sites, nodes, computers,
and so on.
The advantages of distributed systems are as follows −

 With resource sharing facility, a user at one site may be able to use the
resources available at another.
 Speedup the exchange of data with one another via electronic mail.
 If one site fails in a distributed system, the remaining sites can potentially
continue operating.
 Better service to the customers.
 Reduction of the load on the host computer.
 Reduction of delays in data processing.
15

WINDOWS
Windows is a licensed operating system in which source code is inaccessible. It is
designed for the individuals with the perspective of having no computer
programming knowledge and for business and other commercial users. It is very
simple and straightforward to use.

Windows is extensible, portable and assists multiple operating environments,


symmetric multiprocessing and client-server computing. It offers integrated caching,
virtual memory, and preemptive scheduling.

Windows 10 (1709) is the latest release of Microsoft Windows operating system. Its
default user interface is Windows shell (Graphical). It uses hybrid kernel in older
versions micro kernel is mostly used.

LINUX

Linux is a free and open source operating system based on Unix standards. It
provides programming interface as well as user interface compatible with Unix
based systems and provides large variety applications. A Linux system also contains
many separately developed elements, resulting in Unix system which is fully
compatible and free from proprietary code.

The traditional monolithic kernel is employed in Linux kernel for performance


purpose, but its modular feature allows most drivers to dynamically loaded and
unloaded at runtime. Linux protects processes and is a multiuser system.
Interprocess communication is supported by both of mechanisms such as message
queue, shared memory and semaphore.

An abstract layer is used in Linux to govern the different file systems, but to users,
the file system looks like a hierarchical directory tree. It also supports networked,
device-oriented and virtual file systems. Disk storage is accessed through a page
cache which is unified with the virtual memory systems. To minimize the
duplication of shared data among different processes the memory management
system uses page sharing and copy-on-write.
16

Ubuntu 17.10 is the latest release of linux family operating system. The default user
interface of the given version is GNOME, Ubuntu Unity (in older versions).

LINUX V/S WINDOWS

LINUX WINDOWS

Linux is a open source operating While windows are the not the open
system. source operating system.
Linux is free of cost. While it is costly.
It’s file name case-sensitive. While it’s file name is case-insensitive.
In linux, monolithic kernel is used. While in this, micro kernel is used.
Linux is more efficient in comparison of While windows are less efficient.
windows.
There is forward slash is used for While there is back slash is used for
Separating the directories. Separating the directories.
Linux provides more security than While it provides less security than
windows. linux.

DOS
Any operating system which runs from the hard disk drive is termed as Disk
Operating System ( D.O.S ). This also refers to the specific family of disk operating
system which is also known as MS-DOS or Microsoft disk operating system.
Anything which commands and controls the computer’s hardware and its peripheral
devices with control over the program and its functionality is known as the operating
system. This operating system which runs through the hard disk is known as a disk
operating system.
17

DOS V/S WINDOWS


DOS WINDOWS

DOS is single tasking operating system. While windows are multitasking


operating systems
It consumes low power. While windows consume high power

It consumes less memory in comparison While it consumes more memory.


of windows.
DOS does not support networking. While window supports networking.
DOS is complex in terms of using. Whereas it is simple for using.
DOS does not share time. While window can share time.

DOS is a command line operating Whereas windows are the graphical


system. operating systems.
DOS operating system is less While windows are more preferred by
the users in comparison of DOS.
In DOS operating system multimedia is While windows support multimedia
such as: Games, movies,songs etc.
not supported such as: Games,

movies,songs etc.

In DOS operation systems, operation While in windows OS, operation are


performed slowly than DOS OS.
are performed speedily than windows

OS.

There is only one window opened at a While in windows, multiple windows


can be opened at a time.
time in DOS.
18

UNIX
Unix is an Operating System which is truly the base of all Operating Systems like
Ubuntu, Solaris, POSIX, etc. It was developed in the 1970s by Ken Thompson,
Dennis Ritchie, and others in the AT&T Laboratories. It was originally meant for
programmers developing software rather than non-programmers.
Unix and the C were found by AT&T and distributed to government and academic
institutions, which led to both being ported to a wider variety of machine families
than any other operating system. The main focus that was brought by the developers
in this operating system was the Kernel. Unix was considered to be the heart of the
operating System. System Structure of Unix OS are as follows:

Figure – system structure


 Layer-1:Hardware–
It consists of all hardware related information.
 Layer-2:Kernel
It interacts with hardware and most of the tasks like memory management, task
scheduling, and management are done by the kernel.
 Layer-3:Shellcommands
Shell is the utility that processes your requests. When you type in a command
at the terminal, the shell interprets the command and calls the program that you
want.
There are various commands like cp, mv, cat, grep, id, wc, nroff, a.out and
more.
19

 Layer-4:ApplicationLayer
It is the outermost layer that executes the given external applications.

LINUX V/S UNIX

LINUX UNIX
The source code of Linux is freely The source code of Unix is not freely
available to its users available general public

It has graphical user interface along It only has command line interface
with command line interface

Linux OS is portable, flexible, and can Unix OS is not portable


be executed in different hard drives

Different version of Linux are Ubuntu, Different version of Unix are AIS, HP-
Linux Mint, RedHot, Solaries, etc. UX, BSD, Iris, etc.
The file systems supported by Linux are The file systems supported by Unix are
as follows: xfs, ramfs, vfat, cramfsm, as follows: zfs, js, hfx, gps, xfs, vxfs
ext3, ext4, ext2, ext1, ufs, autofs,
devpts, ntfs

Operating system components


Kernel
The kernel gives one of the most fundamental level of control over all the computer’s
hardware devices. The kernel is the central component of an operating system (OS).
It is the component of the operating system that loads initially, and it lingers in main
memory. It manages memory accessibility for programs in the RAM, it establishes
which programs get access to which hardware resources. It establishes or resets the
CPU’s operating states for optimum operation in all times.
Process execution
The operating system offers an interface in between an application program and the
hardware, so that an application program can connect with the hardware just by
following principles and procedures configured into the operating system. Executing
20

an application program includes the creation of a process by the operating system


kernel which appoints memory space and various other resources.

Interrupt
Interrupts are primary to operating systems, as they offer a reliable method for the
operating system to interact with and respond to its environment. An interrupt is a
signal from a device connected to a computer system or from a program within the
computer system that needs the operating system to quit and determine exactly what
to do next. When an interrupt is received, the computer’s hardware automatically
puts on hold whatever program is presently running, saves its status, and runs
computer system code formerly associated with the interrupt.
Memory management
This makes sure that a program does not conflict with memory currently being used
by an additional program. Since programs time share, each program has to have
independent access to memory. To puts it simply, the MMU is in charge of all
aspects of memory management. It is normally integrated right into the cpu, although
in some systems it takes up a separate IC (integrated circuit) chip.
We can divide the work of Memory Management into 3 significant groups:
 Hardware memory management.
 OS (operating system) memory management.
 Application memory management.

Multitasking
Multitasking describes the operating of multiple independent computer programs on
the same computer system. The operating system has the ability to keep an eye on
where you are in these jobs and go from one to the various other without losing
information. Since a lot of computers can do at most one or two things at once, this
is usually done using time-sharing, which means that each program utilizes a share
of the computer’s time to perform.
Networking
The processors interact with each other via communication lines called network. The
communication-network design should consider routing and connection techniques,
and the troubles of opinion and safety and security. Presently most operating
21

systems sustain a range of networking methods, hardware, and applications for using
them. This implies that computers running different operating systems could take
part in a common network for sharing resources such as computing, data, printers,
and scanners making use of either wired or wireless connections.
Security
If a computer systems has several individuals and enables the simultaneous
operation of multiple processes, then the numerous processes have to be secured
from each other’s activities. A computer system being safe and secure depends upon
a variety of technologies working effectively. A modern-day operating system offers
access to a number of resources, which are readily available to software working on
the system, and to external devices like networks by means of the kernel. The
operating system should be capable of differentiating between demands which ought
to be allowed to be processed, and others which need to not be processed. In addition
to allow or disallow version of security, a system with a high level of protection
likewise gives auditing options. These would permit monitoring of requests for
accessibility to resources (such as, “who has read this file?”).
User interface
It is everything created into an information device with which an individual might
interact. The user interface is generally described as a shell and is vital if human
communication is to be supported. The user interface checks out the directory
framework and requests services from the operating system that will obtain
information from input hardware devices and demands operating system services to
display prompts, status messages and such on output hardware devices. The
expanding dependancy of lots of companies on web applications and mobile
applications has actually led numerous companies to place enhanced concern on UI
in an effort to improve the individual’s entire experience.

You might also like