inline asm far jmp with input
Posted: Wed Jul 10, 2002 11:00 pm
I just recently incorporated TSS task-switching into my current OS, but I've got a rather annoying problem.
I can jump through tasks easily enough, and I can write an _intel_ syntax pre-emptive multitasker... but I'm having trouble with the GCC syntax...
asm("ljmp %0, $0"
:
: "r" (task->selector)
);
Yields the following error message:
Error: suffix or operands invalid for `ljmp'
And yet I can hard-code asm("ljmp $0x28, $0") and it'll work.
I also tried something like this:
asm("pushw %0\n"
"pushl $0\n"
"ljmp (%%esp)\n"
:
: "r" (task->selector)
);
But to no avail.
This seems like such a simple thing to get caught up on... maybe I should actually get some sleep
Anyway, I'm basically just looking for a jumpToTSS(long selectorNum) style function.
Cheers,
Jeff
I can jump through tasks easily enough, and I can write an _intel_ syntax pre-emptive multitasker... but I'm having trouble with the GCC syntax...
asm("ljmp %0, $0"
:
: "r" (task->selector)
);
Yields the following error message:
Error: suffix or operands invalid for `ljmp'
And yet I can hard-code asm("ljmp $0x28, $0") and it'll work.
I also tried something like this:
asm("pushw %0\n"
"pushl $0\n"
"ljmp (%%esp)\n"
:
: "r" (task->selector)
);
But to no avail.
This seems like such a simple thing to get caught up on... maybe I should actually get some sleep
Anyway, I'm basically just looking for a jumpToTSS(long selectorNum) style function.
Cheers,
Jeff