From: Avi Kivity <avi-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
To: James Jacobsson <slowcoder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: Interrupt/8259 simulation
Date: Sun, 24 Dec 2006 10:27:35 +0200 [thread overview]
Message-ID: <458E39F7.10507@qumranet.com> (raw)
In-Reply-To: <fe247b50612230243g3c6fbe29g5134b9523e75c44f-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
James Jacobsson wrote:
> I've started writing a simulation environment based on KVM, and so far
> everything is working as expected.
> However, I've reached a point where I need to start simulating the
> 8259A PIC, and I can't really seem to grasp how the interrupts are to
> be simulated in KVM.
>
> kvm_inject_irq() takes a vector-number as an input. I'm assuming this
> is a reference to the IDT, i.e, if I kvm_inject_irq(kvm,0,63), IDT
> entry #63 will be called.
>
Yes.
> So, is it safe to assume that kvm_inject_irq(kvm,0,63) will call IDT
> entry #63 immediately (assuming IF is set correctly),
In general yes. The processor will go through the steps described in
the Intel manual for the 'int' instruction. Note that interrupt
injection may fail for a number of reasons (for example, a fault during
reading the idt entry).
> and that the IRQ
> should be considered serviced when the CPU executes "outb 0x20,0x20"
> to IAK the PIC ?
>
Yes.
--
error compiling committee.c: too many arguments to function
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
prev parent reply other threads:[~2006-12-24 8:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-23 10:43 Interrupt/8259 simulation James Jacobsson
[not found] ` <fe247b50612230243g3c6fbe29g5134b9523e75c44f-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2006-12-24 8:27 ` Avi Kivity [this message]
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=458E39F7.10507@qumranet.com \
--to=avi-atkuwr5tajbwk0htik3j/w@public.gmane.org \
--cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
--cc=slowcoder-Re5JQEeQqe8AvxtiuMwx3w@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