I can't get interrupt from PCI devices after boot from UEFI
-
- Member
- Posts: 104
- Joined: Tue Aug 17, 2021 10:40 am
- Libera.chat IRC: visitor
- Location: CN
- Contact:
I can't get interrupt from PCI devices after boot from UEFI
HI. i moved my os bootloader from multiboot to UEFI. but since i use UEFI as bootloader and booted to my os i can't get any interrupt from PCI devices (PIT and ps2 keyboard/mouse still work).
And i have already cleared PIC mask and cleared bits10 of PCI command register. i'm still using i8259 pic controller. will that a problem of APIC? if so how can i disable it?
And i have already cleared PIC mask and cleared bits10 of PCI command register. i'm still using i8259 pic controller. will that a problem of APIC? if so how can i disable it?
My github: https://github.com/nifanfa
-
- Member
- Posts: 104
- Joined: Tue Aug 17, 2021 10:40 am
- Libera.chat IRC: visitor
- Location: CN
- Contact:
Re: I can't get interrupt from PCI devices after boot from U
And if you don't mind. here is my code
https://github.com/nifanfa/Solution1/bl ... RTL8139.cs
https://github.com/nifanfa/Solution1/bl ... ver/PIC.cs
https://github.com/nifanfa/Solution1/bl ... ver/PCI.cs
https://github.com/nifanfa/Solution1/bl ... RTL8139.cs
https://github.com/nifanfa/Solution1/bl ... ver/PIC.cs
https://github.com/nifanfa/Solution1/bl ... ver/PCI.cs
My github: https://github.com/nifanfa
Re: I can't get interrupt from PCI devices after boot from U
You shouldn't be using the PIC or PIT if your booting from UEFI. You should use the LAPIC or X2APIC in that case.
-
- Member
- Posts: 5563
- Joined: Mon Mar 25, 2013 7:01 pm
Re: I can't get interrupt from PCI devices after boot from U
The PIC and PIT should still work, even if using them isn't a good idea. Future PCs will most likely get rid of them, so you need to use ACPI to determine whether they exist.
Does UEFI program the correct values into the interrupt line field in the PCI configuration space? If it doesn't, you'll have to use some other method (ACPI?) to track down the correct interrupt vectors.
The firmware will initialize the network adapter for booting over the network. Does your initialization code properly reset the network adapter? Have you tried any other PCI devices?
Does UEFI program the correct values into the interrupt line field in the PCI configuration space? If it doesn't, you'll have to use some other method (ACPI?) to track down the correct interrupt vectors.
The firmware will initialize the network adapter for booting over the network. Does your initialization code properly reset the network adapter? Have you tried any other PCI devices?
-
- Member
- Posts: 104
- Joined: Tue Aug 17, 2021 10:40 am
- Libera.chat IRC: visitor
- Location: CN
- Contact:
Re: I can't get interrupt from PCI devices after boot from U
yeah. i have tried two devices. rtl 8139 and e1000. both of them not workOctocontrabass wrote:The PIC and PIT should still work, even if using them isn't a good idea. Future PCs will most likely get rid of them, so you need to use ACPI to determine whether they exist.
Does UEFI program the correct values into the interrupt line field in the PCI configuration space? If it doesn't, you'll have to use some other method (ACPI?) to track down the correct interrupt vectors.
The firmware will initialize the network adapter for booting over the network. Does your initialization code properly reset the network adapter? Have you tried any other PCI devices?
My github: https://github.com/nifanfa
-
- Member
- Posts: 5563
- Joined: Mon Mar 25, 2013 7:01 pm
Re: I can't get interrupt from PCI devices after boot from U
Have you tried any PCI devices that are not network adapters?nifanfa wrote:rtl 8139 and e1000
Does UEFI program the correct values into the interrupt line field in the PCI configuration space?
-
- Member
- Posts: 104
- Joined: Tue Aug 17, 2021 10:40 am
- Libera.chat IRC: visitor
- Location: CN
- Contact:
Re: I can't get interrupt from PCI devices after boot from U
idk. i just use uefi to load the os and get gop. i didn't use anything of PCI in uefi.Octocontrabass wrote:Have you tried any PCI devices that are not network adapters?nifanfa wrote:rtl 8139 and e1000
Does UEFI program the correct values into the interrupt line field in the PCI configuration space?
i also read device's pci configuration space. the value are the same nomatter i use multiboot or uefi. but it just can't get any interrupt.
and i tried to use APIC too. but it still can't get any interrupt.
My github: https://github.com/nifanfa
-
- Member
- Posts: 104
- Joined: Tue Aug 17, 2021 10:40 am
- Libera.chat IRC: visitor
- Location: CN
- Contact:
Re: I can't get interrupt from PCI devices after boot from U
and i don't have any other driver which use PCI and have interrupt.Octocontrabass wrote:Have you tried any PCI devices that are not network adapters?nifanfa wrote:rtl 8139 and e1000
Does UEFI program the correct values into the interrupt line field in the PCI configuration space?
My github: https://github.com/nifanfa
-
- Member
- Posts: 104
- Joined: Tue Aug 17, 2021 10:40 am
- Libera.chat IRC: visitor
- Location: CN
- Contact:
Re: I can't get interrupt from PCI devices after boot from U
i also noticed that irq 0x2B seemed to be overritten. and in that case what should be the real interrupt for 0x2B?Octocontrabass wrote:Have you tried any PCI devices that are not network adapters?nifanfa wrote:rtl 8139 and e1000
Does UEFI program the correct values into the interrupt line field in the PCI configuration space?
My github: https://github.com/nifanfa
-
- Member
- Posts: 104
- Joined: Tue Aug 17, 2021 10:40 am
- Libera.chat IRC: visitor
- Location: CN
- Contact:
Re: I can't get interrupt from PCI devices after boot from U
nvm 11 = B
My github: https://github.com/nifanfa
Re: I can't get interrupt from PCI devices after boot from U
Did you enable interrupts in the network adaptor?
-
- Member
- Posts: 104
- Joined: Tue Aug 17, 2021 10:40 am
- Libera.chat IRC: visitor
- Location: CN
- Contact:
Re: I can't get interrupt from PCI devices after boot from U
yes. by clearing interrupt mask(legacy pic). by setting entry(io apic). by writting device register to enable device. enable bus mastering in pci,enable device io,memory but still no interrupt can be triggered. like i said. it works fine if i boot it using multiboot.Ethin wrote:Did you enable interrupts in the network adaptor?
My github: https://github.com/nifanfa
-
- Member
- Posts: 104
- Joined: Tue Aug 17, 2021 10:40 am
- Libera.chat IRC: visitor
- Location: CN
- Contact:
Re: I can't get interrupt from PCI devices after boot from U
and i also soft-reseted the device
My github: https://github.com/nifanfa
-
- Member
- Posts: 104
- Joined: Tue Aug 17, 2021 10:40 am
- Libera.chat IRC: visitor
- Location: CN
- Contact:
Re: I can't get interrupt from PCI devices after boot from U
and it works if i use PIT's interrupt. but i just can't get the interrupt from the device.Ethin wrote:Did you enable interrupts in the network adaptor?
My github: https://github.com/nifanfa