tomaka/redshirt

A filesystem is needed for wasi support

Opened this issue · 1 comments

Wasi makes it possible for programs to access files. Right now there is no interface that gives access to files, and as a temporary solution the wasi handler simulates a small filesystem in memory at the moment.

Just like Linux does, the root directory of the file system could represent the various reasons why one may want to store a file. For example, it could be something like:

  • /assets: Read-only assets that come with the program.
  • /user: Storage that the program can use, but specific to each user of the system.
  • /sys: Read-only metrics about the system?

I'm not opposed to adding "magic" files (i.e. files that aren't actually files, like system metrics), but it might increase the number of interfaces we depend upon, and it would be annoying if users started by read files rather than using strongly-typed interfaces.

Plan of actions:

  • Add an interface for gathering assets (for the /assets path).
  • Add an interface for the /user path.
  • Implement the possibility for Wasi to read/write these paths.
  • Make it possible for users to configure how Wasi accesses the filesystem. I'm not sure whether Wasi should be a different crate at this point.
  • Modify the CLI kernel to allow passing a directory for /assets and a directory for /user. This would have to be configurable individually per process, so I don't know exactly how to design a proper CLI for that.