0% found this document useful (0 votes)
21 views14 pages

FIT Unit-4 Operating System

The document provides an overview of operating systems, defining them as programs that serve as interfaces between users and computer hardware while managing resources. It details various functions of operating systems, including process, memory, file, device management, security, and command interpretation, as well as types of operating systems such as single-user, multi-user, and real-time systems. Additionally, it explains the roles of assemblers, compilers, and interpreters in translating high-level programming languages into machine language.

Uploaded by

shewaledipa2210
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)
21 views14 pages

FIT Unit-4 Operating System

The document provides an overview of operating systems, defining them as programs that serve as interfaces between users and computer hardware while managing resources. It details various functions of operating systems, including process, memory, file, device management, security, and command interpretation, as well as types of operating systems such as single-user, multi-user, and real-time systems. Additionally, it explains the roles of assemblers, compilers, and interpreters in translating high-level programming languages into machine language.

Uploaded by

shewaledipa2210
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/ 14

lOMoAR cPSD| 45406664

St. PAUL’S DEGREE & PG COLLEGE


(Affiliated to Osmania University)
Street No. 8, Himayathnagar, Hyderabad. Ph.No: 27602533

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.

2. Functions of an Operating System


The functions performed by operating system are as follows,
1. Process Management:
A process is a program in execution. During execution, a process needs certain resources
such as CPU time, memory space, files and I/O devices. Process management takes care of creation
and deletion of processes, scheduling of system resources to different processes requesting them.
2. Memory Management:
Memory management takes care of allocation and de-allocation of memory space to programs.
To execute a program, it must be loaded in main memory together with the data it accesses.
3. File Management:
All computer systems store, retrieve and share information. Normally, a computer stores such
information in units called files. File management takes care of file-related activities such as
organization, storage, retrieval, naming, sharing and protecting of files.
4. Device Management:
The device management of an operating system controls all I/O devices. It keeps track of I/O
requests from processes, issues commands to I/O devices, and ensures correct data transmission
to/from an I/O device.
5. Security:
Computer system often store large amount of information, some of which are highly sensitive
and valuable to their users. Users can trust a computer system and rely on it only if its various
resources and information stored in it are protected against unauthorized access.
6. Command Interpretation:
Command interpretation takes user commands and directs system resources to process the
commands. For various system resources, a user communicates with the operating system via a set
of commands.

3. Measuring System Performance


We usually measure efficiency of an operating system and overall performance of a computer
system in terms of the following factors,
1. Throughput:
Throughput is the amount of work that a system is able to do per unit time. We measure it as
the number of jobs (processes) completed by the system per unit time. For example, if a system is
able to complete n processes in t seconds, its throughput is n/t processes per second during that
interval. Throughput is measured normally in processes/hour.
2. Turnaround time:
Turnaround time is the interval between the time of submission of a job to the system for
processing and the time of completion of the job.
3. Response time:
Response time is the interval between the time of submission of a job to the system for
processing and the time of first response from the system for the job.

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

Program P1 in high-level Compiler for Machine code for P1


language L1 language L1

Compiler for
Program P2 in high-level language L2 Machine code for P2
language L2

Fig. A computer supporting languages L1 and L2

Compiler translates all instructions of a program at a time. Compilers are capable of


generating error messages when they perform translation. After successful compilation of a program,
compiler software is not required as the machine instruction can be reused several times. Examples of
compilers are Pascal compiler, C compiler, etc.

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

(Source program) (Object program)

Difference between Compiler and Interpreter

-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

4. It create an object file 4. It does not create any object file


5. It does not require compilation whenever the 5. It performs reinterpretation every time before
program needs to be executed executing a program
6. It performs code translation and code
6. It performs code translation only
execution
7. Memory usage is very high 7. Memory usage is very low

8. It generates some intermediate code 8. It does not generate any intermediate code

6. Explain the types of the operating system.

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. Explain about 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.
The main function of a batch processing system is to automatically keep executing the jobs in
a batch. This is the important task of a batch processing system.
Features
1. It has the capability to execute the jobs only when the resources are not busy.
2. It makes sure that no resource in the system is idle
3. It provides high rates of utilization
4. It reduces the overall system overhead by running the same program for multiple transactions
5. It provides various priorities to the system in order to perform interactive and non-interactive
work
Advantages:
1. They can be shared by various users simultaneously
2. They have very less idle time
3. They can manage
huge work easily

-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.

9. Explain about multiprocessing system.


In this type of operating system, a single program is processed by multiple CPUs. The multi-
processing operating system is often used because it acts as a backup for the existing CPU.
Multiprocessor Operating System 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 memory and other peripheral devices. These types of systems are used when very high
speed is required to process a large volume of data.
The use of multiple processors allows the computer to perform calculations faster, since tasks
can be divided up between processors.

-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.

Advantages of Multiprocessor Systems


There are multiple advantages to multiprocessor systems. Some of these are −
1. More reliable Systems
In a multiprocessor system, even if one processor fails, the system will not halt. This ability to
continue working despite hardware failure is known as graceful degradation. For example: If there are
5 processors in a multiprocessor system and one of them fails, then also 4 processors are still working.
2. Enhanced Throughput
If multiple processors are working in cycle, then the throughput of the system increases i.e.
number of processes getting executed per unit of time increase. If there are N processors then the
throughput increases by an amount just under N.
3. More Economic Systems
Multiprocessor systems are cheaper than single processor systems in the long run because they
share the data storage, peripheral devices, power supplies etc. If there are multiple processes that
share data, it is better to schedule them on multiprocessor systems with shared data than have different
computer systems with multiple copies of the data.

-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.

13. Microsoft Windows NT


Microsoft Windows NT is a multi-user, timesharing operating system developed by Microsoft. It
has UNIX-like features. Hence, it is suitable for use with powerful workstations, networks and database
servers. Like Unix/Linux, Windows NT and its subsequent versions have native support for networking
and network services. It is a Network operating system (NOS).

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.

14. Write about UNIX operating system.


UNIX is a powerful computer operating system that acts as base software to control a computer
system and its peripherals. It was basically developed for programmers and scientists whose work was
related to hardware. Its functions are similar to that of the popular operating systems like Windows. It
provides the base mechanism to start a computer, log in, run an application, store and retrieve files and
so on. It is commonly used in internet server, workstations and PCs by Solaris, Intel, HP etc.
Unix was written in c language and was created to be portable, multitasking and multi-user
system in a time-sharing configuration.
Structure of Unix operating system:
1. Kernel: Kernel is the central core of Unix operating system. It can directly interact with the
hardware. The main functions performed by the kernel are,
a) It controls computer hardware resources such as memory, disk, printers and so on.
b) It schedules processes, control and execute various users jobs.
c) It manages data storage and access.
d) It controls the access to the computer by several users.
2. Shell: The shell which is also called as command interpreter. It is the most important component
of the Unix structure because it receives and understands the commands issued by the user. It
acts as an interface between the user and the kernel. It contains shell commands which perform
a specific task.
3. Utilities: Utilities are also commands defined in the system directories. The tools are used to
open files, process them and then return the output. The utilities are used to ease the job of the
user.
Features:
1. Multiuser accessing or resource sharing
2. Multitasking
3. Security
4. Portability
5. Communication
6. Utilities
7. Programmer support

- 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 -

You might also like