Mail Archives: djgpp/2011/03/20/19:46:19
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, ®s)
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 -