Is there a way to jump to long mode using an indirect jump?

75 views Asked by At

I am writing an operating system and have just started the other CPUs, so I am in assembly on each now. I have set up long mode and now I just need to perform a far jump. However, when I try to do any form of direct jump, I receive a triple fault. I have tried using -d int in qemu, and of course info registers but I cannot find why. I've spent a long time searching for the answer when I came across this stack overflow question:

The Question

This question is exactly the same as my first question, however no-one has answered it. This did, however, confirm my suspicions that I cannot perform direct jumps and must do an indirect one, which is what I am asking here.

I tried to figure out what caused the triple fault using debugging tools in qemu and gdb but eventually found that stack overflow post. As my assembly is not great (I code more in C), I am wondering how I should go about this problem I have the code:

jmp 0x8:to_target(ap_trampoline_64)

However, how would I turn this into an indirect jump? I have tried many things. Unfortunately, I cannot provide a minimal reproducible example because I would have to provide my whole operating system! Any help would be greatly appreciated.

0

There are 0 answers