www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/02/18/05:35:09

Date: Tue, 18 Feb 1997 12:14:39 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Andrew Crabtree <andrewc AT typhoon DOT rose DOT hp DOT com>
cc: djgpp AT delorie DOT com
Subject: Re: Realmode Callbacks
In-Reply-To: <199702171942.AA004628557@typhoon.rose.hp.com>
Message-ID: <Pine.SUN.3.91.970218120031.20000F-100000@is>
MIME-Version: 1.0

On Mon, 17 Feb 1997, Andrew Crabtree wrote:

> I'm having some difficulty installing a real mode callback to
> a Packet Driver.

Why do you need a real-mode callback at all?  Is that a hardware 
interrupt (if so, you can install a protected-mode handler only) or a 
software interrupt?

> If anybody has an example of installing a protocol over a 
> Packet Driver and just wants to post that that would be fine.

You can llok at the port of WATTCP library to DJGPP.  One port is cited 
in the DJGPP FAQ list; another is available as part of the Lynx sources 
ported by DJ Delorie: ftp://ftp.delorie.com/pub/dj/lynx26s.zip.

> 1) From the FAQ I think I should be calling go32_alloc_realmode_retf
> and then using __dpmi_int.  The pktdrv call needs a ton of registers
> passed and originally I was using int86x but this always crashed.

Don't use int86x at all, always use __dpmi_int.

> Are these the "proper" routines to use or should I always use 
> the dpmi calls or the go32 calls.  Everything I'm writing will be in C.

Then use _go32_XXX functions and lock the data and code of your program 
(the FAQ shows how).

> 2) What is the best way to use 2 bytes of real mode memory.  I know 
> that I can either dpmi_conventional_alloc or use the transfer 
> buffer.  How does one write into the transfer buffer, I only saw
> examples of how to pass it to real mode routines?

Use one of the methods in section 18.4 of the FAQ.  For 2 bytes, using 
`_farpokew' library function seems the most appropriate.  The transfer 
buffer has _dos_ds as its selector and __tb as its linear address.

- Raw text -


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