Summary

In this chapter, we have discussed:

  • Types of memory addresses in use by the kernel. The kernel typically works with virtual addresses both for its own threads as well as those of user space tasks. Physical memory addresses are used between the CPU and memory, as well as hardware devices.
  • The significance of 32-bit and 64-bit memory addressing and modes.
  • How memory allocation is performed across the different kernel subsystems, Mach, BSD, and I/O Kit. In I/O Kit, the preferred mechanism is to use the IOMalloc*() functions or the IOBufferMemoryDescriptor.
  • How the IOMemoryDescriptor and related subclasses are used by many parts of the I/O Kit to manage and describe memory buffers. The IOBufferMemoryDescriptor is one such subclass, which in addition to providing a memory descriptor also allocates memory in various forms, with alignment or even physically contiguous memory.
  • How the IOMemoryMap class is used to manage memory mappings and allows the kernel to map a user space buffer into its virtual address space so memory can be manipulated by the kernel.
  • How the IOUserClient class provides a useful method, clientMemoryForType(), which will handle the details of mapping a kernel buffer into user space.
  • How the IOMemoryDescriptor provides methods such as getPhysicalSegment() that allow mapping of virtual memory addresses to physical addresses.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.21.190