Port-vax archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Weird sprious input



I've rewritten the console driver for the VAX some, in my effort to support all the console ports of a VAX-86x0. One of those ports is the EMM (Environment Monitoring Module), which both report problems, and can respond to queries.

After adding this one, I seem to have hit upon some weird error in the tty driver. So I thought I'd ask here if anyone knows what situation or circumstances might cause this, if anyone have seen this before, and any suggestions on what to do. I really do not feel like starting to hunt and debug the whole terminal subsystem.

The scenario is like this:

I've added interrupt counters to rx and tx for the VAX. I've extended the console driver to access several different ports, selected by the minor number of the device. In the machine, all ports work through the same registers and interrupt vectors. The receive register is 32 bits. 8 bits is the data byte, and another 4 bits is the actual source of the data.

I've written a small user-mode program that opens the device that map to the EMM, and I send one byte out on that port. That byte is a request for status of the EMM. The EMM should respond to this with a total of 34 bytes.

The interrupt counter matches this. I do get 34 interrupts after sending the byte out.

However, in the user program, I sometimes get 34 bytes, but sometimes I get more than 34 bytes. The exact number is somewhat random, but range from about 44 to 56 bytes. The additional bytes do not have any corresponding interrupts which caused them, so I have no idea where they come from. Looking at the data I get back, I can identify which bytes actually comes from the EMM, and which bytes have been inserted into the stream by some weird entity. The place in this sequence of 34 bytes where the spurious bytes are inserted is random, but seems to happen in the latter half of the expected 34 bytes.

The values of these random bytes sometimes looks like they follow some pattern, but I have had totally strange values returned as well. Adding an aprint_normal inside the interrupt handler, to just show what values are received, and from where, seem to affect the system enough that I don't get the random bytes. That would suggest some timing issue.

The actual data expected is binary, and not human readable text. The randomly added data is also binary junk, and not something readable.

An example is this:
Good: 01 20 b5 00 b6 01 b6 02 49 83 49 84 bd 85 bc
Bad: 7f e4 eb ff 7f 49 54 7d 7f 58 03 01 00 b6 00 00 00 2e 04
Good: 86 00 07 9e 08 af 89 c7 0a db 8b 1f 8c 2c 8d 26 8e 27 8f

(All received exactly like this, the bad bytes in the middle.)

As the EMM is another small computer, the response back over the serial line might be high. I don't know at what speeds the actual communication takes place. But it's not like a human sitting at a normal asynch port and typing away.

Anyone seen anything like this before? Or have any good ideas on how to debug this?

        Johnny


Home | Main Index | Thread Index | Old Index