Session 6: Process fundamentals

Textbook: Section 2.1

Minix hierarchy
Process table

Minix hierarchy

A modern operating system fulfills a variety of functions:

This isn't a clean division - file management, for example, is just a very complicated way of interfacing with the disks - but it divides the operating system up into four pieces of comparable size. It's the division that Minix follows, and that we'll follow too.

In fact, Minix is extremely hierarchical in its design. It's built in four layers.

Each layer is basically independent of the others, with occassional communication occurring between programs on adjacent layers.

Process management is at the lowest layer, because processes are very useful for building the rest of the operating system: Each different piece of the operating system can run as a separate process, independent of the others. This leads to a very clean division of the overall operating system.

Here's a picture of the processes within Minix.

layer 0    PROCESS MANAGEMENT

layer 1  disk  clock  keyboard ...
         task  task    task

layer 2    memory       file
            mgmt       system

layer 3 user user user user user ...
        proc proc proc proc proc

This way of organizing an operating system is called a microkernel architecture - that is, we build the smallest possible kernel, and then have different pieces working on top of it. This stands in contrast to the monolithic architecture architecture, employed by all ancient operating systems (and also Linux, which isn't ancient): In this architecture, almost all the OS functions are handled within the same process. By having the same process handle everything, you get a slightly smaller and slightly more efficient system. But you lose on understandability and flexibility. The microkernel architecture is widely considered superior in the modern era, when squeezing every last drop of performance from a chip is no longer a major issue.

Anyway, Chapter 2 of the book, and topic that we'll talk about for the next couple of cycles, is all about process management.

Process table

We've already seen that Posix allows a program to generate any number of processes. This means that it needs to be able to handle a very large number of processes - at least dozens and possibly hundreds of them. One thing that an operating system needs to do, therefore, is to keep track of all the processes that are running on the system. To do this, the operating system maintains a process table.

The process table is very simple data structure: It's a large array of structures. Each structure containts several pieces of data. Some of the pieces of data associated with a process include:

(Actually, in Minix, the process table is a little more complicated, because several processes need information about individual processes - the process manager, the memory manager, and the file system. So each has its own process table with the data it needs.)