[comp.protocols.tcp-ip.ibmpc] Turbo C and Packet Drivers

johnh@dbase.A-T.COM (John Haskey) (04/06/91)

Does anyone out there have some example code that shows how to talk to a 
packet driver from Turbo C?  I can get everything going except for the
most important:  The receiver routine specified in the call to access_type().
If some kind soul could enlighten me with a small code fragment I would be
very thankful.
								---john.

p.s.  What is the latest version of the Packet Driver Specification?

gordon@FTP.COM (Gordon Lee) (04/11/91)

    From: John Haskey
    Subject: Turbo C and Packet Drivers
    
    p.s.  What is the latest version of the Packet Driver Specification?

Version 1.09, available via aononymous ftp from vax.ftp.com:~/pub/packet-d.*

== Gordon Lee                 FTP Software Inc
== voice: (617) 246-0900      26 Princess St
== fax:   (617) 245-7943      Wakefield, MA  01880

jbvb@FTP.COM ("James B. Van Bokkelen") (04/11/91)

    ... The receiver routine specified in the call to access_type().
    If some kind soul could enlighten me with a small code fragment I would be
    very thankful.

Our protocol stacks use a small ASM routine to save the registers and
switch to a stack of their own, and then call C to do the bulk of the
work.  You can probably use a compiler's "interrupt" function mechanism
to make it work, but you'll be relying on the driver leaving you enough
stack.  I don't have experience with Turbo's "interrupt" functions, and
while I know MSC can do them, I've never found the place in the manual
where they're explained.
    
    p.s.  What is the latest version of the Packet Driver Specification?

V1.09 is current.

James B. VanBokkelen		26 Princess St., Wakefield, MA  01880
FTP Software Inc.		voice: (617) 246-0900  fax: (617) 246-0901

romkey@ASYLUM.SF.CA.US (John Romkey) (04/12/91)

   Date: Thu, 11 Apr 91 12:14:35 -0400
   From: "James B. Van Bokkelen" <jbvb@ftp.com>
   Reply-To: jbvb@ftp.com

   Our protocol stacks use a small ASM routine to save the registers and
   switch to a stack of their own, and then call C to do the bulk of the
   work.  You can probably use a compiler's "interrupt" function mechanism
   to make it work, but you'll be relying on the driver leaving you enough
   stack.  I don't have experience with Turbo's "interrupt" functions, and
   while I know MSC can do them, I've never found the place in the manual
   where they're explained.

Declaring a function as 'interrupt' probably won't work properly.
'interrupt' functions do indeed save and restore all the registers,
but they also expect the stack frame to be the same format as an
interrupt stack frame, which means the flags register is pushed on the
stack and popped off it on return. The packet drivers won't have left
the flags register on the stack, so the stack will get screwed up.
		- john romkey			Epilogue Technology
USENET/UUCP/Internet:  romkey@asylum.sf.ca.us	voice/fax: 415 594-1141

jrc@brainiac.mn.org (Jeffrey Comstock) (04/16/91)

In article <9104111225.AA05250@ftp.com> gordon@ftp.com writes:
>
>    From: John Haskey
>    Subject: Turbo C and Packet Drivers
>    
>    p.s.  What is the latest version of the Packet Driver Specification?
>
>Version 1.09, available via aononymous ftp from vax.ftp.com:~/pub/packet-d.*

For people who use archive servers:

pub/packet-d.ascii		- Ascii text
pub/packet-d.mss
pub/packet-d.prn
-- 
Jeffrey R. Comstock