humphd / next

What I'm doing next (name TBD)
MIT License
14 stars 5 forks source link

Add a 9P interface to our filesystem #27

Open humphd opened 6 years ago

humphd commented 6 years ago

Depending on the outcome of our research in #26, we're going to need a way to mount the IndexedDB web filesystem (probably filer) in the browser VM for our OS/shell. Just about every example I see is using the Plan9 filesystem (9P) implementation for Linux v9fs.

The protocol is pretty slim, transport agnostic (we can easily do it over message passing between frames/windows/workers), and would map well onto our filesystem. There are also a number of existing JavaScript implementations, including (and in order of how well maintained they appear to be):

The goal would be to allow our VM (probably v86) to mount our filesystem over 9P into /home or the like, and work with the files and dirs as if they were in the VM.

humphd commented 6 years ago

We shouldn't need to implement this from scratch, since we have existing code we can reuse/adapt. However, here's a good discussion of the protocol: http://plan9.bell-labs.com/magic/man2html/5/0intro.

humphd commented 6 years ago

Also, a good discussion of how you mount a 9p server in QEMU: https://wiki.qemu.org/Documentation/9psetup

humphd commented 6 years ago

Started work on this in a 9p branch https://github.com/humphd/filer/tree/9p

humphd commented 6 years ago

I'm pretty close to having this done now, just need to refactor and clean up a bit.

humphd commented 6 years ago

This is basically done, but I want to upstream the fixes to Filer and v86, and figure out what to land here. I'll leave this open while I do that.

humphd commented 6 years ago

I've sent a PR upstream to Filer, see https://github.com/filerjs/filer/pull/373