Message Signaled Interrupt Implementation in DOS mode

Posted on 2012-08-16
Last Modified: 2012-08-22
Dear Experts,
I am writing an app to test if MSI(Message Signaled Interrupt) for PCI card is OK or not in DOS mode and have some questions... Please help to clarify them if available !


How to setup the Message Address and Data registers in the Capability registers for my environment(DOS) ? Is there any clear document describing these ? And code example would be better...


How to install my own service routine for this interrupt in DOS mode ?
Question by:liaoo

    Author Comment

    ***** [20120821 Status Update] *****
    I list what I have done as below and maybe you all can help to clarify these...

    (1) Multiple Message Enable = 0( for single MSI set this field = 0; MMC = 100b)
    (2) For MSI message address
         - bit[31:20] = 0xFEE
         - bit[19:12] = 0 (Destination ID)
         - bit3 = 0 (Redirection hint = 0)
         - bit2 = 0 (Destination Mode, don't care because of RH = 0)
    (3) For MSI message data
         - bit15 = 0 (trigger mode = edge)
         - bit14 = 0 (trigger level, ignored if trigger mode = edge)
         - bit[10:8] = 000 (delivery mode = fixed)
         - bit[7:0] = 0x20 (vector, and I choose to use 0x20)
    (4) Finally enable MSI by setting MSICAP.MC.MSIE = 1

    @ I have roughly read the doc(chapter 10)

    My current status: I found system hang after enabling MSIE = 1 and device generates interrupt via MSI !

    Note: In above sequence the service routine is NOT installed because I have no idea how to do it...( is this the reason why my app hang ? )

    Author Comment

    When setting the vector in Message Data field to 0x20, app hang...But if set to 0x76, I found app did not hang and then I can check if device generates interrupt and Local APIC receives this interrupt message as below:

    #1. For PCI device(AHCI controller):
    a) ID(Interrupt Disable) = 0
    b) IS(Interrupt Status) = 0
    c) MSI Cap = 0x09,0xFEE00000,0x00000076

    #2 For AHCI HBA registers:
    a) PxIS = 0x00000023
    b) PxIE = 0x7DC0007F
    c) IS = 0x00000001
    d) IE bit1 = 1

    By #1 and #2 I think device successfully sends the message to request service because:
    1. IS bit0 = 1(Port 0 has pending interrupt status)
    2. IE(Interrupt Enable) = 1
    3. PCI Command register bit10(ID) = 0
    4. MSICAP.MC.MSIE = 1(to MSI engine)

    Also I found the LAPIC receives this interrupt message because:
    1. Local APIC IRR(Interrupt Request Register) bit118(=0x76) = 1
    2. Local APIC ISR(In-Service register) bit118(=0x76) = 1

    Thus it seems that device generates the interrupt and Local APIC receives this; even so, my service routine is NOT called

    Author Comment

    After setting the vector to 0x70 my own service routine is successfully invoked. Besides the read/write access is ok in MSI mode !

    But I still did not know why it failed with vector = 0x20 or 0x76...

    Any idea ?

    Accepted Solution


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Enabling OSINT in Activity Based Intelligence

    Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

    Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
    This is an explanation of a simple data model to help parse a JSON feed
    This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
    The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now