Writing a 9P server from scratch (2016)
blog.aqwari.net
blog.aqwari.net
"If you say Y here, you will get experimental support for Plan 9 resource sharing via the 9P2000 protocol. See http://v9fs.sf.net for more information."
It works in at least Ubuntu & Fedora out of the box, and is used by the virt-manager GUI to set up shares, so not too experimental to enable by default I guess.
I guess file systems don't go into staging/?
On x86_64, it's plenty stable, but I see why it's still experimental: On i686 there's a bug where files are mysteriously missing from directory listings. I tried to debug it once; it's reading them from the protocol correctly, but they're being dropped in the VFS layer, which is a bit more complicated than the network protocol.
Intuitively I get the idea that FUSE is going to be the better performer overall because of lack of network overhead.
But I wonder how much worse 9P would be.
9p is really easy to implement. That is a key feature as it makes it easy to create new clients and servers (and presumedly makes bugs rarer). Much like FUSE has been adapted to countless things. I don't know how implementing a FUSE server or client compares to this though.
Unfortunately, the simplicity also means giving up something. Where quite-complicated NFSv4 can be very efficient over slow links (leases makes it a bit like a cache coherency protocol), 9p requires all writes to be committed to the server (for coherency).
I feel like I'm missing the point and should be asking "what's cool about 9p?" to which you provided a very helpful response. Thanks!
Which one? For most user storage, there's kenfs, fossil, venti, hjfs, cwfs, and a few others. But 9p is disjoint from where data is stored, it's just a protocol for doing RPCs on endpoints in a heirarchical namespace.
As a result, everything is served up over 9p on plan 9. iso9660, the device tree, the network subsystem, ftpfs, sshfs, hgwebfs, the vt100 emulator, the keyboard, the mouse, the CD burner commands, and so on. To a good approximation, the only things you can do without going over 9p is starting processes.
This has interesting implications; For example, the Plan 9 equivalent of ssh simply opens a connection to the remote system, and mounts the local /dev before the remote one. That means that remote programs simply open the local devices, such as the mouse and keyboard, and use them in preference to the devices that are connected to the remote machine.
The equivalent to VNC on Plan 9 is simply namespace management to redirect which devices programs use. Here's the full implementation: http://code.9front.org/hg/plan9front/file/fd023f8fd074/rc/bi...
Yes, it is just a shell script.
I wonder how that would change if the system was designed today.
Everything a stream of JSON objects?
Well done guys, you played yourselves.