hua kang
2006-Sep-19 14:28 UTC
[Xen-devel] Problem about rombios initializing network card''s PnP option ROM
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疯狂搜-新歌热歌高速下 --0-1312187016-1158676101=:74815 Content-Type: text/html; charset=gb2312 Content-Transfer-Encoding: 8bit HI:<br>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).<br>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.<br><br>I think maybe rombios has faultiness or some other bug, I am very confused :(<br><br>Who can give me a hand , please telling me why rombios can not init my network card''s pnp option rom ,<br><br>PS :<br>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! <br>I modify the trap function in vm86.c and insert a breakpoint in scan_rom function in rombios.c<br><br>trap(int trapno, int errno, struct regs *regs)<br>{<br> /* emulate device interrupts */<br> if (trapno >= NR_EXCEPTION_HANDLER) {<br> int irq = trapno - NR_EXCEPTION_HANDLER;<br> if (irq < 8)<br> interrupt(regs, irq + 8);<br> else<br> interrupt(regs, 0x70 + (irq - 8));<br> return;<br> }<br><br> switch (trapno) {<br> case 0:<br> <span style="color: rgb(255, 0, 0);">regs->eflags|=eflags.TF</span><br style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);"> regs->eip++;</span><br> case 1: /* Debug */<br> if (regs->eflags & EFLAGS_VM) {<br> /* emulate any 8086 instructions */<br> if (mode != VM86_REAL_TO_PROTECTED)<br> panic("not in real-to-protected mode");<br> emulate(regs);<br> <span style="color: rgb(255, 0, 0);"> regs->eflags|=eflags.TF;</span><br> return;<br> }<br> goto invalid;<br><br> case 13: /* GPF */<br> if (regs->eflags & EFLAGS_VM) {<br> /* emulate any 8086 instructions */<br> if (mode == VM86_PROTECTED)<br> panic("unexpected protected mode");<br> emulate(regs);<br> return;<br> }<br> goto invalid;<br><br> default:<br> invalid:<br> printf("Trap (0x%x) while in %s mode\n",<br> trapno, regs->eflags & EFLAGS_VM ? "real" : "protected");<br> if (trapno == 14)<br> printf("Page fault address 0x%x\n", get_cr2());<br> dump_regs(regs);<br> halt();<br> }<br>}<br><br><br><br><br><br><br><br><br><br><br><br><br><br><p>  <hr size=1><a href="http://music.yahoo.com.cn/?source=mail_mailbox_footer" target=blank> Mp3疯狂搜-新歌热歌高速下 </a> --0-1312187016-1158676101=:74815-- --===============0353685852=Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============0353685852==--