[prog] Do I need to write a kernel module?

softwaregurl l_chix at softwaregurl.com
Sun Dec 27 18:27:13 UTC 2009


I am trying to interface with a relay board originaly used by Walmart to switch car radios into different speakers.  They have since been obsoleted and replaced, but I have one.  They were designed to be controled by a touch screen but that was never implimented and there is no info available except for a pin marked 'data'.
I have been controling it with MSdos and Qbasic (yes I know).  I found with a recording scope that I can duplicate the signal on a com port and convert to the level on the input by a 3 component resistor/capacitor/transistor circuit using (don't quote me..pulling specs from memory) 4800bps 5 data bits 1 stop bit and no parity but there is a non-standard delay between the 2 bytes it needs.  In Qbasic I just did a for next loop.
I tryed using something like this in sh

echo -ne "\x31" >/dev/ttyS2
usleep "$SLP"
echo -ne "\x0e" >/dev/ttyS2

and starting it with different nice values and $SLP as root but it looks on the scope like the output is still getting buffered and is inconsistant.  This was just a shot in the dark first try.
Could I write the same thing in C/C++ or would it have the same sort of problem? I see Kernel land and User land modules but am not sure where to start.  Maybe just hack the existing module?
I am 2 years into Linux at home but experience writing web server apps in Perl and some hardware and software experience back as far as the AppleII series.  Still pretty inexperienced at bash (sh) and have only dabbled in hacking C under Linux so far.
If there are any questions or could be stated more clearly, please ask.  Some of my terminology can be old or use the wrong term or acronym.

System specs:
Dell PII 233
Tiny Core Linux with custom compiled 2.6.26 kernel.

ty
-SG
-- 
softwaregurl <l_chix at softwaregurl.com>


More information about the Programming mailing list