Mac OS X PantherOperating System
Tomomi Kotera
CS 550 Section 3
Fall 2003
Presentation Overview
• Overview of Mac OS X– System Architecture
• Key technologies– CPU scheduling– Symmetric Multiprocessing– Memory Management
• Conclusion
Overview of Mac OS X
• UNIX-based Operating System with the intuitive user interface called Aqua
• “Classic” Mac OS vs. Newer Mac OS
• Four major successes of Mac OS X– Preemptive Multitasking– Symmetric Multiprocessing– Memory Protection– Virtual Memory
System Architecture• Four layers of system software
– Application Environments– Application Services– Core Services– Kernel Environments
Preemptive Multiprocessing
• Cooperative multitasking (Classic Mac OS) vs. Preemptive Multiprocessing (Mac OS X)
• Preemptive Multiprocessing– Multilevel Feedback Queue Scheduling
Algorithm – Round Robin Scheduling Algorithm
Preemptive Multiprocessing (cont.)
• Multilevel Feedback Queue Scheduling Algorithm– 128 priority levels are divided into four bands
• Normal (0-51) • System High Priority (52-79)• Kernel Mode Only (80-95) • Real-Time Threads (96-127)
– Real-Time Threads are treated differently– Avoid Starvation– Threads migrate within a given band
Symmetric Multiprocessing
• Dual processor capabilities
• Share Memory and I/O bus
• Kernel can execute on any processor
Memory Protection
• Crush Resistant– Processes are isolated in own memory
spaces– Cannot interfere one another– If one applications crashes, the system, and
other applications are unaffected - no restarts
Virtual Memory
• Classic Mac OS uses Segmentation
• Mac OS X adopts Demand Paging– Large, sparse virtual address spaces
– Mapping a page reference to a physical address
application
pager
Pagefault
resume
Address spaceFunction call
Virtual Memory (cont.)• VM Object (Virtual Memory Object)
– Object-oriented nature of Mach– Contiguous repository for data
indexed by byte– All data in an address space is
provided through VM objects– Track and manage the resident
and nonresident pages
• Memory Sharing– Inheritance (shared, copy, none)– Copy-on-Write
Virtual Memory (cont.)
• Content of a VM objectField Description
Resident pages
List of resident pages in physical memory
Size The size of the region, in bytes
Pager The pager responsible for tracking and handling the pages of this region in backing store
Shadow Used for copy-on-write optimizations
Copy Used for copy-on-write optimizations
Attributes Flags indicating the state of various implementation details
Virtual Memory (cont.)
• Second-chance first in, first out (FIFO) Algorithm
• Three lists of physical memory pages
List Description
Active list
pages that are currently mapped into memory and have been recently accessed
Inactive list
pages that are currently resident in physical memory
Free list pages of physical memory that are not associated with any address space of the page table
Virtual Memory (cont.)• Continuously check the free list• When the number of pages in the free list dips
below this threshold, remove pages from the inactive list to place them on the free list
• Always maintains a few pages on the inactive list
• Once the free list size exceeds the target threshold, the pager rests
• FIFO-like page replacement • The inactive list serves as a second chance
Conclusion
• Technical Success of Mac OS X– Marriage of stability, reliability and security of
UNIX, with the ease of use of the Macintosh GUI
– Benefits from UNIX features• Preemptive Scheduling
• Symmetric Multiprocessing
• Memory Management
– Target both home users and IT professionals