You are on page 1of 39

Operating Systems/Windows Application

Operating System

Swap out
Process Po

User space

Swap in
Process P1

Main memory

Backing store

Memory management (swapping mechanism)

SALAKO, E. A (2014)

Page 1

Operating Systems/Windows Application

COURSE CODE:

CSC 222

COURSE UNIT:

LEVEL:

200

PROGRAMEE:

NCE

COURSE CONTENTS
Definition and functions of Operating system (OS)
Advantages and disadvantages of using (OS)
Windows (types, uses, etc)
Assemblers, Compilers and Interpreters
Batch processing, Real time processing and time sharing processing
Resource Allocation
Memory management
Input/output systems

SALAKO, E. A (2014)

Page 2

Operating Systems/Windows Application


INTRODUCTION
DEFINITION AND FUNCTIONS OF OPERATING SYSTEM (OS)

ccording Salako (2011), a computer is a programmable machine designed to


sequentially accept, process, store data on the basis of set of predefined instructions

to produce useful information. A computer cannot work or perform functions outside a


predefined set of instructions. The physical appearance of a computer does not guarantee
high performance. What makes computer different and useful in solving many humanly
problems is the platform that drives its functionalities. This platform controls the
functionalities of a computer. The performance of a computer is strictly depends on the
two criteria; namely the capability of hardware and the efficiency of software. This course
note (material) reviews one of the essential components of a computer system (system
software); the Operating System (OS). The note also focuses on the functions of Operating
System (OS); advantages and disadvantages of using (OS); Windows (types, uses, etc);
assemblers, translators and interpreters; batch processing, real time processing and time
sharing processing; allocation and scheduling resource; memory management and
input/output systems.

Read the note with your mind!


What is system software?
Let start the discussion by asking ourselves this fundamental question what is
system software? System software is a set of one or more programs, designed to control

SALAKO, E. A (2014)

Page 3

Operating Systems/Windows Application


the operation of a computer system. These programs do not solve specific problems like
custom made application software. They are general programs written by computer
programmers to assist human in the use of the computer system by performing tasks, such
as controlling all of the operations, required to move data onto and out of a computer and
all the steps in executing an application program. In general, system software (packages)
support the running of other software; communicate with peripheral devices (keyboard,
mouse, CRT, printer, disk and tape devices, etc.); support the development of other types
of software; and monitor the use of various hardware resources (memory, peripherals,
CPU, etc.). Thus systems software makes the operation of the computer system more
effective and efficient. The program included in systems software are called systems
programs and the person who prepares systems software is referred as to as system
programmer.

Categories of System Software


The system software is an essential part of a total computer system. Its function is to
compensate for the differences that exist between the use and the capabilities of the
hardware. A computer without some kind of systems software would be very ineffective
and most likely impossible to operate. The basic categories of system software include:
a. Operating System (OS)
b. Device Driver

SALAKO, E. A (2014)

Page 4

Operating Systems/Windows Application


c. Utility Programs

(a)

Operating system
An operating system (OS) is a collection of software that manages computer

hardware resources and provides common services for computer programs. The operating
system is an essential component of the system software in a computer system. Application
programs usually require an operating system to function. Time-sharing operating systems,
schedule tasks for efficient use of the system and may also include accounting for cost
allocation of processor time, mass storage, printing, and other resources.
For hardware functions such as input, output and memory allocation, the operating system
acts as an intermediary between programs and the computer hardware, although the
application code is usually executed directly by the hardware and will frequently make
a system call to an OS function or be interrupted by it. Operating systems can be found on
almost any device that contains a computerfrom cellular phones and video game
consoles to super-computer and web servers. Examples of popular modern operating
systems include Android, Microsoft Windows, Windows Phone, IBM z/OS and LINUS to
mention but a few.

Major components of operating system (OS)


Most Operating Systems (OS) have many similar elements. These generally include:

Supervisor

SALAKO, E. A (2014)

Page 5

Operating Systems/Windows Application

Command language translator

I/O control system (IOCS)

Librarian

Supervisor
At the heart of every OS is a program called supervisor. The overall coordination and
the management of OS are performed by this program. Located in primary memory when
the computer system is on, the supervisor initiates the call to other parts of the OS
for resources and places any programs that are retrieved during the process into main
memory.
Command Language Translator
The command language translator transforms the needs of users onto actions that the
OS takes. Like other software packages, the OS has its own language with which users and
programmers issue commands. Command language translator converts the English like
commands of OS (DIR, COPY, CLS, or DEL) into the machine language of the computer.

I/O Control System (IOCS)

SALAKO, E. A (2014)

Page 6

Operating Systems/Windows Application


This input/output control system (IOCS) interacts with input and output hardware devices.
Thus, if the supervisor determines that a program should be retrieved from hard disk to
main memory for a user, it hands the task over to the IOCS. Supervisor actually supervise
the input and output devices, the actual work is basically done by IOCS.
Librarian
Computer hard disk is basically a library. The librarian is the software element that catalogs
and manages data, file, directories, programs, space, and users.

Types of operating systems


1. Real-time
A real-time operating system is a multitasking operating system that aims at executing realtime applications. Real-time operating systems often use specialized scheduling algorithms
so that they can achieve a deterministic nature of behavior. The main objective of real-time
operating systems is their quick and predictable response to events. They have an eventdriven or time-sharing design and often aspects of both. An event-driven system switches
between tasks based on their priorities or external events while time-sharing operating
systems switch tasks based on clock interrupts.

2. Multi-user

SALAKO, E. A (2014)

Page 7

Operating Systems/Windows Application


A multi-user operating system allows multiple users to access a computer system at the
same time. Time-sharing systems and Internet servers can be classified as multi-user
systems as they enable multiple-user access to a computer through the sharing of time.
Single-user operating systems have only one user but may allow multiple programs to run
at the same time.
3. Single-tasking
This is one of the operating systems that control the functionalities of a computer system.
A single-tasking system has only one program running at a time. Multiple programs cannot
run simultaneously; one running program at a time. This operating system is designed to
manage the computer so that one user can effectively perform a task at a time. The Palm
OS for palm handheld computers is a good example of a modern single-user, single-task
operating system. Single-tasking results in completing a task faster than performing more
than a task.
4. Multi-tasking
A multi-tasking operating system allows more than one program to be running at the same
time, from the point of view of human time scales. Multi-tasking can be of two types: preemptive and co-operative. In pre-emptive multitasking, the operating system slices the
CPU time and dedicates one slot to each of the programs. Unix-like operating systems such
as Solaris and Linux support pre-emptive multitasking, as does Amiga OS. Cooperative
multitasking is achieved by relying on each process to give time to the other processes in
a defined manner. The 16-bit versions of Microsoft Windows used cooperative multi-

SALAKO, E. A (2014)

Page 8

Operating Systems/Windows Application


tasking. The 32-bit versions of both Windows NT and Win9x, used pre-emptive multitasking. Mac OS prior to OS X used to support cooperative multitasking.

Question

5.

Is it better to focus on one task at a time, or


maximize your time by performing many tasks
simultaneously? Discuss

Distributed
A distributed operating system manages a group of independent computers and

makes them appear to be a single computer. The development of networked computers that
could be linked and communicate with each other gave rise to distributed computing.
Distributed computations are carried out on more than one machine. When computers in a
group work in cooperation, they make a distributed system.
6.

Embedded
Embedded operating systems are designed to be used in embedded computer

systems. They are designed to operate on small machines like PDAs with less autonomy
(independence). They are able to operate with a limited number of resources. They are very
compact and extremely efficient by design. Windows CE and Minix 3 are some examples
of embedded operating systems.
Advantages of computer operating system (OS)

SALAKO, E. A (2014)

Page 9

Operating Systems/Windows Application


The advantages of computer operating system (OS) include:
i. make computers easy to use
ii. user friendly
iii. it serves as an intermediate between all hardwares and softwares of the system
iv. no need to know any technical or programming languages
v. it is the platform of all computer programs to run
Disadvantages of computer operating system (OS)
The disadvantages of computer operating system (OS) include:
i. if any problems affect OS, you may lose all the contents which have been stored
already
ii. unwanted users can use your own system
iii. prone to virus infections
iv. few experts can develop the programs; so it requires deep knowledge and
certification.

Functions of operating system(s)


The functions of operating system(s) include the following:

i. helps in booting up process of the computer

SALAKO, E. A (2014)

Page 10

Operating Systems/Windows Application


ii. checking that the hardware is functioning properly
iii. scheduling and loading of jobs in order to provide continuous processing
iv. control of user selection and operation of I/O devices and file handling
v. calling into main storage of programs and subroutines, as and when required
vi. opening and closing files, checking of files labels etc.
vii.. maintenance of directories in external storages
viii.

provision of error corrections routines

ix.

communications with the computer user by means of Input and output devices

x.

managing tasks such as multitasking, multiprogramming, multiprocessing, and


timesharing.

b. Device Drivers
This software extends the capabilities of OS support I/O devices. Computer does
not have Intelligence Quotient (IQ). It is the device driver that tells the computer that
monochrome monitor is replaced with color monitor, sound card is attached to the CPU,
fax modem card is linked with the computer etc. These device drivers are programs.

c. Utility Software

SALAKO, E. A (2014)

Page 11

Operating Systems/Windows Application


Utility software is a computer software designed to help in the enhancement of
operating system, computer hardware and application software. It is designed to perform
specific single-task or a multiple of small tasks. Examples of utility software include:
i.

Disk defragmenters

ii.

system profilers

iii.

network managers

iv.

application launchers

v.

virus scanners.

Utility software designed to help analyse, configure, optimize or maintain a computer for
the realization of predefined goals.

ADVANTAGES AND DISADVANTAGES OF DIFFERENT (OSs)


As mentioned above, there are many different versions of operating systems, the
advantages and disadvantages of a few of them are discussed below.
1. Advantages of Windows
The advantages of windows include:
i. Window enhances entertainment. Lots of software and games are developed for
windows.
ii. Windows is user friendly.
Disadvantages of Windows

SALAKO, E. A (2014)

Page 12

Operating Systems/Windows Application


The disadvantages of windows include:
i. Very bloated with many features most people don't use, thus slowing down the
computer and takes excessive hard drive space. However this shouldn't be much of
a problem with newer computers.
ii. There are many viruses programmed for windows
iii. Can get a little expensive
2. Advantages of MAC OS X
The advantages of MAC OS X include:
i. Very user friendly with nice graphics
ii. very few viruses are programmed for OS X
iii. Some selection of software and games.
Disadvantages of MAC OS X
The disadvantages of MAC OS X include:
i. The computers are overpriced; also can get expensive for software
3. Advantages of LINUX
The advantages of LINUX include:
i.

has many versions that are designed to do specific tasks

ii.

programmer friendly

iii.

there are many versions that have what you need and will not slow down your
computer

iv.

few viruses infections

SALAKO, E. A (2014)

Page 13

Operating Systems/Windows Application


v.

advanced users can COMPLETELY customize the system

Disadvantages of LINUX
The disadvantages of LINUX include:
i.

not very user friendly

ii.

few software selections

TYPES AND USES OF WINDOWS


The Window supports limited forms of multitasking and networking but shares the memory
limitations of Disk Operating System (DOS). Early versions of windows had some
problems with application crashes when multiple programs competed for the same memory
space.
Microsoft's Windows 98 and Windows 95 are genuine 32-bit operating system. A 32-bit
operating system can run faster than DOS, which could only address data in 32-bit chunks.
Both Windows 98 and 95 provide a streamlined graphical user interface that arranges icons
to provided instant access to common tasks. They can support software written for DOS
but can also run programs that take up more than 640K of memory. Window 98 and 95
feature multitasking, multithreading (the ability to manage multiple independent tasks
simultaneously), and powerful networking capabilities, including the capability to integrate
fax, e-mail, and scheduling programs.

SALAKO, E. A (2014)

Page 14

Operating Systems/Windows Application


Window 98 is faster and more integrated with the Internet than Window 95, with support
for new hardware technologies such as MMX, digital video disks (DVD),
videoconferencing cameras, scanners, TV tuner-adapter cards, and joysticks. It provides
capabilities for optimizing hardware performance and file management on the hard
disk and enhanced three-dimensional graphics. The most visible feature of Window 98 is
the integration of the operating system with web browser software.

Windows NT
Windows NT (for new technology) is another 32-bit operating system developed by
Microsoft with features that make it appropriate for applications in large networked
organizations. It is used as an operating system for high-performance workstations and
network servers. Windows NT shares the same graphical user interface as the other
Windows operating systems, but it has more powerful networking, multitasking, and
memory-management capabilities. Window NT can support existing software written for
DOS and Windows, and it can provide mainframe-like computing power for new
applications with massive memory and file requirements. It can even support
multiprocessing with multiple CPUs.
There are two versions of Windows NT; a Workstation version for user of standalone or
client desktop computers. And a Server version designed to run on network servers.

SALAKO, E. A (2014)

Page 15

Operating Systems/Windows Application


Windows NT Server includes tools for creating and operating websites. Unlike OS/2,
Windows NT is not tied to computer hardware based on Intel microprocessors.

Windows CE
Window CE has some of the capabilities of Windows, including its graphical user interface
(GUI), but it designed to run on small handheld computers, personal digital assistants, or
wireless communication devices such as pagers and cellular phones. It is a portable and
compact operating system requiring very little memory. Non-PC and consumer devices can
use this operating system to share information with Window-based PCs and connect to the
Internet.
According to Vangie (2012), Microsoft Windows is a family of operating systems for
personal computers. Windows dominates the personal computer world, running, by some
estimates, on more than 90 percent of all personal computers the remainder
running Linux and Macoperating

systems.

Windows

provides

a graphical

user

