Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork175
uefi std: add example and add book chapter#1331
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
87cd184
to722eeeb
CompareUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
book/src/tutorial/rust-std.md Outdated
In the `uefi` crate, we provide tooling to create a `no_std` + `no_main` | ||
binary, i.e., an UEFI image, in a convenient way. However, there is also the | ||
option to create a "standard" binary with Rust. The result is the same, but the | ||
build process and the overall programming is much more similar to regular |
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.
nit: the build process is the same either way right?cargo build --target <uefi-target>
book/src/tutorial/rust-std.md Outdated
instead. Just as you would to in the typical Linux application, for example. | ||
The `uefi` crate is suited to extend the functionality of these "standard | ||
binaries". |
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 three sections above are essentially all "what isuefi
+std
" -- I think it would be clearer to shorten down to a quick explanation that there is ongoing work to add more support forstd
to the UEFI targets in rust with link(s) to where more info can be found, then show the example.
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.
Yeah, I also wasn't that happy with them. Do you like the new version better?
book/src/tutorial/rust-std.md Outdated
implementation is not feature-complete and work in progress | ||
(Mid-2024, Rust stable 1.80), and will also be it in the coming months and | ||
probably years. Over time, you will need less and less specific features of | ||
`uefi` and can utilize standard and well-known OS-independent APIs in `std` |
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 think we should avoid making claims about it being recommended or not -- we can stick to just the facts and note that uefi+std is still in progress and gated by an unstable flag.
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 hope the new phrasing is better?
book/src/how_to/rust-std.md Outdated
binary, i.e., an UEFI image, in a convenient way by providing a `#[entry]` | ||
macro for the crate's main function. However, after ongoing efforts in upstream | ||
Rust, there is also the option to create a "standard" binary for UEFI. The | ||
result is the same, but the build process and the overall programming experience |
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.
result -> the compiled result
book/src/how_to/rust-std.md Outdated
## About | ||
In the `uefi` crate, we provide tooling to create a `no_std` + `no_main` |
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 still not 100% satisfied with the phrasing of this paragraph. Any idea?
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.
One thing that would help I think is to drop the "standard binary" terminology; stick tono_std
and thestd
crate.
Here's my attempt:
Programs created with theuefi
crate are typically created withno_std
andno_main
. Ano_std
crate can use thecore
andalloc
parts of Rust's standard library, but notstd
. Ano_main
executable does not use the standardmain
entry point, and must define its own entry point;uefi
provides theentry
macro for this purpose.
Rust has added partial support for building UEFI executables withoutno_std
andno_main
. Some functionality requires a nightly toolchain, and some parts ofstd
are gated by the unstableuefi_std
feature. Follow thetracking issue for details.
This is a prerequisite for the next step.
Ready for review. What do you think? Is this a better version? |
fa36299
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Split-out of#1292. This adds an example for a Ruststandard binary for UEFI that utilizes
uefi
on top of that. It also adds a chapter to the book.Checklist