Manipulating the VFS using FUSE?

C programming, build, interpreter/VM.
Target audience: MicroPython Developers.
Post Reply
d33
Posts: 2
Joined: Sat Jan 21, 2017 12:19 pm

Manipulating the VFS using FUSE?

Post by d33 » Sat Jan 21, 2017 12:21 pm

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.

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: Manipulating the VFS using FUSE?

Post by dhylands » Sat Jan 21, 2017 6:04 pm

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.

d33
Posts: 2
Joined: Sat Jan 21, 2017 12:19 pm

Re: Manipulating the VFS using FUSE?

Post by d33 » Sun Jan 22, 2017 9:23 am

Thanks dhylands. How would you approach this? Also, are the offsets documented, in case I wanted to try with block-based version first?

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: Manipulating the VFS using FUSE?

Post by dhylands » Mon Jan 23, 2017 1:07 am

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.

Post Reply