[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] Problem about rombios initializing network card's PnP option ROM


  • To: xen-devel@xxxxxxxxxxxxxxxxxxx
  • From: hua kang <kangh_77@xxxxxxxxxxxx>
  • Date: Tue, 19 Sep 2006 22:28:21 +0800 (CST)
  • Delivery-date: Tue, 19 Sep 2006 07:28:48 -0700
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com.cn; h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=f653H4Lkqe19HjcSYx931U+G7AvvL9JaSIsa6BY49QKwaZQYjulHJ9msSk3mDmhz7TCz/Zdsq9Af2a1Ua5XdXg3u75ARtnSuQL9jfftEYwWTA3W7S+oqygykFhugIIyh2LJEaut5QDa3sa7Hci+neylxyhTml4RlefVEYN/09Ng= ;
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>

HI:
I try to let guest os to DHA(directly hardware acceess) physical network card, and also want to let rombios (which is not DHA) to initialize networks card's pnp option Rom(the pnp option rom is DHA).
however , I find the init program(offset by 3 from 55aa header signature) within option rom can not run properly ---- it cause stact underflow  . and when retf form option rom ,system crash because stack corruption.

I think maybe rombios has faultiness or some other bug, I am very confused :(

Who can give me a hand , please telling me why rombios can not init my network card's pnp option rom ,

PS :
I trace the initialization by opening the debug 1 exception flag ( eflage.TF=1),and step by step run untill  find a instruction (add sp, 0xeh) ,which cause stack underflow!
I modify the trap function in vm86.c and insert a breakpoint in scan_rom function in rombios.c

trap(int trapno, int errno, struct regs *regs)
{
    /* emulate device interrupts */
    if (trapno >= NR_EXCEPTION_HANDLER) {
        int irq = trapno - NR_EXCEPTION_HANDLER;
        if (irq < 8)
            interrupt(regs, irq + 8);
        else
            interrupt(regs, 0x70 + (irq - 8));
        return;
    }

    switch (trapno) {
    case 0:
              regs->eflags|=eflags.TF
              regs->eip++;
    case 1: /* Debug */
        if (regs->eflags & EFLAGS_VM) {
            /* emulate any 8086 instructions  */
            if (mode != VM86_REAL_TO_PROTECTED)
                panic("not in real-to-protected mode");
            emulate(regs);
            regs->eflags|=eflags.TF;
            return;
        }
        goto invalid;

    case 13: /* GPF */
        if (regs->eflags & EFLAGS_VM) {
            /* emulate any 8086 instructions  */
            if (mode == VM86_PROTECTED)
                panic("unexpected protected mode");
            emulate(regs);
            return;
        }
        goto invalid;

    default:
    invalid:
        printf("Trap (0x%x) while in %s mode\n",
            trapno, regs->eflags & EFLAGS_VM ? "real" : "protected");
        if (trapno == 14)
            printf("Page fault address 0x%x\n", get_cr2());
        dump_regs(regs);
        halt();
    }
}














Mp3疯狂搜-新歌热歌高速下
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.