-
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
Load kernel at specific address in v0.11 #427
Comments
The line you mentioned is only active for kernel compiled as position-independent executables. If you want your kernel to be loaded at a specific address you'll have to compile it with |
Thank you for responding! I'm having some trouble compiling with the flag you mentioned. When I compile with
Which I think refers to here |
This is caused by a bug related to the large code model: |
As explained in my comment in rust-osdev#427, the compiler seems to have trouble emitting relocations for references to global variables in custom sections. For custom sections, it always emits 32-bit relocations even when a 64-bit relocation would be required. This patch works around that by never referencing the global in the custom section directly from code, but only through a pointer from another global variable in the non-custom .data section. The relocation used for the pointer in the global variable will always use a 64-bit relocation.
I opened #428 to work around the compiler bug. |
In v0.11 kernel is placed as a workspace member of the whole project. In this case, how could I pass |
See this example. |
Is there any way to load the kernel at a specific address? With
v0.10
I was usinglink-arg=--image-base=0x00001eecb3620000
to ensure that the kernel was always located at0x00001eecb3620000
, butv0.11
no longer seems to respect the offsets in the ELF file.I'm guessing it's probably because of this code. I'm happy to write a PR that adds a config option to override the address chosen there.
The text was updated successfully, but these errors were encountered: