Skip to content
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

feat: modularize console implementation for late UEFI output #324

Merged
merged 13 commits into from
Apr 9, 2024

Conversation

mkroening
Copy link
Member

@mkroening mkroening commented Apr 9, 2024

This is a larger restructuring, allowing UEFI to use native console implementations as fallback once boot services have exited. This should also allow nice GOP support later.

This is in preparation for #285 (modulo GOP support).

@mkroening mkroening self-assigned this Apr 9, 2024
@mkroening mkroening force-pushed the uefi-output branch 2 times, most recently from 8387af1 to a453839 Compare April 9, 2024 12:17
@mkroening mkroening marked this pull request as ready for review April 9, 2024 13:07
@mkroening
Copy link
Member Author

CC: @sarahspberrypi, @jounathaen

@mkroening mkroening added this pull request to the merge queue Apr 9, 2024
Merged via the queue into main with commit 71145b2 Apr 9, 2024
13 checks passed
@mkroening mkroening deleted the uefi-output branch April 9, 2024 14:14
stdout: NonNull<u8>,
}

fn stdout() -> u32 {
Copy link
Member

Choose a reason for hiding this comment

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

I found this fn name a little confusing. Maybe something like get_stdout or stdout_addr would be more self-explanatory. A doc-comment might also help.

Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe. Though, just adding “get” does not help much, I think. I did not rework this code, I only moved it around.
I am planning a proper rework of this while migrating from hermit-dtb to fdt.

Self::None
}

fn exit_boot_services(&mut self) {
Copy link
Member

Choose a reason for hiding this comment

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

Do I get this correct: This is a callback for exiting the boot services? If so, I'd suggest modifying the name to reflect this. Also, I'm a huge fan of doc comments also for private fns 😉

Copy link
Member Author

@mkroening mkroening Apr 9, 2024

Choose a reason for hiding this comment

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

Correct. I was inspired by https://github.com/rust-osdev/uefi-rs/blob/137932086eff0e0a7d0e5a63426a9e47f32439b3/uefi-services/src/lib.rs#L179.

For me, the few lines of code made the purpose self-explanatory, though we can always add docs if people are confused.

@mkroening mkroening mentioned this pull request Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants