0% found this document useful (0 votes)
21 views

Operating System Lesson 1

Operating systems
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views

Operating System Lesson 1

Operating systems
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 17

OPERATING SYSTEM

COMPILATION BY

MR.: Brian Mwangi

EMAIL: [email protected]

MOBILE PHONE NO: 0722940239


1
Operating System

What is an Operating System?


A program that control the execution of programs and acts as an intermediary between
application and the computer hardware. As an Intermediary, it provides an environment in which
the user can execute programs.
Operating system goals and objective:
 To execute user programs and make solving user problems easier.
 To make the computer system convenient to use.
 To use the computer hardware in an efficient manner (optimal use of computing
resources).
 Ability to evolve; An OS should be constructed in such a way as to permit the effective
development, testing and introduction of a new system functions without interfering with
service.

Computer System Components


The Hardware and software used in providing applications to users can be viewed in a
layered or hierarchical fashion
There are 4 main components of a Computer System, namely;

1. Hardware – provides basic computing resources (CPU, memory, I/O devices).

2
2. Operating system – controls and coordinates the use of the hardware among the various
application programs for the various users.
3. Applications programs – define the ways in which the system resources are used to solve the
computing problems of the users (compilers, database systems, video games, business
programs).
4. Users –try to solve different problems (people, machines, other computers). The user view the
computer system in terms of set of application.
Classes of operating systems
They can be designed as:
⚫ Proprietary o/s – designed for use by specific computer architecture. e.g. MS DOS, PC DOS that
runs on IBM and compatible computers using the Intel series of microprocessors.
⚫ Generic o/s – designed for use by a wide variety of computer architectures e.g. UNIX that runs
on both Intel and Motorola Microprocessors
Operating system functions
a) Process Management
Process - fundamental concept in OS
a. Process is a program in execution.
b. Process needs resources - CPU time, memory, files/data and I/O devices.
OS is responsible for the following process management activities.
 Process creation and deletion
 Process suspension and resumption
 Process synchronization and interprocess communication
 Process interactions - deadlock detection, avoidance and correction

b) Main Memory Management


Main Memory is an array of addressable words or bytes that is quickly accessible.
Main Memory is volatile.
OS is responsible for:
 Allocate and deallocate memory to processes.
 Managing multiple processes within memory - keep track of which parts of memory are
used by which processes. Manage the sharing of memory between processes.
 Determining which processes to load when memory becomes available.

c) File / Secondary storage Management


Since primary storage is expensive and volatile, secondary storage is required for backup.
Disk is the primary form of secondary storage.
3
OS performs storage allocation, free-space management and disk scheduling.

d) Input /Output (Device) System management


I/O system in the OS consists of
 Buffer caching and management
 Device driver interface that abstracts device details
 Drivers for specific hardware devices

e) Protection System (Security)


Protection mechanisms control access of programs and processes to user and system
resources.
Protect user from himself, user from other users, system from users.
Protection mechanisms must:
 Distinguish between authorized and unauthorized use.
 Specify access controls to be imposed on use.
 Provide mechanisms for enforcement of access control.
 Security mechanisms provide trust in system and privacy authentication, certification,
encryption etc.
f) File System Management
File is a collection of related information defined by creator - represents programs and data.
OS is responsible for
 File creation and deletion
 Directory creation and deletion
 Supporting primitives for file/directory manipulation.
 Mapping files to disks (secondary storage).
 Backup files on archival media (tapes).

Operating System Definitions


 Resource Allocator – OS manages and allocates resources (hardware & software-CPU, memory
& file storage space, I/O devices etc) to specific programs and users. Incase of conflicting
requests for resources, OS decides which requests are allocated resources to ensure fair &
efficient computer usage.

4
 Control Program – OS controls the execution of user programs to prevent errors & improper use
of the computer. Also concerned with operation and control of I/O devices.
 Kernel – OS is the one program running at all times on the computer-usually called the kernel
