Add a new "Remote Shell" application
This allows a COS shell to remotely control another shell from a
serial line. It's very crude now, but the plan is to add tools much
like the POSIX tools, but for COS.
trs80: Improve RS-232 driver
I could drive my RC2014 from my TRS-80 4P (using the Remote Shell
coming in the next commit)! A challenge I faced was that the RC2014
spits characters too fast and the CTS line of its ACIA modules
(both the 6850 and SIO/2 ones) are hard-wired to ground, making
flow control difficult. I solved this, for now, by lowering comm
speed.
This driver improvement makes CL<? faster and makes baud rate
configurable in CL$.
doc/asm: add note about ad-hoc assembly frequent mistakes
Have RDLN spit newlines more consistently
On CRLF interfaces, newlines were mostly broken after previous
RDLN consolidation.
Small optimization and block compaction
Make word "." a bit more compact
Make BLK@* and BLK!* into ialiases
Remove one level of C< override
Two was too many.
Integrate RDLN input buffer into sysvars
In the beginning of Collapse OS' Forth version, the readline sub-
system was optional. This is why we had this separate RDLN$ routine
and that the input buffer was allocated at boot time.
It's been a while since the RDLN system has been made mandatory, but
we still paid the complexity tax of this separation. Not anymore.
Remove 2OVER and 2SWAP
They were unused.
Revisit RDLN words
It's been a long while since I visited this part of the code and it
has become a bit messy after having gone through all evolutions of
the core code.
It is now simpler, more compact.
Add BS, CR, LF, SPC ASCII consts
Previously, these words would be ascii emitters, but seldom used
except for the SPC emitter. However, I would often end up hardcoding
these constants. With useless emitters removed and ASCII constants
added, we have a more usable system.
Also, fix broken test harness.
Make NL, renamed to NL> a bit simpler
It doesn't require emitting words anymore. The rename to NL> is
linked to the upcoming commit.
Remove LF word
Also, remove extraneous uses of it. In the rdln routine, we would
spit a new line after each line input, but that NL was spurious:
we already spit the newline we receive as it is typed.
Spit SPC instead of NL between blknos in LOADR
It's a bit wasteful to spit full NLs.
Move blkfs' master index to blk 0
The textual introduction of blk 0 was there when documentation was
inside the blkfs. Now that it's outside it, it serves no purpose:
you're expected to have read the documentation already before seeing
blk 0.
trs80: make (key?) non-blocking
Make KEY non-blocking
... and rename it to KEY?. Then, add KEY from KEY? for its blocking
version.
I need this for an upcoming Remote Shell feature. If a Collapse OS
system remotely controls another shell, it needs to be able to poll
both the remote system and the local keyboard at the same time. A
blocking KEY is incompatible with this.
In some places, the polling mechanism doesn't make sense, so this
new KEY? always returns a character. In some places, I just haven't
implemented the mechanism yet, so I kept the old blocking code and
added a "always 1" flag as a temporary shim.
I have probably broken something, but in emulators, Collapse OS runs
fine. It's an important reminder of what will be lost with the new
"dogfooding" approach (see recent mailing list message): without
emulators, it's much harder to to sweeping changes like this without
breaking stuff.
It's fine, I don't expect many more of these core changes to the
system. It's nearly feature-complete.