|
Description
|
On debug kernels, hitting a key on a ps/2 keyboard will cause the system to trip
over an assertion:
panic[cpu1]/thread=c867fdc0: assertion failed: !servicing_interrupt(), file: ../../common/os/driver_lyr.c, line: 1518
c867fc6c genunix:assfail+5a (feb2e9b0, feb2ee44,)
c867fc9c genunix:ldi_ident_from_dev+82 (1940000, c867fcc0, )
c867fccc kb8042:kb8042_received_byte+c2 (fed3ce60, 22)
c867fcfc kb8042:kb8042_intr+64 (fed3ce60, 0, 1, 0)
c867fd3c i8042:i8042_intr+152 (c7e9aac0, 0, c7e9aa)
c867fd8c unix:av_dispatch_autovect+70 (1, 0, 0, 282)
c867fdac unix:dispatch_hardint+1a (1, 0)
|
|
Comments
|
The kb8042_received_byte() code runs in interrupt context, so tripping
over the assertion in the ldi code make sense. While this does work
with non-debug bits, it's clearly not safe. While the code in kb8042
was an attempt to allow switching without requiring kbtrans to be
present, it doesn't really matter as a ps/2 keyboarded system will
still be in interrupt context when in kbtrans.
The fix is to spawn another thread to do the work. I also pulled the
code out of the kb8042 driver as while it's minor optimization for
some cases, the single code-path is cleaner.
|