On Mon, 5 Apr 2004 23:13:16 +0100 (BST), Bart Oldeman wrote:

Hi, in the FAQ, somebody claims that file handle 4 should default to PRN:
http://fd-doc.sourceforge.net/faq/cgi-bin/viewfaq.cgi?faq=incoming/224
Any idea why this would work at all? And why it works in MS but not in
FreeDOS? Used language is C.

Look at the definitions in <stdio.h> - stdaux is _iob[3], and stdprn is _iob[4] (Borland uses "_streams" instead of "__iob"). The order of these devices in different in MS-DOS and FreeDOS:

MS-DOS: CON, AUX, PRN, CLOCK$, A:-D:, COM1, LPT1, LPT2, LPT3, CONFIG$, COM2, COM3, COM4
FreeDOS: CON, PRN, AUX, LPT1, LPT2, COM1, COM2, COM3, COM4, CLOCK$, A:-D:


Fortunately, fixing this is very easy. It's enough to swap the
corresponding entries in io.asm. Do I need to provide a patch for this?

Aren't you looking at the wrong place here? It's about the high level handles as far as I know.

The PSP has for the handles:
 0  1  2  3  4  5  6 ...
01 01 01 00 02 FF FF

01 = CON
00 = AUX
02 = PRN

which means that also in FreeDOS, (high level) handle 4 corresponds to
PRN.

So the problem must be somewhere else.

I don't understand you (I usually need a bit more explanation ;-) but you're right! The follwing simple test program


#include <stdio.h>
void main()
{
        fputc('\f', stdprn);
}

works on MS-DOS, FreeDOS before my patch, and FreeDOS after my patch!

So my patch is not needed then. And I have no idea what the bug reporter means :-(

But today I encountered an application (a X-modem file transfer program called TRANSFER.EXE by Datalight) that hangs up FreeDOS after returning to DOS prompt when all my drivers and TSRs are loaded (and not in bare DOS). This doesn't happen in MS-DOS (with the same TSRs and drivers). I need to investigate where exactly the incompatibility is and then what exactly causes the hang.

Lucho


------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ Freedos-kernel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/freedos-kernel

Reply via email to