Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 23 Dec 1995 04:44:42 -0500 (EST)
From:      Peter Dufault <dufault@hda.com>
To:        terry@lambert.org (Terry Lambert)
Cc:        pc012@svcc.seqeb.gov.au, hackers@FreeBSD.org
Subject:   Re: Help with lkm's please
Message-ID:  <199512230944.EAA02713@hda.com>
In-Reply-To: <199512230711.AAA21580@phaeton.artisoft.com> from "Terry Lambert" at Dec 23, 95 00:11:05 am

next in thread | previous in thread | raw e-mail | index | archive | help
> 
> > I am writing an lkm device driver for a digital IO board. I have worked 
> > out how to move bytes from the user space to the kernel space but not 
> > vice-versa. Can anyone give me any clues on how I move data from the 
> > kernel space to the user space. Do I use the uiomove() function, if so how.
> 
> Are you using uio structures in all cases?  If you are not required to,
> it would probably be simpler (and faster) to call copyin/copyout directly
> if you know the source/destination to be in user space and the
> destination/source to be in system space (if they are both in system space,
> use bcopy instead).
> 
> Look at the uiomove source in /sys/kern/kern_subr.c.

...

Or use a strategy function and go through physio.

The labpc driver does digital I/O to and from the board's digital
port.  That part of the driver is just a quick hack that copies
all the bytes directly to the port.  Look at "digital_in_strategy"
and "digital_out_strategy".  For something interrupt driven look
at ad_strategy.

--

Peter Dufault               Real Time Machine Control and Simulation
HD Associates, Inc.         Voice: 508 433 6936
dufault@hda.com             Fax:   508 433 5267



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