From owner-freebsd-hackers Sun Oct 5 16:22:11 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id QAA15783 for hackers-outgoing; Sun, 5 Oct 1997 16:22:11 -0700 (PDT) (envelope-from owner-freebsd-hackers) Received: from usr05.primenet.com (tlambert@usr05.primenet.com [206.165.6.205]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id QAA15778 for ; Sun, 5 Oct 1997 16:22:06 -0700 (PDT) (envelope-from tlambert@usr05.primenet.com) Received: (from tlambert@localhost) by usr05.primenet.com (8.8.5/8.8.5) id QAA23234; Sun, 5 Oct 1997 16:22:00 -0700 (MST) From: Terry Lambert Message-Id: <199710052322.QAA23234@usr05.primenet.com> Subject: Re: lkms versus hard linked drivers To: mike@smith.net.au (Mike Smith) Date: Sun, 5 Oct 1997 23:22:00 +0000 (GMT) Cc: mdean@best.com, freebsd-hackers@FreeBSD.ORG In-Reply-To: <199710040821.RAA00605@word.smith.net.au> from "Mike Smith" at Oct 4, 97 05:51:50 pm X-Mailer: ELM [version 2.4 PL23] Content-Type: text Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > > 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.