public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Omar Khan <okhan-e94Sedi4moU@public.gmane.org>
To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: unix lite
Date: Mon, 23 Apr 2007 14:57:54 +0000 (UTC)	[thread overview]
Message-ID: <loom.20070423T164130-191@post.gmane.org> (raw)


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/

             reply	other threads:[~2007-04-23 14:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-23 14:57 Omar Khan [this message]
     [not found] ` <loom.20070423T164130-191-eS7Uydv5nfjZ+VzJOa5vwg@public.gmane.org>
2007-04-24  8:41   ` unix lite Avi Kivity

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=loom.20070423T164130-191@post.gmane.org \
    --to=okhan-e94sedi4mou@public.gmane.org \
    --cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox