[go: up one dir, main page]

0% found this document useful (0 votes)
89 views13 pages

UNIT 07 - Operating Systems

The document discusses operating systems and their functions. It defines an operating system as software that provides an interface between computer hardware and users/application programs. It then describes the objectives of operating systems as making computers easy to use for users and efficiently managing hardware resources. Finally, it outlines several key functions of operating systems including process management, memory management, file management, device management, and security/protection.

Uploaded by

mubanga20000804
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)
89 views13 pages

UNIT 07 - Operating Systems

The document discusses operating systems and their functions. It defines an operating system as software that provides an interface between computer hardware and users/application programs. It then describes the objectives of operating systems as making computers easy to use for users and efficiently managing hardware resources. Finally, it outlines several key functions of operating systems including process management, memory management, file management, device management, and security/protection.

Uploaded by

mubanga20000804
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/ 13

COPPERBELT UNIVERSITY

COMPUTER SCIENCE DEPARTMENT


INTRODUCTION TO COMPUTING
UNIT 7: OPERATING SYSTEM

INTRODUCTION

The computer system comprises of a functional set of hardware, software, user and data.
Hardware consists of the components of computer like memory, processor, storage devices, and
Input/Output devices. The software may be of different kinds—application software and system
software. A computer system may be a single stand-alone system or may consist of several
interconnected systems. The user uses the application software to perform various tasks, for
example, the user uses word processing software for document preparation. While using the
application software, the user uses the storage of a computer—to store a document on the hard
disk, to execute a command on the CPU, to retrieve a document from a peripheral device or to
print document on printer. For using the hardware, there is a need for software that interacts with
both the hardware and the application software. Operating system (OS) is the software that
provides an interface between the computer hardware, and the application programs or users
(Figure 1).

Figure 1 View of components of computer system

In this unit, we discuss about the components of operating system, the different types of
operating system and the functions of operating system. A brief description of some operating
systems is also given.

1
OBJECTIVES OF OPERATING SYSTEM
Operating system is system software that controls and coordinates the use of hardware among the
different application software and users. OS intermediates between the user of computer and the
computer hardware. The user gives a command and the OS translates the command into a form
that the machine can understand and execute. OS has two main objectives—

i. To make the computer system convenient and easy to use, for the user, and
ii. To use the computer hardware in an efficient way, by handling the details of the
operations of the hardware.

OS hides the working of the hardware from the user and makes it convenient for the user to use
the machine. The application program used by the user requires the use of the hardware during
processing. Some examples are—display of application’s user interface, loading a program into
memory, using I/O devices, allocating CPU to different processes during execution, and store or
load data from hard disk. When using the machine, the user gives the command to perform the
required actions to the OS and the OS handles all the operational steps. The user is not bothered
about how these actions will be performed. This is the job of OS. OS provides an interface to the
application programs to interact with the hardware. The user need not get into the details of this
interaction.

At the other end, the different resources of computer hardware have to be managed and
controlled. This includes managing the communication between different devices, controlling the
sequence and execution of processes, allocating space on hard disk, providing error handling
procedures etc. OS supervises and manages the hardware of the computer.

Some of the commonly used operating systems are Microsoft Disk Operating System (MS-
DOS), Windows 7, Windows XP, Linux, UNIX, and Mac OS X Snow Leopard.

TYPES OF OS
OS are classified into different types depending on their capability of processing

1) Single user,
2) Multiuser,
3) Multitasking,
4) Multiprocessing,
5) Real time, and
6) Embedded.

2
Single User and Single Task OS is for use by a single user for a standalone single computer for
performing a single task. Operating system for Personal Computers (PC) are single-user OS. For
example, if the user is editing a document, then a document cannot be printed on the printer
simultaneously. Single user OS are simple operating system designed to manage one task at a
time. MS-DOS is an example of single user OS.

Single User and Multitasking OS allows execution of more than one task or process
concurrently. For this, the processor time is divided amongst different tasks. This division of
time is also called time sharing. The processor switches rapidly between processes. For example,
the user can listen to music on the computer while writing an article using word processor
software. The user can switch between the applications and also transfer data between them.
Windows 95 and all later versions of Windows are examples of multitasking OS.

Multiuser OS is used in computer networks that allow same data and applications to be accessed
by multiple users at the same time. The users can also communicate with each other. Linux,
UNIX, and Windows 7 are examples of multiuser OS.

