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

EG 269 OS

The document outlines the objectives and functions of operating systems (OS), emphasizing convenience, efficiency, and the ability to evolve. It describes the OS as an interface between application programs and hardware, detailing its roles in program development, execution, I/O device access, file management, and error handling. Additionally, it categorizes various types of operating systems, including mainframe, server, personal computer, real-time, embedded, and smart card operating systems, while discussing their specific functions and characteristics.

Uploaded by

Cephas Daka
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)
6 views

EG 269 OS

The document outlines the objectives and functions of operating systems (OS), emphasizing convenience, efficiency, and the ability to evolve. It describes the OS as an interface between application programs and hardware, detailing its roles in program development, execution, I/O device access, file management, and error handling. Additionally, it categorizes various types of operating systems, including mainframe, server, personal computer, real-time, embedded, and smart card operating systems, while discussing their specific functions and characteristics.

Uploaded by

Cephas Daka
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/ 27

EG 269 –Mwenya A.

, University of Zambia 2010

Operating System Objectives and Functions

 An OS is a program that controls the execution of application


programs and acts as an interface between applications and the
computer hardware. It can be thought of as having three objectives:

o Convenience: An OS makes a computer more convenient to


use.
o Efficiency: An OS allows the computer system resources to be
used in an efficient manner.
o Ability to evolve: An OS should be constructed in such a way
as to permit the effective development, testing, and introduction
of new system functions without interfering with service.

 The Operating System as a User/Computer Interface


o The hardware and software used in providing applications to a
user can be viewed in a layered or hierarchical fashion, as
depicted in Fig. 2.1.
o The user of those applications, the end user, generally is not
concerned with the details of computer hardware.

1
EG 269 –Mwenya A., University of Zambia 2010

Fig. 2.1 Layers and views of a Computer system

o End user views a computer system in terms of a set of


applications.
 An application can be expressed in a programming
language and is developed by an application programmer.
o Machine instructions that are completely responsible for
controlling the computer hardware are referred to as utilities
programs.
 these assist in program creation, the management of files,
and the control of I/O devices.
o The most important collection of system programs comprises
the OS. The OS masks the details of the hardware from the

2
EG 269 –Mwenya A., University of Zambia 2010

programmer and provides the programmer with a convenient


interface for using the system.
o Briefly, the OS typically provides services in the following
areas:
 Program development: The OS provides a variety of
facilities and services, such as editors and debuggers, to
assist the programmer in creating programs –referred to as
application program development tools

 Program execution: A number of steps need to be


performed to execute a program. Instructions and data
must be loaded into main memory, I/O devices and files
must be initialized, and other resources must be prepared.
The OS handles these scheduling duties for the user.

 Access to I/O devices: Each I/O device requires its own


peculiar set of instructions or control signals for operation.
The OS provides a uniform interface that hides these
details so that programmers can access such devices using
simple reads and writes.

 Controlled access to files: For file access, the OS must


reflect a detailed understanding of not only the nature of
the I/O device (disk drive, tape drive) but also the
structure of the data contained in the files on the storage
medium. In the case of a system with multiple users, the
OS may provide protection mechanisms to control access
to the files.

3
EG 269 –Mwenya A., University of Zambia 2010

 System access: For shared or public systems, the OS


controls access to the system as a whole and to specific
system resources.The access function must provide
protection of resources and data from unauthorized users
and must resolve conflicts for resource contention.

 Error detection and response: A variety of errors can


occur while a computer system is running. These include
internal and external hardware errors, such as a memory
error, or a device failure or malfunction; and various
software errors, such as division by zero, attempt to access
forbidden memory location, and inability of the OS to
grant the request of an application. In each case, the OS
must provide a response that clears the error condition
with the least impact on running applications. The
response may range from ending the program that caused
the error, to retrying the operation, to simply reporting the
error to the application.

 Accounting: A good OS will collect usage statistics for


various resources and monitor performance parameters
such as response time. On any system, this information is
useful in anticipating the need for future enhancements
and in tuning the system to improve performance. On a
multiuser system, the information can be used for billing
purposes.

4
EG 269 –Mwenya A., University of Zambia 2010

 The Operating System as Resource Manager


