DNT MemoPen Data Especificações

Consulte online ou descarregue Especificações para Software DNT MemoPen Data. DNT MemoPen Data Specifications Manual do Utilizador

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 52
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 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 página 0
1 2 3 4 5 6 ... 51 52

Resumo do Conteúdo

Página 1 - Memory Mapping

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

Página 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

Página 3

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

Página 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

Página 5

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

Página 6

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

Página 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

Página 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

Página 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

Página 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

Página 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

Página 12

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

Página 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

Página 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

Página 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

Página 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

Página 17

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

Página 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

Página 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

Página 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

Página 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

Página 22

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

Página 23

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

Página 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

Página 25

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

Página 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

Página 27

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

Página 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

Página 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

Página 30

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

Página 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

Página 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

Página 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

Página 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

Página 35

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

Página 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

Página 37

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

Página 38

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

Página 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

Página 40

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

Página 41

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

Página 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

Página 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;

Página 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

Página 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

Página 46

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

Página 47

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

Página 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(

Página 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

Página 50

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

Página 51

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

Página 52

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

Comentários a estes Manuais

Sem comentários