Re:r9: Plan 9 in Rust
by magicalhippo on Sunday May 21, 2023 @06:32PM
(#36025251)
> The network stack is a file system.
See this[1] document for details on how that's done.
Pretty much as I expected, eg connections are directories with the parent directory being the protocol, and there's separate files for control messages and the data. Control files are read and written in ASCII to avoid endian issues.
How would you expose something like OpenGL though? I mean, would you serialize the individual GL calls into a custom RPC and feed it to a "gpu/0/opengl/data" file? Exposing the GL calls as separate files could work I guess, if there's guarantees that writes to separate files maintain order (can't seem to find any clear discussion on this right now), but given the number of calls available that seems like it might generate a lot of overhead.
Rio is a file system service providing GUI capabilities (kind of). You still need libraries to draw frames in windows etc.
The network stack is a file system.
HTTP clients can use a file system (webfs) to access servers.
And so on.
One could make a replacement for rio if they wanted to.
The protocol used to draw stuff on the screen isn’t 9p though, curiously.