From 00b9200aa4e6f6ff4fffe7dd8d6e07b0e55ca946 Mon Sep 17 00:00:00 2001 From: copy Date: Tue, 20 Jan 2015 00:50:52 +0100 Subject: [PATCH] Filesystem documentation --- docs/filesystem.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 docs/filesystem.md diff --git a/docs/filesystem.md b/docs/filesystem.md new file mode 100644 index 0000000000..ae947ec7ec --- /dev/null +++ b/docs/filesystem.md @@ -0,0 +1,27 @@ +A 9p filesystem is supported by the emulator, using a virtio transport. Using +it, files can be exchanged with the guest OS, see +[`create_file`](docs/api.md#create_filestring-file-uint8array-data-functionobject-callback) +and +[`read_file`](docs/api.md#read_filestring-file-functionobject-uint8array-callback). It can +be enabled by passing the following options to `V86Starter`: + +```javascript +options.filesystem = { + basefs: "http://localhost/9p/fs.json", + baseurl: "http://localhost/9p/base/", +} +``` + +Here, `basefs` is a json file created using +[fs2json](https://github.com/copy/fs2json). The base url is the prefix of a url +from which the files are available. For instance, if the 9p filesystem has a +file `/bin/sh`, that file must be accessible from +`http://localhost/9p/base/bin/sh`. If `basefs` and `baseurl` are omitted, an +empty 9p filesystem is created. + +The `mount_tag` of the 9p device is `host9p`. In order to mount it in the +guest, use: + +```sh +mount -t 9p host9p /mnt/9p/ +```