Fast access to memory mapped hardware 
Author Message
 Fast access to memory mapped hardware

Bit of a possibly simple question here ....

I have an 8 bit card, memory mapped into the area between a000h and
b000h, just above the video memory.  (That's two 32k ram chips).

I need to dump this data to disk as fast as possible, but am getting lost
amoung all the buffers, file pointers, memory models etc.  Could someone
pls give me a rough guide as to the fastest way to transfer this data?

I guess that I need to define the RAM as a buffer, and then issue
a write (or fwrite) command to dump the data to disk.   Do I need to
further buffer the data?  I would like to avoid this, as the ram chips on
the card are already performing a buffering operation.

Bit of background - This is for a video capture card.  The spec requires
25 frames per second, 8 bit greyscale, with a variable frame size.  (I
can tweak the frame size, so that the performance of my code matches the
performance of the disk/isa bus etc)

The code I have at the moment can only manage about a 65kb/s transfer
rate, using a peek then a fwrite, with a 512 byte buffer.  (Not good....)

Thanks for all your help. (And if this is a FAQ, please point me to the

Andy.

ps - I've just read the abridged faq, and cannot find a reference.
--


                    http://www.*-*-*.com/ ~andyb



Sun, 14 Sep 1997 03:00:00 GMT  
 Fast access to memory mapped hardware
Hi,

Quote:

>The code I have at the moment can only manage about a 65kb/s transfer
>rate, using a peek then a fwrite, with a 512 byte buffer.  (Not good....)

Try enlarging the buffer to at least the size of a disk cluster
(usually 2K, 4K or 8K, depending on operating system and specific
formatting); a larger multiple would be even nicer.          

If you can get away with it: don't safe at all, just store it in memory
and save at a later time (in DOS/Windows, smartdrive's write behind
caching might do this trick for you...)

As disk I/O is 'expensive', compressing the data might speed up
data transfer as well.

Mark Nieuwmans

--



Mon, 15 Sep 1997 03:00:00 GMT  
 Fast access to memory mapped hardware

Quote:
> I have an 8 bit card, memory mapped into the area between a000h and
> b000h, just above the video memory.  (That's two 32k ram chips).

    For this kind of performance tuning question, you may want to try
    a PC newsgroup. However, one approach would be to bypass the
    library IO routines and write directly from your video memory with
    a low-level OS file writing function.

Quote:
> Andy.

--

***  "Radioactivity - It's in the air, for you and for me" - Kraftwerk  ***


Tue, 16 Sep 1997 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Fast access to video memory

2. Fast access to video memory

3. memory mapped files, access denied

4. Memory mapped address access

5. map::insert - Memory Access Violation Error

6. Memory-mapped files - pros and cons of mapping view on whole file

7. Accessing map elements in vector of maps

8. Hardware buttons mapping via eVC

9. Accessing both Access db and SQLServer db faster from VC++

10. Dynamic allocate memory size in memory mapping

11. IPC: Shared memory via dll vs memory map file

12. copying CObject-derived-classes to shared memory (created using Memory-Mapped file)

 

 
Powered by phpBB® Forum Software