Mach

Mach is a microkernel-based operating system. All of its UNIX-specific code are moved to the user-mode servers, only leaves few necessary abstractions or features inside the kernel. This resulted that many operating systems could run on top of Mach like 202204071131# without much hassle.

Mach obliges the Object-Oriented Programming principle (OOP) where it treats all components in it as an object.

Components

  • Task: an execution environment that provides the basic unit of resource allocation. It consists of a virtual address space and protected access to system resources via ports, and it may contain one or more threads.
  • Thread: the basic unit of execution and must be run in the context of task where it inherits the task’s address space, ports, memory etc. The resources are shared among the threads. Threads could use 202204222158# for communication.
  • Memory Object: a source of memory which could be mapped into any tasks’ address spaces.
  • 202204222158# includes some other components such as Port, Port Set and Messages

Networking

See 202203021733#

CPU Scheduler

Mach maintains two thread queues: local and global queue. The threads in the local queue have higher priority than those in the global queue. These queues locked when there are incoming threads.

Mach itself maintain a list of idle processors.

It uses a flexible time quantum which will be adjusted accords to the current total number of threads in the system.

Memory management

202206031311#

Error handling

There are error handlers, one for each thread, in Mach. The thread and its error handler will communicate using message passing#, and the handler will decide whether to resume or terminate the thread.

Links to this page
  • Mach’s Networking

    #202203021657 concentrates its efforts on utilising its communication facilities, which is message-passing. This resulted in a blending of memory and 202204222158# where Mach could be used for distributed and parallel programming.

  • Mach’s Interprocess Communication (IPC) Facility

    To receive messages, every object in Mach, upon creation, must have a port where those messages could send to and queue at. If the queue is full, the sender could abort the send operation and then wait for its turn when the queue is once more available for queuing, or the kernel could deliver that message on behalf of the sender. The port creation share similarity with standard PID concept in UNIX. If the port specified in message# cannot be translated into internal port data structure address, it will then be passed to 202204231514# from the kernel.

  • Mach User Interface

    #202203021657’s user interface is similar to 4.3 BSD.

  • Mach Memory Management

    Unlike monolithic kernels such as 202204081225, #202203021657 relies on user-level memory managers instead of kernel-level virtual memory pager. Following the OOP principle, it treats memory objects like all other components in the system. These objects are fairly independent of the kernel since there is no assumption made on their contents and importance.

#operating-system #oop #multithreading