FIT Unit-4 Operating System
FIT Unit-4 Operating System
FIT
UNIT – IV
OPERATING SYSTEM
1. Definition:
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.
Or
Operating System is an integrated set of programs that controls the resources (CPU, memory,
I/O, devices, etc.) of a computer system and provides its users with an interface that is easy to use.
3. Assemblers:
Assembler is a system software. A computer understands only machine language programs.
Hence, we must convert an assembly language program into machine language program before
executing it on the computer. A translator program called assembler performs this translation. It
translates an assembly language program into its equivalent machine language program.
It is called as assembler because in addition to translating, it also assembles the machine
language program in main memory of the computer and makes it ready for execution.
Assembly language program uses mnemonic codes to perform various operations. Some of
them are
Mnemonic Opcode Meaning
HLT 00 Halt, used at the end of program to stop
CLA 10 Clear and add into A register
ADD 14 Add to the contents of A register
SUB 15 Subtract from the contents of A register
STA 30 Store A register
The following is an assembly language program for adding two numbers and storing the result.
The first instruction of the assembly language program tells the assembler that the instructions for the
main program should start at memory location 0000. Based on this directive, the assembler loads the
first instruction of the main program at memory location 0000. It loads each subsequent instruction in
the following memory location (that is, ADD SCND at location 0001, STA ANSR at location 0002, and
HLT at location 0003).
4. Compiler
A complier is a translator program that translates a high-level language program into its
equivalent machine language program.
-3-
A compiler translates only source programs written in the language, which the compiler can
translate. For example, a FORTRAN compiler can translate only source programs written in FORTRAN.
Therefore, each computer requires a separate compiler for each high-level language that it supports.
That is, to execute both FORTRAN and COBOL programs on a computer, the computer must have
both FORTRAN and COBOL compilers
Compiler for
Program P2 in high-level language L2 Machine code for P2
language L2
5. Interpreter
Interpreter translates high-level language program to machine language program. It is similar
to compiler. But the interpreter reads every individual instruction and executes it immediately rather
than executing entire program at once. In case of any error, the program execution is halted until the
error is rectified. The interpreter needs to be stored in the memory till the program execution is
completed. Interpreter is useful while debugging (deleting errors) because it displays the error
message soon after interpreting individual instruction.
Input Output
High-level language program Interpreter Machine language program
-4-
Compiler Interpreter
1. It interprets and executes every single
1. It compiles complete program at a time statement of a program separately
2. It terminates interpretation once an error
2. It generates errors after compiling program occurs
3. It performs execution quickly 3. It takes more time for code execution
8. It generates some intermediate code 8. It does not generate any intermediate code
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.
Types of operating system
The different types of operating systems are,
1. Single-user operating system
2. Multi-user operating system
3. Multi-process operating system
4. Batch processing
5. Multi programming
6. Time sharing
7. Real time system
8. Distributed system
1. Single-user operating system:
This operating system allows a single user to perform operation on the computer at a given
instance of time. In this type of operating system, a single application rather than multiple application
can be executed at one time.
-5-
2. Multi-user operating system:
This operating system enables multiple users to operate the computer simultaneously.
These operating systems perform efficient utilization of CPU by assigning equal amount of time
slice toevery individual user.
3. Multi-process operating system:
In this type of operating system, a single program is processed by multiple CPUs. This
operating system is used basically when batch processing has to be supported. The multi-processing
operating system is often used because it acts as a backup for the existing CPU.
4. Batch Processing system:
A batch processing operating system reads a set of separate jobs, each with its own control
card. This control card contains information about the task to be performed. Once the job is
completed its output is printed. The processing in a batch system does not involve interaction of user
and the job during its execution.
5. Multi-programming:
In the multi-programming system, one or multiple programs can be loaded into its main
memory for getting to execute. It is capable only one program or process to get CPU for executes for
their instructions, and other programs wait for getting their turn. Main goal of using of
multiprogramming system is overcome issue of underutilization of CPU and primary memory.
Main objective of multiprogramming is to manage entire resources of the system. The primary
components of multiprogramming system are command processor, file system, I/O control system.
6. Time sharing system:
A time-sharing system allows many users to share the computer resources simultaneously. In
other words, time sharing refers to the allocation of computer resources in time slots to several
programs simultaneously. A time-shared system uses CPU scheduling and multi-programming to
provide each user with a small portion of a time-shared computer.
7. Real time system:
Real time operating systems are time bounded systems, wherein the system must respond to
perform a specific task within predefined boundary. There are two types of real time systems.
i) Hard real time system: A process is executed in exact time
ii) Soft real time system: A process might be executed within specified time
-6-
8. Distributed system:
Distributed Operating System is a model where distributed applications are running on multiple
computers linked by communications. A distributed operating system is an extension of the network
operating system that supports higher levels of communication and integration of the machines on the
network.
-7-
8. Explain about multiprogramming system
In the multi-programming system, one or multiple programs can be loaded into its main memory
for getting to execute. It is capable only one program or process to get CPU for executes for their
instructions, and other programs wait for getting their turn. Main goal of using of multiprogramming
system is overcome issue of underutilization of CPU and primary memory.
Main objective of multiprogramming is to manage entire resources of the system. The primary
components of multiprogramming system are command processor, file system, I/O control system.
Multiprogramming operating system has ability to execute multiple programs with using of only
one processor machine.
Advantages of Multiprogramming Operating System
There are various benefits of multiprogramming operating system; below explain
1. To increase CPU utilization and it never gets idle.
2. Resources are utilized smartly.
3. Less response time
4. Short time jobs are done fastest compare to long time jobs.
5. Multiple users can use multiprogramming system at once.
6. It can help to execute multiple tasks in single application at same time duration.
7. It can help to improve turnaround time for short jobs.
8. It reduces total read time that is required to execute a job.
9. Multiprogramming system helps to optimize total job throughput of computer.
10. Multiprogramming system can monitor fastest as entire tasks run in parallel.
-8-
Multiprocessing operating systems can handle tasks more quickly, as each CPU that becomes
available can access the shared memory to complete the task at hand so all tasks can be completed
the most efficiently.
For example, if a single-processor OS were running an application requiring three tasks to be
performed, one taking five milliseconds, another taking eight milliseconds, and the last taking seven
milliseconds, the processor would perform each task in order. The entire application would thus require
twenty milliseconds. If a multiprocessing OS were running the same application, the three tasks would
be assigned to separate processors. The first would complete the first task in five milliseconds, the
second would do the second task in eight milliseconds, and the third would finish its task in seven
milliseconds. Thus, the multiprocessing OS would complete the entire task in eight milliseconds. From
this example, it is clear that multiprocessing OSs offer distinct advantages.
-9-
10. Explain about Time sharing system.
A time-sharing system allows many users to share the computer resources simultaneously. In
other words, time sharing refers to the allocation of computer resources in time slots to several
programs simultaneously. A time-shared system uses CPU scheduling and multi-programming to
provide each user with a small portion of a time-shared computer.
Features:
1. It allows multiple users to share the system among themselves.
2. CPU utilization rate is comparatively low as the system is allocated only for a small period of
time for a single.
3. It utilizes multiprogramming along with special CPU scheduling program to reach its goals
Advantages:
Time sharing systems are quite difficult to design, but they provide following advantages to their
users,
1. Reduce CPU idle time: The computation speed of computer is very high in comparison to the
typing speed of a user. Each time if the user is busy in entering input or thinking at the time of
interactive usage of system, the time-sharing systems does its job by servicing multiple users.
Thus, it reduces the CPU idle time and increases the throughput of a system.
2. Benefits of quick response time: A special CPU scheduling program operating in time sharing
system guarantees a faster response time for each and every user. This characteristic
contributes in the improvement of programmer’s productivity through providing easier and
fasterinteractive programming interface and debugging.
3. Provides better computing facility for small users: The users working at lower level can
easily acquire permission for highly sophisticated hardware and software. So, they don’t
purchase the hardware. But, in time-sharing system, users pay small amount of money to access
the services and this relieves them from hardware, software and conflicts occurring at the time
of obtaining and continuing the installation procedure.
- 10 -
11. Explain about MS-DOS operating system.
MS-DOS stands for Microsoft Disk Operating System. It is a single-user operating system. It was
the most popular operating system for personal computers in the 1980s. In MS-DOS there are two
types of DOS commands. They are,
a) Internal Commands − Commands such as DEL, COPY, TYPE, etc. are the internal commands
that remain stored in computer memory.
b) External Commands − Commands like FORMAT, DISKCOPY, etc. are the external commands
and remain stored on the disk.
Structure of MS-DOS:
MS-DOS has the following three layers:
1. BIOS: BIOS stands for Basic Input Output System. It contains device drivers for standard
devices such as keyboard, disk, floppy, printer and display monitor.
2. Kernel: This layer contains all the modules for process management, memory management and
file management. These modules usually are machine-independent, enabling their easy
portability to other machines.
3. Shell: This layer has the command interpreter. MS-DOS provides a command-line interface.
MS-DOS shell, known as command.com, has about 70 commands, which are divided into two
categories. They are, internal commands and external commands. Internal commands are
those, which are always at memory and external commands normally are on disk.
Command name
Task description
In MS-DOS
copy Copy a file
del or erase Delete/Erase/Remove a file
rename or ren Rename a file or move it from its old name to new name
dir Display a directory listing
mkdir or md Create/Make a new directory
cd Change the current working directory
rmdir Remove an empty directory
date Display or change the current date
type Display (type/catenate) contents of a file
Fig. Some of the shell commands
- 11 -
12. Explain about Microsoft Windows.
Microsoft developed Microsoft Windows operating system to overcome the limitations of MS-
DOS operating system. Windows 3.0 was the first successful version of this operating system. It was
released in 1990. Later released versions were Windows 95, Windows 98, Windows 2000, Windows
XP, Windows Vista, Windows 7 and Windows 10. The numbers associated with some of thse release
versions indicate their year of release.
Main features of Microsoft Windows are
1. Its native interface is GUI (Graphical User Interface). Hence, for a new user it is easy to learn
and use computer system.
2. Microsoft Windows is not just an operating system, but a complete operating environment. That
is, all its programs conform to a standard way of working. For example, a Microsoft Windows
word processor works similarly the way a Microsoft Windows spreadsheet works. This means
that if a user learns one Windows program, this experience is useful while using any other
Microsoft Windows program.
3. It is a single-user, multitasking operating system. That is, a user may run more than one program
at a time.
4. It allows file names contain up to 255 characters as well as some punctuation marks, such as
commas and semicolons.
Features:
1. Its native interface is GUI. Similar to that of Microsoft Windows GUI.
2. It supports multiprogramming and takes advantage of multiprocessing on systems having
multiple processors.
3. It has built-in networking and communication features. Hence, it enables configuration of any
computer with Microsoft Windows NT as a network client or server
4. It provides strict system security.
- 12 -
5. It has a rich set of tools for software development and system administration
6. It can run Microsoft Windows applications and many UNIX applications directly.
- 13 -
15. Write about Linux operating System
Linux is an open-source operating system which is powerful and easy to implement. It can be
easily installed into computer system. It is multi-tasking, multiprocessing operating system. Linux is
derived from inventor Linus Torvalds, he is a student at University of Helsinki, Finland.
Design principles of Linux operating system:
1. It is a multiuser, multitasking, multiprogramming operating system
2. It implements the structure and networking model of Unix
3. It is platform independent
4. It is more suitable for architecture of personal computers
5. It can be executed on multiple processors or machines
6. It aims at speed, efficiency and standardization
Linux development process:
Linux is an open-source operating system, various parties participate in its development
process. Various participants play the following key roles:
1. Application vendors and programmers download the freely available kernel and develop all
types of application software for it.
2. Distribution companies package and sell various Linux versions.
3. Hardware vendors bundle Linux on their systems and supply their systems along with the
Linux operating system and a set of application software.
4. End users run Linux and applications to meet their processing needs.
- 14 -