[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: kernel read/write



Quoting Michael Edward Christman (mec60@columbia.edu):
> I'm trying to write between the application level and the kernel.  I am
> using version 2.0.34 and am attempting to use memcpy_tofs and
> memcpy_fromfs, but am having some trouble.  If I use these functions in
> the application level, what do I use for the *to and *from variables.  I
> assume that you can use a FILE for whatever is in the user space,

Yes, it's the second argument of the foo_read or foo_write.

> but
> where is the data stored in the kernel?  Is it something like /dev/file?,
> and if so, how do I assign a pointer to it?

It's just an automatic (I think that's the jargon; ordinary) variable
declared in the routine. Or are you talking large transfers? Then
you'd have to kmalloc some memory.

One of the nice things about 2.2 kernels is that get/put_user do
all the VERIFY_... checking for you (assuming you're doing single
value read/writes).

> WBTE
> (Wet Behind The Ears)

ditto.

Cheers,

-- 
Email:  d.wright@open.ac.uk   Tel: +44 1908 653 739  Fax: +44 1908 655 151
Snail:  David Wright, Earth Science Dept., Milton Keynes, England, MK7 6AA
Disclaimer:   These addresses are only for reaching me, and do not signify
official stationery. Views expressed here are either my own or plagiarised.


Reply to: