So what will happen, when this all works, is that the sun 3/80 will network boot my code (using rarp and tftp). Then that code will turn around and do exactly the same thing -- run rarp and tftp to boot some other standalone code. It will need to be "some other" code because it will be loaded to and run at a different address than the 0x4000 that the test standalone will be running at.
Once all this works, I will take the next step (probably) and work up a DHCP client to replace RARP.
Doing all this has been an excellent way to really understand things that go on with the bootrom device drivers, especially the ethernet. It has also been a great chance to dig into some Sun 3/80 details I never looked at closely before.
Testing revealed some surprises with virtual address faults to unexpected addresses. The tftp code simply uses a block of memory at 0x3000 for the data structures it needs (a better scheme would use some kind of allocator). The code as trying to use the 3/160 rom base address to access the romvec table -- this was a simple change.
Now I have added a multitude of printf statements to see what the code is doing. It is trying to do the RARP, sending a packet and awaiting a reply.
I fire up wireshark and am pleased to find that "rarp" makes a perfectly good capture filter. It sees the real bootrom sending a rarp request, and my linux machine replying. But it does not see a second rarp request from my test code (though the printf statements indicate it things it sent a packet), so that is the problem I am now troubleshooting.
The lance chip has a 24 bit addressing capability. So what happens as far as the upper 8 bits in the Sun3 memory world. As near as I can tell this happens:
on the sun 3/160 the upper 8 bits get set to 0x0f on the sun 3/80 the upper 8 bits get set to 0xffThe bootrom code uses a simple memory allocator (in monalloc.c) to dole out memory suitable for DMA. It starts (on the 3/80) from a base address of 0xfff0_0000 -- note that the virtual address map has this mapped to physical memory at 0x00ff8000 which is near the top of the actual 16M of physical memory on my sun3/80. This is so for 3 pages (24K) then the mapping does other things. Perhaps 24K is adequate for the lance structures.
On the 3/160 the DMA memory allocator starts off at 0x0ff0_0000, but I have not worked out the full details of the address mapping as I have for the 3/80. But I do know the if_ie.c driver works just fine using that, so I am not worried much about it.
Tom's Computer Info / tom@mmto.org