15
1 Mac OS X Scott Ferguson Section 1

1 Mac OS X Scott Ferguson Section 1. 2 Introduction Background information on OS X Description of the OS X Architecture –Mach Kernel Multithread Scheduling

Embed Size (px)

Citation preview

Page 1: 1 Mac OS X Scott Ferguson Section 1. 2 Introduction Background information on OS X Description of the OS X Architecture –Mach Kernel Multithread Scheduling

1

Mac OS X

Scott Ferguson

Section 1

Page 2: 1 Mac OS X Scott Ferguson Section 1. 2 Introduction Background information on OS X Description of the OS X Architecture –Mach Kernel Multithread Scheduling

2

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

Page 3: 1 Mac OS X Scott Ferguson Section 1. 2 Introduction Background information on OS X Description of the OS X Architecture –Mach Kernel Multithread Scheduling

3

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

Page 4: 1 Mac OS X Scott Ferguson Section 1. 2 Introduction Background information on OS X Description of the OS X Architecture –Mach Kernel Multithread Scheduling

4

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

Page 5: 1 Mac OS X Scott Ferguson Section 1. 2 Introduction Background information on OS X Description of the OS X Architecture –Mach Kernel Multithread Scheduling

5

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

Page 6: 1 Mac OS X Scott Ferguson Section 1. 2 Introduction Background information on OS X Description of the OS X Architecture –Mach Kernel Multithread Scheduling

6

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.

Page 7: 1 Mac OS X Scott Ferguson Section 1. 2 Introduction Background information on OS X Description of the OS X Architecture –Mach Kernel Multithread Scheduling

7

Kernel Environment

Page 8: 1 Mac OS X Scott Ferguson Section 1. 2 Introduction Background information on OS X Description of the OS X Architecture –Mach Kernel Multithread Scheduling

8

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 operating-system 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

Page 9: 1 Mac OS X Scott Ferguson Section 1. 2 Introduction Background information on OS X Description of the OS X Architecture –Mach Kernel Multithread Scheduling

9

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

Page 10: 1 Mac OS X Scott Ferguson Section 1. 2 Introduction Background information on OS X Description of the OS X Architecture –Mach Kernel Multithread Scheduling

10

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

Page 11: 1 Mac OS X Scott Ferguson Section 1. 2 Introduction Background information on OS X Description of the OS X Architecture –Mach Kernel Multithread Scheduling

11

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

Page 12: 1 Mac OS X Scott Ferguson Section 1. 2 Introduction Background information on OS X Description of the OS X Architecture –Mach Kernel Multithread Scheduling

12

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

Page 13: 1 Mac OS X Scott Ferguson Section 1. 2 Introduction Background information on OS X Description of the OS X Architecture –Mach Kernel Multithread Scheduling

13

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

Page 14: 1 Mac OS X Scott Ferguson Section 1. 2 Introduction Background information on OS X Description of the OS X Architecture –Mach Kernel Multithread Scheduling

14

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

Page 15: 1 Mac OS X Scott Ferguson Section 1. 2 Introduction Background information on OS X Description of the OS X Architecture –Mach Kernel Multithread Scheduling

15

END