Re: Using C functions in a TSR program
- From: "nomedeuser@xxxxxxxxx" <nomedeuser@xxxxxxxxx>
- Date: Wed, 28 Nov 2007 03:11:38 -0800 (PST)
On Nov 28, 4:11 am, p...@xxxxxxxxxxxxxxxxxx wrote:
In article <0511af26-8373-4a51-a308-d7a41243b...@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
nomedeu...@xxxxxxxxx "nomedeu...@xxxxxxxxx" writes:
On 27 nov, 17:39, p...@xxxxxxxxxxxxxxxxxx wrote:
In article <dd40c6fa-cb21-4847-a1cb-28ab53d59......@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
nomedeu...@xxxxxxxxx "nomedeu...@xxxxxxxxx" writes:
[..]
Pete, I couldn't see your changes at the pastebin.com code...
but i tried to use open(), but it has the same problem, didn't
solve...
I've not come across pastebin.com before, but just returned there
and selected the link to view follow-ups from "anon" [me] and the
changes I made are showing there...
Well... have you already coded a C program that called this functions?
I frequently use read(), write() etc. when the power/flexibility
of fread()/fwrite()/fprintf() are not needed. You should see
from the changes I made at pastebin that I replaced
printf("Download");
with
write(1, "Download", 8);
for example. printf() in the implementations I've looked at
requires a fair amount of stack space (which write() does not)
and it is things like this that *might* be breaking your TSR.
If yes, so here has to works too and i'll continue trying...
If no, i'll try to use INTs (low level equivalents, was what you said,
right?) like 21, function 3Dh, etc in the place of open() etc...
That would of course be even smaller/faster, but decent
implementations of open(), read() etc. will do just that: set up
the regs and call the appropriate DOS service.
[..]
Hi Pete! So... I wrote the code using INTs and it's running better
now, but not 100%...
For example, if do consecultives CTRL + C at the prompt, after some
time the system
hangs... the same happen if I insure the ENTER key... and I can't run
a application that I have
together with it, but comands like dir, cls, etc etc works well and
the system doesn't hang if
I don't do the things i said above...
The problem is that i have to run this program together with the
TSR...
Memory, I verified, isn't the problem... there's sufficient space to
the two...
And again, I have no idea what can be... :P
But I'll be searching for the problem...
From your observations of pressing ^C, perhaps you should be
monitoring DOS's crtical error flag as well as InDos. I assume
you have a copy of Ralf Brown's Interrupt List (search for RBIL
if not) and take a look at the comments for Int 21h/AH=34h and
also the entry for Int 21h/AX=5d06h. Both flags should be clear
before requesting a DOS service.
Pete
--
"We have not inherited the earth from our ancestors,
we have borrowed it from our descendants."
Hi Pete, so... I tried to use 5D06h function to get the errorFlag, so,
i did this way:
regs.x.ax = 0x5D06;
int86x(0x21, ®s, ®s, &sregs);
errorFlag = (char far *)MK_FP(sregs.es, regs.x.bx);
But I'm getting the same address that InDOS flag... 321. I read some
places that errorFlag is ever 1 byte before the InDOS flag... so i
tried to decrement InDOS flag and i got 320, but in this place it
*ever* has 1.
I searched for some more information about the error flag and I
couldn't find more things about...
.
- Follow-Ups:
- Re: Using C functions in a TSR program
- From: nomedeuser@xxxxxxxxx
- Re: Using C functions in a TSR program
- References:
- Using C functions in a TSR program
- From: nomedeuser@xxxxxxxxx
- Re: Using C functions in a TSR program
- From: nomedeuser@xxxxxxxxx
- Re: Using C functions in a TSR program
- From: pete
- Using C functions in a TSR program
- Prev by Date: Re: Using C functions in a TSR program
- Next by Date: Re: Using C functions in a TSR program
- Previous by thread: Re: Using C functions in a TSR program
- Next by thread: Re: Using C functions in a TSR program
- Index(es):
Relevant Pages
|