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
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.