X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f From: Jim Michaels Newsgroups: comp.os.msdos.djgpp Subject: Re: csdpmi7 not working on virtualbox, how use dosmemget with seg ofs from int21h? Date: Mon, 14 Mar 2011 15:52:59 -0700 (PDT) Organization: http://groups.google.com Lines: 94 Message-ID: References: <39cdc18e-eccb-4213-b896-db3be020702e AT w9g2000prg DOT googlegroups DOT com> <3e035797-6b8e-4106-bd29-98e87a9cc121 AT a21g2000prj DOT googlegroups DOT com> NNTP-Posting-Host: 24.21.90.47 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1300143180 30157 127.0.0.1 (14 Mar 2011 22:53:00 GMT) X-Complaints-To: groups-abuse AT google DOT com NNTP-Posting-Date: Mon, 14 Mar 2011 22:53:00 +0000 (UTC) Complaints-To: groups-abuse AT google DOT com Injection-Info: i39g2000prd.googlegroups.com; posting-host=24.21.90.47; posting-account=05hOMwoAAAB6R8xtiQKzEljSMzgOhVF1 User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.15) Gecko/20110303 Firefox/3.6.15 ( .NET CLR 3.5.30729),gzip(gfe) Bytes: 5040 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com On Mar 14, 4:19=A0am, Eli Zaretskii wrote: > > 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 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