Page 1 of 1

Some thing on PCI I dont understand...

Posted: Sun Feb 07, 2010 4:02 pm
by NoMatter
Hi all!

I detect 4 devices on bus 0, and all they are master capable or enabled(really don't know if enabled or capable, they have the master bit in command header register set). What exactly the Bus Master stand for?

One of the devices are a Host-PCI bridge. It is almost entirely zeroed. Have I to configure the Host-PCI Bridge?

I found an CDrom device in the function 1 of the PCI-ISA bridge. The IRQ number is zero. Apparently CDrom don't use IRQ-s. Therefore I dont know how to implement the demo driver for ATAPI PIO in wiki.osdev. He need an Interrupt.

I have 2 devices with the same IRQ-s: "0xB",and the same line: INTA, on the same bus 0. They are the VGA compatible controller and the Fast ethernet controller. How this scenario work?

I have an PCI-ISA bridge and only one PCI bus. The MP table show me 2 buses: PCI and ISA. The table report I/O APIC Interrupt entries for both buses. Do this means that the IRQ-s for a device present under one of the functions of the PCI-ISA bridge will be seen by the I/O APIC as coming from ISA bus?

PD:I have a year in the programming world and it seems well and easy. The last week was my first encounter with the hardware and I'm terrified. :roll:

Thanks in advance!

Re: Some thing on PCI I dont understand...

Posted: Sun Feb 07, 2010 4:59 pm
by Selenic
First question: is this a real machine or a virtual machine? Having some idea of the specs (if a real machine) or which VM it is might help.
NoMatter wrote:What exactly the Bus Master stand for?
IIRC, it means that the device itself can request memory accesses and is standard for PCI devices (ISA devices need the DMA controller, which is separate, to do this)
NoMatter wrote:I have 2 devices with the same IRQ-s: "0xB",and the same line: INTA, on the same bus 0. They are the VGA compatible controller and the Fast ethernet controller. How this scenario work?
It's possible to find out which device sent a given interrupt. But that's a bit odd: PCI devices' interrupts are wired in a cycle - INTA on the second device corresponds to INTB on the first, and so on, and if they only use one IRQ it's supposed to be INTA...
NoMatter wrote:I have an PCI-ISA bridge and only one PCI bus. The MP table show me 2 buses: PCI and ISA. The table report I/O APIC Interrupt entries for both buses. Do this means that the IRQ-s for a device present under one of the functions of the PCI-ISA bridge will be seen by the I/O APIC as coming from ISA bus?
The I/O APIC doesn't really know or care what bus the interrupt is from, I think (though I may be wrong). Either way, the PCI-to-ISA bridge should translate ISA interrupts to PCI ones.
NoMatter wrote:PD:I have a year in the programming world and it seems well and easy. The last week was my first encounter with the hardware and I'm terrified. :roll:
That sounds about right, especially for PC-compatible hardware. It's mostly backwards compatibility that's to blame for that...

Re: Some thing on PCI I dont understand...

Posted: Sun Feb 07, 2010 6:11 pm
by NoMatter
Thanks for the reply!
It's possible to find out which device sent a given interrupt. But that's a bit odd: PCI devices' interrupts are wired in a cycle - INTA on the second device corresponds to INTB on the first, and so on, and if they only use one IRQ it's supposed to be INTA...
So probably an easy solution should be to set different IRQs for the different devices. Actually I don't pretend to do a full capable OS because of the infinitely extensive work needed for the drivers(I work one, nobody who I know want to help me, nobody who I know like to touch ASM). So the easiest way conform me, just wont to make it run.

In the MP table that I find at boot time, there are 21 entries for the IRQs associated with the I/O APIC. Each one of this entries have a source bus entry and source bus IRQ, There are 8 entries for IRQs from bus 0(in my system PCI bus) and 13 entries for IRQs from bus 1(my ISA bus).
The IRQs for the ISA bus are:
IRQ:00 redirected to INTIN# 0x02 of the I/O APIC.(I think this is about redirection)
IRQ:01 to INTIN# 0x01
IRQ: ...... better I'll attach a screenshot of the MP table.(and PCI-ISA bridge)

There have not IRQ:0x0B :?:
First question: is this a real machine or a virtual machine? Having some idea of the specs (if a real machine) or which VM it is might help.
This is a "Hyper-V" with minimalistic configuration.

Thanks!
Output.zip
(61.59 KiB) Downloaded 111 times