Apple Darwin User Manual Page 59

  • Download
  • Add to my manuals
  • Print
  • Page
    / 68
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 58
For a computer with 64 GB of RAM, given a 4 KB page size, the OS must manage almost 17 million pages of
physical RAM, each of which has a page table entry and a vm_page structure. In total, these data structures
would potentially consume well over a gigabyte of kernel memory by themselves. In a 32-bit (4GB) address
space, this would significantly limit the kernel address space available for other purposes.
The space constraints are compounded by other data structures (mbuf storage, for example) that should ideally
be allowed to scale with the size of available memory. By moving to a 64-bit address space (when run on
supported hardware), the OS X kernel can accommodate these data structures in large memory configurations.
In OS X v10.8 and later, the kernel runs exclusively in 64-bit mode. In earlier operating systems, the kernel ran
in different modes depending on hardware. (See http://support.apple.com/kb/HT3770 for details.)
What You Must Do
As a driver developer, you must update your drivers with 64-bit binaries. The 64-bit kernel cannot load 32-bit
kernel extensions. Fortunately, because the I/O Kit is a relatively modern environment with few legacy design
constraints, most kernel extensions can be adapted fairly easily to 64-bit. Many drivers “just work” after changing
the compile settings. However, there are a few steps you must take along the way.
Recompile your code
In a 64-bit kernel environment, device drivers and kernel extensions must be made 64-bit clean and
compiled as 64-bit executables. This process is essentially the same as for any other 64-bit code. In
particular, you should be aware of the changes described in Major 64-Bit Changes (page 12), Making
Code 64-Bit Clean (page 16), and Compiling 64-Bit Code (page 31). There is one small difference, however:
you must use GCC 4.2 or later when compiling 64-bit kernel extensions. (64-bit applications can be
compiled with GCC 4.0.)
Update dependency information
In the 64-bit kernel, the kernel exports only KPI dependencies, not the general kernel dependencies or
unsupported dependencies. For example, com.apple.kpi.iokit is supported, but
com.apple.kernel.iokit is not.
Note: If you need to support operating systems that predate the availability of the KPI symbol sets, you must use a
separate driver bundle with a different Info.plist file for those older operating systems.
Stop using unsupported symbols
In addition, the exported KPI symbol lists are cleaned up for the 64-bit environment. If your code uses
functions that are not exported by the 64-bit kernel, you will receive compile-time or load-time errors.
You must fix these by moving off of these APIs and moving to APIs that are supported for 64-bit. You
can learn more about these APIs in Kernel Framework Reference.
Kernel Extensions and Drivers
What You Must Do
2012-12-13 | Copyright © 2004, 2012 Apple Inc. All Rights Reserved.
59
Page view 58
1 2 ... 54 55 56 57 58 59 60 61 62 63 64 ... 67 68

Comments to this Manuals

No comments