>The if statement below will always evaluate to true, since pci_ioaddr
>is always zero. I searched for all references to pci_ioaddr, and the
>two shown below are the only two.
>
>Etherboot source code version 5.0.5
>In pci.c:scan_bus()
>
>...
> unsigned int pci_ioaddr = 0;
>...
> if (pci_ioaddr == 0 || romaddr == ((unsigned long) rom.rom_segment << 4))
> {
>...
> }
>...
Yes, it's a bug, or rather, incomplete code. As the comment indicates it
was also to prefer the NIC that the bootrom is on (and it's probably
doing it wrong anyway), but as you point out, the first candidate always
wins.
The issue of what to do with multiple NICs needs more thinking. The code
in config.c is not flexible enough. The developers list is probably a
better place to discuss this, hence posting is redirected there. There
have been an exchange of opinions in the past but no code came out of
that.
Another issue is what to do with multiple drivers. Some kind of dynamic
linking would allow pulling in the right driver from storage to execute
in the limited memory. Dynamic linking would also pave the way for
callbacks. But memory constraints make implementation difficult. Perhaps
we should just grab all of low memory and give up on zImages. People
with unsufficient memory would have to stay with 5.0 and people with
enough memory could use 5.2.
|