[plug] Any kernel hackers out there...?
Kim Covil
Kim.Covil at csiro.au
Wed Mar 6 12:20:04 WST 2002
On Wed, 2002-03-06 at 10:55, Harry McNally wrote:
> Assuming you also need to talk to the external serial device after boot, I would examine the serial device driver source and look at simply adding the poll and response code into the end of the existing initialisation code (the init_module entry in the driver).
>
> Depending on the drivers default serial port configuration, this might require serial mode setup (baud rate, stop bits etc) and then transmit and receive. After enabling the device interrupts, it should be possible to put chars into the output ring buffer and then use the response (or timeout) to set your kernel variable appropriately.
>
> The driver source would be the first point of reference and then looking at Rubini's book "Linux Device Drivers" (O'Reilly ISBN1-56592-292-1 .. mine's a bit old .. I think there is a second addition now .. Boffins ?)
>
> The book talks about timing methods. While polling the serial port for a few characters pauses the boot at 9600 baud, we are only talking 4 milliseconds or so which is negligible. It assumes that the external device is available to respond as the boot proceeds. Make sure there is no long "warm up" or reset for the external device. This would not have mattered if your user code interrogated the device when it was ready (after the Linux boot itself) but might catch you out if it happens early in the boot process. Traps for young players.
>
> A caveate here: this is munging a serial driver for a specific task which defeats the whole "layers of an onion" but you did say the kernel is highly modified anyway and you need to sqeeze the system into the available space ..
>
> Anyhoo, have fun. Playing with ARM boards sounds interesting :)
>
Cheers... I think I know where in the code I want to call it from... but
I am trying to find out what code I want to call... I will have a hunt
around the serial driver again and see if I can find the output ring
buffer... is there an input ring buffer too...? The read code is the
part I am most stuck with I think...
As for munging the serial driver... I am not too worried about it being
neat and tidy if it works... this is the only device that will (can)
ever be attached to this serial port... I have to watch that what I do
doesn't affect the other serial port though as that is what provides me
with a terminal... :)
Cheers
Kim
--
===========================================================================
Kim Covil - CSIRO Exploration & Mining E-mail: kim.covil at csiro.au
,-_!\
PO Box 1130, Bentley, Direct: +61 8 6436 8638 /
\
Western Australia 6102 Fax: +61 8 6436 8555
*_,-._/
========================================================================
v
Please direct all personal e-mail to kimbotha at covil.com.au
More information about the plug
mailing list