DNT MemoPen Data Especificaciones

Busca en linea o descarga Especificaciones para Software DNT MemoPen Data. DNT MemoPen Data Specifications Manual de usuario

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 52
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 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
Vista de pagina 0
1 2 3 4 5 6 ... 51 52

Indice de contenidos

Pagina 1 - Memory Mapping

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

Pagina 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

Pagina 3

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

Pagina 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

Pagina 5

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

Pagina 6

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

Pagina 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

Pagina 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

Pagina 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

Pagina 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

Pagina 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

Pagina 12

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

Pagina 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

Pagina 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

Pagina 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

Pagina 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

Pagina 17

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

Pagina 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

Pagina 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

Pagina 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

Pagina 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

Pagina 22

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

Pagina 23

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

Pagina 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

Pagina 25

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

Pagina 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

Pagina 27

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

Pagina 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

Pagina 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

Pagina 30

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

Pagina 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

Pagina 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

Pagina 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

Pagina 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

Pagina 35

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

Pagina 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

Pagina 37

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

Pagina 38

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

Pagina 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

Pagina 40

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

Pagina 41

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

Pagina 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

Pagina 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;

Pagina 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

Pagina 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

Pagina 46

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

Pagina 47

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

Pagina 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(

Pagina 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

Pagina 50

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

Pagina 51

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

Pagina 52

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

Comentarios a estos manuales

Sin comentarios