LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices



Reply
 
Search this Thread
Old 08-03-2006, 08:52 PM   #1
mjfeeney
LQ Newbie
 
Registered: Aug 2006
Posts: 1

Rep: Reputation: 0
Accessing page 0 from a kernel module


Hello,

As an experiment, I am trying to access the data in the first page of real memory. This corresponds to real addresses 0..0xFFF, inclusive. I am running openSuse 10.1 (kernel 2.6.16) and have code running in a kernel module (specifically, a device driver). The hardware is a Dell IA32 based server with 2GB of real memory.

I know I can't simply set a char * variable to 0 - we all know what happens when a null pointer is dereferenced. Is there a trick to accessing this data?

Thanks - Martin
 
Old 08-04-2006, 01:02 AM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,165

Rep: Reputation: 330Reputation: 330Reputation: 330Reputation: 330
I don't think that will work since your pointer will be interpreted as a virtual memory addess, not a physical one. The usual way to do this is to access /dev/mem (see man mem for details), but as you're in the kernel, you may be able to call on the functions that implement the fops on /dev/mem directly.
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Error] Kernel Module : No kernel module build environment saman007uk Debian 7 09-09-2006 07:34 PM
white sctreen/page when accessing php files. gottin Linux - Software 1 10-26-2005 10:11 AM
PROBLEM WITH ACCESSING WEB PAGE FROM INTERNET EXPLORER ON A XP MACHINE TO SuSE 9.0 Adrian13 Linux - Networking 2 10-20-2004 12:17 AM
web page accessing port 4662 before allowing connect? skog Slackware 2 03-12-2004 03:38 PM
Accessing cups config page tunedLow Linux - Software 3 04-27-2003 08:17 PM


All times are GMT -5. The time now is 04:36 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration