Does IOAPIC require LAPIC

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
nexos
Member
Member
Posts: 1081
Joined: Tue Feb 18, 2020 3:29 pm
Libera.chat IRC: nexos

Does IOAPIC require LAPIC

Post by nexos »

Hello,
I am currently working on an APIC driver. I was wondering if you needed a Local APIC driver in order to use the IO APIC
Thanks,
nexos
"How did you do this?"
"It's very simple — you read the protocol and write the code." - Bill Joy
Projects: NexNix | libnex | nnpkg
nullplan
Member
Member
Posts: 1791
Joined: Wed Aug 30, 2017 8:24 am

Re: Does IOAPIC require LAPIC

Post by nullplan »

Well, you need to enable LAPIC. And you need to signal EOI to it. If that amounts to a driver to you, then yes, you need a LAPIC driver to use IOAPIC.
Carpe diem!
Korona
Member
Member
Posts: 1000
Joined: Thu May 17, 2007 1:27 pm
Contact:

Re: Does IOAPIC require LAPIC

Post by Korona »

Is this a strange question to ask for the following reason: the LAPIC is relatively simple to drive and offers many useful features (such as the most accurate timers that the architecture has to offer, access to the performance monitoring IRQ, multiprocessor support and the ability to send IPIs/NMIs). If it is available, you want to enable it even on systems where you use the old XT-PIC to handle hardware IRQs (which is perfectly possible).

Correctly handling the I/O APIC requires an ACPI implementation, however. There are chipsets - including most (?) Intel chipsets younger than 10 years - where the I/O APIC simply will not receive all interrupts (not even all non-PCI interrupts) when the _PIC AML method has not been called.
managarm: Microkernel-based OS capable of running a Wayland desktop (Discord: https://discord.gg/7WB6Ur3). My OS-dev projects: [mlibc: Portable C library for managarm, qword, Linux, Sigma, ...] [LAI: AML interpreter] [xbstrap: Build system for OS distributions].
nexos
Member
Member
Posts: 1081
Joined: Tue Feb 18, 2020 3:29 pm
Libera.chat IRC: nexos

Re: Does IOAPIC require LAPIC

Post by nexos »

Ok that is what I figured. Thanks!
"How did you do this?"
"It's very simple — you read the protocol and write the code." - Bill Joy
Projects: NexNix | libnex | nnpkg
Post Reply