A Question Concerning Device Drivers

Greg Pasquariello X1190 gp at picuxa.UUCP
Sat Feb 13 00:44:38 AEST 1988


In article <2879 at watale.waterloo.edu>, watmelon at watale.waterloo.edu (Mech. Eng. Robotics Group) writes:
> In System V, is the cpass/passc combination the only way to pass data
> between a user's buffer and a character driver?
> It seems to be a bit of a waste of time to copy data one character at a time
> when you could probably do some kind of block copy.
> Are there other ways of passing the data?

No. Yes.

No, it is not the only way, Yes there are other ways.

The kernel routines copyin() and copyout() copy a specified number of bytes
from (to) the user space.  They are called as follows:

	int copyin(from,to,n)
	char	 *from,to;
	unsigned n;

	copy a specified number of bytes from user space to kernel space.
	returns 0 if successful, otherwise -1.
	

	int copyout(from,to,n)
	char	 *from,to;
	unsigned n;

	copy a specified number of bytes from kernel space to user space.
	returns 0 if successful, otherwise -1.


There are other routines that access user text space, or user data space,
but the two shown above are the two used most often.



More information about the Comp.unix.questions mailing list