Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Pure rust chainboot#173

berkus started this conversation inGeneral
Oct 15, 2022· 2 comments
Discussion options

Was trying to find through which medium to contact@andre-richter, but hey, this is as good as any.

Some fun:pure Rust chain bootloader for Raspberry Pi

:)

You must be logged in to vote

Replies: 2 comments

Comment options

Nice! I actually went the exact different route and returned to doing basic init in assembly after readingrust-embedded/cortex-m-rt#300.

This decision was later reinforced when I realized that you cannot rely on the compiler to not reorder register manipulations done throughcortex-a, aka tock-registers, with other operations. Unfortunately I don’t remember exactly where I observed it in a problematic situation, and more unfortunately, I never followed through documenting it.

Might have been a situation where I wanted to re-set the stack pointer, but function prologue operations always came in first. But naked functions might have helped, so I’m not sure if it was this example.

All in all, I personally feel more safe having bss and stack prepared in assembly, and thus having the basics of the abstract machine sound when we start with Rust.

In your code's comments I saw the reference torust-embedded/cortex-m-rt#300 as well, but haven’t yet checked the other resources you mentioned regarding this discussion.

You must be logged in to vote
0 replies
Comment options

berkus
Oct 15, 2022
Maintainer Author

Yeah, I took note of pointer provenance woes and switched to pointer+size to make it valid.

While messing SP is still a possibility, making the very first function extremely small (just set SP and call follow up function) makes it very unlikely. I will keep an eye on this, but so far happy to make it boot without involving any asm.

You must be logged in to vote
0 replies
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Category
General
Labels
None yet
2 participants
@berkus@andre-richter
Converted from issue

This discussion was converted from issue #172 on October 15, 2022 19:49.


[8]ページ先頭

©2009-2025 Movatter.jp