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

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

Merged
nicholasbishop merged 6 commits intorust-osdev:mainfromphip1611:uefi-std
Aug 21, 2024

Conversation

phip1611
Copy link
Member

@phip1611phip1611 commentedAug 14, 2024
edited
Loading

Split-out of#1292. This adds an example for a Ruststandard binary for UEFI that utilizesuefi on top of that. It also adds a chapter to the book.

Checklist

  • Sensible git history (for example, squash "typo" or "fix" commits). See theRewriting History guide for help.
  • Update the changelog (if necessary)

@phip1611phip1611 marked this pull request as draftAugust 14, 2024 18:08
@phip1611phip1611 changed the titleUefi stduefi std: add example and add book chapterAug 14, 2024
@phip1611phip1611 marked this pull request as ready for reviewAugust 14, 2024 18:28
@phip1611phip1611force-pushed theuefi-std branch 3 times, most recently from87cd184 to722eeebCompareAugust 14, 2024 18:43
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

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>

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".

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.

Copy link
MemberAuthor

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?

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`

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.

Copy link
MemberAuthor

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?

@phip1611phip1611 marked this pull request as draftAugust 15, 2024 10:26
@phip1611phip1611 marked this pull request as ready for reviewAugust 15, 2024 10:26
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
Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

result -> the compiled result


## About

In the `uefi` crate, we provide tooling to create a `no_std` + `no_main`
Copy link
MemberAuthor

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?

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.

@phip1611
Copy link
MemberAuthor

Ready for review. What do you think? Is this a better version?

@nicholasbishopnicholasbishop added this pull request to themerge queueAug 21, 2024
Merged via the queue intorust-osdev:main with commitfa36299Aug 21, 2024
14 checks passed
@phip1611phip1611 deleted the uefi-std branchMay 1, 2025 09:13
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@nicholasbishopnicholasbishopnicholasbishop approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@phip1611@nicholasbishop

[8]ページ先頭

©2009-2025 Movatter.jp