LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-20-2004, 09:45 AM   #1
mark02k
LQ Newbie
 
Registered: Oct 2004
Distribution: Fedora
Posts: 1

Rep: Reputation: 0
Question mmap64 wrong physical mapping


I am writting an application that needs control over large (1gig+) portions of contiguous memory. I am currently doing this by using mem=1024m during boot. My system is a dual opteron with 5 gig of memory. In my program I have

if ((fd=open("/dev/mem", O_RDWR))<0)
{
perror("open");
exit(-1);
}


PtrMemoryBase = (void *) mmap64(
NULL,
size,
PROT_READ | PROT_WRITE,
MAP_FILE | MAP_SHARED,
fd,
base );

size = 0x400000000

I also have -D_FILE_OFFSET_BITS=64.

If base is between 1 and 3 gig the process works fine. When base is 4 gig + the mmap64 works but the memory does not seem to be mapped to the base location. I write a pattern to PtrMemoryBase then have my hardware start doing DMA transfers to the base address but I do not get the data I wrote to PtrMemoryBase.

Thanks for any help
Mark

Last edited by mark02k; 10-20-2004 at 09:47 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
API for mapping Physical Address to Virtual Address Lakshman_smt Linux - Software 2 10-15-2006 09:08 PM
Wrong Keyboard mapping. mullog *BSD 0 09-22-2004 03:23 PM
how to fix imap wrong domain mapping problem? htm Linux - Networking 29 04-25-2004 11:24 AM
LVM Problem - vgimport - wrong number of physical volumes to import volume group Anything1 Linux - Software 0 09-06-2003 07:18 PM
physical scsi channel mapping to scsiX device node mapping, how to configure manually drthornt Linux - Hardware 3 02-09-2003 11:50 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:12 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration