Ross Ridge於 2014年5月14日星期三UTC+8上午2時52分09秒寫道:
> liaoo <
jimmy...@gmail.com> wrote:
>
> >Recently I found the same error occurs if MSI mode is used.
>
> >
>
> >That is, MSI interrupt can NOT be blocked via _disable() in DOS. And
>
> >it may assert between step 2 and 3 in above code, thus causes code in
>
> >interrupt service routine misjudge...
>
> >
>
> >My question is: is there any way to block Message Signaled Interrupt
>
> >"temporarily" or "tie" (step 2 and 3) together to prevent it from being
>
> >interrupted by MSI ?
>
>
>
> The sti instruction generated by the _disable() function disables all
>
> maskable interrupts regardless of how they're delivered or whether
>
> though the legacy PIC, I/O APIC or Local APIC, whether through PCI MSI
>
> signalling or the normal PCI INT[A-D]# lines. The only exception are
>
> the non-maskable interrupts like NMI and SMI but by their nature you
>
> shouldn't need to mask them.
>
>
>
> So the way to temporarily block an MSI is to use the sti instruction.
>
> If that doesn't seem to be working then your problem must be somewhere
>
> else.
>
YES, you are right !
After trying sti/cli in in-line assembly and _enable()/_disable() I found my test program works well and I can infer that either way protects the code from being interrupted(Maybe I really have to get some rest...)
>
> Also as I undertand it, PCI MSI interrupts won't work under MS-DOS.
>
> They require enabling the processor's Local APIC which makes interrupt
>
> processing incompatible with software that assumes the legacy 8259 PIC
>
> is being used. In other words incompatible with any interrupt routines
>
> used under MS-DOS. You'd have to install your own interrupt handlers
>
> for all external interrupts, including all those handled by the BIOS,
>
> MS-DOS itself and any third-party software or drivers. You effectively
>
> wouldn't be running MS-DOS anymore.
>
>
>
> Ross Ridge
MSI can work in MS-DOS according to my experience...
My test program is executed in MS-DOS(not the command prompt in OS). It supports both Pin-based and MSI mode. As you said first s/w should check if local APIC is enabled or not(usually enabled as default), then s/w should install the interrupt service routine and need to issue EOI(memory write to specific address) at the end of ISR.
BTW, the interrupt vector for MSI I used is 0x70. When MSI generated, we will see memory write occurs(Address:0xFEE00000, Data:0000C070)
I just install the interrupt handler of my own and leave others unchanged. After program exit, MS-DOS is alive and I can edit file or ....
F.Y.I
Ross Ridge於 2014年5月14日星期三UTC+8上午2時52分09秒寫道:
Ross Ridge於 2014年5月14日星期三UTC+8上午2時52分09秒寫道: