Professional Documents
Culture Documents
Operating System
Swap out
Process Po
User space
Swap in
Process P1
Main memory
Backing store
SALAKO, E. A (2014)
Page 1
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
SALAKO, E. A (2014)
Page 3
SALAKO, E. A (2014)
Page 4
(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.
Supervisor
SALAKO, E. A (2014)
Page 5
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.
SALAKO, E. A (2014)
Page 6
2. Multi-user
SALAKO, E. A (2014)
Page 7
SALAKO, E. A (2014)
Page 8
Question
5.
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
SALAKO, E. A (2014)
Page 10
ix.
communications with the computer user by means of Input and output devices
x.
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
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.
SALAKO, E. A (2014)
Page 12
ii.
programmer friendly
iii.
there are many versions that have what you need and will not slow down your
computer
iv.
SALAKO, E. A (2014)
Page 13
Disadvantages of LINUX
The disadvantages of LINUX include:
i.
ii.
SALAKO, E. A (2014)
Page 14
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
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
SALAKO, E. A (2014)
Page 16
SALAKO, E. A (2014)
Page 17
SALAKO, E. A (2014)
Page 18
SALAKO, E. A (2014)
Page 19
It translates mnemonic operation codes and symbolic addresses into machine codes
and addresses.
SALAKO, E. A (2014)
Page 20
Includes the necessary linkages for closed subroutines and insert appropriate
machine codes.
iii.
iv.
v.
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
SALAKO, E. A (2014)
Page 22
Batch Processing
ii.
iii.
i.
Batch processing
SALAKO, E. A (2014)
Page 23
SALAKO, E. A (2014)
Page 24
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
of
expensive
processor
time.
Commonly
used
time-sharing
techniques
SALAKO, E. A (2014)
Page 26
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
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
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
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.
SALAKO, E. A (2014)
Page 30
ii.
iii.
No Pre-emption
iv.
Circular Waiting
ii.
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
Base
300,000
Process 2
420000
120,000
Process 3
Limit
650000
Process 4
820000
Empty Space
1920000
SALAKO, E. A (2014)
Page 32
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
SALAKO, E. A (2014)
Page 34
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
SALAKO, E. A (2014)
Page 36
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
Output Devices
(i)
Monitor (ii) Printers (iii) Plotters (iv) Speakers (v) Projectors (vi) Buzzers
SALAKO, E. A (2014)
Page 38
SALAKO, E. A (2014)
Page 39