9.7.6. Servers
Amoeba has a variety of servers for specific functions, including file management, directory management, object replication, and load balancing. All are based on objects and capabilities. Amoeba supports replicated objects via directories that contain capability sets. UNIX emulation is provided at the source code level, is based on POSIX, but is not 100 percent complete. The emulation is done by mapping UNIX concepts onto Amoeba ones and calling on the native Amoeba servers to do the work. For example, when a file is opened, the capability for the file is acquired and stored in the file descriptor table.
Mach has a single server that runs BSD UNIX as an application program. It provides 100 percent binary-compatible emulation, a great boon for running existing software for which the source code is not available. General object replication is not supported. Other servers also exist.
Chorus provides full binary compatibility with System V UNIX. The emulation is done by a collection of processes (like Amoeba) rather than by running UNIX as an application program (like Mach). However, some of these processes contain actual UNIX code, like Mach and unlike Amoeba. Like Amoeba, the native servers were designed from scratch with distributed computing in mind, so the emulation translates the UNIX constructs onto the native ones. Just as in Amoeba, for example, when a file is opened, a capability for it is fetched and stored in the file descriptor table.
A brief summary of some of the points discussed above is given in Fig. 9-28.
| Item | Amoeba | Mach | Chorus |
|---|---|---|---|
| Designed for: | Distributed system | 1 CPU, multiprocessor | 1 CPU, multiprocessor |
| Execution model | Pool processor | Workstation | Workstation |
| Microkernel? | Yes | Yes | Yes |
| Number of kernel calls | 30 | 153 | 112 |
| Automatic load balancing? | Yes | No | No |
| Capabilities | General | Only ports | General |
| Capabilities in: | User space | Kernel | User space |
| Threads managed by: | Kernel | Kernel | Kernel |
| Transparent heterogenity? | Yes | No | No |
| User-settable priorities? | No | Yes | Yes |
| Multiprocessor support | Minimal | Extensive | Moderate |
| Mapped object | Segment | Memory object | Segment |
| Demand paging? | No | Yes | Yes |
| Copy on write? | No | Yes | Yes |
| External pagers? | No | Yes | Yes |
| Distributed shared memory | Object based | Page based | Page based |
| RPC? | Yes | Yes | Yes |
| Group communication | Reliable, ordered | None | Unreliable |
| Asynchronous communication? | No | Yes | Yes |
| Intermachine messages | Kernel | User space/kernel | Kernel |
| Messages address to: | Process | Port | Port |
| UNIX emulation | Source | Binary | Binary |
| UNIX compatibility | POSIX (partial) | BSD | System V |
| Single-server UNIX? | No | Yes | No |
| Multiserver UNIX? | Yes | No | Yes |
| Optimized for: | Remote case | Local case | Local case |
| Automatic file replication? | Yes | No | No |
Fig. 9-28. A comparison of Amoeba, Mach, and Chorus.
9.8. SUMMARY
Like Amoeba and Mach, Chorus is a microkernel-based operating system for use in distributed systems. It provides binary compatibility with System V UNIX, support for real-time applications, and object-oriented programming.
Chorus consists of three conceptual layers: the kernel layer, the subsystems, and the user processes. The kernel layer contains the microkernel proper, as well as some kernel processes that run in kernel mode and share the microkernel's address space. The middle layer contains the subsystems, which are used to build provide operating system support to user programs, which reside in the top layer.
The microkernel provides six key abstractions: processes, threads, regions, messages, ports, port groups, and unique identifiers. Processes provide a way to collect and manage resources. Threads are the active entities in the system, and are scheduled by the kernel using a priority-based scheduler. Regions are areas of virtual address space that can have segments mapped into them. Ports are buffers used to hold incoming messages not yet read. Unique identifiers are binary names used to identifying resources.
The microkernel and subsystems together provide three additional constructs: capabilities, protection identifiers, and segments. The first two are used to name and protect subsystem resources. The third is the basis of memory allocation, both within a running process and on disk.
Two subsystems were described in this chapter. The UNIX subsystem consists of the process, object, streams, and interprocess communication managers, which work together to provide binary compatible UNIX emulation. The COOL subsystem provides support for object-oriented programming.
PROBLEMS
1. Capabilities in Chorus use epoch numbers in their UIs. Why?
2. What is the difference between a region and a segment?
3. The Chorus supervisor is machine dependent, whereas the real-time executive is machine independent. Explain.
4. Why does Chorus need system processes in addition to user processes and kernel processes?
5. What is the difference between a thread being SUSPENDED and it being STOPPED? After all, in both cases it cannot run.
6. Briefly describe how exceptions and interrupts are handled in Chorus, and tell why they are handled differently.
7. Chorus supports both semaphores and mutexes. Is this strictly necessary? Would it not be sufficient to support only semaphores?
8. What is the function of a mapper?
9. Briefly describe what MpPullIn and MpPushOut are used for.