Mac-OSX-by-Scott-Ferguson-2003

Download Report

Transcript Mac-OSX-by-Scott-Ferguson-2003

Mac OS X
Scott Ferguson
Section 1
1
Introduction
• Background information on OS X
• Description of the OS X Architecture
– Mach Kernel
• Multithread Scheduling
• Memory Management
• Multiprocessing
– BSD-UNIX Components
• Networking
• File Systems
• Unix Security
– I/O Kit
2
OS X Overview
• 1997 Apple acquired NeXT, Inc. and their
NextStep OS
• Apple wanted to create an operating system
with the power and efficiency of UNIX and the
ease of use of the current Mac OS.
• Apple release first version of OS X in 2001
3
OS X Overview
• In what environment is this OS designed to
work?
– Designed to be used only with Apple computers
– Supports single and multiprocessor systems
• Did this OS advance the state of the art?
– Replaced “classic” Mac OS
– Succeeded in making UNIX system easy to use
4
OS X Overview
• Is it commercially successful?
– Mac OS holds about 3% of the current market
share
• What was done right/wrong?
– High Quality Product
– Frequent Updates
5
OS X Architecture
• The kernel is the core that provides basic services for
the other parts of the operating system.
• The Mac OS X kernel environment includes the Mach
kernel, BSD-UNIX, the I/O Kit, file systems, and
networking components.
6
Kernel Environment
7
Mach
• Mach manages processor resources such as CPU usage,
handles scheduling, provides memory protection, and provides
a messaging-centered infrastructure to the rest of the operatingsystem layers.
• The Mach component provides:
– Inter-process communication (IPC)
– remote procedure calls (RPC)
– scheduler support for symmetric multiprocessing (SMP)
– support for real-time services
– virtual memory support
8
Mach Scheduling
•
Mach scheduling is based on a system of run queues at various
priorities that are handled in different ways. The priority levels are
divided into four bands according to their characteristics
Priority Band
Characteristics
Normal
normal application thread priorities
System high priority
threads whose priority has been raised above
normal threads
Kernel mode only
reserved for threads created inside the kernel
that need to run at a higher priority than all
user space threads
Real-time threads
threads whose priority is based on getting a
defined fraction of total clock cycles,
regardless of other activity
9
Memory Management
• Dynamically assigns memory to applications
• Includes a fully-integrated virtual memory system that you
cannot turn off
• OS X does not use a pre-allocated swap partition for virtual
memory. Instead, it uses all of the available space on the
machine’s boot partition
• Memory assigned to applications are protected from other
memory segments, preventing conflicts and crashes
10
Multiprocessing
• OS X implements Multiprocessing by using SMP
• Handles multiprocessor-ready applications by splitting the
application into multiple independent threads, which the
underlying operating system then schedules to run on multiple
processors.
• Automatically assigns threads/tasks to available processors in a
way meant to maximize overall execution speed.
• Uses “critical regions” to restrict access to a given shared
memory range to one thread/task at a time.
• Also, OS X provides semaphores for use as a synchronization
mechanism among cooperating threads/tasks
11
BSD
• Above the Mach layer, the BSD layer provides advanced
networking, security, and compatibility features
• The BSD component provides
– File systems
– networking services
– UNIX security model (user IDs and Permissions)
– BSD Application Program Interfaces (APIs)
– The system framework for exporting APIs to the application
layers
– Multi-user Access
12
I/O Kit
• The I/O Kit provides a framework for simplified driver
development, that supports many categories of devices.
• The I/O Kit component provides
– dynamic device management
– dynamic (“on-demand”) loading of drivers
– power management for desktop systems as well as
portables
– multiprocessor capabilities
13
Conclusions
• Mac OS X provides a powerful UNIX-based operating system
with an easy to use interface
• The Kernel environment, which includes the Mach Kernel, the
BSD-UNIX components, and the I/O kit, provide all of the
needed services to the operating system (CPU, Memory
Management, VM, Networking, Security)
• The real success in OS X is that its Aqua GUI has managed to
“hide” the UNIX from the user
14
END
15