Repository navigation
Use new UEFI bootloader - #792
Merged
kevinaboos merged 56 commits intoJan 12, 2023
Merged
Conversation
Older Rust toolchains didn't have the `rust-std` component for `*-unknown-uefi` targets meaning they couldn't be used for artifact dependencies. Signed-off-by: Klim Tsoutsman <klim@tsoutsman.com>
Signed-off-by: Klim Tsoutsman <klim@tsoutsman.com>
Works with tsoutsman/uefi-bootloader#9c85f8e. Signed-off-by: Klim Tsoutsman <klim@tsoutsman.com>
Signed-off-by: Klim Tsoutsman <klim@tsoutsman.com>
This is the first step in supporting Theseus loaded at an aribtrary address. The changes to `frame_allocator` are necessary for the frame allocator to correctly initialise when a reserved memory region overlaps with more than one reserved memory region that came before it. Reshuffling the order that the bootloader info and modules memory regions are added to the reserved memory regions revealed the problem. The PR also removes `bios` as the default feature for `nano_core` as it makes it impossible to compile for UEFI, as discussed on Discord. Signed-off-by: Klim Tsoutsman <klim@tsoutsman.com>
Signed-off-by: Klim Tsoutsman <klim@tsoutsman.com>
Signed-off-by: Klim Tsoutsman <klim@tsoutsman.com>
Signed-off-by: Klim Tsoutsman <klim@tsoutsman.com>
Signed-off-by: Klim Tsoutsman <klim@tsoutsman.com>
Signed-off-by: Klim Tsoutsman <klim@tsoutsman.com>
Signed-off-by: Klim Tsoutsman <klim@tsoutsman.com>
Signed-off-by: Klim Tsoutsman <klim@tsoutsman.com>
Signed-off-by: Klim Tsoutsman <klim@tsoutsman.com>
Signed-off-by: Klim Tsoutsman <klim@tsoutsman.com>
Signed-off-by: Klim Tsoutsman <klim@tsoutsman.com>
Signed-off-by: Klim Tsoutsman <klim@tsoutsman.com>
Signed-off-by: Klim Tsoutsman <klim@tsoutsman.com>
Co-authored-by: Kevin Boos <1139460+kevinaboos@users.noreply.github.com>
Signed-off-by: Klim Tsoutsman <klim@tsoutsman.com>
Signed-off-by: Klim Tsoutsman <klim@tsoutsman.com>
Signed-off-by: Klim Tsoutsman <klim@tsoutsman.com>
Signed-off-by: Klim Tsoutsman <klim@tsoutsman.com>
Signed-off-by: Klim Tsoutsman <klim@tsoutsman.com>
Signed-off-by: Klim Tsoutsman <klim@tsoutsman.com>
Older Rust toolchains didn't have the `rust-std` component for `*-unknown-uefi` targets meaning they couldn't be used for artifact dependencies. The upcoming switch to the new UEFI bootloader uses artifact dependencies on `*-unknown-uefi` targets. Signed-off-by: Klim Tsoutsman <klim@tsoutsman.com>
Signed-off-by: Klim Tsoutsman <klim@tsoutsman.com>
Signed-off-by: Klim Tsoutsman <klim@tsoutsman.com>
Signed-off-by: Klim Tsoutsman <klim@tsoutsman.com>
Signed-off-by: Klim Tsoutsman <klim@tsoutsman.com>
Signed-off-by: Klim Tsoutsman <klim@tsoutsman.com>
Signed-off-by: Klim Tsoutsman <klim@tsoutsman.com>
Member
Author
|
Depends on #803. |
kevinaboos
reviewed
Jan 11, 2023
kevinaboos
left a comment
Member
There was a problem hiding this comment.
Minor to-do: add a description of the uefi_builder* tool crates to the tools/README.md file
kevinaboos
requested changes
Jan 11, 2023
Signed-off-by: Klim Tsoutsman <klim@tsoutsman.com>
Co-authored-by: Kevin Boos <1139460+kevinaboos@users.noreply.github.com>
Signed-off-by: Klim Tsoutsman <klim@tsoutsman.com>
tsoutsman
force-pushed
the
new-uefi-bootloader-no-aarch
branch
from
January 11, 2023 09:28
e02fe09 to
b4af63d
Compare
Member
|
LGTM; will approve & merge pending a review of |
* top-level Cargo.lock file must match lockfiles in `tools/uefi-builder/*`
kevinaboos
approved these changes
Jan 12, 2023
github-actions Bot
pushed a commit
that referenced
this pull request
Jan 12, 2023
* Removes old assumptions/requirements that all sections
in the kernel base image are loaded into physically-contiguous
memory, especially the stack and bootloader info.
* IOW, we stop relying upon a fixed `KERNEL_OFFSET` to
calculate virtual addresses from physical addresses and vice versa;
instead, we actually translate addresses via the initial page table.
* Thus, we must obtain the address of the GDT used to boot
secondary CPUs (APs on x86) and pass it through the various
init routines so that it can be used when booting secondary CPUs.
* `PageRange` and `FrameRange` constructors will now return an
empty range if invoked with a size of 0 bytes, instead of panicking.
* The major changes in this commit is to introduce new crates that
support building Theseus for and booting it on UEFI bootloaders.
* `tools/uefi-builder` is now multi-architecture,
but aarch64 support is a WIP.
* The separate `theseus-os/uefi-bootloader` repo is a fork of
`rust-osdev/bootloader` but heavily changed to support Theseus's
needs and additional architectures.
* aarch64 is still a WIP here too.
* Currently we manually ensure that the same version of the
`uefi-bootloader*` crates are used in the Theseus workspace
and in the `tools/uefi-builder/*` crates. Ideally this would be
ensured automatically in the future.
* `uefi-builder` consists of separate, per-arch crates; we can combine
them once <rust-lang/cargo#10030> is fixed.
Co-authored-by: Kevin Boos <kevinaboos@gmail.com> 922cb09
github-actions Bot
pushed a commit
to tsoutsman/Theseus
that referenced
this pull request
Jan 12, 2023
* Removes old assumptions/requirements that all sections
in the kernel base image are loaded into physically-contiguous
memory, especially the stack and bootloader info.
* IOW, we stop relying upon a fixed `KERNEL_OFFSET` to
calculate virtual addresses from physical addresses and vice versa;
instead, we actually translate addresses via the initial page table.
* Thus, we must obtain the address of the GDT used to boot
secondary CPUs (APs on x86) and pass it through the various
init routines so that it can be used when booting secondary CPUs.
* `PageRange` and `FrameRange` constructors will now return an
empty range if invoked with a size of 0 bytes, instead of panicking.
* The major changes in this commit is to introduce new crates that
support building Theseus for and booting it on UEFI bootloaders.
* `tools/uefi-builder` is now multi-architecture,
but aarch64 support is a WIP.
* The separate `theseus-os/uefi-bootloader` repo is a fork of
`rust-osdev/bootloader` but heavily changed to support Theseus's
needs and additional architectures.
* aarch64 is still a WIP here too.
* Currently we manually ensure that the same version of the
`uefi-bootloader*` crates are used in the Theseus workspace
and in the `tools/uefi-builder/*` crates. Ideally this would be
ensured automatically in the future.
* `uefi-builder` consists of separate, per-arch crates; we can combine
them once <rust-lang/cargo#10030> is fixed.
Co-authored-by: Kevin Boos <kevinaboos@gmail.com> 922cb09
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bootloader is at https://github.com/theseus-os/uefi-bootloader. It will also need to be reviewed.
Depends on #785, #786, and #790. I haven't been able to properly review all the changes in this PR because it builds on top of many different PRs. Once they are merged, I'll be able to review the changes properly.