by i336_ · 9y ago · 0 comments
From `man socat', which runs on Linux:
(socat PTY,link=$HOME/dev/vmodem0,raw,echo=0,wait-slave
EXEC:'"ssh modemserver.us.org socat - /dev/ttyS0,non-block,raw,
echo=0"')
generates a pseudo terminal device (PTY) on the client that can
be reached under the symbolic link $HOME/dev/vmodem0. An appli-
cation that expects a serial line or modem can be configured to
use $HOME/dev/vmodem0; its traffic will be directed to a modem-
server via ssh where another socat instance links it with
/dev/ttyS0.now kremvax' network stack is bound over my own no need for nat
By "bound over", do you mean tunneled, or "made available alongside"?
I think I'm right in sayig that if one has /net and /net.alt then /net is asked first and then /net.alt
I'm a bit rusty on the details
To make a connection a process open's its /net/tcp/ctrl file, writes a connection string, gets back a response. If that response is a number then it opens /net/tcp/1/ctrl and /net/tcp/1/data and read / writes data to the data and sees out of stream messages on ctrl. To close the connection one closes /net/tcp/1/ctrl
Everything is done via the 9p protocol. So if I can write code on my Arduino that understands 9p and a way to send/rec that data (e.g. serial but even SP1 or JTAG) to a Plan9 machine locally, then the Arduino itself could just open a tcp connection on kremvax.
Once you start layering these things on top of each other it gets a bit mind blowing and you get drunk on power. Then when you are forced back Linux or Windows you realise how dumb they are even with their fancy application software.
And nice. You talk to the kernel via plain text. No ioctls! :D It's like they made an OS designed to make bash happy.
And I can sum up my conclusions of 'modern' Linux in one word: systemd. It's almost worse than Windows now. I'm not surprised this kind of thing doesn't work on Linux :P
...But I'm sad now, that I can't do all of this on Linux.
Hrm. Maybe someone should pull the Plan9 kernel-level stuff out and make a FUSE-based thing (or even a kernel driver!) that emulates all of this on Linux. There's already plan9port for the utilities... okay, they'd need to be modified back to being Plan9-ey again, but it could be really interesting.