-
-
Notifications
You must be signed in to change notification settings - Fork 7.8k
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
RFC: Linux kernel port #5482
base: master
Are you sure you want to change the base?
RFC: Linux kernel port #5482
Conversation
So you can build MicroPython as a Linux kernel module, then |
Basically, yep. You can also place hooks and everything. The |
Wow, very cool! And good work writing the extensive README. I'll have to review it in more detail, but I'm +1 upon first glance. |
According to the readme, the REPL is exposed via TCP on all interfaces? wouldn't it be more (if at all) secure to only expose it via a character device file with root access only (i.e. something like a The lazy loading of globals to access kernel symbols looks interesting, but might be a bit confusing (typos may become a kernel symbol by chance, shadowed symbols)? maybe putting that into a module would make that more explicit, e.g. |
Cool :D
Usually I run this on QEMU and connect to the python via a host-only
If security is an issue - this can be easily changed to bind on a specific interface and possibly include some
Originally I had the globals on a separate module, but I valued typing speed and readability most, at least on the REPL, so I created the globals trick. I don't recall having any issue with this. However, it's totally a matter of taste, and we can add a runtime option to switch between those 2 modes, something like |
With some changes in pyboard.py, I managed to run the tests:
I guess some work has to be done... :) |
Thanks All of you.
…On Mon, Jan 6, 2020, 06:33 Yonatan Goldschmidt ***@***.***> wrote:
With some changes in pyboard.py, I managed to run the tests:
591 tests performed (15390 individual testcases)
408 tests passed
64 tests
I guess some work has to be done... :)
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#5482?email_source=notifications&email_token=AEYAML3FI6ZUYHLZIDSFUNLQ4JU3LA5CNFSM4KB36G2KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIECOCI#issuecomment-570959625>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AEYAML6CSPAJK25JEMZ7V33Q4JU3LANCNFSM4KB36G2A>
.
|
Yes, let's work on that first. One of those PR's is now merged (EMACS REPL), and the other two are pending revision. Please try to split out all other core changes to separate PRs. Ideally this PR would add files only to the new |
I'll move everything that's logically okay to be separate. The remains are, currently:
|
Rebased on latest master. Latest changes include:
Takes about 8 minutes to run.
I've added 1 basic linux-kernel specific test, I've got ideas for a few more though. |
Allow ports to provide a lazy load function for undefined globals.
Use it to remain with the default MPZ_DIG_SIZE = 32 on 64-bit builds.
Still has a long way to go, but IMO this is already proved useful when you need to prototype APIs / monitor specific data.
Importing Python files from the filesystem works as expected.
Uses my "struct_layout" project, written for this purpose.
It sets the top of the stack. The stack should later include arguments passed in the "args" array, and also "ts" itself. By wrapping everything with this function, we ensure that everything's contained.
… context. I really don't know why I placed it inside that inner block. But luckily it seems like this didn't change the compiler output at all; It would've been a tough bug to find...
Defined in 'include/linux/compiler_attributes.h', and it messes up with MicroPython's MP_FALLTHROUGH.
Instead of reimplementing it here :p
…AGE_KERNEL_EXEC pages in new kernels.
I have rebased this branch on v1.16; the old commit (as of 7f2a088) is available at https://github.com/Jongy/micropython/tree/linux-kernel-v1.12. This is
Additionally, I have added some commits from the past few months of my work on making this build on Aarch64. Builds and runs but I haven't tested it very thoroughly. |
…n-main Translations update from Weblate
This is an automated heads-up that we've just merged a Pull Request See #13763 A search suggests this PR might apply the STATIC macro to some C code. If it Although this is an automated message, feel free to @-reply to me directly if |
I've been working on this port in the past month. It started as a fun PoC but I realized its usefulness for kernel research & debugging so I kept expanding it. It shows how powerful MicroPython is, due to the relative ease of porting it.
I'd happily continue maintaining it in a fork, but I prefer mainlining if possible. I think it'll be more accessible for others to contribute. @dpgeorge it's up to you.
TODOs list before merge, as I see it:
complete previous PRs required for this, and perhaps split out more unrelated commits into separate PRs.
create a convenient way to run MicroPython's tests on this port
actually run the whole test suite using the above method