[comp.os.os2.misc] os2 device driver question

drc@konkord.uucp (Dave Carhart) (12/08/90)

I have a basic os2 device driver question.

I have done some OS/2 DLL development, and have used the /Alfu compiler
switch when compiling.  This, amoung other things, causes the compiler to
generate code which pushes the caller's DS and loads DS with the DS of the 
DLL module.  It seems that the Operating System must fill in the selector
values in the code when it loads the DLL into memory.  I looked, using
codeview, at the code generated by the compiler at an entry point into the
DLL, and it generated code something like:

			push ds
			push si
			push di
			mov  ax, 0ea7
			mov  ds, ax

Thus, it must have put the 0ea7 in somehow.

My question is, can I do a similar thing with device drivers?  Can I compile
my device driver module(s) with a compiler switch that causes saving and
reloading of DS?  This is an NDIS device driver, and thus is called by another
ring 0 device driver, and not called via DosDevIOCtl, and hence is not
entered thru the strategy routine (I assume that the kernal loads DS correctly
in this case).

Can/does the OS/2 software that handles loading the device driver resolve
whatever relocation references that are in the code (i.e DS) in the same
way as it does when it loads DLL's into memory?

If not, then it seems that this is one reason why, in the NDIS model, the
caller of another driver must pass the DS of the guy he's calling to the
guy being called.

Thanks alot, for reading this long-winded question.  Thank you very much
in advance for your response.

Please E-mail me at the address below. 
Please note that the internet address doesn't work from the reply line
you must manually type it.

-------------------------------------------------------------------------
Dave Carhart		Phone	508-460-4646    FAX 508-481-9772 
Concord Communications, Inc.		 	Telex  910-240-1986	
753 Forest St. 			uucp     -->	uunet!konkord!drc
Marlboro, MA 01572 USA	        internet -->    drc%konkord@uunet.uu.net
-- 
Dave Carhart		Phone	508-460-4646    FAX 508-481-9772 
Concord Communications, Inc.		 	Telex  910-240-1986	
753 Forest St. 			uucp     -->	uunet!konkord!drc
Marlboro, MA 01572 USA	        internet -->    drc%konkord@uunet.uu.net