Hi Grant,


Additionally, if you wanted a basic example to look at, the camkes-vm-examples project uses a file server to share access to a CPIO filesystem across vmm instances. The fileserver component uses the cpio "filesystem" via musllibc syscalls to export a simple open, close, read, seek RPC interface. The clients can then install the RPC interface functions as open, close, read, write syscall implementations in musllibc​.  I've listed some links to the relevant files below.


Kind regards,

Kent


camkes-vm-examples project adding vm images to cpio archive for vmm to load into vm: https://github.com/seL4/camkes-vm-examples/blob/master/optiplex9020/CMakeLists.txt#L44

Fileserver: https://github.com/SEL4PROJ/global-components/blob/master/components/FileServer/src/server.c

RPC interface: https://github.com/SEL4PROJ/global-components/blob/master/interfaces/FileServerInterface.camkes

VMM fileserver client: https://github.com/seL4/camkes-vm/blob/master/components/Init/src/fsclient.c




From: Devel <devel-bounces@sel4.systems> on behalf of Anna.Lyons@data61.csiro.au <Anna.Lyons@data61.csiro.au>
Sent: Tuesday, July 24, 2018 8:55 AM
To: gajurgensen@gmail.com; devel@sel4.systems
Subject: Re: [seL4] Implementing a Filesystem on CAmkES
 

Hi Grant, 


I can answer the "is there an easy way to integrate said filesystem into musllibc such that one could use the standard open/read/write/close functions"?


The answer is yes ;). Take a look at libsel4camkes [1] which already binds some of the common C library functions. You could extend these for some subset of file descriptors that identifies your file system, or base an implementation on the code in this library.  


[1] https://github.com/seL4/camkes-tool/blob/master/libsel4camkes/src/sys_io.c


Cheers,

Anna. 



From: Devel <devel-bounces@sel4.systems> on behalf of Grant Jurgensen <gajurgensen@gmail.com>
Sent: Tuesday, 24 July 2018 2:44 AM
To: devel@sel4.systems
Subject: [seL4] Implementing a Filesystem on CAmkES
 
Hello all,

I was hoping to get some advice on how to implement a filesystem on my CAmkES project. For now I'm targeting FAT32, but that is flexible. So far, my plan is to port the libsdhcdriver to my platform (which shouldn't be too bad. I'm targeting exynos5, and I see exynos4 is already supported). After that, I assume I'm on my own when it comes to creating a filesystem interface. Perhaps there is an existing library for this that can hook into any standard SD controller implementation? Finally, is there an easy way to integrate said filesystem into musllibc such that one could use the standard open/read/write/close functions?

Does this sound like the best way to go, or am I missing a simpler solution?

Thanks,
Grant