OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Mar 28, 2024 9:47 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: how to make PCI MSI working?
PostPosted: Thu Jun 01, 2023 3:20 am 
Offline

Joined: Thu May 04, 2023 7:54 pm
Posts: 7
Hello everyone. I am a new beginner to OS developer. when I am developping my OS, I got issues which is ralated to MSI interrupt.

in my os, I disabled legacy PIC and enabled APIC, and I also added HPET timer. all these devices interrupts are working well through APIC. But when I am trying to add MSI , I cannot get it working.

according to chapter 6.8 of <PCI local bus sepecification 2.3> , I write 0xFEE00000(only 1 cpu used) to message address register, 0 to upper address(this device supports 64bits address). and then write 0x26(I want to use IRQ6) to message data. and then set bit 0 of message control. set Interrupt Disable of PCI cmd register at last. connect ISR to IRQ6. when the trigger happens, no ISR is called.

can you help me how to fix this issue? it would be a great appreciate to you.


Top
 Profile  
 
 Post subject: Re: how to make PCI MSI working?
PostPosted: Thu Jun 01, 2023 11:09 am 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5099
marcrew wrote:
I write 0xFEE00000(only 1 cpu used)

I'm not sure it's safe to assume the BSP APIC ID will always be 0. It probably will be, but you should still check.

marcrew wrote:
0x26(I want to use IRQ6)

IRQ6 is an input to the legacy PIC and the IOAPIC. There's no such thing as IRQ6 when you're using MSIs.

marcrew wrote:
set Interrupt Disable of PCI cmd register

What are the values of the other bits in the command register? You need to set the bus master bit to receive MSIs.


Top
 Profile  
 
 Post subject: Re: how to make PCI MSI working?
PostPosted: Sun Jun 04, 2023 9:41 pm 
Offline

Joined: Thu May 04, 2023 7:54 pm
Posts: 7
thanks for the reply.

Quote:
Octocontrabass wrote:
marcrew wrote:
I write 0xFEE00000(only 1 cpu used)

I'm not sure it's safe to assume the BSP APIC ID will always be 0. It probably will be, but you should still check.


I have checked the LAPIC ID , it is 0 .

Quote:
marcrew wrote:
0x26(I want to use IRQ6)

IRQ6 is an input to the legacy PIC and the IOAPIC. There's no such thing as IRQ6 when you're using MSIs.


OK, I connected vector 0x26(which is IRQ6 to PIC) to handler, then I wrote 0x26 to message data. is it the correct way?


marcrew wrote:
set Interrupt Disable of PCI cmd register

What are the values of the other bits in the command register? You need to set the bus master bit to receive MSIs.


the CMD reg is 0x407, status reg is 0x10. it means bus master is set ,and legacy int is disabled ,right?


Top
 Profile  
 
 Post subject: Re: how to make PCI MSI working?
PostPosted: Sun Jun 04, 2023 10:31 pm 
Offline
Member
Member

Joined: Mon Mar 25, 2013 7:01 pm
Posts: 5099
marcrew wrote:
OK, I connected vector 0x26(which is IRQ6 to PIC) to handler, then I wrote 0x26 to message data. is it the correct way?

That's the correct value, but I still don't understand where you're getting IRQ6.

marcrew wrote:
the CMD reg is 0x407, status reg is 0x10. it means bus master is set ,and legacy int is disabled ,right?

Right.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Majestic-12 [Bot] and 58 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group