interface(GUI), virtual memory management, multitasking, and support for many


peripheral devices. The following details the history of Microsoft operating systems
designed for personal computers (PCs).
MS-DOS (Microsoft disk operating system)
Originally developed by Microsoft for IBM, MS-DOS was the standard operating system
for IBM-compatible personal computers. The initial versions of DOS were very simple and

SALAKO, E. A (2014)

Page 16

Operating Systems/Windows Application


resembled another operating system called CP/M. Subsequent versions have become
increasingly sophisticated as they incorporated features of minicomputer operating
systems.
Windows 1.0 2.0 (1985-1992)
Introduced in 1985, Microsoft Windows 1.0 was named due to the computing boxes, or
"windows" that represented a fundamental aspect of the operating system. Instead of
typing MS-DOS commands, windows 1.0 allowed users to point and click to access the
windows.
Windows 3.0 3.1 (19901994)
Microsoft released Windows 3.0 in May, 1900 offering better icons, performance and
advanced graphics with 16 colors designed for Intel 386 processors.
Windows 95 (August 1995)
A major release of the Microsoft Windows operating system released in 1995. Windows
95 represents a significant advance over its precursor, Windows 3.1. In addition to sporting
a new user interface, Windows 95 also includes a number of important internal
improvements. Perhaps most important, it supports 32-bit applications, which means that
applications written specifically for this operating system should run much faster.
Windows 98 (June 1998)
Windows 98 offers support for a number of new technologies, including FAT32, AGP,
MMX, USB, DVD, and ACPI. Its most visible feature, though, is the Active Desktop,
which integrates the Web browser (Internet Explorer) with the operating system. From the

SALAKO, E. A (2014)

Page 17

Operating Systems/Windows Application


user's point of view, there is no difference between accessing a document residing locally
on the user's hard disk or on a Web server halfway around the world.
Windows ME - Millennium Edition (September 2000)
The Windows Millennium Edition, called "Windows Me" was an update to the Windows
98 core and included some features of the Windows 2000 operating system. This version
also removed the "boot in DOS" option.
Windows NT 31. - 4.0 (1993-1996)
A version of the Windows operating system. Windows NT (New Technology) is a 32-bit
operating system that supports preemptive multitasking.
Windows 2000 (February 2000)
Often abbreviated as "W2K," Windows 2000 is an operating system for business desktop
and laptop systems to run software applications, connect to Internet and intranet sites, and
access files, printers, and network resources.
Windows XP (October 2001)
Windows XP was first introduced in 2001. Along with a redesigned look and feel to the
user interface, the new operating system is built on the Windows 2000 kernel, giving the
user a more stable and reliable environment than previous versions of Windows.
Windows Vista (November 2006)
Windows Vista offered an advancement in reliability, security, ease of deployment,
performance and manageability over Windows XP. New in this version was capabilities to
detect hardware problems before they occur, security features to protect against the latest

SALAKO, E. A (2014)

Page 18

Operating Systems/Windows Application


generation of threats, faster start-up time and low power consumption of the new sleep
state.
Windows 7 (October, 2009)
Windows 7 made its official debut to the public on October 22, 2009 as the latest in the 25year-old line of Microsoft Windows operating systems and as the successor to Windows
Vista (which itself had followed Windows XP).
Windows 8 (October 2012)
Windows 8 is a completely redesigned operating system that's been developed from the
ground up with touchscreen use in mind as well as near-instant-on capabilities that enable
a Windows 8 PC to load and start up in a matter of seconds rather than in minutes. Windows
8 will replace the more traditional Microsoft Windows OS look and feel with a new
"Metro" design system interface that first debuted in the Windows Phone 7 mobile
operating system.
Windows 8 (August 2014)
Windows 8.1 runs on touchscreen devices as well as traditional computers that rely on a
mouse and keyboard. Microsoft designed Windows 8.1 to address widespread complaints
about Windows 8. Most notably, Windows 8.1 reinstated the Start button, a familiar
navigational feature of previous OS versions. Microsoft also made it easier to open, close
and multitask among several apps using a mouse.

Windows 10 (29 July 2015)

SALAKO, E. A (2014)

Page 19

Operating Systems/Windows Application


Windows 10 is a multi-tasking operating system designed by Microsoft as a major aspect
of Windows OSs. Window 10 combines the strengths of Windows 8, 8.1 with Windows 7.

ASSEMBLERS, COMPILERS AND INTERPRETERS


In the world of programming, there is a term called translator. A translator is a program
which converts statements (program or instructions) written in one language to statements
in another language especially to machine language. There are three types of translators:
1. Assemblers
2. Compilers
3. Interpreters
THE ASSEMBLER: This is a program, which translate assembly language into machine
code. One machine instruction is generated for each source instruction. The resulting
program can only be executed when the assembly process is completed. The assembler
reserves space for the instructions and data, replaces mnemonic operating codes by
machine codes and symbolic addresses by numeric addresses while it determines the
machine representation of constants.
Functions of the assembler
The functions of a typical assembler include the followings:
i.

It translates mnemonic operation codes and symbolic addresses into machine codes
and addresses.

SALAKO, E. A (2014)

Page 20

Operating Systems/Windows Application


ii.

Includes the necessary linkages for closed subroutines and insert appropriate
machine codes.

iii.

Allocates area of storage.

iv.

Detects and indicates invalid source language instructions.

v.

Produces the object program on disk as required.

vi.

Produces a printed listing of the source and object program with comments.

THE COMPILER: Compiler translates a high level language into machine language. The
compiler translate the whole source program into machine code or object program prior to
the object being loaded into main memory and execution. The resulting program can only
be executed when compilation is completed. The storage of the object program into a
diskette facilities future usage of the high level language source program any other time it
is needed.
HOW THE COMPILER DOES ASSEMBLER WORK?
The following steps guide the students on how the compilers do the assemblers work:
1. Translates the source program statements into machine code.
2. Includes linkage for closed subroutines.
3. Allocates areas of main storage.
4. Generates the object program on cards, tapes or disc as required.
5. Produces a printed copy of the source and object program when required.
6. Tabulates list of errors found during program compilation e.g. the use of word or
statement not included in the language vocabulary, the rule of syntax or lexis.

SALAKO, E. A (2014)

Page 21

Operating Systems/Windows Application


THE INTERPRETER: Interpreter is more easily understood by comparing them with
compiler. Both compilers and interpreters are commonly used for the translation of highlevel language program but they perform the translation in two completely different ways.
In the compiler, the whole of the high level language source program is converted into
machine code object program prior to the object program being loaded into main memory
for execution. This in contrast to the interpreter which deals with the source program one
instruction at a time, completely translating and executing each instruction before it goes
onto the next. Interpreter seldom produce object codes but call upon in-built routines
instead. However, some intermediate codes are usually produced temporarily.
The interpreter does not produce object program, it read source program, translates it and
goes ahead to execute it. The object program provided by a compiler fastens execution than
any interpreter can do in the running of a program, the use of object program may however
pose a problem where there is an error as it is very time consuming to discover the source
of error, a compiler is capable of producing a machine code generated by it at any time,
whereas an interpreter can only execute the source program.
If a computer is used, the same program needs only to be translated once. Thereafter, the
object program can be loaded directly into main storage and executed. However, when an
interpreter is used, the source program will be translated every time the program is
executed. Execution carried out in this way may be ten times slower than the execution of
the equivalent object programs.
Uses of interpreters

SALAKO, E. A (2014)

Page 22

Operating Systems/Windows Application


The uses of interpreters include the followings:
i. handling user commands in an interactive system.
ii. they debug programs as they run (i.e. removing faults) i.e. for each line of coding
before implemented.
iii. handling software produced for or by different computer. In this case, the interpreter
may be essential if:
(a) two dissimilar machines are to be connected together for operation, or
(b) if software produced on an old model and not yet converted had to be run on a
new one. This procedure is referred to as SIMULATION since interpreter allow
the new computer to simulate the behavior of the old.
iv. interpreter can also be used to simulate a new machine not yet provided but for
which software is already written.

BATCH PROCESSING, REAL TIME PROCESSING AND TIME SHARING


PROCESSING
How a computer processes data can be classified into three:
i.

Batch Processing

ii.

Real Time Processing

iii.

Time Sharing Processing

i.

Batch processing

SALAKO, E. A (2014)

Page 23

Operating Systems/Windows Application


Batch processing is assembling a group of jobs or tasks in a batch. The earliest computers
were extremely expensive devices, and very slow. Machines were typically dedicated to a
particular set of tasks and operated by control panels, the operator manually entering small
programs via switches in order to load and run a series of programs. These programs might
take hours, or even weeks, to run. As computers grew in speed, run times dropped, and
soon the time taken to start up the next program became a concern. Batch
processing methodologies evolved to decrease these "dead periods" by queuing up
programs so that as soon as one program completed, the next would start.
To support a batch processing operation, a number of comparatively inexpensive card
punch or paper tape writers were used by programmers to write their programs "offline".
When typing (or punching) was complete, the programs were submitted to the operations
team, which scheduled them to be run. Important programs were started quickly; how long
before less-important programs were started was unpredictable. When the program run was
finally completed, the output (generally printed) was returned to the programmer. The
complete process might take days, during which time the programmer might never see the
computer.
The alternative of allowing the user to operate the computer directly was generally far too
expensive to consider. This was because users might have long periods of entering code
while the computer remained idle. This situation limited interactive development to those
organizations that could afford to waste computing cycles. Programmers at the Universities

SALAKO, E. A (2014)

Page 24

Operating Systems/Windows Application


decried the in-humanist behaviors that batch processing imposed, to the point that Stanford
students made a short film humorously critiquing it. They experimented with new ways to
interact directly with the computer, a field today known as human-computer interaction.
ii.

Real time processing

Data processing actually takes place instantaneously upon data entry or receipt of a
command or instruction.
Real time processing is a type of processing where something is maintained or created live,
and not after or before the event has happened. This is used frequently in electronics. A
disadvantage of real time processing may be errors that were not foreseen due to not
waiting or preparing before or after. Real-time processing is just that, processing
calculations right now, in real time. Something like crediting payments to a person's
monthly bill would be an example of real time processing. The payments are processed as
they come in, on a first come, first served basis.
iii.

Time-sharing

Time-sharing, in data processing, is the method of operation in which multiple users with
different programs interact nearly simultaneously with the central processing unit of a
large-scale digital computer. Because the central processor operates substantially faster
than does most peripheral equipment (e.g.,video display terminals, tape drives, and
printers), it has sufficient time to solve several discrete problems during the input/output

SALAKO, E. A (2014)

Page 25

Operating Systems/Windows Application


process. Even though the central processor addresses the problem of each user in sequence,
access to and retrieval from the time-sharing system seems instantaneous from the
standpoint of remote terminals since the solutions are available to them the moment the
problem is completely entered.
Time-sharing was developed during the late 1950s and early 60s to make more efficient
use

of

expensive

processor

time.

Commonly

used

time-sharing

techniques

include multiprocessing, parallel operation, and multiprogramming.


Also, many computer networks organized for the purpose of exchanging data and
resources are centered on time-sharing systems.
Time sharing is also called time slicing. The CPU divides the number of clock cycles it has
per second among several processes. Think a multilane freeway and cars all merging to
cross a river on a 1 lane bridge. Distributed processing means more than one CPU working
in parallel. In the freeway analogy, think 1 lane from the freeway splitting and using more
than one bridge across the river. The load is distributed over two or more bridges. All of
these are just various ways and means of accomplishing one or more tasks from a group of
one or more tasks.
RESOURCE ALLOCATION
To begin the resource allocation, there are fundamental terms that needed to be understood
by the leaners. These terms are resource(s) and process(es).

SALAKO, E. A (2014)

Page 26

Operating Systems/Windows Application


What is resource?
A resource also called system resource, is any physical or virtual component within a
computer system. Every device connected to a computer system is a resource. Every
internal system component is a resource. For examples, keyboard, mouse, RAM, hard
disks, video cards, network cards etc are usable parts of a computer that can be controlled
and assigned by the operating system so all of the hardware and software on the computer
can work together as designed.
What is process?
A process is an instance of a program running in a computer. It is close in meaning to task,
a term used in some operating systems. A process is an instance of a computer program
that is being executed. It contains the program code and its current activity.

Resource allocation
Resource allocation is necessary for any application to run on the system. When the user
opens (clicks) any program this will be counted as a process, and therefore requires
the computer to allocate certain resources for it to be able to run. Resource allocation
involves balancing competing needs and priorities and determining the most effective
course of action (processing) in order to maximize the effective use of limited resources
and gain the best return (output). According to Chris (n.d), general issues on resource
allocation include:

SALAKO, E. A (2014)

Page 27

Operating Systems/Windows Application


In a multi-processing environment, usually processes request more resources than
there are available.
It would be too expensive to provide enough non-shareable resources to cope with
maximum demand.
OS must ensure that processes get the resources they request without compromising
system integrity.
E.g., non-shareable resources cannot be shared amongst processes, because
otherwise input or output could be meaningless (Printer intermingling output from
several processes).

Allocating Resources
In allocating resources, deadlock should be handled sensibly, high level of resource
utilisation should be guaranteed, processes should be allocated resources within a
reasonable length of time and the last two points compromise each other. However,
operating system (OS) can ensure high level of resource utilisation, but sometimes
compromising response times for process completion.
Allocation Mechanisms
A resource is a component of the computer system for which processes can compete.
Typically these are:
i.

Central Processors

SALAKO, E. A (2014)

Page 28

Operating Systems/Windows Application


Usually one, but in a multi-processor environment there will be more than one
processors.
Processors may be several of the same type, or some may have specific
characteristics, to be dedicated to certain tasks.
OS needs to know what each processor can do to help it allocate processor to a
process - uses Processor Descriptor.
Each processor may have its own processor queue, to queue jobs.

ii.

Memory
Processes and data need to be in primary memory to be operated on.
Memory is finite, and Memory Manager must create enough space in primary
memory to accommodate a process for it to become runnable.

iii.

Peripherals
Each device has a device descriptor
Input Output Request Blocks (IORBs) are added to device request queue.
Mutual exclusion to non-shareable peripherals is managed by setting semaphore's
initial value to 1.

iv.

Backing Store
Can be used for Virtual Memory - managed by memory manager
Can also be used for File Store - managed by filing system.

SALAKO, E. A (2014)

Page 29

Operating Systems/Windows Application


Requests for space granted, unless there is no space left, or user has exceeded quota.
Requests cannot be queued.

v.

Files
Collections of related information (Programs, Data, Etc.)
Access may be restricted - security
Access may be limited - non-shareable in write mode
Access may be unlimited - shareable in read mode
Requests may be queued until the expiration of some timeout.

Deadlock
A deadlock occurs when Process A holds non-shareable resource X and requests nonshareable resource Y, and Process B holds resource Y and requests resource X.

Example of a Resource Allocation Graph


Four necessary and sufficient conditions for deadlock include:

SALAKO, E. A (2014)

Page 30

Operating Systems/Windows Application


i.

Mutual Exclusion - non-shareable resources

ii.

Hold and Wait

iii.

No Pre-emption

iv.

Circular Waiting

Deadlock can be resolved by the followings:


i.

Preventing any one of the conditions from holding

ii.

Detection and recovery

iii.

Avoidance by anticipation

MEMORY MANAGEMENT
Memory management is the functionality of an operating system which handles or manages
primary memory of a computer. Memory management keeps track of each and every
memory location either it is allocated to some processes or it is free. It checks how much
memory is to be allocated to processes. It decides which process will get memory at what
time. It tracks whenever some memory gets freed or unallocated and correspondingly it
updates the status.
Memory management provides protection by using two registers, a base register and a
limit register. The base register holds the smallest legal physical memory address and the
limit register specifies the size of the range. For example, if the base register holds 300,000

SALAKO, E. A (2014)

Page 31

Operating Systems/Windows Application


and the limit register is 120,000, then the program can legally access all addresses from
300,000 through 411,999.
0
Operating System
(OS)
251000
Process 1
300000

Base
300,000

Process 2
420000

120,000
Process 3

Limit

650000
Process 4
820000

Empty Space

1920000

Instructions and data to memory addresses can be done in following ways:


Compile time -- When it is known at compile time where the process will reside, compile
time binding is used to generate the absolute code.
Load time -- When it is not known at compile time where the process will reside in
memory, then the compiler generates re-locatable code.
Execution time -- If the process can be moved during its execution from one memory
segment to another, then binding must be delayed to be done at run time

SALAKO, E. A (2014)

Page 32

Operating Systems/Windows Application

Dynamic Loading
In dynamic loading, a routine of a program is not loaded until it is called by the program.
All routines are kept on disk in a re-locatable load format. The main program is loaded into
memory and is executed. Other routines methods or modules are loaded on request.
Dynamic loading makes better memory space utilization and unused routines are never
loaded.
Dynamic Linking
Linking is the process of collecting and combining various modules of code and data into
an executable file that can be loaded into memory and executed. Operating system can link
system level libraries to a program. When it combines the libraries at load time, the linking
is called static linking and when this linking is done at the time of execution, it is called
as dynamic linking. In static linking, libraries linked at compile time, so program code
size becomes bigger whereas in dynamic linking libraries linked at execution time so
program code size remains smaller.
Logical versus physical address space
An address generated by the CPU is a logical address whereas address actually available
on memory unit is a physical address. Logical address is also known a Virtual address.
Virtual and physical addresses are the same in compile-time and load-time address-binding
schemes. Virtual and physical addresses differ in execution-time address-binding scheme.

SALAKO, E. A (2014)

Page 33

Operating Systems/Windows Application


The set of all logical addresses generated by a program is referred to as a logical address
space. The set of all physical addresses corresponding to these logical addresses is referred
to as a physical address space.
The run-time mapping from virtual to physical address is done by the memory management
unit (MMU) which is a hardware device. The MMU uses following mechanism to convert
virtual address to physical address.
The value in the base register is added to every address generated by a user process which
is treated as offset at the time it is sent to memory. For example, if the base register value
is 10000, then an attempt by the user to use address location 100 will be dynamically
reallocated to location 10100.
The user program deals with virtual addresses; it never sees the real physical addresses.
Swapping
Swapping is a mechanism in which a process can be swapped temporarily out of main
memory to a backing store, and then brought back into memory for continued execution.
Backing store is a usually a hard disk drive or any other secondary storage which fast in
access and large enough to accommodate copies of all memory data for all users. It must
be capable of providing direct access to these memory images.
Major time consuming part of swapping is transfer time. Total transfer time is directly
proportional to the amount of memory swapped. Let us assume that the user process is of
size 32KB and the backing store is a standard hard disk with transfer rate of 1MB per
second. The actual transfer of the 32K process to or from memory will take

