X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f X-Recipient: djgpp AT delorie DOT com Date: Mon, 14 Mar 2011 07:19:26 -0400 Message-Id: From: Eli Zaretskii To: djgpp AT delorie DOT com In-reply-to: <3e035797-6b8e-4106-bd29-98e87a9cc121 AT a21g2000prj DOT googlegroups DOT com> (message from Jim Michaels on Mon, 14 Mar 2011 02:06:34 -0700 (PDT)) Subject: Re: csdpmi7 not working on virtualbox, how use dosmemget with seg ofs from int21h? References: <39cdc18e-eccb-4213-b896-db3be020702e AT w9g2000prg DOT googlegroups DOT com> <3e035797-6b8e-4106-bd29-98e87a9cc121 AT a21g2000prj DOT googlegroups DOT com> MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Reply-To: djgpp AT delorie DOT com > From: Jim Michaels > Newsgroups: comp.os.msdos.djgpp > Date: Mon, 14 Mar 2011 02:06:34 -0700 (PDT) > > On Mar 3, 2:31 am, "Rod Pemberton" > wrote: > > "Jim Michaels" 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!