Skip to contentSkip to conversation

2.4 virtual terminal timing

DISCUSSION Tom Schouten 2 participants 2 messages Nov 10, 2004

lore
Share & tools
lore
#0 lore raw

hi all,

kernel noob first post beware..
i am using a virtual terminal on i386 arch to do reaction time measurement for a perception psychology vision/hearing experiment.

i am trying to find out if there is a direct path in 2.4.x from keyboard interrupt, through console/tty stuff to process wakeup, for a 2 thread process with one thread blocking on tty read, running SCHED_FIFO, or a single thread process with async IO.

i suspect there is no direct path to wakeup or SIGIO delivery, so i walked the tty/console code for a day and i can't tell really. i got very confused. i'm not using 2.6 yet (other scheduling problems).

so, questions:
- where exactly does wake-up after keyboard interrupt happen?
- if no direct path, how can i get reasonable timing from keyboard?
- anyone has keyboard driver code or incredibly dirty hack replacing tty code that can record time stamps for keys pressed/released?
- any pointers to documentation or other hints that could put me on the right track??

i'm a bit lost

cheers
tom

#1 lore raw
Quoted 5 lines · Tom Schouten

i am trying to find out if there is a direct path in 2.4.x from keyboard interrupt, through console/tty stuff to process wakeup, for a 2 thread process with one thread blocking on tty read, running SCHED_FIFO, or a single thread process with async IO.

You hit the keyboard. A microcontroller with a brain the size of a pea sits around for a bit works out what you hit and we get an interrupt. After
that it sends it slowly over a serial link to the PC.

The tty driver figures out the characters and sends them down to the line discipline layer. The line discipline will wake the user process from that event.

At least in 2.6 the tty driver isn't doing batching for keyboard commands that I can see so it ought to be reasonably quick.