SALAKO, E. A (2014)

Page 34

Operating Systems/Windows Application


32KB / 1024KB per second
= 1/32 second (0.03125 second)
= 31.25 milliseconds

Operating System

Swap out
Process Po

User space

Swap in
Process P1

Main memory

Backing store

Memory Allocation
Main memory usually has two partitions namely:
Low Memory -- Operating system resides in this memory.
High Memory -- User processes are held in high memory.
Operating system uses the following memory allocation mechanism.
Fragmentation
As processes are loaded and removed from memory, the free memory space is broken into
little pieces. It happens after sometimes that processes cannot be allocated to memory

SALAKO, E. A (2014)

Page 35

Operating Systems/Windows Application


blocks considering their small size and memory blocks remains unused. This problem is
known as Fragmentation. The fragmentation is of two types:

External fragmentation can be reduced by compaction or shuffle memory contents to place


all free memory together in one large block. To make compaction feasible, relocation
should be dynamic.
Paging
External fragmentation is avoided by using paging technique. Paging is a technique in
which physical memory is broken into blocks of the same size called pages and represented
in power of 2. When a process is to be executed, it's corresponding pages are loaded into
any available memory frames. Operating system keeps track of all free frames. Operating
system needs n free frames to run a program of size n pages.
Address generated by CPU is divided into:
Page number (p) -- page number is used as an index into a page table which contains base
address of each page in physical memory.
Page offset (d) -- page offset is combined with base address to define the physical memory
address.

The following figure shows the paging table architecture.

SALAKO, E. A (2014)

Page 36

Operating Systems/Windows Application

Segmentation
Segmentation is a technique to break memory into logical pieces where each piece
represents a group of related information. For example, data segments or code segment for
each process, data segment for operating system and so on. Segmentation can be
implemented using or without using paging.
Unlike paging, segments are having varying sizes and thus eliminate internal
fragmentation. External fragmentation still exists but to lesser extent.
Address generated by CPU in terms of segments can also be divided into two:
Segment number (s) -- segment number is used as an index into a segment table which
contains base address of each segment in physical memory and a limit of segment.
Segment offset (o) -- segment offset is first checked against limit and then is combined
with base address to define the physical memory address.

SALAKO, E. A (2014)

Page 37

Operating Systems/Windows Application

INPUT AND OUTPUT DEVICES


The devices which are used to input the data and the programs in the computer are known
as "input devices". Input device can read data and convert them to a form that a computer
can use. Output devices can produce the final product of machine processing into a form
usable by humans. Input and Output (I/O) devices provide man to machine communication.
Some of the input devices are explained below:
(i) Keyboard (ii) Mouse (iii) Scanner (iv) Track Ball (v) Light Pen (vi) Optical
Character Rader (OCR) (vii) Bar Code Reader (viii) Voice Input Systems (ix) Digital
Camera

Output Devices
(i)

Monitor (ii) Printers (iii) Plotters (iv) Speakers (v) Projectors (vi) Buzzers

(vii) Earphones and headphones (viii) Braille embosser


References
Arthur, C. (2012). "Windows 8 will run on ARM chips - but third-party apps will need
rewrite". The Guardian. P 23 - 26
Chris, S. (n.d). Introduction to operating systems. Retrieved on October 20, 2015 from
http://staff.um.edu.mt/csta1/courses/lectures/csm202/os6.html
Dhotre, I. A. (2009). Operating Systems. Technical Publications. p. 102.

SALAKO, E. A (2014)

Page 38

Operating Systems/Windows Application


Poisson, Ken. "Chronology of personal computer software". Retrieved on retrieved on
12th September, 2013.
Salako, E. A. (2011). Introduction to computer operating system for secondary schools.
An unpublished textbook.
Stallings, D. (2005). Operating systems, internals and design principles. Pearson:
Prentice Hall. p. 6 - 8.
Stallings, D. (2008). Computer organization & architecture. New Delhi: Prentice-Hall
of India Private Limited. p. 267. ISBN 978-81-203-2962-1.
Victor, G. (2010). "Operating system market share". Net applications. Retrieved on 5th
November, 2009.

SALAKO, E. A (2014)

Page 39

You might also like