Date: Mon, 23 Apr 2001 13:52:01 +0300 (IDT) From: Eli Zaretskii X-Sender: eliz AT is To: Dennis Yelle cc: djgpp AT delorie DOT com Subject: Re: int86 problems In-Reply-To: <3AE34C5A.CDD4F2E5@jps.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Sun, 22 Apr 2001, Dennis Yelle wrote: > > mov ds, dx > > mov dx, offset DriveDP ;ds:dx points to a device parameters structure > > mov ax, 440Dh ;IOCTL for block device > > int 21h > > > > jc error_handler ;carry set means error > > > That is fine, except for the segment number > that they want in ds. > > info tells me this about int86: > > > This function simulates a software interrupt. Note that, unlike the > > `__dpmi_int' function, requests that go through `int86' and similar > > functions are specially processed to make them suitable for invoking > > real-mode interrupts from protected-mode programs. For example, if a > > particular routine takes a pointer in `BX', `int86' expects you to put > > a (protected-mode) pointer in `EBX'. Therefore, `int86' should have > > specific support for every interrupt and function you invoke this way. > > Currently, it supports only a subset of all available interrupts and > > functions: > > > > 1) All functions of any interrupt which expects only scalar arguments > > registers (i.e., no pointers to buffers). > > > > 2) In addition, the following functions of interrupt 21h are supported: > > 9, 39h, 3Ah, 3Bh, 3Ch, 3Dh, 3Fh, 40h, 41h, 43h, 47h, 56h. > > > So I see that 44h is NOT one of the supported functions. > What is the best, (or any) way to do this? See section 18.2 of the DJGPP FAQ, it explains how to do that. In a nutshell, you need to use `__dpmi_int' instead of `int86', and you need to point DS:DX to the transfer buffer, which is a buffer in conventional memory created by the library for such cases. Then you will need to copy data from the transfer buffer.