From: Avi Kivity <avi@redhat.com>
To: "Saksena, Abhishek" <abhishek.saksena@intel.com>
Cc: "kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: Re: KVM's PIT and PIC programming question
Date: Thu, 20 Aug 2009 11:28:52 +0300 [thread overview]
Message-ID: <4A8D0944.10901@redhat.com> (raw)
In-Reply-To: <4158487B9DEE0647BA23911D1C22795712DF668F5B@orsmsx501.amr.corp.intel.com>
On 08/20/2009 12:26 AM, Saksena, Abhishek wrote:
> Hi Guys,
> I am writing very simple bios for KVM (not using Qemu but creating a simple io device models around KVM). I am having trouble in receiving regular Timer interrupts after programming PIT.
>
> I think I have enabled PIC and PIT correctly using following code:-
>
> PIC Programming
> ;; PIC
> mov al, #0x00
> out 0x21, AL ;master pic: all IRQs unmasked
> out 0xA1, AL ;slave pic: all IRQs unmasked
>
>
> PIT Programming
>
> and also enable PIT to genrate regular timer interruput
>
> SET_INT_VECTOR(0x08, #0xF000, #int08_handler)
> mov al, #0x34 ; timer0: binary count, 16bit count, mode 2
> out 0x43, al
> mov al, #0x00 ; maximum count of 0000H = 18.2Hz
> out 0x40, al
> out 0x40, al
>
>
> PIT Timer ISR code
>
> Timer ISR code
>
> ;---------
> ;- INT08 -
> ;---------
> .org 0xfea5 ; INT 08h System Timer ISR Entry Point
> int08_handler:
> sti
> push ax
> push ds
> mov ax, #0x0040
> mov ds, ax
> mov ax, 0x006c ; increment lower word
> inc ax
> mov 0x006c, ax
> jnz inc_done
> mov ax, 0x006e ; increment upper word
> inc ax
> mov 0x006e, ax
>
>
>
> For some reason I never see int08_handler ever been called. Any clues what may be wrong? I am creating only one VCPU
>
>
>
Things to check:
- have you initialized the kernel PIC and PIT?
- are interrupts enabled?
--
error compiling committee.c: too many arguments to function
next prev parent reply other threads:[~2009-08-20 8:28 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-19 21:26 KVM's PIT and PIC programming question Saksena, Abhishek
2009-08-20 8:28 ` Avi Kivity [this message]
2009-08-20 15:05 ` Saksena, Abhishek
2009-08-20 15:20 ` Avi Kivity
2009-08-20 16:49 ` Saksena, Abhishek
2009-08-20 17:26 ` Avi Kivity
2009-08-20 17:36 ` Saksena, Abhishek
2009-08-20 17:41 ` 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=4A8D0944.10901@redhat.com \
--to=avi@redhat.com \
--cc=abhishek.saksena@intel.com \
--cc=kvm@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).