ftp.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/04/20/10:59:29

Date: Thu, 20 Apr 95 01:09:20 EDT
From: skr5 AT cornell DOT edu (Steven K. Rossi)
Reply-To: skr5 AT cornell DOT edu (Steven K. Rossi)
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: dosmemget and dosmemput

Hi! 
I am a new subscriber to this list, and a relatively new
users to djgpp.
I'm trying to use it to compile code that accesses hardware
(a DSP coprocessor
board) in the PC's conventional memory space, i.e segment
0xD000.
I'm trying to use the dosmemget and dosmemput routines to
read and write to these locations, where I generate the
"offset" value that is passed to these routines as  (dos
segment * 16) + (dos offset). As far as I can tell, I'm
doing
everything right, but it doesn't work. I write to several
consecutive locations then read back, and I get
pseudo-garbage. I say pseudo-garbage, because it isn't
really garbage, there may be some rhyme or reason to it.
Here is what I observe:

Value Written				Value Returned
0 - 255					0
256-511					257
512-767					514
768-1023				771
1024-1279				1028
1280-1535				1285
1536-1791				1542
1792-2047				1799

etc... See the pattern? The most striking thing is that
constant values are returned, changing on byte boundaries of
the input. The other thing is that the values returned are
increasing by 1 each time, from what you might expect, i.e.
in the returned column, I might expect to see 0, 256, 512,
768, 1024, 1280, 1536, etc
instead I see 0+0, 256+1, 512+2, 768+3, 1024+4, 1280+5,
1536+6, 1792+7, etc... very strange!! I can't quite
understand whats causing this.

Does anyone have any experience using these functions, who
may be able to offer some advice?

The location that I write to is actually shared memory,
physically located on the coprocessor board which is on the
ISA bus. Could there perhaps be some kind of a timing issue
involved that the dosmemget and put routines don't take into
consideration, since reads and writes to these location
actually go over the ISA bus?

Any advice would be appreciated!
Thanks!
Steve
_____________________________________________________________________
Steven K. Rossi                        	skr5 AT cornell DOT edu
319 Highland Rd. #7A			Cornell University
Ithaca, NY 14850	                M.Eng. Electrical Engineering

http://www.cs.cornell.edu/Info/People/srossi/srossi.html
---------------------------------------------------------------------
Get WARPED today! ... OS/2 Warp!

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019