Keyboard design - thoughts and questions
Posted: Thu Jan 05, 2012 10:46 pm
Hi all,
I have been working on my OS for a little bit and have made some progress with some assistance -- thanks to all who have helped. I admit that I am working without a plan or design; my primary objective at this point is to prove to myself that I can understand the mechanics of interacting with the hardware.
So far, I have only produced video output and created a process switching model and have started reading keyboard input. I have been successful at taking keyboard scan codes and echoing them to the screen. It strikes me that I am at a critical design decision point and I thought I would ask for some coaching while I wait for Tanenbaum to arrive.
So far, my keyboard service routine is handling retrieving the scan code from the controller and translating it to a character. I use look-up tables to convert the scan codes to characters, accounting for the different "decorations" for the key such as shift. I queue the character (unicode) and finally return from the ISR. It feels like a performance issue waiting to happen (or happening already and I don't have enough going on to notice).
The scan codes are developed in such a way that I should be able to replace the default key map with a difference one as desired. The thinking behind this is that I set aside unicode f800 - f8ff to be used as special responses and can register handlers for these keystrokes. I expect to use this facility as I continue to build the OS to, say, display the process tables.
I have been pondering simply queuing the scan codes (or messaging them through IPC; not implemented yet) and then waking a process to do the conversion to the unicode key and queuing the result. But that also feels like a possible delay during any period of heavy processing. Or... should the ISR continue to do the translation? I also recognize that though I one option is closer aligned to a micro-kernel and the other is closer to a monolithic kernel.
If I continue down the path of a micro-kernel, it also strikes me that now is the time to standardize on a driver interface (is this called a ioctrl block?). I have searched for ideas on how to approach my questions and have come up with nothing -- I'm certain that I am not using the right terms in my search.
Anyway, the reason for my post, I am asking for some guidance or coaching as I consider my options at this juncture.
Thanks!
I have been working on my OS for a little bit and have made some progress with some assistance -- thanks to all who have helped. I admit that I am working without a plan or design; my primary objective at this point is to prove to myself that I can understand the mechanics of interacting with the hardware.
So far, I have only produced video output and created a process switching model and have started reading keyboard input. I have been successful at taking keyboard scan codes and echoing them to the screen. It strikes me that I am at a critical design decision point and I thought I would ask for some coaching while I wait for Tanenbaum to arrive.
So far, my keyboard service routine is handling retrieving the scan code from the controller and translating it to a character. I use look-up tables to convert the scan codes to characters, accounting for the different "decorations" for the key such as shift. I queue the character (unicode) and finally return from the ISR. It feels like a performance issue waiting to happen (or happening already and I don't have enough going on to notice).
The scan codes are developed in such a way that I should be able to replace the default key map with a difference one as desired. The thinking behind this is that I set aside unicode f800 - f8ff to be used as special responses and can register handlers for these keystrokes. I expect to use this facility as I continue to build the OS to, say, display the process tables.
I have been pondering simply queuing the scan codes (or messaging them through IPC; not implemented yet) and then waking a process to do the conversion to the unicode key and queuing the result. But that also feels like a possible delay during any period of heavy processing. Or... should the ISR continue to do the translation? I also recognize that though I one option is closer aligned to a micro-kernel and the other is closer to a monolithic kernel.
If I continue down the path of a micro-kernel, it also strikes me that now is the time to standardize on a driver interface (is this called a ioctrl block?). I have searched for ideas on how to approach my questions and have come up with nothing -- I'm certain that I am not using the right terms in my search.
Anyway, the reason for my post, I am asking for some guidance or coaching as I consider my options at this juncture.
Thanks!