Mail Archives: djgpp/2011/03/14/19:15:19
On Mar 14, 4:19=A0am, Eli Zaretskii <e DOT DOT DOT AT gnu DOT org> wrote:
> > From: Jim Michaels <jmich DOT DOT DOT 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 ne=
ed
> > > > 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 73=
03h
> > > > (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. =A0the code is not working. =A0I get garbage.
>
> > the code you showed me simply passes ES:DI to the function and the
> > same ES:DI buffer is passed back. =A0nothing useful there. =A0in 7303h,
> > the function returns new information. =A0big problem. =A0no code exampl=
es
> > from djgpp!
>
> I think you will find what you need in the venerable DJGPP FAQ list.
>
> http://www.delorie.com/djgpp/v2faq/faq18_4.htmltells 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.htmltells you how to move
> data from a structure filled by Int 21h, and shows an example.
>
> In a nutshell, you will need:
>
> =A0. Define a struct according to the expectations of 217303, and use
> =A0 =A0__attribute__((packed)) on its members, see faq18_5.html.
>
> =A0. Copy the drive string ("C:\\" etc.) into the transfer buffer using
> =A0 =A0dosmemput and __tb, see faq18_4.html.
>
> =A0 . Put the segment and offset of the transfer buffer into DS:DX using
> =A0 =A0 __dpmi_regs and __tb. =A0See also faq18_3.html.
>
> =A0 . Put into ES:DI the segment and offset of the address in the
> =A0 =A0 transfer buffer that is after the end of the drive string. =A0Aga=
in,
> =A0 =A0 use __dpmi_regs.
>
> =A0 . Call __dpmi_int.
>
> =A0 . Copy the information from the transfer buffer to the struct you
> =A0 =A0 defined above, starting at the address you put into ES:DI, using
> =A0 =A0 dosmemget. =A0See faq18_5.html.
>
> That's it!
I don't take to hand-waving. I need concrete examples. code it.
you quote http://www.delorie.com/djgpp/v2faq/faq18_5.html
so I ask again, the address is actually from DOS in ES:DI, how do I
translate this address into an address dosmemget can use? I KNOW that
this address is NOT __tb. so try again.
that FAQ is only half useless to me right now - parts of it I think I
may need like maybe the peek and dosmemget.
but the translation of the address is the critical piece.
I don't know, maybe DJ forgot to put that piece in DJGPP or just
didn't think to document it - hey - I make mistakes too.
maybe the answer is simple.
one part of the answer I was thinking was to convert it to a long
after the int21h call:
unsigned long adr =3D r.x.es;
adr <<=3D 4;
adr +=3D r.x.di;
but what to do with it after that I don't rightly know.
Jim Michaels
- Raw text -