DNT MemoPen Data Spezifikationen

Stöbern Sie online oder laden Sie Spezifikationen nach Software DNT MemoPen Data herunter. DNT MemoPen Data Specifications Benutzerhandbuch

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 52
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 0
This is the Title of the Book, eMatter Edition
Copyright © 2005 O’Reilly & Associates, Inc. All rights reserved.
412
Chapter 15
CHAPTER 15
Memory Mapping
and DMA
This chapter delves into the area of Linux memory management, with an emphasis
on techniques that are useful to the device driver writer. Many types of driver pro-
gramming require some understanding of how the virtual memory subsystem works;
the material we cover in this chapter comes in handy more than once as we get into
some of the more complex and performance-critical subsystems. The virtual mem-
ory subsystem is also a highly interesting part of the core Linux kernel and, there-
fore, it merits a look.
The material in this chapter is divided into three sections:
The first covers the implementation of the mmap system call, which allows the
mapping of device memory directly into a user process’s address space. Not all
devices require mmap support, but, for some, mapping device memory can yield
significant performance improvements.
We then look at crossing the boundary from the other direction with a discus-
sion of direct access to user-space pages. Relatively few drivers need this capabil-
ity; in many cases, the kernel performs this sort of mapping without the driver
even being aware of it. But an awareness of how to map user-space memory into
the kernel (with get_user_pages) can be useful.
The final section covers direct memory access (DMA) I/O operations, which pro-
vide peripherals with direct access to system memory.
Of course, all of these techniques require an understanding of how Linux memory
management works, so we start with an overview of that subsystem.
Memory Management in Linux
Rather than describing the theory of memory management in operating systems, this
section tries to pinpoint the main features of the Linux implementation. Although
you do not need to be a Linux virtual memory guru to implement mmap, a basic
overview of how things work is useful. What follows is a fairly lengthy description of
,ch15.13676 Page 412 Friday, January 21, 2005 11:04 AM
Seitenansicht 0
1 2 3 4 5 6 ... 51 52

Inhaltsverzeichnis

Seite 1 - Memory Mapping

This is the Title of the Book, eMatter EditionCopyright © 2005 O’Reilly & Associates, Inc. All rights reserved.412Chapter 15CHAPTER 15Memory Mappi

Seite 2 - Address Types

This is the Title of the Book, eMatter EditionCopyright © 2005 O’Reilly & Associates, Inc. All rights reserved.Memory Management in Linux|421VMAs

Seite 3

This is the Title of the Book, eMatter EditionCopyright © 2005 O’Reilly & Associates, Inc. All rights reserved.422|Chapter 15: Memory Mapping and

Seite 4 - High and Low Memory

This is the Title of the Book, eMatter EditionCopyright © 2005 O’Reilly & Associates, Inc. All rights reserved.The mmap Device Operation|423The fu

Seite 5

This is the Title of the Book, eMatter EditionCopyright © 2005 O’Reilly & Associates, Inc. All rights reserved.424|Chapter 15: Memory Mapping and

Seite 6

This is the Title of the Book, eMatter EditionCopyright © 2005 O’Reilly & Associates, Inc. All rights reserved.The mmap Device Operation|425The va

Seite 7 - Page Tables

This is the Title of the Book, eMatter EditionCopyright © 2005 O’Reilly & Associates, Inc. All rights reserved.426|Chapter 15: Memory Mapping and

Seite 8 - Virtual Memory Areas

This is the Title of the Book, eMatter EditionCopyright © 2005 O’Reilly & Associates, Inc. All rights reserved.The mmap Device Operation|427To mak

Seite 9 - The vm_area_struct structure

This is the Title of the Book, eMatter EditionCopyright © 2005 O’Reilly & Associates, Inc. All rights reserved.428|Chapter 15: Memory Mapping and

Seite 10 - Memory Management in Linux

This is the Title of the Book, eMatter EditionCopyright © 2005 O’Reilly & Associates, Inc. All rights reserved.The mmap Device Operation|429Otherw

Seite 11 - The mmap Device Operation

This is the Title of the Book, eMatter EditionCopyright © 2005 O’Reilly & Associates, Inc. All rights reserved.430|Chapter 15: Memory Mapping and

Seite 12

This is the Title of the Book, eMatter EditionCopyright © 2005 O’Reilly & Associates, Inc. All rights reserved.Memory Management in Linux|413the d

Seite 13 - Using remap_pfn_range

This is the Title of the Book, eMatter EditionCopyright © 2005 O’Reilly & Associates, Inc. All rights reserved.The mmap Device Operation|431map th

Seite 14 - A Simple Implementation

This is the Title of the Book, eMatter EditionCopyright © 2005 O’Reilly & Associates, Inc. All rights reserved.432|Chapter 15: Memory Mapping and

Seite 15 - Adding VMA Operations

This is the Title of the Book, eMatter EditionCopyright © 2005 O’Reilly & Associates, Inc. All rights reserved.The mmap Device Operation|433Most o

Seite 16 - Mapping Memory with nopage

This is the Title of the Book, eMatter EditionCopyright © 2005 O’Reilly & Associates, Inc. All rights reserved.434|Chapter 15: Memory Mapping and

Seite 17

This is the Title of the Book, eMatter EditionCopyright © 2005 O’Reilly & Associates, Inc. All rights reserved.Performing Direct I/O|435Performing

Seite 18 - Remapping Specific I/O Regions

This is the Title of the Book, eMatter EditionCopyright © 2005 O’Reilly & Associates, Inc. All rights reserved.436|Chapter 15: Memory Mapping and

Seite 19 - Remapping RAM

This is the Title of the Book, eMatter EditionCopyright © 2005 O’Reilly & Associates, Inc. All rights reserved.Performing Direct I/O|437list from

Seite 20 - 0 when opened for

This is the Title of the Book, eMatter EditionCopyright © 2005 O’Reilly & Associates, Inc. All rights reserved.438|Chapter 15: Memory Mapping and

Seite 21

This is the Title of the Book, eMatter EditionCopyright © 2005 O’Reilly & Associates, Inc. All rights reserved.Performing Direct I/O|439needs to k

Seite 22

This is the Title of the Book, eMatter EditionCopyright © 2005 O’Reilly & Associates, Inc. All rights reserved.440|Chapter 15: Memory Mapping and

Seite 23

This is the Title of the Book, eMatter EditionCopyright © 2005 O’Reilly & Associates, Inc. All rights reserved.414|Chapter 15: Memory Mapping and

Seite 24 - Performing Direct I/O

This is the Title of the Book, eMatter EditionCopyright © 2005 O’Reilly & Associates, Inc. All rights reserved.Direct Memory Access|441Overview of

Seite 25

This is the Title of the Book, eMatter EditionCopyright © 2005 O’Reilly & Associates, Inc. All rights reserved.442|Chapter 15: Memory Mapping and

Seite 26 - Asynchronous I/O

This is the Title of the Book, eMatter EditionCopyright © 2005 O’Reilly & Associates, Inc. All rights reserved.Direct Memory Access|443when the re

Seite 27

This is the Title of the Book, eMatter EditionCopyright © 2005 O’Reilly & Associates, Inc. All rights reserved.444|Chapter 15: Memory Mapping and

Seite 28 - An asynchronous I/O example

This is the Title of the Book, eMatter EditionCopyright © 2005 O’Reilly & Associates, Inc. All rights reserved.Direct Memory Access|445The mask sh

Seite 29 - Direct Memory Access

This is the Title of the Book, eMatter EditionCopyright © 2005 O’Reilly & Associates, Inc. All rights reserved.446|Chapter 15: Memory Mapping and

Seite 30

This is the Title of the Book, eMatter EditionCopyright © 2005 O’Reilly & Associates, Inc. All rights reserved.Direct Memory Access|447this functi

Seite 31 - Allocating the DMA Buffer

This is the Title of the Book, eMatter EditionCopyright © 2005 O’Reilly & Associates, Inc. All rights reserved.448|Chapter 15: Memory Mapping and

Seite 32 - Bus Addresses

This is the Title of the Book, eMatter EditionCopyright © 2005 O’Reilly & Associates, Inc. All rights reserved.Direct Memory Access|449Some import

Seite 33 - The Generic DMA Layer

This is the Title of the Book, eMatter EditionCopyright © 2005 O’Reilly & Associates, Inc. All rights reserved.450|Chapter 15: Memory Mapping and

Seite 34 - DMA mappings

This is the Title of the Book, eMatter EditionCopyright © 2005 O’Reilly & Associates, Inc. All rights reserved.Memory Management in Linux|415Diffe

Seite 35

This is the Title of the Book, eMatter EditionCopyright © 2005 O’Reilly & Associates, Inc. All rights reserved.Direct Memory Access|451dependent,

Seite 36 - DMA pools

This is the Title of the Book, eMatter EditionCopyright © 2005 O’Reilly & Associates, Inc. All rights reserved.452|Chapter 15: Memory Mapping and

Seite 37

This is the Title of the Book, eMatter EditionCopyright © 2005 O’Reilly & Associates, Inc. All rights reserved.Direct Memory Access|453void pci_da

Seite 38

This is the Title of the Book, eMatter EditionCopyright © 2005 O’Reilly & Associates, Inc. All rights reserved.454|Chapter 15: Memory Mapping and

Seite 39 - Scatter/gather mappings

This is the Title of the Book, eMatter EditionCopyright © 2005 O’Reilly & Associates, Inc. All rights reserved.Direct Memory Access|455The channel

Seite 40

This is the Title of the Book, eMatter EditionCopyright © 2005 O’Reilly & Associates, Inc. All rights reserved.456|Chapter 15: Memory Mapping and

Seite 41

This is the Title of the Book, eMatter EditionCopyright © 2005 O’Reilly & Associates, Inc. All rights reserved.Direct Memory Access|457particular,

Seite 42 - A simple PCI DMA example

This is the Title of the Book, eMatter EditionCopyright © 2005 O’Reilly & Associates, Inc. All rights reserved.458|Chapter 15: Memory Mapping and

Seite 43 - DMA for ISA Devices

This is the Title of the Book, eMatter EditionCopyright © 2005 O’Reilly & Associates, Inc. All rights reserved.Quick Reference|459 int residue;

Seite 44 - Registering DMA usage

This is the Title of the Book, eMatter EditionCopyright © 2005 O’Reilly & Associates, Inc. All rights reserved.460|Chapter 15: Memory Mapping and

Seite 45 - Talking to the DMA controller

This is the Title of the Book, eMatter EditionCopyright © 2005 O’Reilly & Associates, Inc. All rights reserved.416|Chapter 15: Memory Mapping and

Seite 46

This is the Title of the Book, eMatter EditionCopyright © 2005 O’Reilly & Associates, Inc. All rights reserved.Quick Reference|461int is_sync_kioc

Seite 47

This is the Title of the Book, eMatter EditionCopyright © 2005 O’Reilly & Associates, Inc. All rights reserved.462|Chapter 15: Memory Mapping and

Seite 48 - Quick Reference

This is the Title of the Book, eMatter EditionCopyright © 2005 O’Reilly & Associates, Inc. All rights reserved.Quick Reference|463int request_dma(

Seite 49 - Implementing Direct I/O

This is the Title of the Book, eMatter EditionCopyright © 2005 O’Reilly & Associates, Inc. All rights reserved.Memory Management in Linux|417there

Seite 50

This is the Title of the Book, eMatter EditionCopyright © 2005 O’Reilly & Associates, Inc. All rights reserved.418|Chapter 15: Memory Mapping and

Seite 51

This is the Title of the Book, eMatter EditionCopyright © 2005 O’Reilly & Associates, Inc. All rights reserved.Memory Management in Linux|419Virtu

Seite 52

This is the Title of the Book, eMatter EditionCopyright © 2005 O’Reilly & Associates, Inc. All rights reserved.420|Chapter 15: Memory Mapping and

Kommentare zu diesen Handbüchern

Keine Kommentare