hi,
   
   I am trying to run unix like operating system (mainly meant for educational
purposes) on kvm called "Unix Lite" (http://www.unixlite.org/). It runs fine on
qemu but on kvm it gives the unhandled vm exit 0x9. This is caused by the
hardware task switch that is used in unix lite. The code for the switch is :

void gdt_t::swtch(tss_t * from, tss_t * to)
{
        /* also clear "busy tss" flag */
        tss[0].init(X86AVL386TSS, (u32_t)from, sizeof(tss_t)-1);
        tss[1].init(X86AVL386TSS, (u32_t)to, sizeof(tss_t)-1);
        asm volatile(
                "ltr %w0\n\t"
                "ljmp %1,$0\n\t"
                ::"r"(TSS0SEL),"i"(TSS1SEL));
}

As you can see the code is basically saving the context of one task and loading
from the next. The unhandled exit is caused by the ljmp which causes the switch.
What would be a good way to convert this to a software switch only? Just
manually push the current state on the outgoing task state segment(we have the
pointers to this) and load from the incoming task's state segment? I am new to
this therefore I am not sure how to save the current CS:IP pair and whether this
is the way to do it or not, any help/hints will be welcomed.

Thanks 

Omar 


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel

Reply via email to