AgonConsole8 / agon-mos

Official AGON QUARK Firmware for Console8: eZ80 MOS
MIT License
31 stars 10 forks source link

Error output stream? #97

Open stevesims opened 3 days ago

stevesims commented 3 days ago

Further to #80, #81 and #82 it may be sensible to consider adding support for a distinct error output stream.

Currently on MOS we have a logical model that uses only one output stream. Many operating systems support the concept of having a separate "error" stream. This will often/usually point to the same place as the standard output stream, but does not have to.

RISC OS followed the simplistic approach of having only one output stream, as did the BBC Micro. Acorn's PANOS had an error: stream that was by default set to be the screen, but could be changed to a different file or device. Unix systems have stderr as a logically different output than stdout.

stevesims commented 3 days ago

all output in the MOS code is currently basically just printf or putch function calls. essentially all actual output is contained within mos.c, except for the line-editor (mos_editor.c, which is inherently screen-based in its output)

inside mos.c the mos_error function is used to print the current error. mos_cmdDIR prints to screen when an invalid flag is detected altho that won't cause the command itself to error out. similarly mos_cmdHELP prints a "Command not found" message out but does not actually result in an error being returned. that's it - all the places where we have output that could go to an error stream.