Page 1 of 1

How to debug e1000 driver?

Posted: Mon Dec 19, 2016 11:50 pm
by szhou42
Hi
My e1000 driver is having troubles sending any packets, basically, the e1000 card never writes to my transmit descriptor's status field. I m wondering if there are any tools to help me debug this?

I''ve seen MIT's JOS lab mentioned a qemu flag that can do this, in this web page

Code: Select all

https://pdos.csail.mit.edu/6.828/2011/labs/lab6/#Exercise-8
but I don't find any useful commands in its makefile, or on google, that tell qemu to log e1000 error message.

:( :( :(

Thanks!

Re: How to debug e1000 driver?

Posted: Tue Dec 20, 2016 1:50 am
by iansjack
If you look at the "Transmitting Packets" section (and later sections) of your reference, examples are given of using these debug flags.

Re: How to debug e1000 driver?

Posted: Tue Dec 20, 2016 3:16 am
by Kevin
Note that E1000_DEBUG only works in the 6.828 version of QEMU.
They patched their qemu...

If you want to get debugging information from qemu (which can be a very useful approach if you're stuck and don't mind reading qemu code), you'll have to patch it as well. hw/net/e1000.c already has quite a few DBGOUT() calls which write to stderr if they are enabled in debugflags, and you can still add more of them if the information you're looking for is missing.

Re: How to debug e1000 driver?

Posted: Tue Dec 20, 2016 5:47 am
by szhou42
Thanks! I never thought we could patch the qemu..