Introductory Notes
What is an Operating System?
- Provide an environment in which programs and users can work.
- To be precise, extract the problems that are common
to all programs or users on the system,
and provide the solutions to them,
so that programs and users can get on with doing
the real work.
- For example, the programmer writing a program
does not normally need to know about the physical layout
of the hard disk - he wants to be able to work with "files"
(as does the user).
- Not wanting PROGRAMMERS to have to REINVENT THE WHEEL each time:
- 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'?
These are not questions for each programmer.
They have better things to do.
These are questions for the OS.
- Network utilities - provide API for applications to use.
- Bundling utilities so that USERS have many/most programs they
need already installed.
Any utility that 90 percent of users need
ends up bundled with the OS.
Question - Are these "part of OS" or not?
- 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 (mainframes and servers).
Most people have their own CPU now,
but still share CPUs via web servers and file servers.
Often you may have both - a CPU in the client on your desk,
and also running processes on a shared CPU on a mainframe/server.
- HIDE the reality of the system from the programs and users.
- Hide the fact that my program is scattered all over memory,
and is even being constantly moved around in memory.
- Hide the fact that my file is physically scattered all over the disk
(or even multiple disks),
and is even 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 constantly 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.
Press "Save".
- When deleting large areas of memory or disk, just put markers
at the
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.
The whole history of Operating Systems / Computers
can be summarised as:
"Never enough".
Never enough CPU speed.
Never enough disk space.
Never fast enough disk access.
Never enough memory.
Never enough screen size.
Never enough bandwidth.
Never enough battery life time.