Why code for 8295a still work on APIC platform?

angwer <[email protected]> Tue, 16 Dec 2014 23:54:37 +0800
Newsgroups gmane.comp.emulators.bochs.devel
Message-ID <[email protected]>
Hi everyone, I am new here.

Recently I use bochs as the emulator to learn OS development. I get some 
assembly code from a book, which manipulate interrupts. It initialize 
the 8295a PIC and IDT. I compile the code and then run it in freedos 
(since I have not written a complete boot loader, the book tells me to 
run it as com file in freedos, which makes no difference) and all goes 
well. The PIC is initialized correctly by sending ICWx and the handler 
is called when interrupt occurs.

But I don't understand why the code can run correctly. I run freedos and 
the sample on bochs with the a  Pentium 4 cpu which uses xAPIC (I also 
test on core 2). I have search a lot and find that xAPIC is different 
from PIC and no results tell me they are compatible. (Actully when I 
read the Intel manual. I find 8295a can work together with APIC but it 
seems I can not use the usual way to initialize it.) So I think the code 
should not work. I don't see any code disabling APIC in the sample.

So my question are:
Why code using 8295a still work on APIC platforms?
Does that mean cpus like Pentium 4 and core 2 still have PICs? And what 
about newer cpus?

Sorry if the question is stupid and thanks everyone in advance.

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk