3 ms·
> 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
by magicalhippo 3y ago
> 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.
edit: on the upside, exposing the calls as files means it's easy to expose GL extensions, either the respective files are there or they're not.
[1]: https://plan9.io/sys/doc/net/net.pdf https://plan9.io/sys/doc/net/net.pdf