o A computer is a set of resources for the movement, storage,
and processing of data and for the control of these
functions.The OS is responsible for managing these
resources.
o Fig 2.2 suggests the main resources that are managed by the
OS.A portion of the OS is in main memory. This includes the
kernel, or nucleus, which contains the most frequently used
functions in the OS and, at a given time, other portions of the
OS currently in use. The remainder of main memory contains
user programs and data. The allocation of this resource (main
memory) is controlled jointly by the OS and memory
management hardware in the processor.

Fig. 2.2 The OS as a Resource Manager

5
EG 269 –Mwenya A., University of Zambia 2010

o The OS decides when an I/O device can be used by a


program in execution and controls access to and use of files.
The processor itself is a resource, and the OS must determine
how much processor time is to be devoted to the execution of
a particular user program. In the case of a multiple-processor
system, this decision must span all of the processors.

 Ease of Evolution of an Operating System


o A major operating system will evolve over time for a number
of reasons:
 Hardware upgrades plus new types of hardware
 New services: In response to user demand or in
response to the needs of system managers, the OS
expands to offer new services.
 Fixes: Any OS has faults. These are discovered over the
course of time and fixes are made. Of course, the fix
may introduce new faults.

6
EG 269 –Mwenya A., University of Zambia 2010

Evolution of OS

 Serial Processing
o With the earliest computers, from the late 1940s to the mid-
1950s, the programmer interacted directly with the computer
hardware; there was no OS.
o Programs in machine code were loaded via the input device
(e.g., a card reader). If an error halted the program, the error
condition was indicated by the lights. If the program proceeded
to a normal completion, the output appeared on the printer.
o These early systems presented two main problems:
 Scheduling: Most installations used a hardcopy sign-up
sheet to reserve computer time. Typically, a user could
sign up for a block of time in multiples of a half hour or
so.
 Setup time: A single program, called a job, could involve
loading the compiler plus the high-level language program
(source program) into memory, saving the compiled
program (object program) and then loading and linking
together the object program and common functions. If an
error occurred, the user typically had to go back to the
beginning of the setup sequence. Thus, a considerable
amount of time was spent just in setting up the program to

7
EG 269 –Mwenya A., University of Zambia 2010

o This mode of operation could be termed serial processing,


reflecting the fact that users have access to the computer in
series.
 Simple Batch Systems
o Early computers were very expensive; therefore it was
important to maximize processor utilization. To improve
utilization, the concept of a batch operating system was
developed.
o In this scheme the user no longer has direct access to the
processor. Instead, the user submits the job on cards or tape to a
computer operator, who batches the jobs together sequentially
and places the entire batch on an input device, for use by the
monitor, its OS.
 Multiprogrammed Batch Systems
o Even with the automatic job sequencing provided by a simple
batch operating system, the processor is often idle. The problem
is that I/O devices are slow compared to the processor.
o Fig. 2.3 shows the approach known as multiprogramming, or
multitasking where the OS switches between jobs. It is the
central theme of modern operating systems

8
EG 269 –Mwenya A., University of Zambia 2010

Fig. 2.3 Multiprogramming Example

9
EG 269 –Mwenya A., University of Zambia 2010

 Time-Sharing Systems
o Developed due to need for an interactive computing facility i.e.
the use of a dedicated personal computer or workstation.
o That option was not available in the 1960s, when most
computers were big and costly. Instead, time sharing was
developed.
o Just as multiprogramming allows the processor to handle
multiple batch jobs at a time, multiprogramming can also be
used to handle multiple interactive jobs.
 In this latter case, the technique is referred to as time
sharing, because processor time is shared among multiple
users.
o In a time-sharing system, multiple users simultaneously access
the system through terminals, with the OS interleaving the
execution of each user program in a short burst or quantum of
computation.
 if there are n users actively requesting service at one time,
each user will only see on the average 1/n of the effective
computer capacity, not counting OS overhead
o Both batch processing and time sharing use multiprogramming.
The key differences are listed in Table 2.1.

10
EG 269 –Mwenya A., University of Zambia 2010

Table 2.1 Batch Processing Vs Time Sharing

11
EG 269 –Mwenya A., University of Zambia 2010

Varieties of OS

 Mainframe Operating Systems


o At the high end are the operating systems for the mainframes,
those room-sized computers still found in major corporate data
centres
o distinguish themselves from personal computers in terms of
their I/O capacity. A mainframe with 1000 disks and thousands
of gigabytes of data is not unusual: a personal computer with
these specifications would be odd indeed.
o Mainframes are also making something of a comeback as high-
end Web servers, servers for large-scale electronic commerce
sites, and servers for business-to-business transactions.
o The OS for mainframes are heavily oriented toward processing
many jobs at once, most of which need large amounts of I/O.
They typically offer three kinds of services: batch, transaction
(Multiprogramming) processing, and timesharing.
o An example mainframe operating system is OS/390, a
descendant of OS/360.
 Server Operating Systems
o One level down are the server operating systems. They run on
servers, which are very large personal computers, workstations,
or even mainframes.

12
EG 269 –Mwenya A., University of Zambia 2010

o They serve multiple users at once over a network and allow the
users to share hardware and software resources. Servers can
provide print service, file service, or Web service.
o Internet providers run many server machines to support their
customers and Web sites use servers to store the Web pages and
handle the incoming requests.
o Typical server operating systems are UNIX and Windows 2000.
Linux is also gaining ground for servers.

 Multiprocessor Operating Systems


o An increasingly common way to get major-league computing
power is to connect multiple CPUs into a single system.
o Depending on precisely how they are connected and what is
shared, these systems are called parallel computers,
multicomputers, or multiprocessors.
o They need special operating systems, but often these are
variations on the server operating systems, with special features
for communication and connectivity.

 Personal Computer Operating Systems


o Their job is to provide a good interface to a single user.
o widely used for word processing, spreadsheets, and Internet
access.

13
EG 269 –Mwenya A., University of Zambia 2010

o Common examples are Windows 98, Windows 2000, the


Macintosh operating system, and Linux.

 Real-Time Operating Systems


o Characterized by having time as a key parameter.
o For example, in industrial process control systems, real-time
computers have to collect data about the production process and
use it to control machines in the factory.
o Often there are hard deadlines that must be met. For example, if
a car is moving down an assembly line, certain actions must
take place at certain instants of time, if a welding robot welds
too early or too late, the car will be ruined. If the action
absolutely must occur at a certain moment (or within a certain
range), we have a hard real-time system.
o Another kind of real-time system is a soft real-time system, in
which missing an occasional deadline is acceptable. Digital
audio or multimedia systems fall in this category.
 Embedded Operating Systems
o Category of palmtop computers and embedded systems.
o A palmtop computer or PDA (Personal Digital Assistant) is a
small computer that fits in a shirt pocket and performs a small
number of functions.

14
EG 269 –Mwenya A., University of Zambia 2010

o Embedded systems run on the computers that control devices


that are not generally thought of as computers, such as TV sets,
microwave ovens, and mobile telephones.
o These often have some characteristics of real-time systems but
also have size, memory, and power restrictions that make them
special.
o Examples of such operating systems are PalmOS and Windows
CE (Consumer Electronics).
 Smart Card Operating Systems
o The smallest operating systems run on smart cards, which are
credit card-sized devices containing a CPU chip.
o have very severe processing power and memory constraints.
Some of them can handle only a single function, such as
electronic payments, but others can handle multiple functions on
the same smart card.
o Some smart cards are Java oriented. What this means is that the
ROM on the smart card holds an interpreter for the Java Virtual
Machine (JVM). Java applets (small programs) are downloaded
to the card and are interpreted by the JVM interpreter. Some of
these cards can handle multiple Java applets at the same time,
leading to multiprogramming and the need to schedule them.
o Resource management and protection also become an issue
when two or more applets are present at the same time. These

15
EG 269 –Mwenya A., University of Zambia 2010

issues must be handled by the (usually extremely primitive)


operating system present on the card.
OS Concepts

 The Process
o The concept of process is fundamental to the structure of
operating systems. Many definitions have been given for the
term process, including
 A program in execution
 An instance of a program running on a computer
 The entity that can be assigned to and executed on a
processor
 A unit of activity characterized by a single sequential
thread of execution, a current state, and an associated set
of system resources
o We can think of a process as consisting of three components:
 An executable program
 The associated data needed by the program
(variables,work space, buffers, etc.)
 The execution context of the program
 The execution context, or process state, is the
