home | list info | list archive | date index | thread index

[OCLUG-Tech] Last two questions on I/O -- I hope.

Hi;

I have just about finished the project I set myself of tracing keyboard
input and consequent monitor output.  However, there are two questions
for which I have been unable to find an answer.  I hope somebody on this
list might help.

     1. What is the typical scan frequency the keyboard
        encoder/controller uses to scan the keyboard matrix?
     2. How can I find out what *exactly* the <Enter> (Return) key does?

A rather long explanation follows in the Post-amble.

Post-amble

Over the last four or five months I have been tracing down exactly how
data (characters and commands) gets put into my computer and what the
computer does with them.  It seemed like as good a concrete way as any
other to dive in and begin learning how computers work.

I have developed for my own use, three streams for understanding of what
is happening under the hood with regards to keyboard inputs.  In doing
this I have captured, scanned and saved about 150 pages of explanation
from manuals, texts, the Internet and OCLUG advice, all with their
attributions.

The first stream I used, is hardware based where I have traced all of
the interconnecting encoders, modules, firmware, from BIOS POST to a
character's appearance on my monitor.

The second stream is the software path where I hope I have found and
traced each and every user and kernel (including embedded firmware)
module, driver system call, and handler that transforms a key push and
release through to the appearance of character on the command line of my
monitor.  This would include the use and internal interpretation of
keyboard control codes.

The third stream is my cache flow (poor pun but I like it). That is, I
have found and documented each table used to transform make/break code
to scancodes, scancodes to key codes, key codes to character sets, and
character sets to font tables.

With the above information, I have begun to trace through each stream in
a written document for myself to ensure I in fact understand it all and
to search for any gaps I may have missed.  (And, just because that's the
way I like to do things.)

My two questions above reflect the following gaps:

Question 1) re: obtaining scan frequency simply reflects a missing
paragraph, as it were.  As I writeup the first stream and come to the
explanation of how key pushes are translated by the encoder, and since
that encoder reads the make/break code based on the timing of a scan
cycle, completeness demands a reference to an actual or typical scan
rate.

I have taken an old keyboard apart and found a Texas Instruments
HTMS70C40N2L encoder.  When I google for a data sheet to get some idea
of the scan frequency, lots of those encoders are available from
wholesalers but no data sheets.  Texas Instruments no longer lists that
particular encoder at all.  Any other encoder data sheets I have found
do not state, at least in a way that is clear to me, what a frequency
might be.

If anybody has the personal knowledge, a useful data sheet or just more
experience than I in searching for such a thing, would you please help
me fill in the paragraph I am writing.

Question 2 has me really flummoxed.  Although I am not yet writing up
the software path I have gathered and read the pertinent data.  It seems
to me that of all the keys on a keyboard the <Enter> key is the most
unique.  By pushing it (and releasing) one of several things seem to be
happening i.e. data or a string gets put into a buffer and/or a command
(a process) in the shell or an application becomes active.  There has to
be a process or function or part of the tty driver or something else
that has code detailing the exact function of the <Enter> key and into
what part of the inputting process it interjects itself.  If there is
such code or an explanation, I can't find it -- neither in libc, kernel
code or on the web.

Can someone suggest where I might look next?

With those two questions answered, I should be able to leave everyone on
this list alone for a while.

Regards Bill