memory mapped data aquisition card

memory mapped data aquisition card

Post by ra » Sun, 12 Feb 1995 07:49:48



I'm Interested to read  data via memory mapped data aquisition card
How can I access the card's phisical address (C800-C840)   ( 16 bits
IOPL code ,write a device drive , IOCLT calls?).
 C Static pointers like DOS turbo c++ ( char *p=(ADDRESS))  generate GFPs.
(note: I use C set ++ compiler)

Thanks , Ricardo

 
 
 

memory mapped data aquisition card

Post by David Charl » Thu, 16 Feb 1995 08:41:53



>I'm Interested to read  data via memory mapped data aquisition card
>How can I access the card's phisical address (C800-C840)   ( 16 bits
>IOPL code ,write a device drive , IOCLT calls?).

> C Static pointers like DOS turbo c++ ( char *p=(ADDRESS))  generate GFPs.

Your pointer is completely invalid.  Your c800 address is a segment
address.  You have to convert it to a 32-bit address.  I think C Set
has a library routine to do this for you.

But that still won't work because the memory isn't in your address
space.  I think you're going to need a device driver.  Perhaps you can
set it up to create a piece of shared memory and map the card's
address space onto it.  This way, an app can open the shared memory
and access it.  (Perhaps an IOCtl can be used to request the shared
memory handle.)

But I'd want to review what the card does.  Don't manipulate it like
you would in DOS.  Let your device driver deal with the memory mapping
and stuff.  Think up a useful high-level API for interfacing with the
card and let your driver provide that interface.  From there, your
application can request access to the card with DosOpen, and can
connunicate with it using DosRead, DosWrite and DosDevIOCtl, releasing
it with DosClose.

---------------------+--------------------------------------------------------
David Charlap        | The contents of this message are not the opinions of

Visix Software, Inc. +--------------------------------------------------------
Member of Team-OS/2  |
---------------------+

 
 
 

memory mapped data aquisition card

Post by @ » Sat, 18 Feb 1995 00:55:47




>>I'm Interested to read  data via memory mapped data aquisition card
>>How can I access the card's phisical address (C800-C840)   ( 16 bits
>>IOPL code ,write a device drive , IOCLT calls?).
>> C Static pointers like DOS turbo c++ ( char *p=(ADDRESS))  generate GFPs.
>Your pointer is completely invalid.  Your c800 address is a segment
>address.  You have to convert it to a 32-bit address.  I think C Set
>has a library routine to do this for you.

>But that still won't work because the memory isn't in your address
>space.  I think you're going to need a device driver.  Perhaps you can
>set it up to create a piece of shared memory and map the card's
>address space onto it.  This way, an app can open the shared memory
>and access it.  (Perhaps an IOCtl can be used to request the shared
>memory handle.)

Yes, you have to use a device driver to access the memory of the
memory-mapped device.  The driver is very, very simple.  You need to
support two driver calls: Init and an ioctl.  The init does nothing just
returns OK.  The ioctl returns a valid pointer that can be used by the
calling process to access the memory, it uses the DevHlp call
PhysToUVirt (physical address to user virtual address).

Tim