-
Notifications
You must be signed in to change notification settings - Fork 19
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
Upgrade Limine crate and EFI binaries #216
Conversation
Will re-run the build once the binaries are synced |
r.address.as_ptr().unwrap() as u64 - 0xffff800000000000 | ||
} /* TODO: MEGA HACK */), | ||
rsdp: LIMINE_TABLE.get_response().map( | ||
|r| r.address() as u64 - 0xffff800000000000, /* TODO: MEGA HACK */ |
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.
Can this be set to the value we get from the id map, now, I wonder?
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.
If that is what that magic number is supposed to be then yeah.
Will syncing those binaries cause breakage for the current main branch? |
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.
LGTM
I don't think so (at least after this is merged in). I have tested this locally and the kernel boots with the static and dynamic runtime. |
I synced the binaries into the file server, but maybe I did it wrong? |
I downloaded the binaries from the file server and it seems that the version hosted is Limine 4.20230317.0. The test run on x86 hangs since the bootloader firmware fails to find the config file in the old format, and does not print the error message to serial. |
Okay, I had forgotten to actually push the changes, but I think I did now. This failure looks different, though. |
This patch upgrades the version of the Limine crate used and is meant to work with the latest version of the Limine EFI binaries (v8.4.0). We would have updated the Limine crate to the newest version, but it needs rustc v1.77. The new binaries introduce various fixes for example stability with U-Boot UEFI (used by Morello/Bhyve). Some of the changes we introduced are API changes. The only things that really needed updating was the format of the Limine configuration file, and issues surrounding the location of the identity map.
Turns out that newer versions of Limine place the identity map at the start of kernel memory (
0xFFFF_0000_0000_0000
), but for aarch64 only. So this caused thephys_to_virt
function to not work correctly and MMIO address allocation to fail. Luckily we can fix this by asking Limine what the offset is (we need to do this since currently the kernel memory map is copied from the bootloader). Funny enough, the offset remains the same for amd64, but we implemented the logic to grab the offset anyways to prevent future breakage with Limine. In the future we might want to decide where our identity map (and other things) live in the kernel's address space.What is needed to make this work is to update the hosted Limine EFI binaries to version 8.4.0. The binaries can either compile from source or downloaded as so:
Summary
phys_to_virt