From: batman@mb5000.anes.upmc.edu (William E Madden Jr.)
Newsgroups: comp.os.msdos.apps,comp.os.msdos.misc,comp.os.msdos.programmer
Subject: Pointer to absolute address conversion, and other fun topics
Keywords: pointers DMA Stupid architecture
Date: 4 Sep 92 16:12:01 GMT
Organization: UPMC



Hi out there!  I'm cross posting this to most of the msdos groups, since I'm not
real sure which one I want.  I don't read any of these groups frequently, so if
you can answer my question, please respond via e-mail to one of the addresses in 
my sig.

I'm a unix weenie, and don't get into working with DOS very much, in fact, I think
that the memory models of C programming put a bit too much constraint on the 
programmer, but that's neither here nor there.  Right now, I'm developing a SCSI
interfaced box, and the embedded processsor/OS combination we chose was i386 DOS5.0. 
The DOS machine transfers the data to a workstation in a workstation understood format over
the SCSI bus.  This may sound complicated, but believe me, it's easier than the other choices.
I would like to know the answers to any of the following questions:

1) Does anyone know how the SCSI transfers on the DOS "Kernel" level are implemented?
What I mean is how does DOS interface with SCSI chips.  What is handled by an ISR, what is
typically handled by the kernel, based on flags set when the ISR recieves a "SCSI BUS NEEDS
INFO" type of signal.  From what we can tell, we could parse the phase of the SCSI protocol
in an ISR and then "poll" the DMA chip when the flags set tell us to, but if we don't have
to re-invent the wheel, we don't want to.  

2) To use DMA, we need the absolute address of a page in memory to specify a read/write
start.  I know how to derive the absolute address from a pointer on unix, but how would
you do it with, say a DOS far or near pointer (ie, shift what 4 bits for the segment, and
add what to get the offset.)

3) Does anyone out there have any experience using the _vheapinit() _vmalloc() etc
functions provided by the MSC 7.0 kit?  This may not be the best choice but we'd
really like to get away with not using a DOS extender.  What we need to do is store and
retrieve data in memory above 1 MB (typically 1-4MB), but we want to do it with a DMA.  
In addition to knowing the reliability of the _v functions, I need to know how to translate
the virtual handle to an absolute address for the DMA.

Hopefully, these questions  made SOME sense.
		Thanks in advance,
			Please reply to my e-mail address below.
					Bill
-----------------------------------------------------------------------------------
William E. Madden Jr.			| Even I won't be held responsible 
Software/Systems Engineer		| for the things said in this message
Computational Diagnostics, Inc.		| so why should Starfleet Acadamy,
Pittsburgh, PA 15213			| any of my ex-girlfriends, or CDI
madden@cdi01s.cdi.com			| be held accountable?
wemst7@unix.cis.pitt.edu		|
-----------------------------------------------------------------------------------
	"There is no problem that cannot be solved by the proper application
		of plastic explosives."
			-Anonymous
-----------------------------------------------------------------------------------

Newsgroups: comp.os.msdos.apps