Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 5 Oct 1997 23:22:00 +0000 (GMT)
From:      Terry Lambert <tlambert@primenet.com>
To:        mike@smith.net.au (Mike Smith)
Cc:        mdean@best.com, freebsd-hackers@FreeBSD.ORG
Subject:   Re: lkms versus hard linked drivers
Message-ID:  <199710052322.QAA23234@usr05.primenet.com>
In-Reply-To: <199710040821.RAA00605@word.smith.net.au> from "Mike Smith" at Oct 4, 97 05:51:50 pm

next in thread | previous in thread | raw e-mail | index | archive | help
> > My question is very simple: What can't be a lkm?
> 
> Literally speaking; anything that's required by the load path for LKMs.

Including all boot critical code, which is not normally though of
as being in the code path for anything, once it's been used.

It's not strictly true that "anything that's required for the load path"
is required, in the most technical sense.  There are possible applications
for ELF object archivers and the use of "fallback drivers" which would
make the statement false.  But for the level at which you are dealing
with it, it's probably true enough.


> > For instance if I have some intel 8255As that I am going to use to produce
> > a 500hz pulse train for stepper motor control. These chips aren't stateless
> > and need to be intialized and mostly need to be kernel code to access
> > change of state interrupts and the high frequency clock (obviously). Can I
> > do all this from an lkm?
> 
> You don't want to do this sort of very hard realtime work inside the 
> FreeBSD kernel.  Use a real stepper controller card and save yourself a 
> world of grief.
> 
> Yes, you could do this from an LKM, but you would find that your 500Hz 
> output was not anything like as regular as you might want.  Delayed 
> stages in your pattern sequence will give you stepper a really ugly 
> sound, and may cause you serious problems depending on what you're 
> trying to do with it.

Peter Wemm actually did this type of thing very early on as part of
an industrial process control.  He used FreeBSD as the OS.  I think
that your timing constraints are higher than the hard guarantees
you can get out of the current kernel, however.  8-(.

You probably want to contact the realtime list on this problem, and
see what they recommend.  A real stepper controller card is one answer,
though depending on your start/stop constraints, probably not all cards
would work for you... you'd probably need a fairly smart one.


					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199710052322.QAA23234>