internal data by which the OS is able to supervise
and control the process.

16
EG 269 –Mwenya A., University of Zambia 2010

 Memory Management
o The OS, to satisfy these requirements, has five principal
storage management responsibilities:
 Process isolation: The OS must prevent independent
processes from interfering with each other’s memory,
both data and instructions.
 Automatic allocation and management: Programs
should be dynamically allocated across the memory
hierarchy as required. Allocation should be transparent
to the programmer.
 Support of modular programming: Programmers
should be able to define program modules, and to
create, destroy, and alter the size of modules
dynamically.
 Protection and access control: Sharing of memory, at
any level of the memory hierarchy, creates the potential
for one program to address the memory space of
another. The OS must allow portions of memory to be
accessible in various ways by various users.
 Long-term storage: Many application programs
require means for storing information for extended
periods of time, after the computer has been powered
down.

17
EG 269 –Mwenya A., University of Zambia 2010

o Typically, operating systems meet these requirements with


virtual memory and file system facilities.
 The file system implements a long-term store, with
information stored in named objects, called files. The
file is a convenient concept for the programmer and is a
useful unit of access control and protection for the OS.
 Virtual memory is a facility that allows programs to
address memory from a logical point of view, without
regard to the amount of main memory physically
available.
 Information Protection and Security
o Much of the work in security and protection as it relates to
operating systems can be roughly grouped into four
categories:
 Availability: Concerned with protecting the system
against interruption
 Confidentiality: Assures that users cannot read data for
which access is unauthorized
 Data integrity: Protection of data from unauthorized
modification
 Authenticity: Concerned with the proper verification
of the identity of users and the validity of messages or
data

18
EG 269 –Mwenya A., University of Zambia 2010

 Scheduling and Resource Management


o Any resource allocation and scheduling policy must consider
three factors:
 Fairness: Typically, we would like all processes that
are competing for the use of a particular resource to be
given approximately equal and fair access to that
resource. This is especially so for jobs of the same
class, that is, jobs of similar demands.
 Differential responsiveness: On the other hand, the OS
may need to discriminate among different classes of
jobs with different service requirements.
 Efficiency: The OS should attempt to maximize
throughput, minimize response time, and, in the case of
time sharing, accommodate as many users as possible.
• These criteria conflict; finding the right balance
for a particular situation is an ongoing problem
for operating system research.

19
EG 269 –Mwenya A., University of Zambia 2010

Windows

 Began with MS-DOS or PC-DOS developed by Microsoft for the first


IBM personal computer.
 The initial version, DOS 1.0, was released in August 1981.
o It consisted of 4000 lines of assembly language source code
and ran in 8 Kbytes of memory using the Intel 8086
microprocessor.
 In 1983, DOS supported a hard disk-based personal computer.
o a disk could contain only one directory of files, supporting a
maximum of 64 files.
 Beginning in the early 1980s, Microsoft began development of a
graphical user interface (GUI) that would be interposed between the
user and DOS. Microsoft’s intent was to compete with Macintosh,
whose OS was unsurpassed for ease of use. By 1990, Microsoft had a
version of the GUI, known as Windows 3.0, which incorporated some
of the user friendly features of Macintosh.
o It used to run on top of DOS.

 In 1993, Windows NT (3.1) was released with some GUI as Windows


3.0.
o NT exploits the capabilities microprocessors and provides
multitasking in a single-user or multiple-user environment.
o Was a new 32-bit OS with the ability to support older DOS and
Windows applications as well as provide OS/2 support.

20
EG 269 –Mwenya A., University of Zambia 2010

 So far,Windows 95 (an enhanced upgrade to Windows 3.1),Windows


98, 2000 (ME),XP,Vista and just recently Windows 7 have been
released

Operating System Organization

 Windows has a highly modular architecture.


o Each system function is managed by just one component of the
OS.
o Key system data can only be accessed through the appropriate
function. In principle, any module can be removed, upgraded, or
replaced without rewriting the entire system or its standard
application program interface (APIs).

21
EG 269 –Mwenya A., University of Zambia 2010

Fig. 2.4 Windows and Windows Vista Architecture


 The kernel-mode components of Windows are the following:
o Executive: Contains the base OS services, such as memory
management, process and thread management, security, I/O, and
interprocess communication.
o Kernel: Controls execution of the processor(s). The Kernel
manages thread scheduling, process switching, exception and
interrupt handling, and multiprocessor synchronization.
22
EG 269 –Mwenya A., University of Zambia 2010

o Hardware abstraction layer (HAL): Maps between generic


hardware commands and responses and those unique to a
specific platform. It isolates the OS from platform-specific
hardware differences.
 The HAL makes each computer’s system bus, direct
memory access (DMA) controller, interrupt controller,
system timers, and memory module look the same to the
Executive and Kernel components.
o Device drivers: Dynamic libraries that extend the functionality
of the Executive.
 include hardware device drivers that translate user I/O
function calls into specific hardware device I/O requests
and software components for implementing file systems,
network protocols, and any other system extensions that
need to run in kernel mode.
o Windowing and graphics system: Implements the graphical
user interface (GUI) functions, such as dealing with windows,
user interface controls, and drawing.

 The Windows Executive includes components for specific system


functions and provides an API for user-mode software. Following is a
brief description of each of the Executive modules:

23
EG 269 –Mwenya A., University of Zambia 2010

o I/O manager: Provides a framework through which I/O devices


are accessible to applications, and is responsible for dispatching
to the appropriate device drivers for further processing.
o Cache manager: Improves the performance of file-based I/O
by causing recently referenced file data to reside in main
memory for quick access, and by deferring disk writes by
holding the updates in memory for a short time before sending
them to the disk.
o Object manager: Creates, manages, and deletes Windows
Executive objects and abstract data types that are used to
represent resources such as processes, threads, and
synchronization objects.
 It enforces uniform rules for retaining, naming, and
setting the security of objects.
 The object manager also creates object handles, which
consist of access control information and a pointer to the
object.
o Plug-and-play manager: Determines which drivers are
required to support a particular device and loads those drivers.
o Power manager: Coordinates power management among
various devices and can be configured to reduce power
consumption by shutting down idle devices, putting the

24
EG 269 –Mwenya A., University of Zambia 2010

processor to sleep, and even writing all of memory to disk and


shutting off power to the entire system.
o Security reference monitor: Enforces access-validation and
audit-generation rules.
o Virtual memory manager: Manages virtual addresses,
physical memory, and the paging files on disk. Controls the
memory management hardware and data structures which map
virtual addresses in the process’s address space to physical
pages in the computer’s memory.
o Process/thread manager: Creates, manages, and deletes
process and thread objects.
o Configuration manager: Responsible for implementing and
managing the system registry, which is the repository for both
system wide and per-user settings of various parameters.
o Local procedure call (LPC) facility: Implements an efficient
cross-process procedure call mechanism for communication
between local processes implementing services and subsystems.
Similar to the remote procedure call (RPC) facility used for
distributed processing.

25
EG 269 –Mwenya A., University of Zambia 2010

Unix

 UNIX was initially developed at Bell Labs and became operational in


1970. Some of the people involved at Bell Labs had also participated
in the timesharing work being done at MIT’s Project MAC.
 Work on UNIX at Bell Labs, and later elsewhere, produced a series of
versions of UNIX. The first notable milestone was porting the UNIX
system from the PDP-7 to the PDP-11. This was the first hint that
UNIX would be an operating system for all computers.
 The next important milestone was the rewriting of UNIX in the
programming language C as opposed to Assembly Language. This
was an unheard-of strategy at the time because
o Memory (both RAM and secondary store) was small and
expensive by today’s standards, so effective use was important.
o Even though compilers had been available since the 1950s, the
computer industry was generally skeptical of the quality of
automatically generated code.
 The C implementation demonstrated the advantages of using a high-
level language for most if not all of the system code.Today, virtually
all UNIX implementations are written in C.
 Licenses for UNIX were provided to commercial institutions as well
as universities.The first widely available version outside Bell Labs
was Version 6, in 1976.The follow-on Version 7, released in 1978, is
the ancestor of most modern UNIX systems.

26
EG 269 –Mwenya A., University of Zambia 2010

 The most important of the non-AT&T systems to be developed was


done at the University of California at Berkeley, called UNIX BSD
(Berkeley Software Distribution), running first on PDP and then VAX
computers.

Fig. 2.5 Modern UNIX Architecture

27

You might also like