Page 1 of 1

Manipulating the VFS using FUSE?

Posted: Sat Jan 21, 2017 12:21 pm
by d33
Is there any documentation on what the format of VFS I found on my esp8266 image? I'd like to have a go at implementing a FUSE FS that would let me easily manipulate the VFS.

Re: Manipulating the VFS using FUSE?

Posted: Sat Jan 21, 2017 6:04 pm
by dhylands
The VFS uses FAT, although this should be largely irrelevant.

It would be much better to make a file based FUSE filesystem rather than a block based one. If you create a block based filesystem then you'll have problems with corruption since blocks based filesystems aren't designed for sharing.

If you create a file-based FUSE filesystem, then the host and the pyboard can happily share and you eliminate corruption issues.

Re: Manipulating the VFS using FUSE?

Posted: Sun Jan 22, 2017 9:23 am
by d33
Thanks dhylands. How would you approach this? Also, are the offsets documented, in case I wanted to try with block-based version first?

Re: Manipulating the VFS using FUSE?

Posted: Mon Jan 23, 2017 1:07 am
by dhylands
The FAT filesystem used in MicroPython is from here: http://elm-chan.org/fsw/ff/00index_e.html and this page has links to the FAT32 specfication.

FUSE is inherently a file based system anyways.

Fundamentally, to make anything host side work, you need to have a communications channel between the host and the device. If you choose to use the block based filesystem then you'll have all the same corruption issues caused by the fact that the host thinks it has exclusive access, when in fact it doesn't.

rshell uses the raw-repl (via pyboard.py) to send snippets of python to the device and execute them and they send back informaiton to the host.

I chose to use that method since it doesn't require any additional code to be installed on the device. You can use it, or you can install some code on the device that talks to your code on the host.