On Thursday 29 March 2001 17:48, Christos Tranoris wrote:
> I would like to write an example program under RTL
> and I would like to access the status of NumLock for example.
Does that include changing the status?
> The status in dos is on a byt located on segment 0x0040 and offset 0x0017.
> As a new to RTL, how I can get this status under RTL?
Two methods, basically:
1. The easy way; ask the normal Linux keyboard driver.
2. Port the keyboard driver to RTL, so you can open the keyboard as a
native RTL driver under the posixio layer or similar. (You'd
probably have to implement an emulation layer to give normal Linux
access to the keyboard as well. If you need that, that is.)
1) should be fairly easy, although I can't tell you exactly how to do it
without some investigation. However, I can see two ways; the nice way of
going via user space and the normal APIs (or possibly something in kernel
space, but not an RTL ISR or thread) - and the more brutal way of reading
directly from the driver status struct of the keyboard driver.
2) is a great deal of work, and it's also quite pointless, I think. Unless
you have a keyboard with a custom "turbo scan" MCU, you probably won't be
able to get any additional timing info by using RTL. (If you were to analyze
the typing "feel" of users or something... :-) If you want to make sure the
keyboard is *very* responsive, just throw the lowlatency patch in to ensure
that nothing blocks Linux drivers and threads for more than about .5 ms.
> How I can read this byte at this address?
AFAIK, this address is updated by ether the BIOS or DOS - which obviously
means it's not there under Linux. That is, it would be pointless to read that
address, even if you could map it.
//David
.- M A I A -------------------------------------------------.
| Multimedia Application Integration Architecture |
| A Free/Open Source Plugin API for Professional Multimedia |
`----------------------> http://www.linuxaudiodev.com/maia -'
.- David Olofson -------------------------------------------.
| Audio Hacker - Open Source Advocate - Singer - Songwriter |
`--------------------------------------> [EMAIL PROTECTED] -'
-- [rtl] ---
To unsubscribe:
echo "unsubscribe rtl" | mail [EMAIL PROTECTED] OR
echo "unsubscribe rtl <Your_email>" | mail [EMAIL PROTECTED]
--
For more information on Real-Time Linux see:
http://www.rtlinux.org/rtlinux/