Mach (kernel)
Mach is an operating system kernel developed at Carnegie-Mellon University to support operating system research, primarily distributed and parallel computation.
Mach developed from the realization that all modern operating systems shared a number of features in common, or wanted to. These included:
- support for multiple applications using multitasking
- threads which can be thought of as parts of an application, or mini-applications which then multitask
- multi-processor support, in a single machine or over a network
- interapplication communications, sending messages directly between applications
- memory protection and safety
At the time, in the early to mid-1980's, any number of projects were attempting to address one of these problems. This typically meant taking an existing OS - often BSD - and modifying parts of it. After each modification the OS was built, the machine rebooted, and the new change was tested. There were a number of problems with this approach, not the least of which was that even minor problems would cause the entire machine to crash.
Mach explored the concept that we now refer to as a microkernel. Instead of having all of the code for the operating system in a single large program (called the kernel), the majority of the code would instead be located in libraries and run just like other programs. The kernel's job was reduced from essentially "being" the OS, to maintaining the parts that made it up and scheduling their access to hardware.
In theory this meant that changes to the OS required nothing more than a re-loading of that single library, as opposed to re-building and rebooting the entire OS. Only work on the Mach kernel itself would require such a step, and since Mach was small, it should be much easier to maintain.
Mach is not an operating system on its own, and is largely unusable without such a set of libraries. And those libraries do not exist. In order to get some sort of usable system up and running, the Mach authors ported BSD onto the Mach kernel in a quick-n-dirty fashion: instead of breaking down BSD into parts and building each of them as a library, they simply compiled the entire kernel into one library and ran it.
With this library running (effectively) beside the other applications, performance was abysmal. Every call from a user application, say to get the time, required the message to be sent to the kernel (an expensive operation known as a context switch), which would then send the request to the Unix library with another context switch - and then repeat it all again for the response! Thus Mach, through no real fault of its own, was generally considered to be very powerful, but increadibly slow.
Work over the next decade managed to improve the performance of these messages many times, to the point where the performance of late Mach-like OS's was in fact often better than the BSD's they were based on. However by this point in time the academic world had largely lost interest in OS research, and Mach's promise remains unfullfilled.
Work on Mach took place for a number of years at CMU, but eventually became dormant when many of the players involved left school to work in industry. Mach was briefly revived at the University of Utah in the mid-1990s and produced Mach 4 [1] with significant improvements, before once again becoming dormant.
At one time it was thought that Mach would slowly take over the entire operating system universe, but time has proven this to be false. Perhaps the biggest reason for the general failure of Mach can be blamed on "lazyness": everyone seemed to think it was someone else's job to deliver the library-based OS, and no one ever did. The largest effort to date is the HURD, but the HURD is now about a decade overdue.
Meanwhile several vendors took practical approaches to using Mach. The BSD (or other) layer was run directly inside the kernel (thus avoiding lots of context switches) which resulted in reasonable performance while still retaining the advantages of multi-processing and an easy-to-use threading model. However even these advantages have been eroded as the various Unix vendors worked to provide them in their own products.
Versions of Mach-based OS's of this ilk were found in OSF/1, NEXTSTEP, and IBM's OS/2 for the RS6000-based machines - all of which are dead. However the last laugh happened more recently when Apple selected OpenStep to replace the MacOS, which is in fact an upgraded version of NEXTSTEP. In this form Mach is now the most used Unix system in the world.