(with all else being application programs).

Operating System Capabilities (“Types of o/s”)


A particular o/s may incorporate one or more of these capabilities:

a) Single User processing – only one user at a time to access a computer e.g. DOS
b) Multi-user processing – allows two or more users to access a computer at the same time. Actual no
of users depends on the hardware and o/s design e.g. UNIX
c) Single Tasking – allows one program to execute at a time and that program must finish executing
before the nest program can be gin e.g. DOS.
d) Context Switching – allows several programs to reside in the memory but only one to be active at a
time. Active program is in the foreground and others in the background.
e) Multitasking / Multiprogramming – allows single CPU to execute what appears to be more that one
program at a time. The CPU switches its attention between 2 or more programs in main memory as it
receives requests for processing from one program and the other. It happens so quickly that the
programs appear to execute simultaneously / executing concurrently.
f) Multiprocessing / Parallel processing – allows the simultaneous or parallel execution of
programs by a computer that has 2 or more CPU’s
g) Multithreading – support several simultaneous functions with the same application.
h) Inter-processing / Dynamic linking – allows any change made in one application to be
automatically reflected in any related linked applications e.g. a link between word processing
and financial applications (linked together).
i) Time sharing – allows multiple users to access a single computer found on a large computer o/s
where many users need access at the same time.
j) Virtual storage – o/s with the capability of virtual storage called virtual memory, allows you to use
a secondary storage device as an extension of main memory.
k) Real Time Processing – allows a computer to control or to monitor the task performances of other
machines and people by responding to input data in a specified amount of time. To control
processes immediate response is usually necessary.

5
OPERATING SYSTEM DESIGN AND IMPLEMENTATION

Design and Implementation of OS is not “solvable”, but some approaches have proven successful.
Internal structure of different Operating Systems can vary widely. The design starts by defining goals and
specifications and this is affected by choice of hardware and type of system.
In guiding the design operating systems the user and system goals are taken into consideration.
 User goals –operating system should be convenient to use, easy to learn, reliable, safe, and fast.
 System Goals – operating systems should be easy to design, implement, and maintain, as well as
flexible, reliable, error- free, and efficient
Important principles to separate during design are:
 Policy: What will be done? (decide what will be done)
 Mechanism: How to do it? (determine how to do something)
The separation of policy from mechanism is a very important principle since it allows maximum
flexibility if policy decisions are to be changed later.

Types of structures
a) Simple Structure / Monolithic systems
It has also been subtitled “The Big Mess” i.e. no structure where the o/s is viewed as a collection of
procedures which can call each other. There is no information hiding (procedures can view each other)
and basically suggests a basic structure for the o/s which includes:
 Main Program – invokes service procedure
 A set of service procedures – which carry system calls.

6
 A set of utility procedures that help the service procedures
Example of MS DOS
MS-DOS –written to provide the most functionality in the least space. It is not divided into modules.
Although MS-DOS has some structure, its interfaces and levels of functionality are not well separated (no
information hiding).

b) Layered Approach
The operating system is divided into a number of layers (levels), each built on top of lower layers. The
bottom layer (layer 0), is the hardware; the highest (layer N) is the user interface. With modularity, layers
are selected such that each uses functions (operations) and services of only lower-level layers.

Examples of layers developed


by Dijkstra (1968) in
Netherlands Layer
Function
(5) Operator
(4) User Programs
(3) Input / Output
Management
(2) Operations / Process
communication
(1) Memory and Device
Management
(0) Process allocation and
multiprogramming

Example is UNIX which had a simple layered structure consisting of:


 Systems programs
 The kernel
i) Consists of everything below the system-call interface and above the physical
hardware
ii) Provides the file system, CPU scheduling, memory management, and other
operating-system functions; a large number of functions for one level
c) Modules
Most modern operating systems implement kernel modules. It uses object-oriented approach.
Each core component is separate and each talks to the others over known interfaces. Each is loadable as
needed within the kernel. Overall it is similar to layers but with more flexible

Solaris Modular approach

7
e) Virtual Machines
A virtual machine takes the layered approach to its logical conclusion. It treats hardware and the
operating system kernel as though they were all hardware. A virtual machine provides an interface
identical to the underlying bare hardware. The operating system creates the illusion of multiple processes,
each executing on its own processor with its own (virtual) memory.
The resources of the physical computer are shared to create the virtual machines. CPU scheduling can
create the appearance that users have their own processor. Spooling and a file system can provide virtual
card readers and virtual line printers. A normal user time-sharing terminal serves as the virtual machine
operator’s console

g) Client-Server Model / Microkernel System Structure


(client process sends a request to server process).

Machine 1 Machine 2
client File Server
Kernel Kernel
NETWORK

Message from client to server

The kernel handles communication between clients and servers. The server processes run as user mode
processes and in kernel mode, they do not have direct access to the hardware (hard for hardware to crash).
It has also been adapted to distributed systems.

8
SYSTEMS
1. Mainframe Systems
Batch Systems
 Reduced setup time by batching similar jobs which were then run through the computer as
a group. But the CPU sat idle during the transition from one job to another.
 Automatic job sequencing was required; i.e. automatically transferring control from one job to
another. This led to the creation of the first rudimentary/basic operating systems.
 Resident Monitor: a procedure for automatically transferring control from one job to the next.
It is always (resident) in memory.
 When the computer was turned on, RM was invoked,
 It would then transfer control to a program
A Batch Operating system therefore reads a stream of separate jobs (from a card
reader), each with its own control cards that predefine what the job does. Job output is printed
on a line printer (on-line processing).
 But there is lack of interaction between the user and the job while that job is executing
2. Desktop Systems
 Personal computers (PCs) – computer system dedicated to a single user.
 I/O devices – keyboards, mouce, display screens, small printers etc replaced card readers and line
printers.
 Smaller & less expensive than mainframe systems.
 Main goal of PC OS is User convenience and responsiveness rather than CPU and
peripheral utilization.
 Can adopt technology developed for larger operating system often individuals have sole use of
computer and do not need advanced CPU utilization of protection features.
May run several different types of operating systems (MSDOS, Windows, Apple MacOS, UNIX,
Linux.
Multi-Processor Systems
3. Parallel Systems
 Other than Single processor systems (systems with only one main CPU) there is a new trend
toward multiprocessor systems (systems having more than one CPU in close communication).
 Tightly coupled system – systems that have more than one processor in close communication,
sharing the computer bus, clock, memory and peripheral devices. communication usually takes
place through the shared memory.
 Advantages of tightly coupled systems:
 Increased throughput:Increasing No. of processors gets more work done in a shorter
period of time. Speed up ratio of n processors is not n but rather less; since when
multiple processors cooperate on a task, a certain amount of overhead is incurred in
keeping everything working correctly, & contention for shared resources all lower the
expected gain.
 Economical; these systems save money compared to several single systems. Sharing
of peripheral devices, cabinets, power supplies, disks.
 Models used in Multiple-processor systems
1.Symmetric Multiprocessing Model
(SMP)
 Each processor runs an identical copy of the operating system & the copies communicate with
each other as needed.
 Many processes (N processes if N CPUs exist) can run at once without performance deterioration.
 Most modern operating systems support SMP
 Ex. Encore’s version of UNIX for Multimax computer.
9
2. Asymmetric Multiprocessing
 Each processor is assigned a specific task; master processor schedules & allocates work to
slave processors (Master- Slave Relationship) or slave processors have predefined tasks.
 More common in extremely large systems, where the most time consuming activities
is processing I/O

Symmetric Multiprocessing Architecture

The difference between symmetric and asymmetric processing: asymmetric needs special
hardware to differentiate the multiple processors or software written to allow only one master and
multiple slaves. E.g. Sun’s operating system version provides asymmetric multiprocessing where
as version 5 (Solaris 2) is symmetric.
4. Distributed Systems
Loosely Coupled systems (Distributed systems) – each processor has its own local memory;
processors communicate with one another through various communications lines, such as high-
speed buses or telephone lines.
 Processors vary in size & function (e.g microprocessors, workstations, minicomputers, large
general purposes systems); also referred to as sites, nodes, computers etc depending on the
context in which they are mentioned.
 Distribute the computation among several physical processors.
5. Clustered Systems
 Involves gathering together multiple CPUs to accomplish computational work.
 Different from Parallel systems, in that, these involve two or more individual systems coupled
together.
 Clustered computers share storage and are closely linked via LAN networking.
Provides high availability: a layer of cluster software runs on each cluster node. @ node
monitors one or more of others (over a LAN). If the monitored part fails, the monitoring machine
can take ownership of its storage, and restart the application(s) that were running on the failed
node. Failed node remains down but users & clients of application(s) only see a brief interruption
in service.
Asymmetric clustering:
 One machine is in hot standby mode, while other is running the applications. The hot standby
host only monitors the active server- so when the server fails, hot standby host becomes the
active server.
Symmetric clustering:
 Two or more hosts are running applications, and they are monitoring each other.
 This mode is more efficient since it uses all the available hardware.
6. Handheld Systems
These Include;
 Personal Digital Assistants (PDAs) e.g. palm pilots, cellular telephones
 Issues:
 Limited memory; i.e. btn 512KB and 8MB.this is due to limited size-most devices are 5
Inches by 3 Inches.

10
 Slow processors; processors run at a fraction of the speed of a PC processor. Faster
processors require more power. Thus a handheld device would need a large battery that
requires to be replaced/recharged frequently. For portability of handheld devices, small-
slower processors which consume less power are used.

COMPUTER SYSTEM COMPONENTS


What is a system?
A system is the entire set of components, both computer related, and non-computer related, that provides a
service to a user. Or a system is a group of related parts/components that work together as a unit to realize
a common goal/function.

Functional Parts of a Digital Computer

PROCESSOR

Control Unit

Arithmetic &
Logic Unit

Registers

INPUT
MEMORY OUTPUT

FIXED BACKING
STORAGE
Key
Data Flow
Control Flow
REMOVABLE BACKING Program Flow 11
STORAGE
Major categories of hardware components
Input
System unit
o Mother Board
o Processor – Control Unit, Arithmetic Unit, Registers
o Memory (Primary)
o Fixed Backing Storage (Secondary storage device)
Backing Storage
Output

INPUT DEVICES
Input is any data and instructions entered into the memory of a computer.
Input devices is any hardware component that allows users to enter data and instructions into a computer
Instructions entered into the computer can be in form of:
i) Programs – Series of instructions that tells a computer what to do how to do it.
ii) Command – an instruction that causes a program to perform a specific action. Users
issue command by typing or pressing keys on keyboard, click a mouse button, speaking
into a microphone or touching an area of a screen.
iii) User response – an instruction a user issues by replying to a question displayed by a program.

SYSTEM UNIT
It is a case that contains electronic components of the computer used to process data. Many electric
components and most storage devices are part of the system unit. Other devices such as keyboards,
mouse, microphone, monitor, printer, and scanner are all connected to the system unit. Parts of the
system unit include:
a) Mother Board (System board)
It is the main circuit board of the computer system unit. Many electronic components are attached
to it.
b) Processor (Central Processing Unit)
Interprets and carries out the basic instructions that operate a computer. It impacts on overall
computing power and manages most of a computer’s operations.
Examples of Processor Manufacturers: Intel Corporation (Xeon MP, Itanium, Pentium, 80486,
Celeron). AMD (Opteron, Athlon MP, Duron). Motorola (68040, 68030) Motorola/IBM(Power
PC). Transmeta (Efficeon, Crusoe)
Parts of a processor
i) Control Unit (CU)
Component of the processor that directs and co-ordinates most of the operations in the
computer.
It interprets each instruction issued by a program then initiates the appropriate action to
carry out the instruction.
ii) Arithmetic and Logic Unit (ALU)
Performs arithmetic comparison and other operations. Also includes basic calculations
such as addition, subtraction, multiplication and division.
iii) Registers
A processor contains small high speed storage locations called registers that temporarily
hold data and instructions.
Register functions include storing the locations from where an instruction was
fetched, storing an instruction while the CU decodes it, storing data while the ALU
computes it and storing these results of a calculation.

12
Buses
Address bus – carry device address that identifies a device being communicated
Data Bus – carry data to or from a device
Control Bus – transmit I/O Commands

There are four types of commands that are transmitted:


(a) Control command – activates device and informs it what to do e.g. rewind
(b) Status command – used to test conditions in the interface and peripherals e.g. checking for errors.
(c) Data output command – interface caused to transfer data into device.
(d) Data input command – interface receives an item of data from device.

System Clock – The processor relies on a small quartz crystal circuit called system clock
to control the timing of all computer operations. Just as your heart beats at a regular rate
to keep you body functioning, the system clock generates regular electronic pulses or
ticks that set the operating pace of components of the system unit. The pace of the system
clock, called clock speed is measured by no of ticks per second (current personal
computer processors have clock speeds in gigahertz. Giga is a prefix that stands for
billions and hertz is one cycle per second; thus one gigahertz equals one billion ticks of
the system clock per second)
c) MEMORY
Consists of electronic components that store instructions waiting to be executed by the processor, data
needed by those instructions and results of processed data (Information). Memory usually consists of one
or more chips on the motherboard. Memory sizes are given in terms of number of bytes the device has
available for storage:
Types of memory
i) Volatile – when power of computer is turned off it loses its contents.
ii) Non – volatile – Doesn’t lose its contents when power is removed from computer

Volatile
RAM (Random Access Memory) – Main memory which consists of memory chips that can read from and
written to by the processor and other devices. The processor interprets and executes a program’s
instructions while the program is in the RAM. RAM can accommodate multiple programs
simultaneously. Examples of RAM include:
Non – Volatile
ROM (Read Only Memory) - are chips storing permanent data and instructions. Data on most ROM
chips cannot be modified hence the name read only. Manufacturers of ROM chips often record data and
instructions or information on chips (firmware).

Other type of ROMs include PROM and EEPROM.

SECONDARY STORAGE
Storage holds data, instructions and information for future use. A storage medium also called secondary
storage is the physical material on which a computer keeps data, instructions and information.
Examples include:
i) Floppy Disks (Magnetic Disks)
ii) Hard Disks (Magnetic Disks)
iii) Magnetic Tapes (Magnetic Disks)
iv) Compact Disks (Optical Discs)
v) Digital Versatile Disks (DVD) -(Optical Discs)
vi) PC Cards
vii) Flash Memory
viii) Microfiche

13
Capacity is the number of bytes (Characters) a storage medium can hold. Terms used by manufacturers to
measure capacity are same as those used for memory.
Typical sizes for devices include
Floppy Disks – 1.44 Megabytes
Hard Disks – 80 Gigabytes
Flash Memory – 512 MB
Compact Disc – 700 MB
DVD – 4.7 GB
Secondary Storages are used to supplement the Primary storage. Their typical uses include:
a) Storing the operating system, Application software, user data and information
b) Software back ups
c) Transportation of files

task
Differentiate between primary and secondary storage

Magnetic Disks – use magnetic materials to store items such as data, instructions, and information on a
disk’s surface. Depending on how the magnetic particles are aligned, they represent either a 0 bit or a
1 bit. Examples are floppy disks, Zip Disks, Hard Disks.

Optical Discs – Is a type of storage media that consists of a flat, round, portable disc made of metal,
plastic, and lacquer that is written and read by a laser. They primarily store software, data, digital
photographs, movies and music. Some optical discs are read only – meaning users cannot write (save) on
media. Others are read/write – allows users to save on discs. Examples include: CD (Compact Discs),
DVD (Digital Versatile Disc)/ (Digital Video Disc).

USB Flash Drives – is a flash memory storage device that plugs in a USB port on a computer or mobile
device. They are convenient for mobile users because they are small and light weight enough to be
transported in a pocket. Experts predict that USB flash drives will become the mobile user’s primary
portable storage device, eventually making the floppy disk obsolete.

Assignment 2
Explain the following storage devices
a) Smart Cards
b) Microfilm and Microfiche
c) PC Cards
d) Magnetic Tapes

OUTPUT
Output is data that has been processed into a useful form. A computer generates several types of output
depending on hardware and software being used and the requirements of the user. These types may
include: Text, Graphics, Audio, and Video.
An output device is any type of hardware component that conveys information to one or more people.
Examples of Output devices include:
a) Display devices – give output that is visually conveyed sometimes called soft copy.
Examples include:
- Monitor (Display device packaged as a separate device)
- Flat Panels Displays (is a lightweight display device with a shallow depth and flat screen
and that typically uses Liquid Crystal Display-LCD)
b) Printers – is an output device that produces text and graphics on a physical medium such as
paper or transparency film. Printed information, called hard copy, exists physically and is a more
permanent form of output. Examples of types of printers include:

14
- Non Impact printers (Ink Jet Printers, Photo Printers, Laser Printers, Mobile Printers)
- Impact Printers (Dot Matrix, Line Printers)
c) Speakers and Head sets – Produce music speech or other sounds such as beeps.
d) Plotters and Large formats Printers – are sophisticated printers used to produce high quality
drawings such as blue prints, maps and circuit diagrams.
e) Other Output Devices - Fax Machines, Multifunction Peripherals (printer, scanner,
and photocopy) and Data Projectors.

15
COMPUTER SOFTWARE
Software is a set of electronic instructions consisting of complex codes (also known as programs) that
make the computer perform tasks. In other words, software tells the computer what to do. Some programs
exist primarily for the computer's use and help the computer perform and manage its own tasks. Other
types of programs exist primarily for the user and enable the computer to perform tasks, such as creating
documents or drawing pictures. Computer software is divided into two major categories: System and
application software.

SYSTEM SOFTWARE
Consists of the programs that control and maintain the operating of the computer and its devices. It serves
as an important interface between the user, application software and hardware. Types of system software
are:
a) Operating system
b) Utility programs

Operating System – are a set of programs containing instructions that co-ordinate all the activities among
computers hardware resources. Basic function of the operating system include:
 Memory management
 Process Management
 File Management
 Device Management
 Providing security

Utility Programs – They are included with most operating systems and provide the following functions:
 Managing files
 Viewing images
 Securing a computer from unauthorized access,
 Uninstalling programs.
 Scanning disks (deletes and corrects physical and logical problems on a hard disk and searches
and removes unnecessary file).
 Disk Defragmenter – reorganizes the file sand unused space on a computer’s hard disk so that the
operating system accesses data more quickly and programs run faster).
 Diagnostic Utility – Compiles technical information about your computer’s hardware and certain
system software programs and prepares a report outlining any identified problem.
 Back up utility - allows users to copy or back up selected files or an entire hard disk to another
storage medium.

Examples of operating system


Category Operating System Names
Stand alone DOS, Windows 3.X, Windows 95, Windows NT, Windows 98,
Windows ME, Windows XP, Windows VISTA, Macintosh
O/S, UNIX, LINUX
Network Netware, Windows 2000 Server, Windows2003 Server, UNIX,
LINUX, Solaris
Embedded Windows CE, Windows Mobile, Palm O/S, Embedded LINUX,
Symbian O/S.

16

You might also like