Operating System

You might also like

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

Operating System

An operating system (OS) is a large and complex set of system programs that control the various
operations of a computer system and provide a collection of services to other (user) programs. It
is an intermediary component between the application programs and the hardware. The ultimate
purpose of an operating system is:

1. To provide various services to application programs


2. To control the functioning of the computer system hardware in an efficient manner

The operating system is also considered a huge


resource manager and performs a variety of
services as efficiently as possible to ensure the
desired performance of the system. The operating
system hides the underlying complex operations
of hardware and provides the user the
convenience to use the computer.

Roles of operating System

An Operating System is low-level software that enables a user and higher-level application
software to interact with a computer’s hardware. An OS performs basic tasks, such as recognizing
input from the keyboard, sending output to the display screen, keeping track of files and
directories on the disk, and controlling peripheral devices such as printers. The operating system
has the following roles in a computer system.

1. It acts as the master controller of the computer system


2. It acts as a resource manager. It manages and handles all the computer resources like
memory, CPU, etc.
3. Acts as an intermediary between the user(s) and the computer.
4. It acts as a file manager and performs overall activities like creating, modifying, deleting
and hiding files.
5. It acts as an I/O manager and handles input to the system and output from the system.

Functions of Operating System

Operating System is the grandmaster of the computer system. It plays vital roles to control,
coordinate, instruct and operate the hardware and other software components. The following are
the major functions of the operating system.

1. Resource Management
The operating system is also considered a huge resource manager. It performs a variety of
services as efficiently as possible to ensure the desired performance of the system is
achieved. The most important active resource in the computer system is the CPU. Other
important resources are memory and I/O devices. Allocation and deallocation of all

Compiled By: Prajwal Niroula


resources in the system are handled by the operating system. Most of the time the same
resources are shared by the different processes. The operating system is responsible to
provide resources on-demand to the processes. An example of time resource
management is sharing the printer. When multiple print jobs are queued up for printing
on a single printer, a decision must be made about which one is to be printed next.

2. Process Management
A process is a program in execution. A process needs certain resources, including CPU
time, memory, files, and I/O devices, to accomplish its task. The operating system is
responsible for creating and terminating processes, scheduling processes, and
communicating between the processes. Providing resources to each process and
managing them is done by the operating system.

3. Memory Management
Operating System is responsible for efficiently managing all memory resources including
RAM and virtual memory and allocating memory space to applications and processes as
needed. The memory manager of the operating system must keep track of all memory
addresses and what they are currently being used for. It must also protect those address
ranges, and the data and instructions stored in them, from data and instructions being
used by other processes. The operating system is also responsible for freeing up memory
when it is no longer being used so that other processes can use it.

4. File Management
Files are logical units of information created by processes. A disk will usually contain
thousands or even millions of them, each one independent of the others. Processes can
read existing files and create new ones if needed. These files are managed by the operating
system. How they are structured, named, accessed, used, protected, implemented, and
managed are determined by the operating system. An Operating system provides different
operations to create, retrieve and delete the files. Files are normally stored on disk, so the
management of disk space is another major function of the operating system. An
Operating system provides backup to the files providing a mechanism to retrieve and
restore the accidental deletion and corruption of the files.

5. I/O Management
An operating system must be capable to handle the inputs provided and the output
generated by the computer system. The operating system uses device controllers to
control I/O devices like printer, monitor, keyboard, mouse, joystick, etc. The operating
system also controls how data is transmitted to and from I/O devices. The operating
system handles all input and output requests and prioritizes them and carryout them
accordingly.

Compiled By: Prajwal Niroula


6. Backup and Recovery
Backup and recovery describe the process of creating and storing copies of data that can
be used to protect organizations against data loss. The operating system creates the
system image to back-up the files which can be used to restore the system if the secondary
memory stops working. Operating System offers recurring copying of files you use to a
secondary drive or other memory devices as a backup—and the option to restore only the
version of a file you need to recover.

7. Protection and Security


Protection refers to a mechanism for controlling access by programs, processes, or users
to both system and user resources. The protection mechanism of the operating system
must distinguish between authorized and unauthorized usage. Operating systems through
the password or other access control mechanisms (like fingerprint recognition, facial
recognition, voice recognition) discourage unauthorized access to the computer system.
Each file and directories can be protected using one of these access controls.

8. Power Management
The operating system plays a key role in energy management. It controls all the devices,
so it must decide what to shut down and when to shut it down. is responsible to turn off
parts of the computer which are currently not in use. The operating system automatically
adjusts the brightness level of display, provides power saving options and manages the
temperature of the device.

9. User Interface
An operating system provides a user interface to interact with the computer system. An
operating system provides a user-friendly interface using different graphical means or
non-graphical working environment to provide instructions and commands to the
computer.

10. Command Interpretation


An Operating system interprets the commands from the user into a machine-
understandable form. The operating system translates commands into a detailed set of
instructions as per the architecture of the computer system.

Types of Operating System

Operating systems are featured with different sorts of capabilities. Based on how they act, process,
and they appear there are different categories of the operating system.
i. Based on the Processing Method
ii. Based on User Interface
iii. Based on the mode of user

Compiled By: Prajwal Niroula


Based on the Processing Method

Any program must be in execution state to perform some operation. These executing tasks could
initiate multiple processes. Based on how and when these processes are executed (processed)
there are different types of operating systems. They are:

1. Batch Processing OS
In Batch Operating System a set of jobs/processes is submitted in a sequence for
processing. These systems have a relatively long interval from job arrival time to
completion time for jobs. However, once the jobs start executing the transition from one
job to another does not require any intervention. The very first types of operating systems
were the simple batch operating systems in which users had to submit their jobs on
punched cards or tape. The computer operator grouped all the jobs in batches and stacked
these on the main input device and later processed one by one and the output was
published at once.

2. Multiprogramming Operating System


Multiprogramming OS can execute two or more different and independent programs by
the same processor. This OS could handle multiple programs in primary memory at any
time, executing them concurrently (at the same time). The CPU switches from one program
to another almost instantaneously (instantly/at the same time). When any program waits
for any Input/output devices in these systems, the OS can switch very rapidly from the
currently executing program to the next in the minimum interval. This short interval is
called a context switch time. Multiprogramming normally improves the processor and
device utilization.

3. Multiprocessing Operating System


Multiprocessing is the idea to use multiple processors (CPUs) to simultaneously execute
different processes from different programs or different processes from the same
program. The Multiprocessing systems are designed in such a way that if any processor
(CPU) breaks down, the other CPU takes over its job. The multiprocessing operating system
schedules, balances and coordinates the input, output and processing activities of multiple
processors.

4. Time-Sharing Operating System


Timesharing refers to the allocation of computer resources in time-dependent fashions to
several programs simultaneously. The Time-Sharing Operating System enables different
programs to share the processor’s time uniformly. The operating system provides CPU
service during a small and fixed interval to a program and then switches to the next
program. The CPU switches back and forth so quickly that it seems as if the processors are
executing in parallel. The Timesharing OS reduces CPU idle time and provides quick

Compiled By: Prajwal Niroula


responses. In a timesharing system, if 20 users are logged in and 17 of them are thinking
or talking or drinking coffee, the CPU can be allocated in turn to the three jobs that want
service.

5. Multi-Tasking Operating System


A multi-tasking operating system allows running more than a program simultaneously in
any single processor or multi-processor system. In the case of a computer with a single
CPU, only one job can be processed at a time, but the Multi-tasking operating system can
execute several programs at the same time. In the multitasking system, the tasks may share
the CPU in turn, or any program may wait for another task to get completed. The
multitasking operating system increases the productivity of users as multiple tasks can be
carried out simultaneously.

6. Real-Time Operating System


Real-Time System means a time-critical system that requires an immediate response. In a
real-time system, a job/process accesses and updates quickly enough to make some
prompt decisions. The Real-Time OS uses CPU in such a way that the CPU processes input
data and presents the result in such a form the output can immediately be brought into
action. The response time of each process must be very short in Real-Time Systems. This
OS must be highly reliable because even minimal downtime/delay in many critical
applications may be dangerous to human life or financial loss. Air Traffic control system,
Chemical process- control system, Airline reservation system are some examples of
Realtime systems.

Based on User Interface


User interface – UI is usually a set of certain displays and controls that the user uses to control the
entire system and to perform different sets of operations on it. The operating system provides the
basic services of the user interface for communication with the user. There are mainly two types
of User Interface. They are:
i. Character User Interface (CUI)
CUI is a kind of user interface that uses only alphanumeric characters for input-output and
presentation of information. Character/Command Line User Interface is the interface in which
the user communicates with programs or operating system by writing commands in the
command line. The users type the command, which should be executed, and then they press
the key “Enter “. After the key “Enter” has been pressed the command will be executed and the
computer will display the result or perform changes on the system. For example, DOS.

Features of CUI
• CUI operating system requires less memory space to get installed and to perform
operations.
• Computer system operation/command execution is faster.

Compiled By: Prajwal Niroula


• Requires low memory space to perform I/O operations.
• CUI is less user friendly.
• Every command must be entered manually to perform operations.
• Generally, the CUI based system does not support multiple users and multi-tasking.

ii. Graphical User Interface (GUI)


The Graphical User Interface (GUI) is a user interface that allows you to control the computer
using interactive graphical controls. The user uses the keyboard, mouse, touchpad, input and
graphical elements such as menus, icons, buttons, scroll bars, forms, and others to operate the
computer. Using icons and other auxiliary elements the device with GUI can comfortably be
used by any user. Commands can be initiated by touching touchpads, clicking, and scrolling
mouse or entering through keyboards.

Features of GUI
• GUI uses different graphical elements to represent different commands and execute
them.
• GUI makes operating computers easier; operations can be done with ease.
• Different input devices like the touchpad, touchscreen, sensors, mouse, keyboard, etc.
can be used while using GUI based OS.
• Features of the system can be explored by the user, as commands should not be
remembered.
• GUI OS provides an Interactive way to use computers. Changes in the system can be
noticed immediately by the user.
• GUI is capable of multiprogramming, multitasking, and multiuser handling.
• GUI OS requires a system with high memory.
• The high-end processor is required.
• Loading GUI based operation is slower and sometimes operating computer uses heavy
resources like memory, peripherals, and CPU.

Based on the mode of user

Users can operate a computer as per their requirements. Based no. on the user operating on a
computer system at a time instance, there are two types of operating systems. They are:

i. Single-User operating system


A single-user operating system is a system in which only one user can access the
computer system at a time. In other words, it supports one user at a time. A single user
operating system may be a single-tasking or multitasking operating system. A single
set of hardware is handled by this OS. However, the user can use all or any resources
connected to the system at any time. The OS of mobile phones and PCs like Android,
Symbian, MS-DOS, Windows 95, etc. is an example of a single-user OS.

Compiled By: Prajwal Niroula


ii. Multi-user Operating system
A multi-user operating system can handle multiple users a time. This operating system
allows hundreds or even more concurrent users. In a multi-user environment, a
network is used, so that a computer can be remotely used. Multiple computers
(terminals) are connected over the network to the main computer (server computer).
In a multi-user operating environment, resources are shared among different users.
So, multi-user OS must be capable to manage all the resources and balance them in
between the users. E.g.: Windows Server operating system, UNIX, Linux, Windows, etc.

Basic Terminologies of Operating System

Process
A program in execution is called process. A single program can create multiple processes.
Every process must have a program, input, output, and state. Any process may be in ready,
running (currently executing), suspended (paused) or committed (completed) state. For
example, when we write a program in C or C++ and compile it, the compiler creates binary
code. The original code and binary code are both programs. When we run the binary code, it
becomes a process.

Buffering
A buffer is a memory area that stores data while they are transferred between two devices or
between a device and an application. Buffering is done to cope with a speed mismatch
between the input and output of a data stream. Suppose, for example, that a file is being
received via modem for storage on the hard disk. The modem is about a thousand times
slower than the hard disk. So a buffer is created in main memory to accumulate the bytes
received from the modem. When an entire buffer of data has arrived, the buffer can be
transferred to a hard disk in a single operation. Another use of buffering is to adapt between
devices that have different data-transfer sizes.

Spooling
A spool is a buffer that holds output for a device, such as a printer, that cannot accept
interleaved data streams. Spooling stands for Simultaneous Peripheral Operations On-
line. It refers to putting jobs in a buffer, where a device can access them when it is
ready. Although a printer can serve only one job at a time, several applications may wish to
print their output at the same time, without having their output mixed. The operating system
solves this problem using the spooling technique. Each application's output is spooled(stored)
to a separate disk file. When an application finishes printing one request, then only the next
request is processed.

Compiled By: Prajwal Niroula


Context Switching
During processing several processes wait for processing. Switching the CPU to another process
requires performing a state save of the current process and a state restore of a different
process. This task is known as context switching.

Scheduling

Every process that needs to be executed must reside in RAM and processes that need to be
executed must have CPU access. In single-processor systems, the CPU can handle only one
task at a time. So if there are too many processes that are ready to be executed, the operating
system then maintains the order to run process accordingly, so that the processor will be able
to execute all the processes. This process of maintaining order in which each process is
allowed to be executed in CPU is known as scheduling. A scheduler in an OS is responsible
to decide which process to execute next. A scheduling system allows one process to use the
CPU while another is waiting for I/O, thereby making full use of otherwise making CPU jobless.

Virtual Memory

The size of RAM is not enough to run all of the programs that most users expect to run at
once. So the system stores the copy of primary memory on secondary memory and caches
only the most frequently used data in RAM. This memory space at secondary memory where
the copy of primary memory is kept is known as virtual memory. Since the hard drive is much
slower than the RAM, data stored in virtual memory must be mapped back to real memory to
be used. Virtual memory allows us to run multiple programs at the same time and helps to
share files and memory by multiple processes.

Booting

Booting is the process of loading an operating system to the main memory from the secondary
memory when the power button of the computer is switched on. A boot sequence is the initial
set of operations that the computer performs when it is switched on.

There are two types of booting:

i. Cold Booting: Switching on the computer when the computer system is in a shut-down
state.

ii. Warm Booting: Restarting the operating system when the computer system is on the
turned-on state.

Compiled By: Prajwal Niroula


Disk Operating System (DOS)

DOS is an operating system that contains disk-oriented commands and uses disk devices for
permanent storage. DOS is a single-user, single-tasking operating system that uses the
Command-line User Interface. The DOS provides a command-based mechanism to create,
organize, read, write and delete files on the disk. DOS did not support mouse and other
peripherals as it was possible to provide commands only through keyboards. These
commands were text-based as no Graphical User Interface was provided. Each command is
executed by the DOS interpreter called COMMAND.COM.

Features of DOS

i. DOS is a command-line user interface. It takes text-based commands as input.


ii. The applications of DOS could have Graphical User Interface, but not DOS itself.
iii. A mouse is not supported. Commands must be provided only through the keyboard.
iv. Commands must be exact. Misspelled commands don't execute. So, it is difficult to use
for ordinary users.
v. It is a single-user and single-tasking OS. Multi-tasking is not possible.
vi. DOS boots quickly.
vii. DOS is a 16-bit operating system.
viii. Maximum Disk space available is 2 GB.

DOS Commands

There are two types of DOS commands. They are:

i. Internal Commands
Internal commands are used to perform the frequent and important operation on the
computer system. Internal commands are built-in (preloaded or already provided)
commands loaded with the DOS interpreter called COMMAND.COM. Some internal
commands are:

COMMANDS ACTION
CD Change directory or display the current directory path.
CLS Clear the window.
DIR Display a list of contents of the current directory.
EXIT Exits or closes the DOS window.
MD or MKDIR Creates a directory
TYPE Displays the contents of a text file.
DEL Deletes one or more files
TIME Displays current time
DATE Displays current date

Compiled By: Prajwal Niroula


ii. External Commands

External commands are very powerful and can help to fix problems, improve
performance, or perform other actions. They are usually kept in a separate file and the
file is loaded whenever required. Some of the external commands are:

COMMANDS ACTION
EDIT Modify or change the data of a file
LABEL Create, change, or delete the volume label of a disk
CHKDSK Checks a disk and displays a status report.
Moves one or more files from one directory to another
MOVE
directory.
FIND Searches for a text string in a file or files.
HELP Displays a list of commands or help about a command.

Wildcard

If you want to carry out a task for a group of files whose names have something in common,
you can use wildcard characters to specify groups of files. DOS recognizes two wild card
symbols.

The asterisk (*) and question mark (?) are used as wildcard characters. The asterisk matches
any sequence of characters, whereas the question mark matches any single character.

DOS File System

DOS uses a hierarchical file system. Directories (Folders) and files can be nested inside a
directory at different levels. The drives, folders, and files are displayed in groups, which allows
the user to see only the files they're interested in seeing.

A File is a program or collection of information with a specific name and extension. For
example, autorun.exe is a file with name autorun and .exe extension. The extension of a
program describes the nature of the file and determines how it is executed.

Directory (Folder) is a repository that can hold several files and other sub-directories within
itself.

For example: If a file path is provided as C:\DOS\config\autorun.exe

C is a drive name.

DOS is a root directory and config is a sub-directory.

autorun.exe is an executable file.

Compiled By: Prajwal Niroula


DOS system files

There are mainly five system files (including command file and configuration file) in DOS.

SYSTEM FILES FUNCTIONS


IO.SYS This contains the system's initialization code and built-in device drivers.
This contains the DOS kernel and is responsible for file access and
MSDOS.SYS
program management.
It is also called a command interpreter that takes and executes
COMMAND.COM
commands.
CONFIG.SYS This contains statements to configure DOS and load device drivers.
It is automatically executed when the system is started to execute
AUTOEXEC.BAT
commands at startup.

Compiled By: Prajwal Niroula


Windows Operating System

Windows is the multi-tasking, multi-processing, multi-user operating system with Graphical User
Interface developed by Microsoft Incorporation initially released in 1985. Windows is in this state,
going through several changes in a different version of its release. The Windows Operating
System is the most widely used licensed operating system. Most of the personal computers,
laptops come with preloaded Windows OS. It is widely used in different sectors, ranging from
home to high-level corporate organization and scientific research organization. The ease of use
of user interface attracted a lot of general users, and the capability to handle threads, processes
and errors made them popular among high-level users and companies.

Features of the Windows Operating System

1. The Windows GUI is easy to use for normal users and it is customizable. The use of icons,
menus, and pointer made the use of computers easier.
2. It supports multi-user and multi-tasking.
3. Windows OS comes with built-in drivers for most frequently used hardware components.
It provides greater hardware support.
4. Windows operating system has an advanced security feature, network management
capability, power management capability and more advanced features.
5. File Management and task management in Windows is easier.
6. Most of the software is developed for Windows OS. It provides greater software support.

Some of the elements of the User Interface of Windows operating system are:

ELEMENTS DESCRIPTIONS

The area on the display screen where icons are grouped each representing
DESKTOP
different files, folders or application programs.

WINDOW In each window, you can run a different program or display a different file.

It is a list of executable commands allowing the user to execute


MENUS
commands by selecting a choice from the list.

ICONS Small pictures that represent commands, files, or windows.

Usually, the small angled arrow symbol that appears on the display screen
POINTER
and that you move to select objects and commands.

Note: Please refer to the text-book for file management and customization of Windows
OS.

Compiled By: Prajwal Niroula


Open Source Operating System

Open Source operating system is an OS with source code made publicly available that anyone can
inspect, modify, and enhance. Programmers who have access to a computer program's source
code can improve that program by adding features to it as per their requirement and desire.
Unlike proprietory operating systems, Open Source OS is free to use. In general, Open Source
licenses grant computer users permission to use the Open Source operating system for any
purpose they wish. An open-source operating system must:

- Be freely distributable
- Have openly available source codes
- not be discriminating any group of users
- not restrict enhancement and modifications only to a specific system

Examples: Linux operating system, DOS, Android, etc.

Introduction to UNIX and Linux

UNIX

Unix is the original and most powerful and popular multi-user and multi-tasking Operating
System. UNIX was developed by AT&T in 1970. Unix operating systems run on a wide variety of
digital devices and are commonly used on web servers, mainframes, and supercomputers. Unix
was developed using a high-level programming language C, enabling its portability across
multiple computer platforms. UNIX can be used for any kind of processing environments. It can
work on a single-processor system or a multi-processing system. It provides a hierarchical file
structure that facilitates fast data access. It has built-in networking functions so that computers
can easily exchange information.

There are many different versions of UNIX, although they share common similarities. The most
popular varieties of UNIX are Sun Solaris, GNU/Linux, and macOS X.

Linux

Linux is the most popular open-source UNIX based operating system created by Linus Torvalds at
the University of Helsinki in 1991. The source code of Linux is opensource. The drastic
development of Linux is the result of continuous support from numerous volunteers and its large
community. Linux is multi-tasking, multi-processing, and multi-user operating system that has
been installed on a variety of platforms including mobile phones, tablets, video game consoles,
routers, and large servers. Currently, the world's largest and most powerful data centers and
scientific research centers use some different variants of Linux. Most major versions of Linux are

Compiled By: Prajwal Niroula


designed to be as user-friendly and as easy to install as any other operating system on the market
today. Some of the distributions of Linux OS are Red Hat, Kali Linux, Fedora, Debian, Ubuntu, etc.

Linux, as it is opensource it is free to use and can be used for any purpose. It can be redistributed
any way you want to. Linux ensures better protection and security, standard file structure and
community support.

Compiled By: Prajwal Niroula

You might also like