gcc has internal error at ljmp

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
iammisc
Member
Member
Posts: 269
Joined: Thu Nov 09, 2006 6:23 pm

gcc has internal error at ljmp

Post by iammisc »

In gas i try to do

ljmp $0x20,$(%eax)

but gas says internal compiler error. please report this bug.

that is all fine and dandy(the bug reporting thing) but how do i compile my kernel.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Post by Combuster »

you are trying to assemble something that an intel processor can't do:

according to intel's big book of patterns you can only:
JMP FAR immediate:immediate
or
JMP FAR [far_pointer_in_memory]

you can not:
JMP FAR immediate:register
and especially not
JMP FAR 0x20:[DS:EAX]
Which throughly messes up GAS into asking you to go tell the developers...
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
iammisc
Member
Member
Posts: 269
Joined: Thu Nov 09, 2006 6:23 pm

Post by iammisc »

um. i never knew that.

It also says i can't do inter-privelege-level jmps so how do i call a callback in userspace? For my ipc i want to call a callback function for each message received, however i need to know how to do this.

thanks.
Post Reply