delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2011/03/20/19:46:19

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
From: Jim Michaels <jmichae3 AT yahoo DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: csdpmi7 not working on virtualbox, how use dosmemget with seg ofs
from int21h?
Date: Sun, 20 Mar 2011 16:37:02 -0700 (PDT)
Organization: http://groups.google.com
Lines: 62
Message-ID: <d2261757-c649-4911-a491-956f91511dc1@l2g2000prg.googlegroups.com>
References: <39cdc18e-eccb-4213-b896-db3be020702e AT w9g2000prg DOT googlegroups DOT com>
<iknmth$1lb$1 AT speranza DOT aioe DOT org> <3e035797-6b8e-4106-bd29-98e87a9cc121 AT a21g2000prj DOT googlegroups DOT com>
<E1Pz5o6-0001qv-4s AT fencepost DOT gnu DOT org> <428d9bd6-efc5-4f66-bab3-961a0c4598f9 AT f31g2000pri DOT googlegroups DOT com>
<E1PzO3K-0007xl-Bg AT fencepost DOT gnu DOT org> <42d13cb8-adf4-4a86-9cf2-012d0929fb4c AT q40g2000prh DOT googlegroups DOT com>
<E1PzRg3-0006F7-Fj AT fencepost DOT gnu DOT org> <50f38a5d-a391-45e7-a039-14932c9134d8 AT 11g2000prf DOT googlegroups DOT com>
<E1Q06Xg-0003hM-93 AT fencepost DOT gnu DOT org>
NNTP-Posting-Host: 24.21.90.47
Mime-Version: 1.0
X-Trace: posting.google.com 1300664222 25526 127.0.0.1 (20 Mar 2011 23:37:02 GMT)
X-Complaints-To: groups-abuse AT google DOT com
NNTP-Posting-Date: Sun, 20 Mar 2011 23:37:02 +0000 (UTC)
Complaints-To: groups-abuse AT google DOT com
Injection-Info: l2g2000prg.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: 4475
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

On Mar 16, 11:18=A0pm, 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: Wed, 16 Mar 2011 16:16:47 -0700 (PDT)
>
> > it would be very nice if
> > I didn't have to do this, if DJGPP supported this already in
> > _dos_getdiskfree() so I wouldn't have to code my own stuff.
>
> Since no one felt the need to code this in the library, it wasn't
> coded. =A0DJGPP is developed by volunteers. =A0You are welcome to submit
> patches for inclusion in the library.
>
> > when I make the 7303h calls I always get back failure (carry flag set
> > and ax=3D0x0f), bur first I call 7300h, this seemed to help some. =A0ma=
ybe
> > I need to install a critical error handler?
>
> I don't think you need a critical error handler.
>
> > the entire code for the program is 3100 lines long, so I think it's
> > too large to post here.
>
> No one asked for everything, just for enough of it to see all the
> crucial details related to this system call. =A0Omitting declarations of
> some of the arguments of the system call leaves important information
> out.
>
> > maybe __dpmi_int() is hooking the software interrupt in a way that
> > causes errors
>
> No, __dpmi_int doesn't hook any interrupts. =A0It uses a DPMI function
> to call a real-mode interrupt from a protected-mode program.
>
> > or the flags register is not being set correctly after a software
> > interrupt?
>
> There's no need for you to consider a possibility that basic
> infrastructure of calling DOS functions does not work in DJGPP. =A0If
> something like that could be a problem, many library functions would
> fail, which of course doesn't happen.
>
> The answer to the problem is in your program, or perhaps in some issue
> with FreeDOS and protected mode or DPMI (since I understand the
> assembly that works is a real-mode program, not a protected-mode
> program that uses DPMI).
>
> You have been shown two working implementations. =A0I suggest to try
> compiling them and see if they work. =A0If they work, then modify your
> program to use the same code as those two implementations. =A0If they
> don't work, the problem is with FreeDOS.

 http://jesusnjim.com/code/windows-dos/df.html

in looking at working code and wondering why mine wasn't working for
over a month now, I came to realize 2 things:
1. I had swapped DS:DX and ES:DI (ouch). this was causing the error
flag to be set.
2. I was getting garbage back from the function call because you have
to use dosmemput and dosmemget very close to _dpmi_int(0x21, &regs)
calls in djgpp, or that memory will get written over by something else
in your program quickly without your knowledge!  it can get scrambled.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019