Page 1 of 1
Trampoline code question
Posted: Wed Jul 08, 2020 1:13 pm
by nexos
Hello,
I was wondering what the best method to load trampoline code for SMP is. How do you embed it in a section in the executable?
Thanks,
nexos
Re: Trampoline code question
Posted: Wed Jul 08, 2020 1:22 pm
by iansjack
I'm not quite sure what the problem is. You just link it in to the kernel object file in the same way as any other code.
Re: Trampoline code question
Posted: Wed Jul 08, 2020 1:25 pm
by pvc
I do it as normal assembly subroutine, but written in position independed fashion. Then copy it somewhere below first meg, so it can be reached with startup IPI.
Re: Trampoline code question
Posted: Wed Jul 08, 2020 1:32 pm
by nexos
Thank you both. I was making a problem when there was no problem

Re: Trampoline code question
Posted: Wed Jul 08, 2020 2:22 pm
by 8infy
Wait so an elf32 binary can contain 16 bit code?
Re: Trampoline code question
Posted: Wed Jul 08, 2020 2:35 pm
by pvc
8infy wrote:Wait so an elf32 binary can contain 16 bit code?
And 64 bit too. It can be a little bit problematic to link, since not every type of relocation can be applied, but it sure can be done.