In any computer
system we have:
- hardware
devices
- application
software
Such a system has
one major flaw: There is no way for
application software written by one vendor to
be aware of software in the same system
written by another vendor. When two pieces of
software in the same system are not aware of
each other, it is only a matter of time
before they clash in some way resulting in
the subsequent incorrect operation of one or
both programs. This is clearly not
acceptable.
The solution is to
define a piece of software which manages
resources in a system. This is the operating
system. Programs are written so that they request
resources from the OS which grants or denies
the requests and allocates resources to the
programs.
The other problem
with this system is the potential pile-up of
redundant code. The software required to
interface devices at the hardware port level
may require many instructions to perform just
one operation. This operation may be
performed by a program many times which is
when we put that code into a procedure. This
operation will also be performed by many
programs, but they cannot share each other's
procedures because they do not know about
each other. Instead they share the OS
procedures for accessing devices: One call
intruction will result in the code being
executed to perform a high-level operation.
The interface to the collection of such
procedures needs to be held constant so that
applications can depend upon the structure of
the interface. This interface is an API.
There are many benefits to an API, all
resulting from smaller application programs:
- reduced
application development time
- less code
to write means less bugs
- less disk
and memory space used
The purpose of an
Operating System is therefore:
- to manage
system resources on behalf of
multiple software entities
- to provide
a higher-level interface to the
hardware devices in the system