Mail Archives: djgpp/2011/03/14/07:53:33
> From: Jim Michaels <jmichae3 AT yahoo DOT com>
> Newsgroups: comp.os.msdos.djgpp
> Date: Mon, 14 Mar 2011 02:06:34 -0700 (PDT)
>
> On Mar 3, 2:31 am, "Rod Pemberton" <do_not_h DOT DOT DOT AT notreplytome DOT cmm>
> wrote:
> > "Jim Michaels" <jmich DOT DOT DOT AT yahoo DOT com> wrote in message
> >
> > news:39cdc18e-eccb-4213-b896-db3be020702e AT w9g2000prg DOT googlegroups DOT com...
> >
> > >.
> > > I am doing an int 21h function 7303h disk free space call, and I need
> > > to pass a structure to this function and when the function finishes,
> > > it returns a similar structure back, but with different data filled
> > > in.
> > > [...]
> >
> > > the addresses of the structures in real mode memory in question are in
> > > segment offset format coming from and going into int21h function 7303h
> > > (a DOS FAT32 function) at es:di and I need a C string at ds:dx, and I
> > > need to get at whatever is coming back from es:di.
> >
> > > any detailed clues/code as to how I should deal with that?
> >
> that doesn't actually tell me how to to get a random memory location
> value back from int21h in ES:DI and the structure is passed back in
> that. the code is not working. I get garbage.
>
> the code you showed me simply passes ES:DI to the function and the
> same ES:DI buffer is passed back. nothing useful there. in 7303h,
> the function returns new information. big problem. no code examples
> from djgpp!
>
I think you will find what you need in the venerable DJGPP FAQ list.
http://www.delorie.com/djgpp/v2faq/faq18_4.html tells you how to copy
data from your program to conventional memory, where Int 21h can get
at it.
http://www.delorie.com/djgpp/v2faq/faq18_5.html tells you how to move
data from a structure filled by Int 21h, and shows an example.
In a nutshell, you will need:
. Define a struct according to the expectations of 217303, and use
__attribute__((packed)) on its members, see faq18_5.html.
. Copy the drive string ("C:\\" etc.) into the transfer buffer using
dosmemput and __tb, see faq18_4.html.
. Put the segment and offset of the transfer buffer into DS:DX using
__dpmi_regs and __tb. See also faq18_3.html.
. Put into ES:DI the segment and offset of the address in the
transfer buffer that is after the end of the drive string. Again,
use __dpmi_regs.
. Call __dpmi_int.
. Copy the information from the transfer buffer to the struct you
defined above, starting at the address you put into ES:DI, using
dosmemget. See faq18_5.html.
That's it!
- Raw text -