-
Notifications
You must be signed in to change notification settings - Fork 214
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
Panic in stage 4 in BIOS boot #331
Comments
Thanks for reporting! Could you give us instructions how to reproduce this error? |
I suspect that this could be caused by a non-PIE kernel that maps memory to the same address we use for the context switch in the bootloader. The error occurs because we load the context switch function into the kernel's address space. We currently need to do this because the address space switch is not the last instruction of the context switch, so the context switch function needs to be mapped in the kernel's address space to complete. Similar errors could probably be provoked by setting other addresses (e.g. frame buffer, boot info) to this address. This might be fixed by #240.
No, this wouldn't work, the current implementation expects the context switch function to be mapped in both address spaces. Ignoring the error would mean that the context switch function would jump into rogue kernel memory after doing the address space switch. |
After removing
I was supposed to put a match guard in there. Using |
I just tried to reproduce the error by adding these flags, but it still works fine for a small test kernel. Do you have the project where this happens online somewhere so that we can try to reproduce the error? |
Yep its here |
The bootloader panics on line 242 with
failed to identity map fame PhysFrame[4kib](20a000): PageAlreadyMapped(PhysFrame[4Kib](0x20a000))
bootloader/common/src/lib.rs
Lines 229 to 244 in c73786d
I checked the mapping for
0x20b000
and QEMU says its mapped to0x20b000
A potental fix would be to just ignore the error with an extra match arm
Err(MapToError::PageAlreadyMapped(frame)) => {}
The text was updated successfully, but these errors were encountered: