Handlers are one level above devices, and reside in L:. Their interface stems from Tripos, and hence a lot of BCPL legacy is found here. The very last snipped of BCPL code is, however, finally gone. 3.1.4 includes a completely new Aux-Handler that was written from scratch in C. For those that do not know: Aux is the "serial" counterpart of CON:. Unlike SER:, which only reads and writes characters, AUX: also buffers lines and includes a couple of keyboard shortcuts for editing text. Hence, you can start a new shell on a serial terminal with
newshell AUX:
The AUX: handler here handles now also ^C through ^F more carefully, and ACTION_WAIT_FOR_CHAR allows buffering of multiple requests.
Speaking of SER: This is implemented by the Port-Handler, which is also responsible for PAR: and PRT:. It is also new and fixes many issues. The previous version crashed if multiple read or write requests were piled up, and hence did not support asynchronous I/O at all. It also tries to identify the nature of the device it talks to, and hence changes its interface to either speak "parallel", "serial" or "printer" language, even if you connect it to another device - which is also a new feature. If you open "SER:" with the additional "path name" NOWAIT (i.e. Open("SER:NOWAIT")), then SER: will not block when no characters are in the input buffer of the serial port. It will return immediately.
The full set of options encoded in the path name is "BAUD/N,CONTROL,RAW/S,NOWAIT/S,TRANSPARENT/S,UNIT/K/N", where "BAUD" sets the serial speed, and CONTROL sets the serial parameters, e.g. "8N1" is 8-bit, no parity, 1 stop bit. NOWAIT we discussed above. RAW turns off the translation from LF to LF/CR pairs for the printer, and TRANSPARENT disables the translation of Amiga-specific (ANSI) control characters to printer-specific sequences. UNIT sets the unit number.
For some strange reason, the old port handler neither supported ACTION_WAIT_FOR_CHAR, which was a logical packet to support, especially with the serial console. Strange...
Also, a ^C send to the requesting process aborts the I/O interface. If you previously send a string to PAR:, but the printer was not ready, the system deadlocked because the process cannot be aborted waiting for PAR: to return, which it never did... This changed now, and even a "LIST >PAR:" can be safely aborted.
Speaking of speaking, there is a revised SPEAK:-Handler, though no narrator.device for it. There is not much new, except for a couple of minor fixes. ^C to abort speaking did not work quite right, it also stayed in memory permanently, and parsing of opt/ as well.
The queue-handler is completely new and unrelated to any former QUEUE-Handler. It handles abortion of queues ("broken pipes") now correctly, and this is the queue-handler you should use for the new shell. Even though there is no "IN:" or "OUT:" as in Os 4, there is "PIPE:". That is,
type s:foo | type pipe: hex
is a complicated way to type s:foo in hex. The "PIPE:" file name of the second "type" command accesses the input pipe.
Similarly,
list lformat="..." | execute PIPE:
creates a list of commands with list, and executes it with "execute". Here, PIPE: also accesses the input stream (reading end) of the pipe. PIPE: can also be used as the writing end of a pipe, i.e.
type s:foo to PIPE: | type pipe: hex
works too, just more complicated. Hence, no need for "IN:" or "OUT:", just write "PIPE:" and it will figure out itself into which end of the pipe the stream will go, reading or writing.
Other than that, there are also named pipes, as before. They can be read or write by name. For example:
type s:foo to pipe:bar &
type pipe:bar hex
starts the first command in background, and then reads from the same pipe, with type again. Even more complicated than before, but does just the same...
There are more new handlers: CrossDos, and the CD File System. I will cover them later in a separate blog.