Different behavior of fopen("w") under freedos and msdos? (Developers)
> 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:
- Different behavior of fopen("w") under freedos and msdos? - RayeR, 16.03.2011, 00:55 (Developers)
![Open in board view [Board]](img/board_d.gif)
![Open in mix view [Mix]](img/mix_d.gif)
- Different behavior of fopen("w") under freedos and msdos? - ecm, 16.03.2011, 18:27
- Different behavior of fopen("w") under freedos and msdos? - RayeR, 17.03.2011, 14:58
- Creating files: Lack of error checking in TF kernel - ecm, 17.03.2011, 15:40
- Creating files: Lack of error checking in TF kernel - ecm, 08.04.2011, 21:38
- Creating files: Lack of error checking in TF kernel - RayeR, 10.04.2011, 00:25
- Creating files: Lack of error checking in TF kernel - ecm, 10.04.2011, 00:35
- Creating files: Lack of error checking in TF kernel - RayeR, 10.04.2011, 00:25
- Creating files: Lack of error checking in TF kernel - DOS386, 03.05.2011, 09:56
- Creating files: Lack of error checking in TF kernel - ecm, 03.05.2011, 18:03
- Creating files: Lack of error checking in TF kernel - DOS386, 04.05.2011, 11:14
- Terminology - ecm, 04.05.2011, 14:07
- Creating files: Lack of error checking in TF kernel - DOS386, 04.05.2011, 11:14
- Creating files: Lack of error checking in TF kernel - RayeR, 04.05.2011, 18:48
- Creating files: Lack of error checking in TF kernel - ecm, 03.05.2011, 18:03
- Creating files: Lack of error checking in TF kernel - ecm, 08.04.2011, 21:38
- Creating files: Lack of error checking in TF kernel - ecm, 17.03.2011, 15:40
- Different behavior of fopen("w") under freedos and msdos? - RayeR, 17.03.2011, 14:58
- Different behavior of fopen("w") under freedos and msdos? - ecm, 16.03.2011, 18:27
Mix view