bootloader icon indicating copy to clipboard operation
bootloader copied to clipboard

Add boilerplate for a page aligned SMP trampoline function

Open phil-opp opened this issue 5 years ago • 4 comments

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.

phil-opp avatar Feb 19 '20 16:02 phil-opp

I only did a quick test, but it appears to work:

image

phil-opp avatar Feb 19 '20 16:02 phil-opp

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.

phil-opp avatar Feb 21 '20 15:02 phil-opp

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!

vinaychandra avatar Feb 21 '20 16:02 vinaychandra

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.

phil-opp avatar Feb 25 '20 11:02 phil-opp

Closing, as this is only an old draft.

phil-opp avatar Jan 02 '23 11:01 phil-opp