[Etherboot-developers] Re: Etherboot 5.0.10 problem + solution
Brought to you by:
marty_connor,
stefanhajnoczi
|
From: David A. <da...@xd...> - 2003-07-11 18:35:23
|
>You should be trying 5.1, it works better with linuxbios.
I looked at this, it's too different from earlier versions. No mention of
the .ebi file needed by 5.0.10. Too alien.
However I fixed the rtl8139 network problem and it turned out to be a very
subtle problem in the driver, and it is present in every version of linux
that I've checked. However the circumstances that demonstrate this problem
only seem to appear when linuxbios is doing the booting.
Here's the problem:
The 8139 IntrStatus register (word at offset $3e) is read only, writes have
no effect. The act of reading the register *CLEARS* every interrupt request.
The drivers all assume they need to write 1 bits back to this register to
clear the appropriate interrupt request bits, and leave the other ones
untouched. So what was happening with my setup was network traffic was flaky,
it might send a packet but then miss the response, if the response came back
fast enough (which it usually does).
I fixed it by changing the rtl8139.c file so IntrStatus isn't directly accessed
by the code, but instead goes through some helper functions:
static unsigned short cintr=0;
static unsigned short getstatus(void)
{
return cintr|=inw(ioaddr + IntrStatus);
}
static void setstatus(unsigned short val)
{
cintr&=~val;
}
So all times where inw(ioaddr+IntrStatus) is used, use getstatus() instead,
and instead of using outw(val, ioaddr+IntrStatus) use setstatus() instead.
After this it works perfectly.
|