OS X Kernel Architecture
The foundation layer of Darwin and OS X is composed of several architectural components, as shown in the figure. Taken together, these components form the kernel environment.
- In MAC OS, the kernel environment contains much more than the Mach kernel itself.
- The MAC OS kernel environment includes the Mach kernel, BSD, the I/O Kit, file systems, and networking components.
- Also, Because MAC OS contains three basic components (Mach, BSD, and the I/O Kit), there are also frequently as many as three APIs for certain key operations.
- In general, the API chosen should match the part of the kernel where it is being used, which in turn is dictated by what your code is attempting to do.
- Mach manages processor resources such as CPU usage and memory, handles scheduling, provides memory protection, and provides a messaging-centered infrastructure to the rest of the operating-system layers.
- Moreover, The Mach component provides:
- untyped interprocess communication (IPC)
- remote procedure calls (RPC)
- scheduler support for symmetric multiprocessing (SMP)
- support for real-time services
- virtual memory support
- support for pagers o modular architecture
- Above the Mach layer, the BSD layer provides “OS personality” APIs and services.
- Also, The BSD layer is based on the BSD kernel, primarily FreeBSD.
- The BSD component provides:
- file systems
- networking (except for the hardware device level)
- UNIX security model
- syscall support
- the BSD process model, including process IDs and signals
- FreeBSD kernel APIs
- many of the POSIX APIs
- kernel support for pthreads (POSIX threads)
- MAC OS networking takes advantage of BSD’s advanced networking capabilities to provide support for modern features, such as Network Address Translation (NAT) and firewalls.
- The networking component provides:
- 4BSD TCP/IP stack and socket APIs
- support for both IP and DDP (AppleTalk transport)
- multicast support
- server tuning
- packet filtering
- Mac OS Classic support (through filters)
- MAC OS provides support for numerous types of file systems, including HFS, HFS+, UFS, NFS, ISO 9660, and others.
- Also, The default file-system type is HFS+; MAC OS boots (and “roots”) from HFS+, UFS, ISO, NFS, and UDF. Advanced features of MAC OS file systems include an enhanced Virtual File System (VFS) design.
- Moreover, VFS provides a layered architecture (file systems are stackable).
- The file system component provides:
- UTF-8 (Unicode) support
- Moreover, Increased performance over previous versions of Mac OS.
- The I/O Kit provides a framework for simplified driver development, supporting many categories of devices.
- Moreover, The I/O Kit features an object-oriented I/O architecture implemented in a restricted subset of C++.
- Also, The I/O Kit framework is both modular and extensible.
- The I/O Kit component provides:
- true plug and play
- dynamic device management
- dynamic (“on-demand”) loading of drivers
- power management for desktop systems as well as portables
- multiprocessor capabilities