MacOSX-by-Darrell-Hall-Ryan-Lanman-Chris Sanford&John

Download Report

Transcript MacOSX-by-Darrell-Hall-Ryan-Lanman-Chris Sanford&John

Mac OS X
December 5, 2005
Fall 2005 Term Project
CS450 Operating Systems (Section 2)
Darrell Hall, Ryan Lanman, Chris Sanford, John Suarez
{halldl, lanmanrm, sanforcp, suarezjg}@jmu.edu
OS X History
• 1985, CEO Steve Jobs leaves Apple
– Creates NeXT Inc.
• NEXTSTEP
– based on Mach 2.5 and 4.3BSD
– said to be ahead of its time
– GNUstep (www.gnustep.org)
OS X History
• Meanwhile…Apple encounters problems:
– Pink OS fails (joint effort by IBM and Apple)
– Advanced OS Copland makes little impact
– Considers purchasing
 Windows NT, Solaris, and even Pink OS
• Steve Jobs pitches NeXT technology to
Apple
• Apple agrees and purchases NeXT for
$427 million dollars
OS X History
• NeXT-based system called Rhapsody
– Two developer releases
• OS X
– Announced in 1997
– Mac OS X Server and preview of desktop version
become available in 1999
– Mac OS X beta released on September 13, 2000
– 10.0, “Cheetah” released on March 24, 2001
– 10.1, “Puma” released September 29, 2001
– 10.2, “Jaguar” released August 13, 2002
– 10.3, “Panther” released October 24, 2003
The Good of Mac OS X
• Aqua’s usability
• Excellent FireWire support
• Apple's iLife suite (iDVD, iMovie, iPhoto,
iTunes, and GarageBand)
– Metadata stored in a relation database
• Power management
• Zero configuration networking
The Bad of OS X
• Scattered documentation
• System slow down
• DVD-R burn errors
OS X Success/Potential
•
•
•
•
•
•
10 to 15 million OS X ready Macs worldwide
Mac OS userbase: 25 million worldwide
26% share of US education market
85% share of US graphics professionals market
> 1 million shrink-wrapped copies of OSX sold
Apple has become the largest UNIX vendor in
history
• Linux: 12 million users worldwide (linux.org)
(Steffen, 2002)
Processor Overview
• Two processor modes:
– User
– Supervisor
• Multiprocessor capability
– SMP
CPU Scheduling
• Preemptive priority scheduling
• Priority bands
– Normal
– System High Priority
– Kernel Mode Only
– Real Time Threads
• “Mach Thread API”
Process States
• Process states are actual thread states:
– “ready to execute”
– “executing”
– “stopped”
→ ready
→ running
→ block
System 7-style Virtual Memory
• Each page: 4 KB
• Processes are given either a 32 or 64-bit
virtual address space
– 32-bit address can grow to 4 gigabytes
– 64-bit address can grow to 18 exabytes
• (exabyte = 260 bytes)
VM controls 2 major address
ranges
• Primary Address Range
– Normal memory
• File mapping space
– Created when Code Fragment Manager is
loaded
Figure X: VM address ranges
Source: http://developer.apple.com/technotes/tn/pdf/tn1094b.pdf
Implementation
• System 7 VM implementation has 5
difficulties:
– prevention of fatal page faults
– running old drivers
– a synchronous SCSI manager
– An asynchronous SCSI manager
– an ATA manager
Prevention of Fatal Page Faults
•
Two different approaches:
1. Stopping paging devices from causing page
faults in the process of handling a read/write
request
2. Virtual Memory stops code that may cause a
page fault (referred to as “User code”) from
executing with another page fault is currently
being handled
Old Drivers
•
Two techniques:
1. Device Manager routines such as “_Read”,
“_Write”, “_Status”, and “_Control” are
patched to avoid parameter blocks passed
to the device drivers.
2. The entire system heap is held.
– Doing so prevents device drivers from causing a
page fault while accessing their own code
Synchronizing the SCSI
manager
• Solutions:
– Ensure the device managers did not cause a
page fault
– Disable user code while the SCSI bus is busy
Asynchronous SCSI manager
• Problem: With the current Virtual Memory Manager, user
code quite commonly takes page faults while interrupts
have been disabled. However, the asynchronous SCSI
manager needs these interupts to complete its
operations.
• Solution: Patching “vSyncWait” to poll the SCSI
hardware looking for interrupts
– Not pretty, but it works
ATA manager
• When ATA hard disks were intoduced to
Mac computers, SCSI software problems
reappeared, only for the ATA disks.
• Similar problem, similar solution
Bibliography
• Steffen, D. (2002). “Mac OS X: The
Darwin Kernel.” URL:
http://www.maths.mq.edu.au/~steffen/t
alks/comp342-macosx-darwin.pdf
Questions?