PCI device mapping questions - Minix

This is a discussion on PCI device mapping questions - Minix ; Please excuse me if this is posted twice - I wasn't sure if got the captcha right the first time. I'm trying to make MINIX (3.1.2a) recognize my Promise Ultra133 TX IDE controller. I have two IDE controllers - the ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: PCI device mapping questions

  1. PCI device mapping questions

    Please excuse me if this is posted twice - I wasn't sure if got the
    captcha right the
    first time.

    I'm trying to make MINIX (3.1.2a) recognize my Promise Ultra133 TX IDE
    controller.
    I have two IDE controllers - the built-in VIA one and a PCI card with
    the Promise controller
    My system only recognizes the VIA controller. For example, 'part' can
    see /dev/c0d0,
    my IDE drive on the VIA controller, but not /dev/c1d0, the IDE drive I
    have on the
    Promise controller.

    I've been reading the code (in drivers/pci, drivers/at_wini, and
    servers/vfs) but it is slow going
    and I seem to be missing some basic understanding with respect to the
    system architecture.

    Here are some of the things I'm trying to figure out, in no particular
    order:

    First, I can't find where the system actually detects the device and
    maps it to the correct driver.
    Does this have to be configured manually?
    If so, how does one configure this?

    Second, the Promise card reports its subclass as 0x80 (Other mass
    storage device)
    rather than 0x01 (IDE controller). Could this be why it isn't
    recognized?
    If so, what needs to be done to make the system see it as an IDE
    controller?

    Third, I see tables for mapping PCI {vid,pid} codes to text strings. I
    have been assuming
    these tables are only used to generate user-friendly output and should
    not prevent an
    unknown device from working. Is this correct?

    Fourth, how can I see what the current device mapping is?

    Fifth, does the system support more than one IDE controller?

  2. Re: PCI device mapping questions

    Somebody told me about the relation between device node and drivers.
    Hope this will be useful for your first question:


    ++++++++++++
    A device node is just a file that consists of three attributes:
    a type (block or character), a major device number, and a minor device
    number.

    Each major device number maps to a driver label. This is done by VFS,
    which keeps the mapping in /usr/src/servers/vfs/dmap.c. The driver
    label
    maps to a driver endpoint, and that mapping is kept by DS. It is the
    RS
    process that is responsible for setting up all those mappings when
    you
    start a driver (with 'service up').

    Each at_wini driver is started for a specific controller (and since
    there are two controllers on a typical system, there are also two
    at_wini's). The at_wini driver uses the *minor* device number from a
    /dev file to determine which disk to access. For example, /dev/c0d0
    has
    major 3 and minor 0, telling VFS to use entry 3 from dmap (->
    at_wini_0)
    and telling at_wini_0 to access disk 0. Another example: /dev/c1d1
    (the
    second disk on the second controller) has major 8 and minor 5,
    telling
    VFS to use entry 8 from dmap (-> at_wini_1) and telling at_wini_1 to
    access disk 1 (that 5 maps to disk 1 is entirely up to the at_wini
    driver). You can see the two at_wini instances being started in the
    /usr/src/drivers/memory/ramdisk/rc startup script.

    So:

    - A device node maps to a major, minor device number pair (VFS does
    this, just by looking at the inode details of that file).
    - The major device number maps to a driver label (VFS keeps this
    mapping; RS sets it up).
    - The driver label maps to a driver endpoint (DS keeps this mapping;
    RS
    sets it up).
    - The minor device number maps to a disk or (sub)partition on the
    driver
    (the driver itself is responsible for this).
    ++++++++++++++++

  3. Re: PCI device mapping questions


    wubingzheng wrote:
    > Somebody told me about the relation between device node and drivers.
    > Hope this will be useful for your first question:
    >


    Thank you so much for responding and for pointing me to
    DS and RS. I am reading them now.

+ Reply to Thread