UNIT 3 OS.docx
UNIT 3 OS.docx
ST.
PR
OF
.GU
RU
RA
JN
.KU
LK
AR
NI
INTRODUCTION OF OPERATING SYSTEM:
NI
AR
Operating System – Definition:
LK
● An operating system is a program that controls the execution of application programs
and acts as an interface between the user of a
.KU
computer and the computer hardware.
● A more common definition is that the operating
An operating system is a software which performs all the basic tasks like file management,
memory management, process management, handling input and output, and controlling
ST.
Some popular Operating Systems include Linux Operating System, Windows Operating System,
VMS, OS/400, AIX, z/OS, etc.
● Memory Management
● Processor Management
BLDEA S.B.S. ARTS, COMMERCE AND SCIENCE COLLEGE FOR WOMEN BCA DEPT.Page 2
● Device Management
● File Management
● Security
● Control over system performance
● Job accounting
● Error detecting aids
● Coordination between other software and users
NI
Memory Management
AR
● Memory management refers to management of Primary Memory or Main Memory. Main
LK
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
.KU
program to be executed, it must in the main memory. An Operating System does the
following activities for memory management −
JN
● Keeps tracks of primary memory, i.e., what part of it are in use by whom, what part are
not in use.
RA
● In multiprogramming, the OS decides which process will get memory when and how
much.
RU
● De-allocates the memory when a process no longer needs it or has been terminated.
OF
Processor Management
PR
● 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
ST.
● Keeps tracks of processor and status of process. The program responsible for this task is
AS
BLDEA S.B.S. ARTS, COMMERCE AND SCIENCE COLLEGE FOR WOMEN BCA DEPT.Page 3
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.
NI
● Allocates the device in the efficient way.
AR
● De-allocates devices.
LK
File Management
.KU
A file system is normally organized into directories for easy navigation and usage. These
directories may contain files and other directions.
JN
An Operating System does the following activities for file management −
● Keeps track of information, location, uses, status etc. The collective facilities are often
RA
known as file system.
RU
Following are some of the important activities that an Operating System performs −
ST.
● 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.
BLDEA S.B.S. ARTS, COMMERCE AND SCIENCE COLLEGE FOR WOMEN BCA DEPT.Page 4
● Coordination between other softwares and users − Coordination and assignment of
compilers, interpreters, assemblers and other software to the various users of the
computer systems.
NI
● Multitasking/Time Sharing OS
● Multiprocessing OS
AR
● Real Time OS
● Distributed OS
LK
● Network OS
●
.KU
Mobile OS
NI
AR
LK
.KU
Advantages of Time-Sharing OS:
o Each task gets an equal opportunity
JN
RA
o Fewer chances of duplication of software
o CPU idle time can be reduced
RU
o One must have to take care of the security and integrity of user programs and data
o Data communication problem
OF
Real time OS
PR
● A real time operating system time interval to process and respond to inputs is very small.
Examples: Military Software Systems, Space Software Systems are the Real time OS
ST.
example.
AS
BLDEA S.B.S. ARTS, COMMERCE AND SCIENCE COLLEGE FOR WOMEN BCA DEPT.Page 6
NI
AR
Advantages of RTOS:
o Maximum Consumption: Maximum utilization of devices and system, thus more
output from all the resources
LK
o Task Shifting: The time assigned for shifting tasks in these systems are very less. For
.KU
example, in older systems, it takes about 10 microseconds in shifting one task to
another, and in the latest systems, it takes 3 microseconds.
o Focus on Application: Focus on running applications and less importance to
applications which are in the queue. JN
o Real-time operating system in the embedded system: Since the size of programs are
RA
small, RTOS can also be used in embedded systems like in transport and others.
o Error Free: These types of systems are error-free.
RU
o Limited Tasks: Very few tasks run at the same time and their concentration is very less
on few applications to avoid errors.
o Use heavy system resources: Sometimes the system resources are not so good and
OF
to write on.
o Device driver and interrupt signals: It needs specific device drivers and interrupts
ST.
BLDEA S.B.S. ARTS, COMMERCE AND SCIENCE COLLEGE FOR WOMEN BCA DEPT.Page 7
NI
AR
Advantages of Distributed Operating System:
o Failure of one will not affect the other network communication, as all systems are
LK
independent from each other
o Electronic mail increases the data exchange speed
.KU
o Since resources are being shared, computation is highly fast and durable
o Load on host computer reduces
JN
o These systems are easily scalable as many systems can be easily added to the network
o Delay in data processing reduces
RA
Disadvantages of Distributed Operating System:
o Failure of the main network will stop the entire communication
o To establish distributed systems the language which is used are not well defined yet
RU
o 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
.GU
OF
manage data, user, groups, security, application, and other networking functions.
ST.
AS
BLDEA S.B.S. ARTS, COMMERCE AND SCIENCE COLLEGE FOR WOMEN BCA DEPT.Page 8
Advantages of Network Operating System:
o Highly stable centralized servers
o Security concerns are handled through servers
o New technologies and hardware up-gradation are easily integrated into the system
o Server access is possible remotely from different locations and types of systems
Disadvantages of Network Operating System:
NI
AR
Mobile OS
LK
● Mobile operating systems are those OS which is especially that are designed to power
smartphones, tablets, and wearables devices.
.KU
● Some most famous mobile operating systems are Android and iOS, but others include
BlackBerry, Web, and watchOS.
SYSTEM PROGRAMS:
JN
RA
The system program serves as a part of the operating system. It traditionally lies between the
RU
user interface and the system calls. The user view of the system is actually defined by system
programs and not system calls because that is what they interact with and system programs are
.GU
So here, the user can only view up-to-the System Programs he can’t see System Calls.
System Programs can be divided into these categories :
BLDEA S.B.S. ARTS, COMMERCE AND SCIENCE COLLEGE FOR WOMEN BCA DEPT.Page 9
1. File Management –
A file is a collection of specific information stored in the memory of a computer system. File
management is defined as the process of manipulating files in the computer system, its
management includes the process of creating, modifying and deleting files.
● It helps to create new files in the computer system and placing them at specific
locations.
● It helps in easily and quickly locating these files in the computer system.
NI
● It makes the process of sharing files among different users very easy and
user-friendly.
AR
● It helps to store files in separate folders known as directories.
● These directories help users to search files quickly or to manage files according to
LK
their types of uses.
● It helps users to modify the data of files or to modify the name of files in directories.
.KU
2. Status Information –
JN
Information like date, time amount of available memory, or disk space is asked by some
RA
users. Others providing detailed performance, logging, and debugging information which is
more complex. All this information is formatted and displayed on output devices or printed.
RU
Terminal or other output devices or files or a window of GUI is used for showing the output
of programs.
.GU
3. File Modification –
OF
For modifying the contents of files we use this. For Files stored on disks or other storage
devices, we used different types of editors. For searching contents of files or perform
PR
4. Programming-Language support –
AS
BLDEA S.B.S. ARTS, COMMERCE AND SCIENCE COLLEGE FOR WOMEN BCA DEPT.Page 10
When the program is ready after Assembling and compilation, it must be loaded into
memory for execution. A loader is part of an operating system that is responsible for loading
programs and libraries. It is one of the essential stages for starting a program. Loaders,
relocatable loaders, linkage editors, and Overlay loaders are provided by the system.
6. Communications –
Virtual connections among processes, users, and computer systems are provided by
NI
programs. Users can send messages to another user on their screen, User can send e-mail,
browsing on web pages, remote login, the transformation of files from one user to another.
AR
APPLICATION PROGRAMS
LK
● These programs perform a particular function directly for the users. Some of the
.KU
common application programs include Email, web browsers, gaming software, word
processors, graphics software, media player etc.
JN
● All of these programs provide an application to the end users, so they are known as
application programs. For example: a web browser is used to find information while a
RA
gaming software is used to play games.
● The requests for service and application communication systems used in an application
RU
UTILITIES:
OF
These software analyzes and maintain a computer. These software are focused on how OS
works on that basis it perform task to enable smooth functioning of computer. These software
PR
may come along with OS like windows defender, windows disk cleanup tool.
Antivirus, backup software, file manager, disk compression tool all are utility software.
ST.
AS
Antivirus:
● It is used to protect a computer from the virus. It detects a virus and notify the user and
take action to secure the computer.
● The virus are kept in different location called vault where it has different file system due
to which virus effect it. User can itself instruct antivirus to delete malicious program, put
BLDEA S.B.S. ARTS, COMMERCE AND SCIENCE COLLEGE FOR WOMEN BCA DEPT.Page 11
it in vault or even ignore it. These days most come in GUI form.
● The first antivirus program appeared in 1987 with the introduction of an antivirus
program from G Data Software for the Atari ST. Later in the same year, VirusScan was
introduced by John McAfee, which later became the McAfee antivirus program.
Examples: Windows Defender, AVG, AVAST, MCAFEE, etc.
NI
● The software is used to manage files stored in a file system. It can be used to create,
AR
group file. Like Windows File Explorer is a file management tool.
File system (like FAT32, NTFS) should not be confused with File management tool former
is a data structure used to store file in an OS while later is used to perform task on file
LK
stored in the file System.
.KU
o Some examples of File management Tool are:
File Manager in Windows.
macOS Finder.
Directory Opus.
Dolphin in KDE.
JN
RA
RU
Compression Tool:
● These tool are used to reduce the size of a file based on the selected algorithm.
.GU
Most operating systems include tools for compressing and uncompressing files.Linux has
tools for both .tar.gz and .zip. Other compressed files, like .7z and .rar, require a
OF
WinAce
WinZip
ST.
WinRAR
AS
NI
to remove files that are no longer needed or that can be safely deleted. Removing
unnecessary files, including temporary files, can help to improve the functioning and
AR
increase the free space of the computer. Running Disk Cleanup at least once a month is
an excellent maintenance task.
LK
● Disk Cleanup tool can delete temporary internet files, old check disk files, compress old
files and offline webpages. Disk Cleanup also allows you to empty the Recycle Bin, delete
.KU
temporary files, and delete Thumbnails.
Some Disk Cleanup software are:-
• Iolo System mechanic
• IObit Advanced systemCare
JN
RA
• Piriform CCleaner
RU
DISK DEFRAGMENTER:
.GU
● Defragmenting a disk minimizes head travel, which reduces the time it takes to read files
from and write files to the disk.
PR
● The defragmenter will search your hard drive partition and move data from one location
to other location, so that the files stored there are one contiguous piece, instead of
ST.
BLDEA S.B.S. ARTS, COMMERCE AND SCIENCE COLLEGE FOR WOMEN BCA DEPT.Page 13
THE UNIX OPERATING SYSTEM:
The Unix operating system is a set of programs that act as a link between the computer and the
user.
The computer programs that allocate the system resources and coordinate all the details of the
computer's internals is called the operating system or the kernel.
Users communicate with the kernel through a program known as the shell. The shell is a
command line interpreter; it translates commands entered by the user and converts them into
a language that is understood by the kernel.
NI
● Unix was originally developed in 1969 by a group of AT&T employees Ken Thompson,
AR
Dennis Ritchie, Douglas McIlroy, and Joe Ossanna at Bell Labs.
● There are various Unix variants available in the market. Solaris Unix, AIX, HP Unix and
LK
BSD are a few examples. Linux is also a flavor of Unix which is freely available.
.KU
● Several people can use a Unix computer at the same time; hence Unix is called a
multiuser system.
JN
● A user can also run multiple programs at the same time; hence Unix is a multitasking
environment.
RA
Unix Architecture
RU
BLDEA S.B.S. ARTS, COMMERCE AND SCIENCE COLLEGE FOR WOMEN BCA DEPT.Page 14
The main concept that unites all the versions of Unix is the following four basics −
● Kernel − The kernel is the heart of the operating system. It interacts with the hardware
and most of the tasks like memory management, task scheduling and file management.
● Shell − The shell is the utility that processes your requests. When you type in a
command at your terminal, the shell interprets the command and calls the program
that you want. The shell uses standard syntax for all commands. C Shell, Bourne Shell
and Korn Shell are the most famous shells which are available with most of the Unix
variants.
NI
● Commands and Utilities − There are various commands and utilities which you can
make use of in your day to day activities. cp, mv, cat and grep, etc. are few examples of
AR
commands and utilities. There are over 250 standard commands plus numerous others
provided through 3rd party software. All the commands come along with various
LK
options.
.KU
● Files and Directories − All the data of Unix is organized into files. All files are then
organized into directories. These directories are further organized into a tree-like
structure called the filesystem.
JN
RA
BASIC UNIX COMMANDS:
RU
1. who : The ‘$ who’ command displays all the users who have logged into the system
currently.As shown above on my system I am the only user currently logged in.The thing
.GU
tty2 is terminal line the user is using and the next line gives the current date and time
$ who
OF
says,it displays the directory in which we are currently (directory is same as folder for
Windows OS users).
ST.
In the output we are harssh directory(folder for Windows OS that are moving to
Linux),which is present inside the home directory
AS
$ pwd
Output: /home/harssh
3. mkdir : The ‘$ mkdir’ stands for ‘make directory’ and it creates a new directory.We
have used ‘$ cd’ (which is discussed below) to get into the newly created directory and
again on giving ‘$ pwd’ command,we are displayed with the new ‘newfolder’ directory.
$ mkdir newfolder
BLDEA S.B.S. ARTS, COMMERCE AND SCIENCE COLLEGE FOR WOMEN BCA DEPT.Page 15
$ cd newfolder
$ pwd
Output: /home/harssh/newfolder
4. rmdir : The ‘$ rmdir’ command deletes any directory we want to delete and you can
remember it by its names ‘rmdir’ which stands for ‘remove directory’.
$ rmdir newfolder
NI
5. cd : The ‘$ cd’ command stands for ‘change directory’ and it changes your current
AR
directory to the ‘newfolder’ directory.You can understand this a double-clicking a folder
and then you do some stuff in that folder.
LK
$ cd newfolder (assuming that there is a directory named 'newfolder' on your system)
.KU
6. ls : The ‘ls’ command simply displays the contents of a directory.
$ ls
JN
Output: Desktop Documents Downloads Music Pictures Public Scratch Templates Videos
RA
RU
7. touch : The ‘$ touch’ command creates a file(not directory) and you can simple add an
extension such as .txt after it to make it a Text File.
$ touch example
.GU
$ ls
OF
Output: Desktop Documents Downloads Music Pictures Public Scratch Templates Videos
example
PR
Note: It is important to note that according to the Unix File structure, Unix treats all the
ST.
stuff it has as a ‘file’, even the directories(folders) are also treated as a file.You will get to
know more about this as you will further use Linux/Unix based OS
AS
8. cp : This ‘$ cp ‘ command stands for ‘copy’ and it simply copy/paste the file wherever
you want to.In the above example, we are copying a file ‘file.txt’ from the directory
harssh to a new directory new.
$ cp /home/harssh/file.txt /home/harssh/new/
BLDEA S.B.S. ARTS, COMMERCE AND SCIENCE COLLEGE FOR WOMEN BCA DEPT.Page 16
9. mv : The ‘$ mv’ command stands for ‘move’ and it simply move a file from a directory
to anothe directory.In the above example a file named ‘file.txt’ is being moved into a
new directory ‘new’
$ mv /home/harssh/file.txt /home/harssh/new
10. rm : The ‘$ rm ‘ command for remove and the ‘-r’ simply recursively deletes file. Try
‘$ rm filename.txt’ at your terminal
$ rm file.txt
NI
11. chmod : The ‘$ chmod’ command stands for change mode command.As there are
AR
many modes in Unix that can be used to manipulate files in the Unix
environment.Basically there are 3 modes that we can use with the ‘chmod’ command
LK
1. +w (stands for write and it changes file permissions to write)
2. +r (stands for read and it changes file permissions to read)
.KU
3. +x (generally it is used to make a file executable)
$ chmod +w file.txt
$ chmod +r file.txt
$ chmod +x file.txt
JN
RA
RU
12. cal : The ‘$ cal’ means calendar and it simply display calendar on to your screen.
$ cal
.GU
1 2 3 4 5 6 7 8
9 10 11 12 13 14 15
ST.
16 17 18 19 20 21 22
AS
23 24 25 26 27 28 29
30 31
13. file : The ‘$ file’ command displays the type of file.As I mentioned earlier Linux treats
everything as a file so on executing the command file on a directory(Downloads) it
displays directory as the output
BLDEA S.B.S. ARTS, COMMERCE AND SCIENCE COLLEGE FOR WOMEN BCA DEPT.Page 17
$ ls
Output: Desktop Documents Downloads Music Pictures Public Scratch Templates Videos
$ file Downloads
Output: Downloads: directory
14. sort : As the name suggests the ‘$ sort’ sorts the contents of the file according to the
ASCII rules.
NI
$ sort file
AR
15. grep : grep is an acronym for ‘globally search a regular expression and print it’.The ‘$
LK
grep’ command searches the specified input fully(globally) for a match with the supplied
pattern and displays it.
.KU
In the example, this would search for the word ‘picture’ in the file newsfile and if
found,the lines containing it would be displayed on the screen.
$ grep picture newsfile
JN
RA
16. man : The ‘$ man’ command stands for ‘manual’ and it can display the in-built
manual for most of the commands that we ever need.In the above example, we can read
RU
17. lpr : The ‘$ lpr’ command send a file to the printer for printing.
OF
$ lpr new.txt
PR
18. passwd : The ‘$ passwd’ command simply changes the password of the user.In above
ST.
19. clear : The ‘$ clear’ command is used to clean up the terminal so that you can type
with more accuracy
$ clear
BLDEA S.B.S. ARTS, COMMERCE AND SCIENCE COLLEGE FOR WOMEN BCA DEPT.Page 18
MICROKERNEL BASED OPERATING SYSTEM:
Kernel
A kernel is an important part of an OS that manages system resources. It also acts as a bridge
between the software and hardware of the computer. It is one of the first program which is
loaded on start-up after the bootloader. The Kernel is also responsible for offering secure access
to the machine’s hardware for various programs. It also decides when and how long a certain
application uses specific hardware.
NI
Microkernel
AR
Microkernel is a software or code which contains the
LK
required minimum amount of functions, data, and
features to implement an operating system. It
.KU
provides a minimal number of mechanisms, which is
good enough to run the most basic functions of an
operating system. It allows other parts of the
operating system to be implemented as it does not
impose a lot of policies.
JN
RA
Microkernels and their user environments are usually
RU
implemented in the C++ or C programming languages with a little bit of assembly. However,
other implementation languages are possible with some high-level coding.
.GU
● The operating system puts the CPU in kernel mode when it is executing in the kernel so, that
kernel can execute some special operation.
● The operating system puts the CPU in user mode when a user program is in execution so,
that the user program cannot interface with the operating system program.
BLDEA S.B.S. ARTS, COMMERCE AND SCIENCE COLLEGE FOR WOMEN BCA DEPT.Page 19
● User-level instruction does not require special privilege. Example are ADD,PUSH,etc.
● The concept of modes can be extended beyond two, requiring more than a single mode bit
CPUs that support virtualization use one of these extra bits to indicate when the virtual
machine manager, VMM, is in control of the system. The VMM has more privileges than
ordinary user programs, but not so many as the full kernel.
● System calls are typically implemented in the form of software interrupts, which causes the
hardware’s interrupt handler to transfer control over to an appropriate interrupt handler,
which is part of the operating system, switching the mode bit to kernel mode in the process.
NI
The interrupt handler checks exactly which interrupt was generated, checks additional
AR
parameters ( generally passed through registers ) if appropriate, and then calls the
appropriate kernel service routine to handle the service requested by the system call.
LK
● User programs’ attempts to execute illegal instructions ( privileged or non-existent
instructions ), or to access forbidden memory areas, also generate software interrupts,
.KU
which are trapped by the interrupt handler, and control is transferred to the OS, which
issues an appropriate error message, possibly dumps data to a log ( core ) file for later
JN
analysis, and then terminates the offending program.
What is Microkernel?
RA
A microkernel is one of the classifications of the
kernel. Being a kernel it manages all system
RU
The Operating System remains unaffected as user services and kernel services are isolated so if
any user service fails it does not affect kernel service. Thus it adds to one of the advantages of a
microkernel.
BLDEA S.B.S. ARTS, COMMERCE AND SCIENCE COLLEGE FOR WOMEN BCA DEPT.Page 20
It is easily extendable i.e. if any new services are to be added they are added to user address
space and hence require no modification in kernel space. It is also portable, secure, and
reliable.
Microkernel Architecture –
Since the kernel is the core part of the operating system, so it is meant for handling the most
important services only. Thus in this architecture, only the most important services are inside
the kernel and the rest of the OS services are present inside the system application program.
Thus users are able to interact with those not-so-important services within the system
NI
application. And the microkernel is solely responsible for the most important services of the
operating system they are named as follows:
AR
● Inter process-Communication
LK
● Memory Management
● CPU-Scheduling
.KU
Advantages of Microkernel –
●
●
JN
The architecture of this kernel is small and isolated hence it can function better.
Expansion of the system is easier, it is simply added to the system application without
RA
disturbing the kernel.
RU
BOOTING :
.GU
● The system. Hence it needs a special program, stored in ROM to do this job known as
the Bootstrap loader. Example: BIOS (boot input output system). A modern PC BIOS
(Basic Input/Output System) supports booting from various devices.Typically, the BIOS
OF
will allow the user to configure a boot order. If the boot order is set to:
● CD Drive
PR
● Then the BIOS will try to boot from the CD drive first, and if that fails then it will try to
boot from the hard disk drive, and if that fails then it will try to boot from the network,
AS
BLDEA S.B.S. ARTS, COMMERCE AND SCIENCE COLLEGE FOR WOMEN BCA DEPT.Page 21
starts its execution.In some systems, a simple bootstrap loader fetches a more complex
boot program from disk, which in turn loads the kernel.
Dual Booting:
When two operating system are installed on the computer system then it is called dual booting.
In fact multiple operating systems can be installed on such a system. But how system knows
which operating system is to boot? A boot loader that understand multiple file systems and
NI
multiple operating system can occupy the boot space.Once loaded, it can boot one of the
AR
operating systems available on the disk.The disk can have multiple partitions, each containing a
different type of operating system. When a computer system turn on, a boot manager program
displays a menu, allowing user to choose the operating system to use.
LK
.KU
JN
RA
RU
.GU
OF
PR
ST.
AS
BLDEA S.B.S. ARTS, COMMERCE AND SCIENCE COLLEGE FOR WOMEN BCA DEPT.Page 22