Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 04 Oct 1997 17:51:50 +0930
From:      Mike Smith <mike@smith.net.au>
To:        mdean <mdean@best.com>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: lkms versus hard linked drivers 
Message-ID:  <199710040821.RAA00605@word.smith.net.au>
In-Reply-To: Your message of "Fri, 03 Oct 1997 19:05:57 MST." <Pine.SGI.3.95.971003185032.22045A-100000@shellx.best.com> 

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.

> 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.

> What about this: I am pretty sure I cannot do this inside the kernel. What
> if I want my device driver for the stepper motor to socket(2) since it is
> really not going to have any ioctls. This way controlling motor position
> can be done from any machine on the network. 

You appear to have some strange ideas about how the kernel actually 
works internally. 8)  If you want to make the motor position 
network-controllable, write a device driver for the stepper controller 
card (if necessasry, you might well find that user-space I/O is 
adequate for your needs) and have *that* open the server socket.

> Can I use any system call in a) device driver in the kernel tree b) lkm?

Not in the fashion that you are thinking of above, no.

mike





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