Reputation: 631
I am trying to write a program that uses dual ported RAM. I have a made a pointer to the memory address listed in the resources for the device in device manager. But every time I try to read from it, I get an Access Violation, what I am doing wrong? According to the device manufacturer, an offset of 0x0800 is open to read and write.
IntPtr ptr = new IntPtr(0xF7E00000);
float value = Marshal.ReadInt32(ptr, 0x0800);
MessageBox.Show(value.ToString());
Upvotes: 0
Views: 1173
Reputation: 3813
If this is a physical address, you need a device driver. You can't create a device driver with .NET. If the device comes with a driver, it probably has an API you can call.
If you really need to write a driver, I'd recommend downloading the DDK from Microsoft, and learning C and kernel-mode programming. This is not a simple task.
Upvotes: 1