Multiprocessing OS have two or more processors for a single running process. Processing takes
place in parallel and is also called parallel processing. Each processor works on different parts of
the same task, or, on two or more different tasks. Since execution takes place in parallel, they are
used for high speed execution, and to increase the power of computer. Linux, UNIX and
Windows 7 are examples of multiprocessing OS.

Real Time OS are designed to respond to an event within a predetermined time. These operating
systems are used to control processes. Processing is done within a time constraint. OS monitors
the events that affect the execution of process and respond accordingly. They are used to respond
to queries in areas like medical imaging system, industrial control systems etc.

Embedded OS is embedded in a device in the ROM. They are specific to a device and are less
resource intensive. They are used in appliances like microwaves, washing machines, traffic
control systems etc.

FUNCTIONS OF OS
Operating system is large and complex software consisting of several components. Each
component of the operating system has its own set of defined inputs and outputs. Different
components of OS perform specific tasks to provide the overall functionality of the operating
system. Main functions of the operating system are as follows:

3
Process Management

The process management activities handled by the OS are—(1) control access to shared
resources like file, memory, I/O and CPU, (2) control execution of applications, (3) create,
execute and delete a process (system process or user process), (4) cancel or resume a process (5)
schedule a process, and (6) synchronization, communication and deadlock handling for
processes.

Memory Management

The activities of memory management handled by OS are—(1) allocate memory, (2) free
memory, (3) re-allocate memory to a program when a used block is freed, and (4) keep track of
memory usage.

File Management

The file management tasks include—(1) create and delete both files and directories, (2) provide
access to files, (3) allocate space for files, (4) keep back-up of files, and (5) secure files.

Device Management

The device management tasks handled by OS are—(1) open, close and write device drivers, and
(2) communicate, control and monitor the device driver.

Protection and Security

OS protects the resources of system. User authentication, file attributes like read, write,
encryption, and back-up of data are used by OS to provide basic protection.

User Interface or Command Interpreter

Operating system provides an interface between the computer user and the computer hardware.
The user interface is a set of commands or a graphical user interface via which the user interacts
with the applications and the hardware.

Below is a detailed explanation of each of the above points.

4
PROCESS MANAGEMENT
A process is a program in a state of execution. It is a unit of work for the operating system. A
process can be created, executed, and stopped. In contrast, a program is always static and does
not have any state. A program may have two or more processes running. A process and a
program are, thus, two different entities.

To accomplish a task, a process needs to have access to different system resources like I/O
devices, CPU, memory etc. The process management function of an operating system handles
allocation of resources to the processes in an efficient manner. The allocation of resources
required by a process is made during process creation and process execution.

A process changes its state as it is executed. The various states that a process changes during
execution are as follows:

 New—process is in a new state when it is created,


 Ready—process is in ready state when it is waiting for a processor,
 Running—process is in running state if processor is executing the process,
 Waiting—process is in waiting state when it waits for some event to happen (I/O etc),
and
 Terminated—process that has finished execution is in terminated state.

A system consists of collection of processes—(1) system process that executes system code, and
(2) user process that execute user code. OS mainly handles the execution of user code, though it
may also handle various system processes.

The concurrent execution of the process requires process synchronization and CPU scheduling.
The CPU scheduling, process synchronization, communication, and deadlock situations are
described in the following subsections.

CPU Scheduling

CPU or processor is one of the primary computer resources. All computer resources like I/O,
memory, and CPU are scheduled for use.

CPU scheduling is important for the operating system. In a multiprogramming and time sharing
system, the processor executes multiple processes by switching the CPU among the processes, so
that no user has to wait for long for a program to execute. To enable running of several
concurrent processes, the processor time has to be distributed amongst all the processes
efficiently.

5
Scheduler is a component of the operating system that is responsible for scheduling transition of
processes. At any one time, only one process can be in running state and the rest are in ready or
waiting state. The scheduler assigns the processor to different processes in a manner so that no
one process is kept waiting for long.

Scheduling can be non-pre-emptive scheduling or pre-emptive scheduling. In non-pre-emptive


scheduling, the processor executes a process till termination without any interruption. Hence the
system resources are not used efficiently. In pre-emptive scheduling, a running process may be
interrupted by another process that needs to execute. Pre-emption allows the operating system to
interrupt the executing task and handle any important task that requires immediate action. In pre-
emptive scheduling, the system resources are used efficiently.

