html> Operating Systems Concepts

Operating Systems Concepts

Processes

A process is "a program in execution." It has an address space, and a set of resources to which it has access, such as files, registers, related processes, and more, and other program information. A process is the set of all of this information necessary to run a program.

While I am lecturing, your laptop has several processes running: you have an editor in which your are ostensibly taking notes on my lecture, your Facebook page, in which your are posting pictures of your winter break, and a chat window, in which you are typing to your (possible) significant other. The operating system must keep each of these processes running, as well as background processes that might be fetching emails, or upgrading your word processor.

The operating system provides calls that deal with the creation and termination of processes. Generally, a new process is created as a sub-process of an existing one.

Sub-processes displayed by pstree.

Processes are associated with particular users who started them, and with groups the user belongs to. There is often a specially privileged user: in UNIX, it is the superuser, and in Windows, the administrator. In The Matrix, he is called Neo.

Address Spaces

An address space.

Two purposes:

  1. Protect programs from stomping on each other's memory.
  2. Extend the memory available to a single program: the address space may be larger than the machine's physical memory.

Files

The file system hides the messiness of disk, CD, cloud drive, memory stick, etc. details from the application programs: they can just write and read files from a location in the file system hirarchy.

A possible file system hierarchy

A good file system allows mounting of devices at a certain point in the directory structure. So, for instance, a memory stick could be mounted as /memstick. Furthermore, special files can be mounted at places in the file system to allow programs to treat printers, modems, and other devices as files.

Finally, pipes are a sort of pseudo-file, used to connect the output of one program to the input of another.

A UNIX pipeline

Input/Output

Obviously, it is vital that computers be able to accept input from humans and show humans their output. Some of this can be dealt with by files, as above. But in many cases, as with a graphical display or a mouse, files are not a good abstraction for dealing with these devices. Operating systems provide services like device drivers to deal with these situations.

Protection

People often want to protect the information they put on computers from competitors, foreign governments, Russian hackers, disgruntled ex-spouses, their boss, and so on. Operating systems typically provide some form of protection.

Simple example: UNIX protection sets owner, group and other read, write, and execute bits on every file. For example:
rwxr-xr--
means that the owner of the file can read, write and execute (run) it, the owner's group members can read an execute it, and all other system users can only read it.

The Shell

A Bash shell

Happy and you know it. MS-DOS emulator

Ontogeny Recapitulates Phylogeny

Frankly, I think the authors could have done without the Darwinian reference here, since this principle has been abandoned in modern biology. But their point that computer technologies may be "dead" at one point in time but "alive" at another is sound. They give the example of CPU caches: so long as the on-board CPU memory can be accessed much faster than RAM, we will have caches. If RAM technology speeds up significantly, they may disappear. But if the CPU jumps ahead again, they will make a comeback. It is important to understand history, and why certain concepts fell out of favor, and why they might come back into favor.

Large Memories

Most powerful computer in the early 1960s had 128K of RAM. The history of RAM was recapitulated on the first minis, and then again on the first micros.

Protection Hardware

The first mainframes had no protection hardware. Then it was added.
The first minicomputers had no protection hardware. Then it was added.
The first microcomputers had no protection hardware. Then it was added.
The "wheel of reincarnation" spins fast in the computer industry!

Disks

One directory to many back to one. (CPM)

Virtual Memory

Similarly, virtual memory first appeared on mainframes, later on minis, and finally on micros.

"In these developments, we see ideas invented in one context and later thrown out when the context changes... Only to reappear the context often a decade later. For this reason this book we will sometimes look at ideas and algorithms that may seem dated on today's gigabyte PCs, but which may soon come back on embedded computers and smartcards."

Credits