-
Notifications
You must be signed in to change notification settings - Fork 165
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
Make support for u-boot #227
Conversation
From CI seems that |
I've also tried to reduce code complexity. |
Updated |
Thanks for your contribution! Please, fix the CI so it works with your new feature |
|
I found out that something else preventing from booting through u-boot. So PR should not be merged yet. :( |
Don't worry, let's mark it as draft :) |
Can you please add documentation to guide users on how to use this feature? |
Done. I'm not sure about writing docs on how to use u-boot to boot resulting elf binary. I don't think this is the right place for that. |
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'm not familiar with u-boot
, so there are some details that I missed. For instance, if u-boot
passes arguments via the stack, shouldn't we load the input parameters to a0
and a1
so the Rust main function gets the correct input?
If you tested this and it works, I am probably missing something, but I would like to understand what is going on 😁
What you did is more than enough, thanks! |
Also, while the current assembly code pushes three registers to the stack, they are popped out before calling |
I tested this, was able to work with arguments and they were correct. |
There is a chance that I was wrong and they are passed through a0 and a1. Will check with debugger. |
I don't know why caller also places argv address in a2 |
Maybe it points to the last element of argv? Can you try to forward two arguments? |
Now macro can check for pointer types and strips type's path. |
I also changed expected type of argv to *const *const c_char in that commit. |
I think that might be just some kind of side effect. |
CI failure seems unrelated to this PR |
Yep, from time to time, Clippy gets more strict. Please, fix the new lints |
I checked locally and seems like now clippy should not complain. |
Should I add entry to CHANGELOG that I fixed clippy warnings? |
a4d6961
U-Boot passes arguments through
int argc
andchar *const argv[]
. In order to work with them riscv-rt should accept appropriate entry point signature. Also because the only way to get boot-hart is through fdt this feature implies single-hart.Expected entry point signature for u-boot: https://github.com/u-boot/u-boot/blob/master/lib/elf.c#L26