Sunday, October 5, 2008

3c905: transmitting!

It turns out that we'd overlooked something about the northbridge's SMM handling: the memory controller blocks PCI DMA access to the SMM segments just like it prevents the CPU from reaching them. This explains why sending packets was failing before; at some point shortly after sending the first packet, the network card would attempt to access the no-longer-open frame descriptor, and be told "no!"

Now that we've set Tseg to be open all the time, packet sending works reliably under both Linux and Pebbles, and the PCI bothering code still does what it's supposed to. The next step is to start sending out screen dumps...

This brought up an interesting race condition. Suppose we have some device that we set up to repeatedly attempt to DMA our code into SMM. Most of the time, this will fail. However, at some point, an SMI will occur (and if not, we can enable some more traps); if the DMA happens to occur while the northbridge is in SMM, then shazam...

No comments: