-
how to access memory
Hello,
I'm trying to write a simple program to access a specific memory location (0x7FFF00000000). There is a device mapped at that location. Of course, the OS gives seg fault and doesn't let me access the location. Is there a way to work around this problem? Thanks a lot!
-
Which OS? Most of them don't like you poking around where you shouldn't be.
Quzah.
-
-
clicky click Have fun.
Quzah.
-
> There is a device mapped at that location.
Then use the device driver to do the work for you.
There's no way a protected OS like Solaris is going to let a mere user mode program anywhere near the hardware.
> Is there a way to work around this problem?
Yes, use the appropriate device driver.
-
But there is a problem with the device driver. I don't know how to tell the driver that the device is actually mapped at a memory location. How do I do that? Any hints? Thanks a lot.
-
Oh, I don't know. You could perhaps read the link I pointed you at entitled "device driver tutorial", or maybe the one titled "Writing Device Drivers".
Quzah.
-
> But there is a problem with the device driver.
Tell the author.
> I don't know how to tell the driver that the device is actually mapped at a memory location.
Read the manual for the driver perhaps?
At a rough guess, you (with your system admin hat on) update some OS startup script.
At the point the driver is started, you provide some additional configuration parameter which is the location to look at.
Moved to tech, as this seems more about Solaris admin rather than C programming.