Dr. Mark Humphrys

School of Computing. Dublin City University.

Online coding site: Ancient Brain

coders   JavaScript worlds

Search:

Free AI exercises


Introductory Notes




What is an Operating System?

  1. 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:
      • 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 to be solved by each programmer. They have other 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. Editor, browser, calculator, image editor. Could go on.

  2. 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).

  3. 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:

  1. Respond to the user interface as quick as possible. Everything else can wait.

  2. 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).

  3. 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".

  4. 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.
    See un-deleting files.




"Never enough"

The whole history of Operating Systems / Computers can be summarised as:

"Never enough".

  1. Never enough CPU speed.
  2. Never enough memory (RAM).

  3. Never enough disk space on personal machine.
    Perhaps solved. 10 T now less than €200.

  4. Never enough disk space on server.
    File system must be reliable, redundant, always-on, 24/7 in-use, heavy-use. Much more expensive.
    We cannot yet disregard disk space on servers. If a user wants to put terabytes on a server, still very expensive.
    If a user wants to put 100 G on a shared server, there are affordable VPS packages.

  5. Never fast enough disk access.

  6. Never enough screen size.
    No real solution!

  7. Never enough bandwidth.
    sftp editing off remote sites still not fast enough.

  8. Never enough battery life time.
    Still never enough.



ancientbrain.com      w2mind.org      humphrysfamilytree.com

On the Internet since 1987.      New 250 G VPS server.

Note: Links on this site to user-generated content like Wikipedia are highlighted in red as possibly unreliable. My view is that such links are highly useful but flawed.