Re: [hatari-devel] SCC issues (vs. real MegaSTE) mentioned in Atari-forum |
[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]
Le 10/09/2024 à 23:39, Eero Tamminen a écrit :
Hi, On 10.9.2024 17.38, Nicolas Pomarède wrote:from his answer I see some code is not present in MFP case as in SCC to handle DCD signal.I'm looking at this to make both code more similar but I see rs232.c is using File_Open to open the in/out file associated with the serial port, and not using open() directly as in scc.cIs there any reason for that ? I see File_Open allows to use stderr and stdout as a filename but is that really used for rs232 emulation ?Hatari "--help" states: <file> Devices accept also special 'stdout' and 'stderr' file namesI.e. it's a documented Hatari feature that's supposed to work for all devices.And one of the reasons why all Hatari debug/trace/log output goes (should go) by default to stderr nowadays, instead of some of it going to stdout.That way one can eg. pipe Atari device output directly from Hatari to another command (when using "stdeout"), or mix it with Hatari debug/trace output (when using "stderr").How useful that is, depends on the device.
Hiok for piping, but as you say is that really useful / used, as this only exist for rs232/mfp and not scc ?
If not, I'd rather replace use of "FILE *" handler by file descriptor number (as returned by open() )Why you want to use FD?(You can get FD out of FILE*, so in principle you should be able to same things also with FILE*.)
I know I can get fd from file*, that would just remove an extra layer of file abstraction and deal directly with more "low level" calls like "open()".
Looking at the code we can see that on nearly every rs232 functions file* is converted to fd to do the real job (especially for ioctl) that why I wondered why it was this way.
Using FD would allow to have similar logic/code between serial in mfp and scc, making it easier to fix mfp to better handle DCD and other signals.
Mail converted by MHonArc 2.6.19+ | http://listengine.tuxfamily.org/ |