Access to Sram memory

  • Thread starter Thread starter Kevin Hirst
  • Start date Start date
K

Kevin Hirst

Not Sure if this in the right place.
Our Base board has some Battery backed Sram Memory located in ISA SPACE at
0xd0000.
Our problem is that when we attempt to access this memory from Visual studio
or Vb6 the Operating system (XPe) raises an exception (as it should I guess).

The question is does anyone know how to get around this problem or know of a
DLL etc designed to allow access to memory of this type?
 
Hi Sean
The ETX base board design was drafted in house by our company and is going
to be used in the gaming industry, Up until now we only used port mapping in
ISA space and we used a driver called IO.DLL to access it. We have recently
amendded our design to include Sram memory in the Isa Space as well and I am
having trouble getting to grips with exactly how to access it from within our
design environment (VB6 preferably)

Thanks and Regards

Kevin Hirst
(e-mail address removed)
 
How are you call the IO.DLL now? Via C/C++?

From VB.NET, I know that a P/Invoke call would have to be used to call down
into the DLL via C/C++ solution. The same should be true for VB6.

-Sean
 
Hi Sean
Thanks for your Diligence on this problem.

The IO.DLL is declared as a function as shown below

Private Declare Function PortIn Lib "IO.DLL" (ByVal Port As Integer) As
Byte

Below is the Get memory function declared in VB6 from the msvbsm60 DLL
unfortunatly if the memory address passed is not the address of a current
variable in the project (usualy obtained with VARPTR) then the Kernal Raises
an exception.

Private Declare Sub GetMem1 Lib "msvbvm60" (ByVal Addr As Long, Retval As
Byte)


Regards


Kevin Hirst
 
I'll just like to add a few comments;
(I had a simlar problem in Windows XP Professional - but it should be the
same in Embedded)

Please make a post in development.device.drivers or in ntdev at
osronline.com,
they know about the issues regarding the memory-bridge (memory-window) in
the LPC/ISA-to-PCI-bridge.

1. The "PortIn" in IO.DLL should be OK,
even though that the IO-address is not really "claimed" by the right device
driver.
(It does not conform to WHQL to claim a port range that does not belong to
"you")

The right way is to define both the IO-range and the MEM-range in the
ACPI-table of the BIOS.
Then, the PnP manager in Windows XP will load the correct driver and assign
it the correct port- and memory-ranges.

2. GetMem1 is wrong.

GetMem will only get the virtual memory of the current process.
It will not get the physical ISA / LPC memory.

You will have to map the physical memory to a valid kernel address inside
the "real" Windows XP kernel (not kernel32.dll!).
And then perform a memory copy between the user-mode buffer and the kernel
address.

I think that you might have to open a "memory window" in the PCI-bridge
controller
between the ISA / LPC to the PCI-memory bus.

It's a bit complicated.


Make a post in the other (two) newsgroups, if you need a more detailed
answer.


.... but a few notes here anyway;
-----------------------------------------------------------------------------------

A shortcut (if you do not want to encode a ACPI-table in the BIOS)
is to use the the "LogConfig" directive of the device driver INF-file.

The PnP-manager will handle the IO-ranges and the memory-bridges by itself,
you will only have to declare your LogConfig-section and
write (find) a proper device-driver (using KMDF, of course! - see
www.microsoft.com/whdc)
that will handle the routing between your user mode code and the mapped
addresses.
 
Hi Andrew
Thanks for the advice below. I will make a post in the other areas that you
suggest
below if our problme persists. Your advice is most helpful though.

In digginag around the net I came across a product called rapid driver which
is essentially a tool kit from ENtech that builds a DLL for you in response
to the settings that you provide.
It operates with ISA (PORT and MEMORY), PCI, USB Etc.
It is of course not free but the trial version that I have just tested
worked great.

The DLL that it produces can be Declared in VB or .NET , C# etc etc
and they provide good documentation and examples in Various languages.
In all it took us only half an hour to get the prolem solved with this
product.
An easy bridge between the application and the hardware.

The Address for anyone interested in taking a look is:

http://www.entechtaiwan.com/dev/rapid/index.shtm

Thanks to all who replied.


Regards



Kevin Hirst
 
Back
Top