What is an Operating System?
- Provide an environment in which programs and users can work.
- Extract problems that are common
to multiple programs and users on the system,
and provide the solutions to them,
so that programs and users do not have to.
- e.g. The programmer writing a program
does not need to know about the physical layout
of the hard disk - he wants to be able to work with a concept called "files"
(as does the user).
- Not wanting programmers to have to reinvent the wheel each time:
These are not questions to be solved by each programmer.
They have other things to do.
These are questions for the OS.
- File systems - Where does this file go on the physical disk?
What if it grows bigger than the slot initially assigned to it?
- User interfaces - If I move a window, how do I re-draw the
window underneath? What pixels do I set to draw the letter 'A'?
- Network utilities - provide API for applications to use.
- Bundling utilities so that users have many/most programs they
need already installed.
Editor, browser, calculator, image editor.
Could go on.
- Clever OS algorithms squeeze the most usage out of
slow machines and limited resources
- Wanting to run multiple programs on one machine,
ideally overlapping in time.
e.g. A web browser and a text editor. Take it for granted.
- Wanting multiple users to be able to share one machine
at the same time (web server, ssh to mainframe).
- HIDE the reality of the system from the programs and users.
- Hide the fact that my program is
scattered all over memory,
is being moved around in memory,
and is being swapped out to disk.
- Hide the fact that my file is physically
scattered all over the disk,
and is being moved around the disk.
- Hide the fact that my program shares memory with lots of
running system programs and multiple other user's programs,
all of which are being moved around.
- Hide the fact that my program is not actually running
constantly, but is actually getting little timeslices of the CPU,
in between it going off to service other programs.
Principles that an OS will work by
Principles will include things like:
- Respond to the user interface as quick as possible.
Everything else can wait.
- Only load into memory the absolute minimum that we need
to work with.
We can load more if and when needed.
For example, just load the initial code to display a program and its menus.
Don't load the code to handle specific menu items until they are called
(which often never happens).
- Only write to disk the absolute minimum we need to make the changes.
Example: Editing a 5 M file.
Added a few lines to the end.
- When deleting large areas of memory or disk, just put markers
start of block and end of block
showing it is free to be overwritten if and when needed in the future.
There is no need to actually go through every location
and scrub it clean.
Example: Delete a 10 G file.
See un-deleting files.
The whole history of Operating Systems / Computers
can be summarised as:
Never enough CPU speed.
Never enough memory (RAM).
Never enough disk space.
(Perhaps solved for PCs.
10 T now less than $300.)
Never enough disk space on reliable, redundant,
(Much more expensive. 10 T costs around $10,000.)
Never fast enough disk access.
Never enough screen size.
Never enough bandwidth.
Never enough battery life time.