-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add NFS client PD and MicroPython VFS support #1
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd like to get @ivan's review as well. There are a number of minor changes I'd like before merging.
|
||
mp_obj_t mp_vfs_sddf_fs_file_open(const mp_obj_type_t *type, mp_obj_t file_in, mp_obj_t mode_in) { | ||
mp_obj_vfs_sddf_fs_file_t *o = m_new_obj(mp_obj_vfs_sddf_fs_file_t); | ||
// const char *mode_s = mp_obj_str_get_str(mode_in); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is all this commented out stuff still here for a reason?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently I'm not supporting any notion of modes in open, which we might want to change, so I've left that there as reference.
#include "util.h" | ||
#include "tcp.h" | ||
|
||
#define LINK_SPEED 1000000000 // Gigabit |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be queried from system rather than hard coded. The NIC may have connected at 100Mb/s
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took that part of the code from the echo server. Not sure how to query the system.
|
||
bool network_ready; | ||
|
||
int tcp_ready(void) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
static inline?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tcp_ready
is called from other compilation units.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this belong in micropython
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see there is stuff like await(mp_event_source_nfs);
but everything else is generic right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not particularly generic as it is based on the synchronous model that we are using in MicroPython. I want to provide a generic client library but that will provide an asynchronous interface.
Main things I want to understand are:
Why?
What flag?
Why? We can discuss this more open-ended stuff in-person though. |
For the README we should also have some examples of some basic usage of NFS from Micropython - for our own reference as well as outside users of the example. |
This commit modifies the NFS client to: - provide an asynchronous API; - use ringbuffers for communicating with clients; - support running multiple operations concurrently; - bounds-check client-provided buffers; - allocate continuations from a pool instead of using malloc. It also modifies the MicroPython FS support to the new NFS client interface.
This commit enables multiplexing of the ethernet between the NFS client and MicroPython. In order to do this, the NFS client's ethernet support needed to be updated to reflect the latest sDDF protocol. The sDDF submodule commit was also updated.
This channel is so MicroPython can transfer the data it has | ||
put in the framebuffer to be given to the Linux driver guest. | ||
--> | ||
<end pd="micropython" id="0" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The channel between Micropython and the VMM seems to be gone ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. Can't test the graphics VM so didn't notice it went missing.
Add NFS client PD and MicroPython VFS support
Add NFS client PD and MicroPython VFS support
This adds an NFS client PD to fs/nfs as well as adding an implementation of MicroPython's VFS layer to the Kitty system's MicroPython which allows you to interact with the NFS client. The end result being that you can run MicroPython's standard file operations to interact with a remote NFS server.
Neither the NFS client nor the MicroPython layer are complete or bug-free.
Building the Kitty system is now a bit more complicated. It requires a cross-compiling GCC for one (use the one that Microkit asks for). I also could not build libnfs on macOS due to an unsupported compiler flag that CMake was trying to use. You will need to define environment variables LIBGCC (directory where libgcc.a can be found), NFS_SERVER and NFS_DIRECTORY. The README has not been updated yet.