C/IL 102
Notes on Software, especially Operating Systems
Acknowledgement: Much of the material on this page is based upon
How Operating Systems Work
Recall that a computer program is a set of instructions that can be
interpreted and executed by a computer.
Software is a collective term for computer programs, although
it is also sometimes used to refer to stored data.
Software is commonly categorized as follows:
- Application Software:
provides you with a means to accomplish something that is not
inherently related to computers, but for which a computer
serves as a useful tool.
Examples of popular applications include
document preparation (MS Word),
presentation preparation (MS Powerpoint),
database management (various Oracle products),
accounting/financial management (Quickbooks),
web browsing (Mozilla Firefox),
and games.
- System Software:
In recent years, desktop and laptop PC's normally have come pre-loaded
with the most recent incarnation of the Microsoft Windows family
of operating sytems, the latest of which is Windows Vista, which
became available in 2007. However, many people still use its predecessor,
Windows XP.
Many corporate (and educational institution) computers
run some flavor of Unix (possibly Linux), which is also
popular among serious computer enthusiasts, who tend to view Windows
(and Microsoft products in general) with some disdain.
Apple Macintosh computers come pre-loaded with a flavor of Unix called
OS X.
Special-purpose computers, such as those that control microwave ovens,
have no need for an OS, because the set of functions they perform is narrow
and unchanging, and hence these functions are typically "hardwired" into the
electronic circuitry.
Computational devices that are designed to be more flexible, on the other
hand, run under the direction of operating systems. By "flexibile" we
mean that their behavior can be changed, either by upgrading (or adding new)
application programs or possibly even upgrading (or replacing) the OS itself.
Cell phones and personal digital assistants (PDAs)
utilize OS's, although they tend to be somewhat more rudimentary than the
OS's used on more powerful desktop/laptop computers.
Question: What does an operating system do?
Answer: At least two main things:
- It manages the hardware and software resources of the system, including
the processor, memory, and disk space. (On a cell phone, this list
would include the keypad, the screen, the address book,
the phone dialer, the battery, and the network connection.)
- It provides a stable, consistent way for application programs (and
users) to communicate with the hardware without having to know all
the details of the hardware (such as which brand/model of hard disk
or printer is attached).
One can categorize OS's based upon the kinds of computers they control
and the kinds of applications they support. Indeed, we can identify
four broad classes:
- real-time: used for controlling machinery, scientific instruments,
and industrial systems (e.g., factories, nuclear reactors).
This kind of OS typcially provides very little user interface
support or end-user utilities; rather, its purpose is to ensure
that "things happen" (in whatever environment it controls) in the
right sequence and at the right times.
- single-user, single-task: designed to manage a computer so that
one user can execute one program at a time. The Palm OS
for Palm hand-held computers is an example, as was
MS-DOS (Microsoft Disk Operating System), which ran on
"IBM-compatible" PC's in the early 1980's.
- single-user, multi-tasking: designed to allow a single user
to run multiple programs at the same time. MS Windows is an example,
This is more complicated than single-tasking because the various
executing processes must not be allowed to interfere with each
other (for example, by overwriting each other's data in RAM) and each
process must be given sufficiently many "processor cycles" (with
sufficient frequency) to continue doing its job. (If a media player
program is playing a music CD or a video on DVD, the processor
must devote some attention to it on a regular basis or else the
sound or image will become "choppy".)
- multi-user: designed to allow multiple users to run
multiple programs at the same time. This is more complicated
than single-user because care must be taken not to allow one
user's program to access another user's private data.
Examples include any in the Unix family of OS's,
including Linux.
Now we answer, in somewhat more detail, the question raised earlier:
What does an operating system do?
We can identify at least six categories of tasks:
- processor management: schedules processes for execution.
Typically, many processes are "in execution" concurrently, but the
CPU can be devoted to running (i.e., executing the instructions of)
at most one process at any moment in time.
(Under Windows XP, press CNTRL-ALT-DEL (at the same time) in order
to get the Windows Task Manager, which lists all the processes
running, how much RAM they're occupying, and what percentage of
CPU time they are consuming.)
Each process takes turns getting "time slices"
(on the order of thousandths of a second) during
which the CPU executes some of its instructions before switching
its attention to another process.
- memory management: decides where in RAM to store programs and
data currently in use (making sure not to allow one to overwrite
another).
- device management: handles input from the keyboard and
mouse, makes sure that print jobs are scheduled properly.
- storage management: maintains records about the files resident
on secondary storage devices (e.g., hard disk, memory sticks),
keeping track of where each file is stored and where "empty" space
exists for storing new files.
(Such records are stored on the storage devices themselves,
of course.)
- application interface: an operating system acts as a layer
between the hardware and application programs, allowing the latter
to issue commands and requests to the former without the latter
having to "know" all the details of how the former works.
A good analogy is the "interface" through which one drives an
automobile. Over the past fifty years, many advances have been made
in the "hardware" at the core of an automobile: the engine,
transmission, braking system. Yet the interface that a driver
utilizes has changed very little over those years: it consists mainly
of gas and brake pedals, a steering wheel, and a lever for changing
gears.
- user interface: similar to the item above, except this
allows a user (rather than an application program) to interact
with the hardware in a structured, consistent way.