macOS
macOS is a Unix-based operating system developed by Apple for Mac computers such as MacBook, iMac, Mac mini, Mac Studio, and Mac Pro.
It is the next topic after Windows in your OS roadmap.
1. What is macOS?
macOS is Apple's desktop operating system used on Mac computers.
It manages:
- CPU
- Memory
- Processes
- Files
- Storage
- Devices
- Networking
- Security
- Applications
- User interface
Simple architecture:
User ↓ Applications ↓ macOS User Space ↓ System Frameworks / APIs ↓ XNU Kernel ↓ Hardware
Exam definition
macOS is a Unix-based operating system developed by Apple for Macintosh computers that manages hardware and software resources and provides a graphical interface and system services to users and applications.
2. History of macOS
Apple's desktop operating system has gone through several names and generations.
Macintosh System Software ↓ Mac OS ↓ Mac OS X ↓ OS X ↓ macOS
Important versions include:
| Version | Example |
|---|---|
| Mac OS X | 10.x generation |
| OS X | Mavericks, Yosemite, El Capitan |
| macOS | Sierra onward |
| Modern macOS | Apple Silicon + Intel support depending on version |
macOS is based on technologies derived from NeXTSTEP, following Apple's acquisition of NeXT.
3. macOS is Unix-based
One of the most important facts for OS exams:
macOS has a Unix foundation.
The core operating-system technology is called Darwin, which includes the XNU kernel and other Unix-derived components.
Because of this, macOS provides:
- Unix shell
- Terminal
- POSIX interfaces
- Unix filesystem concepts
- Processes
- Permissions
- Users/groups
- Pipes
- Signals
- System calls
Therefore, someone familiar with Linux/Unix commands can adapt relatively easily to macOS Terminal.
4. macOS Architecture
A simplified architecture is:
┌─────────────────────────────┐ │ Applications │ │ Safari, Xcode, Finder, etc. │ ├─────────────────────────────┤ │ Cocoa / System APIs │ ├─────────────────────────────┤ │ macOS Services │ ├─────────────────────────────┤ │ Darwin / XNU Kernel │ ├─────────────────────────────┤ │ Hardware │ └─────────────────────────────┘
Let's understand each layer.
5. Applications
Applications run primarily in user space.
Examples:
- Safari
- Finder
- Terminal
- Xcode
- Messages
- Preview
- Photos
Applications normally cannot directly control hardware.
They request services from the operating system.
6. System Frameworks and APIs
Applications use APIs/frameworks to access OS functionality.
Examples include:
- Foundation
- AppKit
- SwiftUI
- Core Foundation
- Core Graphics
- Metal
For example:
Application ↓ macOS API ↓ Operating System ↓ Hardware
7. Darwin
Darwin is the open-source core foundation of macOS.
It includes important low-level technologies such as:
- XNU kernel
- BSD components
- networking
- filesystem infrastructure
- process-related functionality
Conceptually:
macOS ├── Darwin │ ├── XNU │ ├── BSD components │ └── Core system components │ └── Apple user-space frameworks/apps
8. XNU Kernel
The macOS kernel is called XNU.
XNU historically stands for:
X is Not Unix
XNU combines technologies from different sources, including:
- Mach
- BSD
- I/O Kit
Simplified:
XNU │ ┌───────┼────────┐ ↓ ↓ ↓ Mach BSD I/O Kit
9. Mach
Mach provides important low-level kernel mechanisms.
Conceptually it is involved in:
- task management
- threads
- virtual memory
- inter-process communication
- scheduling-related mechanisms
10. BSD Layer
The BSD components provide many Unix-like facilities.
Examples:
- processes
- users
- permissions
- sockets
- networking
- filesystem interfaces
- POSIX functionality
- command-line utilities
This is one reason Terminal commands feel familiar to Linux users.
11. I/O Kit
I/O Kit is Apple's framework for device drivers and hardware management.
It helps macOS communicate with hardware such as:
- USB devices
- keyboards
- displays
- storage
- network interfaces
- other peripherals
Conceptually:
Application ↓ macOS I/O subsystem ↓ I/O Kit / Driver ↓ Hardware
12. User Space vs Kernel Space
Like Linux and Windows, macOS separates applications from privileged kernel code.
┌──────────────────────────────┐ │ User Space │ │ │ │ Safari │ │ Finder │ │ Terminal │ │ Applications │ └──────────────┬───────────────┘ │ System Calls │ ┌──────────────▼───────────────┐ │ Kernel Space │ │ │ │ XNU │ │ Memory │ │ Processes │ │ Networking │ │ Drivers │ │ Filesystems │ └──────────────┬───────────────┘ ↓ Hardware
Why?
For:
- security
- stability
- hardware protection
- process isolation
13. macOS Processes
A process is a program currently executing.
Examples:
Safari Finder Terminal Xcode
Each process has a:
- Process ID (PID)
- memory space
- threads
- resources
- security context
You can see processes through:
Activity Monitor
or Terminal:
ps
14. Threads
A process can contain multiple threads.
Example:
Safari Process │ ├── UI Thread ├── Network Thread ├── Rendering Thread └── Other Worker Threads
Threads share many process resources but have their own execution state.
15. macOS Multitasking
macOS supports multitasking.
You can run:
Safari + Terminal + Xcode + Music + Finder
at the same time.
The scheduler decides which threads/processes receive CPU time.
16. Memory Management
macOS uses virtual memory.
Conceptually:
Application ↓ Virtual Address ↓ Memory Management ↓ Physical RAM ↓ Storage when required
Important concepts:
- virtual memory
- paging
- memory protection
- process isolation
- shared memory
- memory-mapped files
Modern macOS also uses compressed memory to improve memory utilization.
17. Memory Compression
Suppose RAM becomes heavily used.
Instead of immediately moving everything to storage, macOS can compress less-active memory pages.
RAM │ ├── Active pages │ ├── Active pages │ └── Compressed pages
This can reduce memory pressure and delay storage-based swapping.
18. Storage and File Systems
Modern macOS primarily uses:
APFS
APFS = Apple File System
It is designed for modern Apple storage technologies, especially SSDs.
Important APFS concepts include:
- containers
- volumes
- snapshots
- encryption support
- copy-on-write mechanisms
- space sharing
Older macOS systems also used:
HFS+
Also called Mac OS Extended.
19. APFS Structure
A simplified view:
Physical Storage ↓ APFS Container ↓ ┌─────┼─────┐ ↓ ↓ ↓ Vol 1 Vol 2 Vol 3
APFS volumes can share free space within an APFS container.
20. macOS File Hierarchy
macOS has a Unix-style filesystem hierarchy.
Important directories include:
| Directory | Purpose |
|---|---|
/ | Root |
/Applications | Applications |
/Users | User home directories |
/System | Core system components |
/Library | System-wide libraries/configuration |
/usr | Unix/system utilities |
/bin | Essential commands on systems where present |
/etc | Configuration-related path |
/tmp | Temporary data |
/dev | Device interfaces |
/var | Variable data |
Some paths and system components differ between macOS versions, especially on modern sealed system volumes.
21. Home Directory
A user generally has a home directory such as:
/Users/uday
Inside:
/Users/uday/ ├── Desktop ├── Documents ├── Downloads ├── Movies ├── Music ├── Pictures └── Library
The ~ symbol represents the current user's home directory.
Example:
cd ~
22. Finder
Finder is the graphical file manager of macOS.
It allows users to:
- browse files
- create folders
- copy files
- move files
- delete files
- search
- connect to servers
- manage storage locations
Equivalent conceptually to File Explorer in Windows.
| macOS | Windows |
|---|---|
| Finder | File Explorer |
| Terminal | CMD/PowerShell |
| Activity Monitor | Task Manager |
| System Settings | Settings |
| Disk Utility | Disk Management |
23. Terminal
macOS includes Terminal, which provides command-line access.
Common shells include:
- zsh
- bash
- other Unix shells
Modern macOS commonly uses zsh as the default interactive shell.
Open Terminal:
Applications → Utilities → Terminal
24. macOS Users and Groups
macOS supports:
- users
- groups
- permissions
- ownership
- administrative accounts
Example:
whoami
Shows the current username.
id
Shows user and group information.
25. File Permissions
macOS uses Unix-style permissions.
Example:
-rwxr-xr--
Meaning:
- rwx r-x r-- │ │ │ │ │ owner group others │ file
Permissions:
r = read w = write x = execute
Numeric permissions:
r = 4 w = 2 x = 1
Example:
chmod 755 script.sh
means:
Owner → rwx = 7 Group → r-x = 5 Others → r-x = 5
26. macOS Security
macOS contains several security mechanisms.
Important concepts include:
- user permissions
- sandboxing
- Gatekeeper
- System Integrity Protection (SIP)
- FileVault
- code signing
- application security
- firewall
- privacy permissions
27. Gatekeeper
Gatekeeper helps control applications downloaded from outside trusted sources.
It works with mechanisms such as:
- code signing
- notarization
- application security checks
Its goal is to reduce the risk of executing malicious/untrusted applications.
28. System Integrity Protection
SIP = System Integrity Protection
SIP protects important system components from unauthorized modification, including by processes with elevated privileges.
This is an important macOS security feature.
Conceptually:
Normal User ↓ Admin privileges ↓ Still restricted by SIP ↓ Protected system components
29. FileVault
FileVault provides full-volume/device encryption for Mac storage.
Purpose:
Without encryption: Storage → readable if improperly accessed With encryption: Storage → encrypted data ↓ authentication ↓ access
It helps protect data if the physical device is lost or stolen.
30. macOS Networking
macOS supports:
- Ethernet
- Wi-Fi
- Bluetooth networking
- TCP/IP
- DNS
- DHCP
- IPv4
- IPv6
- VPNs
- network interfaces
Terminal commands can inspect networking.
For example:
ifconfig
View interfaces.
ping example.com
Test connectivity.
netstat
Network statistics/connections, depending on macOS version.
Modern macOS users may also use tools such as:
scutil --dns
for DNS configuration information.
31. Device Management
macOS communicates with hardware through its I/O subsystem and drivers.
Examples:
USB Keyboard Mouse Display SSD Wi-Fi Bluetooth Camera Printer
Simplified:
macOS ↓ I/O subsystem ↓ Driver ↓ Hardware
32. System Settings
Modern macOS uses:
System Settings
for configuration.
It manages things such as:
- Wi-Fi
- Bluetooth
- display
- users
- privacy
- security
- keyboard
- mouse
- network
- software updates
Older versions used the name:
System Preferences
33. Activity Monitor
Activity Monitor is macOS's graphical system-monitoring tool.
It displays:
- CPU
- memory
- energy
- disk
- network
- processes
It is conceptually similar to Windows Task Manager.
34. macOS Boot Process
Simplified:
Power On ↓ Firmware / BootROM ↓ Boot process ↓ macOS kernel ↓ System initialization ↓ Launch services ↓ Login ↓ Desktop
On Apple Silicon Macs, the boot architecture differs significantly from older Intel Macs, but the high-level idea remains:
Firmware ↓ Boot environment ↓ Kernel ↓ System services ↓ Login/Desktop
35. Intel Mac vs Apple Silicon
macOS has run on different CPU architectures.
Intel Macs
Used Intel x86-64 processors.
Apple Silicon Macs
Use Apple's ARM-based architecture.
Examples:
M1 M2 M3 M4 ...
Conceptually:
Older Mac ↓ Intel x86-64 Modern Mac ↓ Apple Silicon ↓ ARM-based architecture
36. Rosetta 2
On Apple Silicon Macs, Rosetta 2 helps run many applications built for Intel-based Macs.
Conceptually:
Intel Mac application ↓ Rosetta 2 ↓ Apple Silicon Mac
This is a form of binary translation.
37. macOS and Virtualization
macOS can run virtual machines using virtualization software.
Conceptually:
macOS ↓ Hypervisor / Virtualization framework ↓ Virtual Machine ↓ Linux / Windows / other OS
Common virtualization software includes applications such as VMware Fusion and Parallels Desktop.
38. macOS vs Linux
| Feature | macOS | Linux |
|---|---|---|
| Developer | Apple | Open-source community/organizations |
| Kernel | XNU | Linux |
| Unix-based | Yes | Unix-like |
| Source | Core components partly open; proprietary components also present | Linux kernel GPL/open source |
| Hardware | Apple hardware | Very broad hardware |
| Package managers | Homebrew, etc. | apt, dnf, pacman, etc. |
| Default shell | zsh on modern macOS | Varies |
| Filesystem | APFS commonly | ext4, XFS, Btrfs, etc. |
| GUI | Apple-controlled ecosystem | Many desktop environments |
| Customization | More controlled | Highly customizable |
39. macOS vs Windows
| Feature | macOS | Windows |
|---|---|---|
| Developer | Apple | Microsoft |
| Kernel | XNU | Windows NT kernel |
| Hardware | Mainly Apple hardware | Many manufacturers |
| Filesystem | APFS | NTFS |
| CLI | Unix shell | CMD + PowerShell |
| GUI file manager | Finder | File Explorer |
| Process monitor | Activity Monitor | Task Manager |
| Security | SIP, Gatekeeper, FileVault, etc. | Defender, UAC, ACLs, etc. |
| Package ecosystem | App Store/Homebrew/etc. | Microsoft Store/winget/etc. |
| Unix environment | Native Unix/POSIX foundation | Separate compatibility layers/tools |
40. macOS Advantages
1. Unix foundation
Excellent for:
- programming
- networking
- development
- terminal usage
2. Hardware/software integration
Apple controls both hardware and software.
3. Security
Provides mechanisms such as:
- SIP
- Gatekeeper
- FileVault
- sandboxing
4. Developer environment
Popular for:
- software development
- web development
- iOS/macOS development
- Unix-based tooling
5. User interface
Apple provides a consistent graphical environment.
41. macOS Disadvantages
- Apple hardware is relatively expensive.
- Less hardware customization than typical PCs.
- Some Windows-specific applications may not run natively.
- Gaming support is generally narrower than Windows.
- Hardware upgrades can be limited depending on Mac model.
- Apple ecosystem is comparatively closed.
42. Important macOS Components
| Component | Purpose |
|---|---|
| XNU | Kernel |
| Darwin | Core Unix foundation |
| Mach | Low-level kernel mechanisms |
| BSD | Unix/POSIX functionality |
| I/O Kit | Device/hardware framework |
| Finder | File manager |
| Terminal | Command-line interface |
| Activity Monitor | Process/resource monitor |
| APFS | Modern filesystem |
| Gatekeeper | Application security |
| SIP | System protection |
| FileVault | Storage encryption |
| Rosetta 2 | Intel app compatibility on Apple Silicon |
43. Complete macOS Architecture
USER │ ↓ ┌──────────────────────┐ │ Applications │ │ Safari, Xcode, etc. │ └──────────┬───────────┘ ↓ ┌──────────────────────┐ │ macOS Frameworks/API │ └──────────┬───────────┘ ↓ ┌──────────────────────┐ │ Darwin │ │ BSD + system tools │ └──────────┬───────────┘ ↓ ┌──────────────────────┐ │ XNU │ │ Mach + BSD + I/O Kit │ └──────────┬───────────┘ ↓ ┌──────────────────────┐ │ Hardware │ └──────────────────────┘
🧠 Exam Revision
What is macOS?
macOS is Apple's Unix-based operating system for Mac computers.
Kernel?
XNU
Core foundation?
Darwin
Modern filesystem?
APFS
File manager?
Finder
Terminal?
Terminal with shells such as zsh
Process monitor?
Activity Monitor
System protection?
System Integrity Protection (SIP)
Disk encryption?
FileVault
Application security?
Gatekeeper
Intel application compatibility on Apple Silicon?
Rosetta 2
Main memory concept?
Virtual memory + memory compression + paging
Main architecture memory trick:
macOS = Darwin + XNU + Frameworks + Applications
And for the kernel:
XNU = Mach + BSD + I/O Kit