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.
Bochs gives you the exact error: the provided selector has TI (bit 3) set, and loading an LDT from an existing LDT is not allowed.
Your inline assembly is suspect here. You tell lldt to use a register of gcc's choice (%0) while you force the argument into EAX:EDX ("A"), which needs not be the same (apart from the fact that using the eax-edx pair is just wrong)
"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 ]