Port-amiga archive

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

Re: Keyboard lockup with NetBSD5




Am 09.11.2009 um 23:50 schrieb Frank Wille:

Alexander Coers wrote:

something you did to this kernel made the bug nearly disappear :-)
I needed to type a lot and at very high speed to trigger this bug
again.

Hmm. Perhaps the additional delay from the debugging output is causing that?
I could make a kernel with a much bigger delay, but that can't be the
solution.

There is already a 2000(!) microseconds handshake delay in the kbd interrupt
handler. The AmigaOS keyboard.device uses 85 - and seems to work.


Here is the kernel output:
[...]
Oct 27 20:15:51 a1200 /netbsd: kbd sdr=00 (inverted=ff),  rotated=ff

0xff? The keyboard would never send that.


IMHO the keyboard sends one "garbage" character (0x00), followed by a
resync (0xf9) indicating a false character.

Indeed. That's interesting. The keyboard will do that when it didn't receive the expected handshaking pulse. Maybe there is a handshaking problem? And
those 2000us look quite suspiscous to me.


After reading the keyboard chapter of Amiga Intern (I know, sometimes it is really bad, but it covers nearly all aspects of OCS/ECS Amigas), I am quite sure that my keyboard has a sync problem. After sync loss the keyboard sends '1' until sync is recovered (correct handshake). This is the 0xff
value seen in the capture.


After that the keyboard repeats the last good character followed by a
buffer full indication (0xfa).

Maybe the buffer overflows because of the out-of-sync situation?

Another problem is that the handler is not prepared to deal with any special
codes from the keyboard, except "reset warning" (0x78).


The keyboard of the ECS machines should have a puffer of 10
characters, but I don't know about the A1200.

Don't know either. My hardware reference manual is from the OCS era.


This would also explain the buffer full indication (0xfa). The sync could be lost the duration of more than 10 chars. As I typed total nonsens while testing your kernel I can not say if a character is missing. But from my earlier tests I know the last character is repeated roughly 10 times, giving me a funny "rooooooooooot" login...


But where does the 0x00 come from?

Good question. Random SDR contents, although the keyboard didn't transmit
anything? But there must have been a CIA-A SP-interrupt.


see above :-)


What puzzles me is that I didn't find any code to setup the CIA-A timer A. The timer has to run in continuous mode for keyboard handshaking. Or is it still running, because AmigaOS initialized it before booting the kernel?

I will think about that over this week, and will do some experiments with
modified timing, handshaking and special-code handling.

Until then, I'm open to any ideas.


Strange. I thought an OS sets all registers necessary without making assumptions
what a bootrom did before.
Can you check the handshaking timing somehow? The Amiga Intern states that after the last bit is transmitted the keyboard waits max. 145ms for KDAT going low. The signal should be kept low for at least 75us, no max
value given.
Maybe some keyboard controllers in conjunction with Blizzard1260/BPPC are picky about this?







Home | Main Index | Thread Index | Old Index