Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

Different behavior of fopen("w") under freedos and msdos? (Developers)

posted by RayeR Homepage, CZ, 17.03.2011, 14:58

> fopen, fwrite and fclose are not functions provided by FreeDOS itself
> directly - these functions are in the compiler's libraries.

Yes. I asked DJGPP group and got some reply pointing the involved DOS calls:

What happens is that fwrite copies data to a buffer
until it is full, then calls _flsbuf (see flsbuf.c in djlsr203.zip),
which in turn calls _write (see _write.c) which invokes Int 21h with
the AH register set to 40h, the DOS Write To File Or Device function.

As for fopen, the exact sequence of system calls depends on the flags
you passed to it. I think it eventually calls Int 21h AH=3Ch (Create
File), but I cannot tell for sure without seeing your code.

---
DOS gives me freedom to unlimited HW access.

 

Complete thread:

Back to the forum
Board view  Mix view
22753 Postings in 2120 Threads, 402 registered users (1 online)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum