bootloader
bootloader copied to clipboard
Add boilerplate for a page aligned SMP trampoline function
This code crates a page aligned smp_trampoline
function that lives in the first megabyte and exports its address in the boot information. According to https://github.com/rust-osdev/bootloader/issues/74, it should be possible to implement a SMP trampoline function using these building blocks.
I only did a quick test, but it appears to work:
I don't think that we should merge this PR without implementing the trampoline function. Feel free to open a new PR with the commit from this PR included.
I will try do that. My main idea is to make a near copy of the current stage 1 and stage 2 without much of stage 3 so that we can go into 64bit mode and enter a function as specified by the user. I will probably need help in writing a macro so that a function can be detected in user's kernel so that we can jump to that from bootloader.
Let me know when you need help for this!
I will probably need help in writing a macro so that a function can be detected in user's kernel so that we can jump to that from bootloader.
We could use the Cargo.toml configuration to let the kernel specify the function name that the trampoline should call. This way, we could even make it a compile time error when the kernel does not set a function name.
Closing, as this is only an old draft.