There are many different CPU scheduling algorithms that are used to schedule the processes.
Some of the common CPU scheduling algorithms are as follows—

i. First Come First Served (FCFS) Scheduling: As the name says, the process that
requests for the CPU first, gets the CPU first. A queue is maintained for the processes
requesting the CPU. The process first in the queue is allocated the CPU first. FCFS
scheduling is non-pre-emptive. The drawback of this scheduling algorithm is that the
process that is assigned to the CPU may take long time to complete, keeping all other
processes waiting in the queue, even if they require less CPU time.

ii. Shortest Job First (SJF) Scheduling: The process that requires the least CPU time is
allocated the CPU first. SJF scheduling is non- pre-emptive. The drawback of this
scheduling is that a process that requires more CPU time may have to wait for long time,
since processes requiring less CPU time will be assigned the CPU first.

iii. Round Robin (RR) Scheduling: It is designed for time-sharing systems. RR scheduling
is pre-emptive. In this scheduling, a small quantum of time (10–100 ms) is defined, and
each process in the queue is assigned the CPU for this quantum of time circularly. New
processes are added at the tail of the queue and the process that has finished execution is
removed from the queue. RR scheduling overcomes the disadvantage of FCFS and SJF
scheduling. A process does not have to wait for long, if it is not the first one in the queue,
or, if it requires CPU for a long period of time.

6
Process Synchronization

In a computer, multiple processes are executing at the same time. The processes that share the
resources have to communicate with one another to prevent a situation where one process
disrupts another process.

When two or more processes execute at the same time, independent of each other, they are called
concurrent processes.

A situation where multiple processes access and manipulate the same data concurrently, in which
the final result depends on the order of process execution, is called a race condition. To handle
such situations, synchronization and coordination of the processes is required.

Deadlock

In a multiprogramming environment, multiple processes may try to access a resource. A


deadlock is a situation when a process waits endlessly for a resource and the requested resource
is being used by another process that is waiting for some other resource.

A deadlock arises when the four necessary conditions hold true simultaneously in a system.
These conditions are as follows:

 Mutual Exclusion: Only one process at a time can use the resource. Any other process
requesting the resource has to wait until the resource is released.
 No Pre-emption: A process releases the resource by itself. A process cannot remove the
resource from another process.
 Hold and Wait: A process holds a resource while requesting another resource, which may
be currently held by another process.
 Circular Wait: In this situation, a process P1 waits for a resource held by another process
P2, and the process P2 waits for a resource held by process P1.

Deadlock handling can be done by deadlock avoidance and deadlock prevention.

 Deadlock Prevention is a set of method that ensures that at least one of the above four
necessary conditions required for deadlock, does not hold true.

 Deadlock Avoidance requires that the operating system be given information in advance
regarding the resources a process will request and use. This information is used by the
operating system to schedule the allocation of resources so that no process waits for a
resource.

7
MEMORY MANAGEMENT
In a computer, there may be multiple processes executing at the same time. Every process that
needs to execute, requires a certain amount of memory. Memory management is one of the tasks
handled by the operating system. Memory management schemes handle the allocation of
memory to different processes. On completion of process execution, the memory is de-allocated
and made available to another process. Additionally, different processes that have been allocated
memory should not interfere into each other’s memory space. This requires some memory
protection and sharing mechanism.

Virtual Memory

In the memory management, the whole process is kept in memory before the execution starts.
However, for some applications, large memory is required to run the applications, and the whole
program cannot be loaded into the memory.

Virtual memory allows the execution of those processes that are not completely in memory.
When a process executes and a page is required, that page is swapped-in into the memory. This
allows execution of large-sized programs without loading them completely into the memory.

FILE MANAGEMENT
The file management function of the operating system involves handling the file system which
consists of two parts—a set of files, and a directory structure.

 File is a collection of related information, has a name, and is stored on a secondary


storage. It is the smallest named unit that can be written to a secondary storage device.
Data cannot be stored on the secondary storage if it is not in the form of a file. A file has
attributes like its name, location, size, type, time, and date of creation etc. The
information stored in a file can be accessed in different ways—sequential access (access
is in a sequential order from start to end) and direct access (the file can be accessed in any
order).

 Directory structure provides information about the files stored on the secondary storage.
Directory contains information about all the files within it. The information about the
files is kept as entries in the directory of device. A directory further may have a sub-
directory defined within it. Directory contains the name, location, size, and type of all the
files defined on the device. The tree-structured directory is the commonly used directory
structure.

8
The operating system manages the storage media like the disk and implements the abstract
concept of the file. System calls are an interface between the process and the operating system.
Operating system provides system calls for creating, reading, writing, deleting, repositioning,
and truncating a file. Some of the operations that can be performed on a directory are—search
for a file, create, delete and rename a file, list a directory, and traverse the file system within the
directory. The user simply uses the system calls like “dir”, “list” to perform operation on a file or
directory, without going into the details of its working.

DEVICE MANAGEMENT
Several peripheral devices like mouse, hard disk, printer, plotter etc. are connected to the
computer. The peripheral devices have varying characteristics like character or block device,
sequential or random access device, and dedicated or shared device.

OS manages and controls the devices attached to the computer. OS provides appropriate
functionality to the application programs for controlling different aspects of the devices.

OS handles the devices by combining both hardware and software techniques. The I/O hardware
includes the ports, buses, and device controllers for the devices. The OS communicates with the
I/O hardware via the device driver software. The device driver software comes along with each
device.

A device communicates with the computer hardware via a port (for example, a serial port or a
parallel port). Bus is a common set of wires used by one or more devices. The computer uses
different kinds of buses like PCI bus for connecting processor or memory to the fast devices,
expansion bus to connect to slow I/O devices and SCSI bus to connect disks. A device controller
operates a port, bus, and a device. Device controller is just like a bridge between the device and
the operating system. The device controller receives the data from a connected device, stores it
temporarily, and then communicates the data to the device’s device driver. Device driver is the
software with which the device controller communicates with the operating system.

Operating system enables handling of the different I/O devices in a uniform way. The
complexity of handling the different devices is abstracted and hidden in the device drivers of the
devices. The device drivers hide the differences among the different device controllers and
present a uniform interface to the operating system.

In addition to managing the peripheral devices, OS also provides various services related to I/O
like I/O scheduling, buffering, spooling, and error handling.

Scheduling of I/O requests involves ordering the requests to improve performance of the system
and provide fair access to all processes. For this, a queue of request is maintained for each
device. The I/O scheduler re-arranges the queue to improve the efficiency of the overall system.

9
Buffer is a memory area that stores the data, while it is being transferred between two devices or
between a device and an application. The speed at which the I/O device can transfer data is
different from the speed at which the data is processed. Buffering handles the speed mismatch by
storing the data in a buffer till the complete data has arrived and then writing it in a single write
operation.

Spool (Simultaneous Peripheral Operation On-Line) is a buffer in memory area or disk. Spooling
stores the jobs in a spool where the device can access it when it is ready. Spooling is commonly
used for printers. Users may give several print commands, and continue working with other
operations. However, the printer can print only one job at a time. The rest of the jobs are stored
in the spool in a queue, and the printer accesses the spool when it is ready to print the next job.

PROTECTION AND SECURITY


The access of programs, processes, and users, to the resources defined by the computer are
controlled by the protection mechanism.

Protection ensures that the resources of the computer are used in a consistent way.

Security mechanism prevents unauthorized access to the computer. Security concerns include—
security of software, security of data stored in the computer, and security of physical resources of
the computer.

In a personal computer, security can be ensured using—(1) user accounts—individual accounts


for each user, (2) user authentication— using password protection, (3) access rights—define
rights for access of different kind of information for different people, (4) data encryption—store
data in computer in encrypted form, and (5) data backup—storing data on a peripheral device
other than the hard disk. In a networked environment, only trusted computers should be able to
share data. Some of the common security threats occur due to hacking, viruses etc.

USER INTERFACE
The primary goal of operating system is to make the computer convenient for use by its user. It
should allow users to easily access and communicate with the applications and the hardware.

The users can interact with the computer by using mainly two kinds of interfaces—(1) Command
Line Interface (CLI), and (2) Graphical User Interface (GUI).

CLI requires the user to interact with operating system in the form of text keyed in from the
keyboard. In this, the user has to learn and remember the different commands required for
copying, deleting, opening a file or folder etc.

10
GUI use graphics to display the various commands. The interface consists of icons, menus,
windows, and pointers. The user need not learn the commands, instead, the user can give
instructions by moving the pointer on the screen using a mouse and pressing the mouse button.

EXAMPLES OF OPERATING SYSTEMS


MS-DOS, Windows family of operating systems, Unix OS, Linux OS, and Mac OS X are some
of examples of commonly used OSs. Each operating system has specific characteristics. Here,
we will discuss the features of the MS-DOS, Windows family of operating systems and Linux
operating system.

MS-DOS

MS-DOS was the first widely-installed operating system for PCs in 1980s.

MS-DOS is easy to load and install. It neither requires much memory for the operating system,
nor a very powerful computer to run on.

MS-DOS is a command line user interface operating system. This means that the user has to type
single line commands through the command interface. So, user has to remember the different
commands and their syntax.

It is a single-user and single-tasking operating system for the PC. Only one user can use it and
only one task can be executed, at a given point of time. Also, it does not have a built-in support
for networking.

MS-DOS is a 16-bit OS, meaning thereby that it can send or receive 16 bits of data at a time and
can process 16 bits of data. It is not able to take the advantage of 32-bit processors.

To use MS-DOS, user must know where the programs and data are stored and how to interact
with it. In the MS-DOS command mode, command.com routine interprets the typed in command
from the keyboard.

Command prompt is the command line interpreter on the current Windows-based OS. It is
similar to command.com in MS-DOS. cmd.exe is a Windows program that acts as a DOS-like
command line interpreter.

mnn

11
Windows Family of OS

Windows is a personal computer operating system from Microsoft.

The Windows family of OS which is currently in use includes the Windows 9x family (Windows
95, Windows 98 and Windows 2000), Windows XP, Windows Vista, and Windows 7 operating
systems.

Windows family of OS is GUI-based operating system. Since GUI interfaces are easy to use and
are user-friendly, these have become very popular.

Windows support multi-tasking. It means Windows OS allows simultaneous execution of


multiple tasks.

Windows contains built-in networking, which allows users to share files and applications with
each other, if their PCs are connected to a network.

Windows 7 comes in six different editions, Starter, Home Basic, Home Premium, Professional,
Enterprise and Ultimate.

With each new version of the Windows OS, the user interface undergoes some changes and the
user mhas to learn to use the new interface. This becomes troublesome for the user.

Windows 8 is the current release of the Windows operating system, produced by Microsoft for
use on personal computers, including home and business desktops, laptops, tablets, and home
theater PCs. Development of Windows 8 started before the release of its predecessor in 2009. Its
existence was first announced at CES 2011, and followed by the release of three pre-release
versions from September 2011 to May 2012. The operating system was released to
manufacturing on August 1, 2012, and was released for general availability on October 26, 2012.

Windows 8 introduces significant changes to the operating system's platform, primarily focused
towards improving its user experience on mobile devices such as tablets to rival other mobile
operating systems like Android and iOS taking advantage of new or emerging technologies like
USB 3.0, UEFI firmware, near field communications, cloud computing and the low-power ARM
architecture, new security features such as malware filtering, built-in antivirus software, and
support for secure boot (a UEFI feature which allows operating systems to be digitally signed to
prevent malware from altering the boot process), along with other changes and performance
improvements.

Windows 8 also introduces a new shell and user interface based on Microsoft's "Metro" design
language, featuring a new Start screen with a grid of dynamically updating tiles to represent
applications, a new app platform with an emphasis on touch screen input, the new Windows
Store to obtain and purchase applications for the system, and the ability to synchronize programs
and settings between multiple devices.

12
Linux OS

Linux is a Unix-like OS. Unix OS has a user interface called shell. The kernel provides interface
for the programs to interact with the hardware, and provides services like process management
and memory management. The shell interacts with the kernel through the system calls.

Linux was developed by Linus Torvalds in 1992. Linux is copyright under the GNU Public
License. Linux is a “free” operating system that is easily available. Since Linux follows the open
development model, it is being constantly upgraded by programmers across the globe.

Some organizations offer Linux with add-on features and capabilities. Red Hat, Mandrake,
Debian and Novell are the popular vendors of Linux OS.

Tux, the Linux penguin is the official mascot of Linux.

Linux is a command line user interface OS. Linux has GUI interfaces called desktop
environments like GNOME and K Desktop Environment (KDE). The GUI interface is
convenient for the user to use.

Linux is a 32-bit, multi-tasking OS. It supports multiple users and multiple processors.

Linux is a reliable and secure OS, and is available almost for free. So, Linux is fast becoming
very popular and powerful OS.

Linux OS is easily available, such as Redhat Linux ver. 9, and, Debian’s— Ubuntu, Kubuntu,
and Edubuntu.

13

You might also like