Transcript Document

Software: The Operating System
•
•
•
Software is another term for computer program.
The operating system is important software that comes with your computer
There is a whole field of computer science concerned with the study of operating
systems
•
•
The operating system is the software that enables you use a computer
An operating system manages both the computer's hardware and software for
you.
It allows you use the computer by providing a user interface which enables you
give the computer commands. There are 2 kinds of user interface:
Graphical user interfaces (GUIs) are very popular nowadays. A GUI allows you
use a mouse to select commands from menus usually displayed in windows on the
screen.
MS-Windows and the Macintosh operating system (Mac OS) interface are widely
used GUIs
A command interpreter is a user interface program that displays a prompt on the
screen and the user enters a command using the keyboard.
Note that many systems provide both GUIs and command interpreters. So, on a
Unix system, you may use the Unix command interpreter or a windows-based GUI
- e.g. X-windows. On a personal computer you may to choose to use MSWindows or Command Prompt.
•
•
•
•
•
Comp 1001: IT & Architecture - Joe Carthy
1
OS Development - History
•
•
•
•
•
•
•
•
•
•
Computers and Operating Systems: Shared History
Early OS were not designed as such - software was developed as the need arose
and eventually OS systems “emerged”
Numerous different types of computers were manufactured by many computer
companies
Each manufacturer’s hardware was different from that of their competitors.
For this reason, traditionally, each computer type had its own operating system
developed for it.
This is because the operating system was totally dependent on the hardware of the
computer it was to manage.
The operating system could only be used on the particular machine it was
designed for.
This meant that if you bought a different type of computer, you had to learn how to
use a new operating system.
While this may have suited manufacturers, who did not want you to buy a
competitor's machine, it certainly did not suit users.
For example, Digital developed the VMS operating system for their VAX range of
computers and IBM developed the MVS, VM and other operating systems for their
mainframe series of computers.
Comp 1001: IT & Architecture - Joe Carthy
2
OS Development - History
•
•
•
•
•
•
•
•
•
•
The Unix Operating System
In the 1970’s a new operating system called Unix was developed at Bell Labs.
Unix was designed to be a portable.
This meant that it could be moved from one type of computer to another different
type of computer which used different hardware, without too much difficulty.
Unix has to be tailored for each machine, but it is designed to make this tailoring
relatively straightforward
By the late 1980's, Unix had been implemented on every common make of
computer, from the Digital VAX to IBM mainframes, from the humble
microcomputer to powerful supercomputers
It is the only operating system that has been implemented on such a diverse range
of hardware platforms.
As a result, Unix and more often Linux (a variant of Unix) is now one of the most
commonly used operating systems in the world
It is very commonly used by Computer Scientists
Linux is free and comes with a wealth of software and software development tools
Comp 1001: IT & Architecture - Joe Carthy
3
OS Development - History
•
•
•
•
•
•
•
•
•
PC Operating Systems
In the microcomputer world, the MS-DOS operating system was very widely used
on IBM microcomputers (PCs) and their clones.
When IBM introduced their PC to the market in the early 1980s, many of their
competitors in effect copied the machine producing IBM compatibles or clones.
Their competitors then acquired the same operating system for the clones, from a
company called Microsoft who had developed the operating system for IBM!
The IBM PC operating system was called PC-DOS while that of its clones was
called MS-DOS. For practical purposes they were almost identical.
MS-DOS became the most widely used operating system in the 1980/90s since
there were hundreds of million PCs in use around the world using MS-DOS.
In the mid-1980s Apple developed the Macintosh with the a successful GUI based
on one developed by Rank Xerox.
The Macintosh GUI with its WIMP (Windows, Icons, Mouse, Pull-down menus)
technology introduced GUIs as the design paradigm of choice
Microsoft then replaced MS-DOS by their Windows (GUI-based) operating system.
Numerous versions of Windows have been released over the years: e.g. Windows
95, Windows 98, Windows ME, Windows 2000, Windows NT and Windows XP.
Comp 1001: IT & Architecture - Joe Carthy
4
OS Components
•
User Interface
– Allows you use the computer
•
Program Execution Subsystem
– Allows you run programs
– Manages the computers memory
•
Filing Subsystem
– Allows you save/retrieve files on disk
– Manages disk storage (CD/DVD)
•
I/O Subsystem
– Carries out ALL I/O for ALL programs
• Reads from keyboard
• Displays information on screen
• Reads/Writes files
Comp 1001: IT & Architecture - Joe Carthy
5
OS Components
•
Memory Management Subsystem
•
Arranges for programs to share memory. For example, a multi-user system running
4 user programs, might have its memory shared as illustrated in the figure below
•
A memory map as shown in the figure is a simple illustration of how memory is allocated
•
Note that the operating system itself is a program and so it must also be stored in
memory and that it occupies a significant portion of memory
•
It also occupies a significant amount of disk storage space
•
It is important to be aware of the fact that the operating system, in managing the
computers resources, uses a significant amount of those resources itself.
•
The resources are CPU time, memory space and disk storage space
Comp 1001: IT & Architecture - Joe Carthy
6
OS Components: Memory Manager
Use r 1
C ode
Un u se d
Use r 4
C ode
Use r 3
C ode
Simple Memory Map
Use r 2
C ode
O pe rati n g
S yste m
C ode
Comp 1001: IT & Architecture - Joe Carthy
7
OS Components: Memory Management
•
•
•
•
•
•
•
•
•
A fundamental problem with computing systems is the lack of sufficient RAM
capacity to store very large programs or a large number of programs
As RAM capacity increases (doubles every 1.5 years approximately), so too, does
program size, including the size of the operating system.
A simple solution to this problem is to use disk storage to store portions of
programs not currently required by the processor and to swap information between
disk and RAM as it is required by the processor.
The disadvantage of this solution is that it slows down program execution time
given the time it takes to access disk storage (100,000 times slower than
accessing RAM).
One strategy called swapping, swaps entire programs between disk and RAM
for execution.
When a program has been swapped into RAM it can execute for a while and it is
swapped out to disk and the next program is swapped into RAM.
This allows you execute many more programs than you have RAM capacity to
cater for.
However, swapping does not allow you write programs larger than the available
RAM
Virtual Memory (which uses disk storage) solves this problem
Comp 1001: IT & Architecture - Joe Carthy
8
OS Components: Virtual Memory
•
A virtual memory system employs disk storage to provide the illusion that a
machine has a very large RAM which is called its virtual memory.
•
In this manner, a machine which has say 256 megabytes of actual RAM, can
operate, as is if it had several gigabytes of RAM
•
The trick is to store much of the information on disk and copy it into RAM as it is
required.
•
The operating system and memory management hardware keeps track of what is
stored in RAM and what is stored on disk, transferring information from disk as it is
required.
•
Information is usually transferred in small units called pages, the technique being
referred to as paging.
•
Virtual memory may be visualised as a large linear address space, much larger
than the actual physical address space, as illustrated in the figure below
•
A mapping function is required to map addresses between the two address spaces
Comp 1001: IT & Architecture - Joe Carthy
9
OS Components: Virtual Memory
0
0
Mappi n g
Fu n cti on
4 Mb
Ph ysi cal Me m ory
1 Gb
Vi rtu al Me m ory
Comp 1001: IT & Architecture - Joe Carthy
10
OS Components: Booting a Computer
•
•
The question arises as to how the operating system gets started? Remember, this
is the software that allows you use the computer
In order for any program to execute, it must be in the computers memory. But the
RAM of a computer loses its contents when the computer is switched off
•
How then is the operating system loaded into RAM and executed when a computer
is switched on?
•
The answer lies in using Read-Only Memory or ROM which retains its contents
permanently
•
The operating system itself is not stored in ROM. There is normally only a very
small amount of ROM available and it would not be large enough to hold an
operating system
•
Also, since its contents cannot be modified, it would not be possible to correct any
errors (bugs) in the software that unfortunately arise in complex programs like
operating systems. Thus it would not be a good idea to store the operating system
in ROM, even if it was possible
•
Instead, what happens is that a small program is stored on the ROM which is used
to get the operating system loaded and executed
Comp 1001: IT & Architecture - Joe Carthy
11
OS Components: Booting a Computer
•
The operating system code is stored on disk.
•
The ROM program loads a part of the operating system, called the bootstrap
program from a fixed location on disk (called the boot block) into RAM and
switches control to this program.
•
This bootstrap program in turn loads the rest of the operating system from disk into
RAM and switches control to it.
•
This process is called bootstrapping (booting) after the notion of pulling yourself
up by your boot laces!
•
One advantage of this technique, is that it means that the same computer can use
a different operating system by placing an appropriate bootstrap program in the
boot block for the operating system you wish to boot up.
•
In addition, the ROM contains self-test code to ensure that the hardware is
functioning properly when the machine is switched on. This code is called poweron self test code (POST code)
Comp 1001: IT & Architecture - Joe Carthy
12
OS Components: Programming Support
•
In order to write programs, language translators such as compilers, interpreters
and assemblers are required.
•
These translators have to have knowledge of the operating system in order to
produce machine code programs that can be executed by the operating system.
•
In addition programs called linkers and loaders are used to allow external
subprograms such as library functions and system calls to be invoked from a
program.
•
Linkers and loaders arrange for the external subprograms to be integrated with a
program and look after the loading of the program into a suitable area of memory.
•
Such software may come with an operating system or be purchased separately. In
either case, it is essential to have such software if users intend to write computer
programs
•
Linux provides a range of compilers and interpreters e.g. C compiler, Perl
interpreter.
Comp 1001: IT & Architecture - Joe Carthy
13
Review Questions
•
What is an OS ?
•
What are the main components of an OS ?
•
Name 3 Operating Systems including at least one non-MS OS
•
What is Virtual Memory and why is it used ?
•
Can a CPU run 2 programs at the same time ?
•
What is a GUI ? What does WIMP mean ?
•
What is a command interpreter ?
•
Explain what happens when a computer is booted up.
•
Why is Rom required for booting ?
Comp 1001: IT & Architecture - Joe Carthy
14