Some thing on PCI I dont understand...

Discussions on more advanced topics such as monolithic vs micro-kernels, transactional memory models, and paging vs segmentation should go here. Use this forum to expand and improve the wiki!
Post Reply
NoMatter
Posts: 2
Joined: Sun Feb 07, 2010 12:41 am

Some thing on PCI I dont understand...

Post 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!
Selenic
Member
Member
Posts: 123
Joined: Sat Jan 23, 2010 2:56 pm

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

Post 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...
NoMatter
Posts: 2
Joined: Sun Feb 07, 2010 12:41 am

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

Post 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
Post Reply