LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Closed Thread
  Search this Thread
Old 11-21-2011, 03:14 PM   #1
dudeatul
LQ Newbie
 
Registered: Nov 2011
Posts: 2

Rep: Reputation: Disabled
Physical address on a x86 64-bit machine


Hi All,

I have been trying to run through an exercise to open a filepointer for /dev/mem in user space and navigate over all of the mem_map entries (struct page entries). In order to get started on this, I wrote a kernel module to display start of memmap logical address and also its physical address. I used the functions pfn_to_page(0) to get the logical address and __pa(pfn_to_page(0)) to get its corresponding physical address.
The output of this kernel module is something like this
MemMapLogicalAddress=ffffea0000000000
MemMapPhysicalAddress=0000620000000000
NumPhysicalPage=524288
PageSize=4096
PageOffset=ffff880000000000

When I try to use mmap to map to the physical address above it works fine but when I try to read values from that map_base, my process gets killed and when I look into /var/log/messages there is a message that says bad PGD.

My question is why is physical address (0000620000000000) beyond 4gb, I have only 2GB memory but its a 64 bit machine. Am I missing something here?
 
Old 11-22-2011, 11:47 AM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.

In this case closing the original in favour of the more sensibly placed dupe:
http://www.linuxquestions.org/questi...1/#post4530118
 
  


Closed Thread


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
segmantation fault on a 64 bit machine caused by binary compiled on a 32 bit machine ninofattore Linux - Newbie 1 10-13-2011 02:48 PM
PC freezes totally while accessing physical memory on Ubuntu 10.04(64-bit machine) pavan8085 Linux - Kernel 3 06-01-2011 03:32 PM
build x86-64 application on 32-bit machine using x86-64 toolchain linuxgentoo Linux - General 16 06-03-2009 04:15 AM
How much physical memory can a 32-bit installation address gschmitt99 Linux - General 1 09-19-2008 02:10 PM
Mandriva 32-bit X86, 64-bit x86-64 & i586. La Dima Mandriva 9 10-07-2005 07:12 AM


All times are GMT -5. The time now is 08:28 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration