Operating Systems
(material from Schneider &
Gersting An Invitation to Computer Science Ch 7)
The Naked Machine : Computers would be very hard to use if all programming
had to be in machine code and all programs had to be "hand-loaded" into the
computer's memory. In the beginning all programming was done this way which
was an inefficient use of hardware and time consuming for the programmer.
For example to execute a program on a naked machine a programmer would have
to
- code the program in binary machine code
- represent all data in binary notation
- hand load the code into consecutive memory locations on memory
- one memory location at a time
- hand load the data into memory making sure the addresses where the
data was located agreed with the corresponding addresses given by the code
- start the program by inserting the first address of the code into
the PC register
Over time programs were written to ease some of the programming burden. Simple
programs called loaders were written to load code into the memory
of a computer. These evolved into operating systems. Operating systems
- hide the user from messy and unnecessary details of underlying hardware
- present system information in meaningful way that does not requires
in-depth knowledge of internals
- allow easy access to system resources
- prevent accidental or intentional damage to hardware, programs and
data
Operating System : One or more programs that
controls the allocation and usage of hardware (e.g. memory, CPU,
disk space, peripheral devices) software resources (e.g. files containing
data and/or code) and functions as an interface between the user,
application programs, and the hardware. Examples: MS-DOS 6.2, Windows 3.1
(GUI), Windows98, Windows XP, Unix
The interface to an operating system is either "command
line" (e.g. MS-DOS) where the user types in commands or "graphical user interface" (GUI) like Windows where
the user uses a pointing instrument (e.g. mouse) to click on icons etc.
Today when you power on a computer,
a small hardwired bootstrap loader program starts
the process of loading the O/S "kernel" into main memory where
it permanently resides (until the power is turned off). The entire O/S does
not reside in memory at one time - it's too big. Instead programs and utilities
belonging to the O/S are swapped into and out of memory as needed.
Operating Systems have a number of functions
- User Interface: An operating system provides a "user-friendly" interface
making the computer easier to use. There are text based command line operating
systems (e.g. MS-DOS, Unix) or graphical user interfaces (GUI) operating
systems (Windows)
- File Handler: An operating system keeps track of files (data and code).
This includes mapping logical file names (e.g. h:\comp150\hello_world.exe)
to actual physical locations on the hardware.
- Resource Handler: An operating system needs keep track and control
systems resources (peripherals) like printers or other input devices.
- Dispatcher/Scheduler : An operating system manages the execution of
programs. This generally includes maintaining a queue of applications (programs)
to be run, loading and executing those applications when system resources
become available. Programs are either Running, Ready, or Waiting
- Efficient Resource Allocation : An operating system manages system
resources to increase "through-put" maximizing the useful work done by a
computer
- System Security and Protection : An operating system controls access
to system resources (e.g. files or storage devices) to prevent accidental
or un-authorized access
- Safe Use of Resources : An operating system protects the computer
from competing applications that might tie-up the computer in deadlock
situation.
Historical Overview of Operating Systems
- 1st generation- No Operating System. Users
loaded and executed programs by hand
- 2nd generation - Batch Processing Systems
- Operating System maintained a queue of jobs submitted by users. Each job
was run to completion before the next job was started. Only user interaction
with system was to submit job and pick up results. Turn-around time would
be hours or even days.
- 3rd generation - Time Sharing Systems and Interactive
Computing : Operating System could seemingly execute a number of jobs
at once. Multiple programs were loaded into memory at one time with the operating
system allowing each to execute for a small "time slice". Due to speed of
the hardware, this gave the appearance that the computer was executing multiple
programs at once. Time-sharing allowed programs that permitted the user to
directly interact with the program giving the appearance that the user had
the resources of the entire computer to him/herself.
- 4th generation - Network Operating Systems
- Operating System manages not only resources of a computer but also the resources
of a network. The operating system has the ability to interface with other
computers and interface with the resources found on the network. In some
sense the operating system does not reside on any one computer but is distributed
over the network.
Return to Comp 150 HomePage