Mail Archives: djgpp/2002/02/15/14:47:21
Eli Zaretskii wrote:
>
> > From: CBFalconer <cbfalconer AT yahoo DOT com>
> > Newsgroups: comp.os.msdos.djgpp
> > Date: Fri, 15 Feb 2002 11:58:27 GMT
> >
> > But that doesn't explain why the static 'firstime' control failed?
>
> I think it failed because malloc is called from the startup code more
> than once. So the condition guarded the very first call, but not the
> others.
>
> > The file system to receive 'write' has no more reason to be
> > initialized at that point than does cprintf, does it?
>
> The call to `write' doesn't need any initializations, assuming you
> write to handles 1 or 2, which are already preconnected when the
> program starts. `write' is more or less straightforward path to a DOS
> call (you can use `_write' if you want to be even closer to the DOS
> call, but in that case, you will need to use "\r\n" to end a line).
Finally I have debug output. The combination of sprintf to a
local buffer and write actually works. You were right, there are
a lot more calls to sbrk during initialization (around 40), but I
guess the clobbered output mechanisms could never show them, so I
thought there was just the one.
This way output *CAN* be redirected.
--
Chuck F (cbfalconer AT yahoo DOT com) (cbfalconer AT XXXXworldnet DOT att DOT net)
Available for consulting/temporary embedded and systems.
(Remove "XXXX" from reply address. yahoo works unmodified)
mailto:uce AT ftc DOT gov (for spambots to harvest)
- Raw text -