LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
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 02-18-2004, 05:57 PM   #1
marudhu
LQ Newbie
 
Registered: Jun 2003
Location: India
Distribution: RH 9 SuSE 9
Posts: 16

Rep: Reputation: 0
Arrow Getting Physical address in User Mode?


How to get physical address of a pointer in a user mode application ?. Anything can be done with /dev/mem ?.
 
Old 02-19-2004, 01:13 AM   #2
jinksys
Member
 
Registered: Aug 2003
Location: 63123
Distribution: OpenSuSE/Ubuntu
Posts: 419

Rep: Reputation: 35
Are you talking about finding the address that a pointer resides at? If so, you can find it out with C like so,

Code:
#include <stdio.h>

void main()
{
int *p;
printf("Address of pointer p is:%p",&p);
}

Last edited by jinksys; 02-19-2004 at 01:14 AM.
 
Old 02-19-2004, 02:57 AM   #3
cjcuk
Member
 
Registered: Dec 2003
Distribution: Openwall, ~LFS
Posts: 128

Rep: Reputation: 15
Quote:
Originally posted by jinksys
Are you talking about finding the address that a pointer resides at? If so, you can find it out with C like so,

Code:
#include <stdio.h>

void main()
{
int *p;
printf("Address of pointer p is:%p",&p);
}
No, he is referring to physical addresses. He wants to know where in the actual memory address his virtual memory mapping equates to.

Marudhu: I'll look into this when I get back from University today, if you do not already have a solution by then.
 
Old 02-19-2004, 09:12 AM   #4
Marius2
Member
 
Registered: Jan 2004
Location: Munich
Distribution: SuSE 9.2, 10.2, 10.3, knoppix
Posts: 276

Rep: Reputation: 31
May I ask why you want to get the physical adress of your pointer? You
should be able to access all of your code/data via logical adresses (of
which your application knows nothing), and you shouldn't want to access
other portions of the memory - any code I can think of which does that
would be called malicious.
 
Old 02-23-2004, 02:36 PM   #5
marudhu
LQ Newbie
 
Registered: Jun 2003
Location: India
Distribution: RH 9 SuSE 9
Posts: 16

Original Poster
Rep: Reputation: 0
I require this for a bios SMI function call argument. I guess , I can access any of memory in bios SMM mode.
 
  


Reply



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
how to open /proc file in RW mode in user mode? cranium2004 Programming 3 03-06-2005 03:03 AM
two IP address spaces on same physical LAN? linux_newbie_23 Linux - Networking 3 09-28-2004 12:19 AM
NIC physical address hennaheto Linux - Networking 2 01-30-2004 08:40 PM
Physical Address yangh66 Linux - Networking 2 06-19-2001 08:01 AM

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

All times are GMT -5. The time now is 11:18 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