janbredenbeek wrote:Martin_Head wrote:
Something that has been nagging at the back of my mind, is that I may be crashing the supervisor stack, by over filling it with subroutine calls. I think there are only 64 bytes available on the supervisor stack. I am pretty sure I have done this before on this project.
Like tofro said, the supervisor stack has room for 768 bytes so you shouldn't overflow that quickly unless you put a lot of data on it.
It might be an interrupt issue. Does the CP2200 use its own interrupt level or is it shared with the other L2 interrupts?
I've done a quick peek into the serial controller which uses the L2 interrupt but doesn't set the external interrupt bit in the interrupt register, hence you can't use the external interrupt list but have to modify the L2 interrupt vector to put your own code in front of it to get serial I/O working in Minerva.
I should have said, I am talking about an interrupt routine that I think may be crashing the supervisor stack. The drivers interrupt routine is linked into both the hardware interrupt, and the 50/60Hz interrupt. And the CP2200 uses a normal level 2 interrupt.
I tried looking through the code yesterday, counting how much of the stack was being used. If I counted correctly, at one point I hit 72 bytes. I would like to keep this to below 64, so the driver could possibly work in QDOS/Minerva as well.
I was also looking at the Wireshark dumps that I have for when the lockups occurred, to see if it would give me any clues of where to look. I don't know if it's significant, but I saw 4 points in the middle of transmission where the driver hung for about 24 seconds, then resumed. So I don't know if something is getting stuck in a loop. But it seems to be random.
If you experience one of these 'hangs', try waiting 2 or 3 minutes to see if it recovers.