Presentation is loading. Please wait.

Presentation is loading. Please wait.

14 Macintosh OS X Internals. © 2005 Pearson Addison-Wesley. All rights reserved The Macintosh Platform 1984 – first affordable GUI Based on Motorola 32-bit.

Similar presentations


Presentation on theme: "14 Macintosh OS X Internals. © 2005 Pearson Addison-Wesley. All rights reserved The Macintosh Platform 1984 – first affordable GUI Based on Motorola 32-bit."— Presentation transcript:

1 14 Macintosh OS X Internals

2 © 2005 Pearson Addison-Wesley. All rights reserved The Macintosh Platform 1984 – first affordable GUI Based on Motorola 32-bit PowerPC chip –Most successful non-Intel PC in marketplace Cult-like status Legendary ease of use OS X is latest Mac operating system

3 © 2005 Pearson Addison-Wesley. All rights reserved Figure 14.1 A functional view of OS X.

4 © 2005 Pearson Addison-Wesley. All rights reserved The functional view Darwin –Open source UNIX base –Core of Mac OS X operating system Graphics subsystem –Screen rendering –API – Open GL –Quicktime

5 © 2005 Pearson Addison-Wesley. All rights reserved The functional view Application environments –Classic – existing System 9 applications –Carbon – migrate System 9 to OS X –Cocoa – native OS X environment –Java – Aqua look to Java applications Aqua –The Mac OS X graphical user interface

6 © 2005 Pearson Addison-Wesley. All rights reserved Figure 14.2 A system software view of OS X. BSD is the command line shell.

7 © 2005 Pearson Addison-Wesley. All rights reserved The system software view Top layer – application environments –Application programs run in environment Application services layer –Graphical and windowing services –Supports application environments Core services –Internal operating system services Darwin – the kernel

8 © 2005 Pearson Addison-Wesley. All rights reserved Figure 14.3 Darwin, the OS X kernel. Mach 3.0 microkernel –Compact kernel –Supports several operating systems BSD UNIX –Open-source UNIX –Networking services –File systems –User management policies

9 © 2005 Pearson Addison-Wesley. All rights reserved Mach 3.0 Task –Basic OS X resource allocation unit Thread –Basic unit Mach schedules for execution Task is container for many threads Task resource allocation –Task sends message to port –Kernel grants permission to access

10 © 2005 Pearson Addison-Wesley. All rights reserved BSD UNIX Part of the kernel –Mach 3.0 and BSD communicate directly BSD views active program as a process Key BSD functions –Process management and file systems –Network services –Security features Darwin also supports POSIX, an API

11 © 2005 Pearson Addison-Wesley. All rights reserved Process scheduling BSD processes run on top of Mach Thread is basic OS X computational unit –Threads are scheduled by Mach Time-sharing scheduling policy –Each thread assigned to priority band –Thread priority can be adjusted dynamically Multiprocessor scheduling –Each processor schedules its own threads

12 © 2005 Pearson Addison-Wesley. All rights reserved Figure 14.4 Thread priority bands. Priority BandsCharacteristics NormalNormal application threads System high priorityThreads whose priority has been raised above normal Kernel mode threadsThreads created in the kernel that run at a higher priority than all user space threads. Real-time threadsThreads that need a significant fraction of available clock cycles

13 © 2005 Pearson Addison-Wesley. All rights reserved Figure 14.5 Virtual address space – 4 GB. Mach responsible for memory management

14 © 2005 Pearson Addison-Wesley. All rights reserved Memory management VM object –Tracks resident and non-resident portions of virtual memory Pager –Moves data between disk and memory Memory object –A specific source of data, such as a file

15 © 2005 Pearson Addison-Wesley. All rights reserved Figure 14.6 VM objects and pagers. Default pager –Fetches pages –Swap space manager Vnode pager –Objects that map files accessed via file system

16 © 2005 Pearson Addison-Wesley. All rights reserved Figure 14.7 Copy on write. (a.) When a new task is created, it is cloned (or copied) from a parent.

17 © 2005 Pearson Addison-Wesley. All rights reserved (b.) If a task modifies a portion of shared memory, Mach makes another copy and gives the task write access.

18 © 2005 Pearson Addison-Wesley. All rights reserved File systems HFS+ (hierarchical file system plus) BSD UNIX file system (UFS) Others –NFS (network file system) –SMB (server message block) – Windows –AFP (AppleTalk filing protocol) –ISO9660 (CD-ROM) –UDF (universal disk format) – DVD

19 © 2005 Pearson Addison-Wesley. All rights reserved Figure 14.8 The virtual file system (VFS). VFS separates generic file-system operations from specific file system implementations.

20 © 2005 Pearson Addison-Wesley. All rights reserved Figure 14.9 An HSF+ file has two forks. Data fork –Like regular file in UNIX Resource fork –Resources associated with file Menus Dialog boxes Icons

21 © 2005 Pearson Addison-Wesley. All rights reserved Figure 14.10 The contents of an HFS+ volume.

22 © 2005 Pearson Addison-Wesley. All rights reserved Contents of an HFS+ volume Boot blocks Volume header Allocation file –Bitmap of every block on disk –Block used or not used Catalog file –Volume’s folder/file hierarchy –Essentially, the directory

23 © 2005 Pearson Addison-Wesley. All rights reserved Contents of an HFS+ volume Attribute file –Future use – new forks Startup file –Facilitates booting a non-Macintosh operating system Alternate volume header –A copy of the volume header

24 © 2005 Pearson Addison-Wesley. All rights reserved UFS – the UNIX File System HFS+ is the Macintosh default UFS used in client/server environments –UFS is case sensitive –Letters and LETTERS are different file names USF stores sparse files efficiently Bridge to UNIX systems

25 © 2005 Pearson Addison-Wesley. All rights reserved Figure 14.11 OS X supports user-space and kernel-space device drivers.

26 © 2005 Pearson Addison-Wesley. All rights reserved User-space v. kernel-space drivers User-space driver –User-space error crashes only application –Calls BSD POSIX procedure, or –Accesses device interface Kernel-space driver –Difficult to write –Kernel-space error crashes system –Avoids replication of code

27 © 2005 Pearson Addison-Wesley. All rights reserved Figure 14.12 Accessing a device through the device interface.

28 © 2005 Pearson Addison-Wesley. All rights reserved Figure 14.13 I/O Kit’s objects as a series of layers. I/O Kit –OS X device driver subsystem –Simplifies driver creation Family –Devices of a particular type Driver –Specific device –Associated with family Nub links drivers

29 © 2005 Pearson Addison-Wesley. All rights reserved Figure 14.14 Building the I/O registry. Registry recreated at boot time

30 © 2005 Pearson Addison-Wesley. All rights reserved Figure 14.15 Adding a new device to the I/O registry. Dynamic run-time process

31 © 2005 Pearson Addison-Wesley. All rights reserved Figure 14.16 The QuickTime architecture.


Download ppt "14 Macintosh OS X Internals. © 2005 Pearson Addison-Wesley. All rights reserved The Macintosh Platform 1984 – first affordable GUI Based on Motorola 32-bit."

Similar presentations


Ads by Google