how does bochs emulate all those interrupts?

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.
Post Reply
ITchimp
Member
Member
Posts: 134
Joined: Sat Aug 18, 2018 8:44 pm

how does bochs emulate all those interrupts?

Post by ITchimp »

My understanding of basic architecture of bochs is to set aside a large block of memory
and interpret the instruction one after another .... what I want to know is how to emulate interrupts, like clock signal, keyboard etc?
Octocontrabass
Member
Member
Posts: 5572
Joined: Mon Mar 25, 2013 7:01 pm

Re: how does bochs emulate all those interrupts?

Post by Octocontrabass »

Every so often, take a break from interpreting instructions to see if an interrupt should happen.
User avatar
bzt
Member
Member
Posts: 1584
Joined: Thu Oct 13, 2016 4:55 pm
Contact:

Re: how does bochs emulate all those interrupts?

Post by bzt »

ITchimp wrote:My understanding of basic architecture of bochs is to set aside a large block of memory
and interpret the instruction one after another .... what I want to know is how to emulate interrupts, like clock signal, keyboard etc?
Like Octocontrabass said, but it is checked after each and every instruction. The main cpu loop is here, and the "interrupt pending" internal flags are checked in event.cc (where each interrupt source is hardwired in the code, like "is_pending(BX_EVENT_PENDING_LAPIC_INTR)" or "is_unmasked_event_pending(BX_EVENT_SMI)").

Use the source, Luke :-D

Cheers,
bzt
Post Reply