SDL and real-time apps

Hello again,
I am currently working on a product that has a very strict real-time
requirement, at times it has to preform a port read within exactly 500
micro second of the last. At times this functionality is turned off
completely. Now, my question is how can I ensure that certain events
are recorded, say keyboard presses, at least part of the time. I have
down time, in between these reads, is there a threaded function I can
wake-up or something that will read the keyboard. I guess I am mostly
confused on how events get generated in SDL, and haven’t found any
really good information, or delved into the code closely enough to
figure out how this works. Can someone help me out, by pointing me
toward resources or advise me on how these events work.
Finally, has anyone had experience with SDL and any of the real-time
kernel extensions. I am currently using hard for loops, I know bad
programmer, and am looking into real-time extensions to accomplish this
hard real-time requirement. Has anyone had any experience with these
kernel extensions, are any of them going to work with SDL, or are they
just going to completely break it down?

Thank you all for your help,
Robert