Closed SnowyCoder closed 11 months ago
AFAICT everything in the bootloader is working as intended. IIUC you compiiled your kernel using the x86_64-unknown-none
target which emits position independent executable by default. For those we currently don't make any guarantees about where the kernel is loaded. I compiled your kernel and attached a debugger to QEMU and it seems to me that the entrypoint is mapped and jumped to correctly. I assume that something eventually breaks because your code assumes a specific kernel base.
If you don't want your kernel to be a position independent executable you can pass -C relocation-model=static
via rustflags.
I'm sorry you are correct, I assumed my kernel was broken because it was loaded to a lower-half location but that is not the case.
Still, you should not say that you support higher-half kernel if you still load it in a lower-half virtual memory offset.
Still, you should not say that you support higher-half kernel if you still load it in a lower-half virtual memory offset.
We support higher-half kernels compiled with -C relocation-model=static
.
Hello, I have a custom kernel that I tried to update to bootloader v0.11, you can find it here. First, I must say, thanks for this project, it has been really useful and the last update seems to simplify a lot of the workflow.
While migrating from v0.10 I found two problems, first the linker script had to align sections to pages (this isn't really a "problem", more it is not written in the migration guide).
Second, and more interesting is that, after correctly loading the kernel sections, it does not jump to the correct entrypoint. The kernel entry point is at
0xffff800000101de0
(read from the ELF), but since the virtual address offset is0xffffffffffffffff0000807fffeff000
the sum overflows and it jumps to0x8000000de0
. I don't have any more clues on where the problem might be, I'm sorry if this is a problem with my setup.Bootloader output:
(might be wrong, I used an image-to-text site)
If I can help with anything I'd be happy to, I just don't have enough knowledge to know where the bug is.