www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/07/26/09:02:34

From: mert0407 AT sable DOT ox DOT ac DOT uk (George Foot)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: __dpmi_int
Date: 25 Jul 1997 20:56:47 GMT
Organization: Oxford University, England
Lines: 36
Message-ID: <5rb3uf$d11@news.ox.ac.uk>
References: <33D43D60 DOT 7BA4 AT indy DOT net>
NNTP-Posting-Host: sable.ox.ac.uk
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

Chris Frolik (frolikcc AT indy DOT net) wrote:
: I am writing (or trying to write) a program in DJGPP which uses IPX
: protocol through the Internet.  This protocol uses the interrupt 0x7A
: from the IPX driver.
: The code which defines a block of data to be sent/recieved is as
: follows:
(snip)
: This code fragment executes function 4 of interrupt 0x7A, which requires
: ES:SI to point to the ECB structure.
(snip)

If you allocate a block of real-mode memory using the
__dpmi_allocate_dos_memory function (qv in the libc reference) then you
can simply use the segment returned with an offset of 0. Copy into this
block any information you need to send to the interrupt routine, call the
interrupt, and then copy the returned information out again, finally
freeing the allocated space using __dpmi_free_dos_memory (qv).

If you will be calling this routine a lot you could more efficiently
allocate the block of low memory on initialisation, use it over and over
again later on, and free the block on shutdown. Or you could use the
transfer buffer, which is already allocated for you, doesn't need freeing,
and can normally be stomped on without causing any problems.

When you call __dpmi_int, it uses the register values in the __dpmi_regs
struct you pass it to initialise the registers, and copies their values
back into this struct before returning, after the interrupt is complete.

See section 18.2 of the FAQ again for further details, including an
example of how to put the address of the transfer buffer into a
__dpmi_regs structure, and section 18.4 for details of how to get your
data to and from the transfer buffer or another buffer you have allocated. 

-- 
George Foot <mert0407 AT sable DOT ox DOT ac DOT uk>
Merton College, Oxford

- Raw text -


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