Felix-KM wrote:
I think that could work (only an idea, not tested):
struct Region
{
void * p;
size_t s;
};
#define IOBIG _IOWR ('b', 123, struct Region)
userland:
char data[1000];
struct Region r;
r.p = data;
r.s = sizeof data;
int error = ioctl (fd, IOBIG, &r);
kernel:
int my_i
> I think that could work (only an idea, not tested):
>
>
> struct Region
> {
> void * p;
> size_t s;
> };
>
>
> #define IOBIG _IOWR ('b', 123, struct Region)
>
>
> userland:
>
> char data[1000];
> struct Region r;
>
> r.p = data;
> r.s = sizeof data;
> int error = ioctl (fd,
Scott Long wrote:
Felix-KM wrote:
I can't understand how to use the function copyout().
It is necessary to write the data from a device driver to the
array defined in user program.
I do it this way:
#define IOCTL_GET_B_IOWR("F", 127, 0x4)
What you've declared here i
Felix-KM wrote:
I can't understand how to use the function copyout().
It is necessary to write the data from a device driver to the
array defined in user program.
I do it this way:
#define IOCTL_GET_B_IOWR("F", 127, 0x4)
What you've declared here is an ioctl that wil
Giorgos Keramidas wrote:
On 2005-07-25 18:14, Felix-KM <[EMAIL PROTECTED]> wrote:
I have no idea if it is possible for ioctls to have mapped more than
a few 100 bytes for data exchange. You should use read and uiomove()
instead.
So if I get it right, it's impossible in FreeBSD to gain acces
Kamal R. Prasad wrote:
Im not sure of the bug in your code, but you have got
to assume that copyout() would fail if the user/kernel
addr passed to it is not accessible.
regards
-kamal
The whole point of copyin and copyout is to deal with copying
to and from user virtual memory that might not
Felix-KM wrote:
#define IOCTL_GET_B_IOWR("F", 127, 0x4)
I think the third parameter to _IOWR should directly specify a type,
e.g. _IOWR("F", 127, int) or _IOWR("F", 127, struct MyStruct).
driver
struct my_softc {
...
short unsigned int B;
};
...
static int
my_io
On Mon, 25 Jul 2005, Felix-KM wrote:
In the Linux driver Ioctl is realized with the macroses _put_user
_get_user all over it. As I understand in FreeBSD their analogues are
functions described in store(9), copy(9) and fetch(9).
Linux doesn't provide any help for driver IOCTL routines, FreeBSD
>
> > So if I get it right, it's impossible in FreeBSD to gain access to
> > 64KB of user's program memory with ioctl?
> >
> > My situation is this - I have a device driver for Linux. My task is
> > port it as it is (1:1) into FreeBSD.
> >
> > In the Linux driver Ioctl is realized with the macroses
On 2005-07-25 18:14, Felix-KM <[EMAIL PROTECTED]> wrote:
> >I have no idea if it is possible for ioctls to have mapped more than
> >a few 100 bytes for data exchange. You should use read and uiomove()
> >instead.
>
> So if I get it right, it's impossible in FreeBSD to gain access to
> 64KB of use
>> #define IOCTL_GET_B_IOWR("F", 127, 0x4)
>
>I think the third parameter to _IOWR should directly specify a type,
>e.g. _IOWR("F", 127, int) or _IOWR("F", 127, struct MyStruct).
>
>>
>> driver
>>
>> struct my_softc {
>> ...
>> short unsigned int B;
>> };
>>
>> ...
>>
>> static
> #define IOCTL_GET_B_IOWR("F", 127, 0x4)
I think the third parameter to _IOWR should directly specify a type,
e.g. _IOWR("F", 127, int) or _IOWR("F", 127, struct MyStruct).
>
> driver
>
> struct my_softc {
> ...
> short unsigned int B;
> };
>
> ...
>
> static int
> my_ioctl(s
Im not sure of the bug in your code, but you have got
to assume that copyout() would fail if the user/kernel
addr passed to it is not accessible.
regards
-kamal
--- Felix-KM <[EMAIL PROTECTED]> wrote:
> I can't understand how to use the function
> copyout().
> It is necessa
On Mon, Jul 25, 2005 at 04:35:20PM +0400, Felix-KM wrote:
> I can't understand how to use the function copyout().
> It is necessary to write the data from a device driver to the
> array defined in user program.
> I do it this way:
>
> #define IOCTL_GET_B_IOWR("F
I can't understand how to use the function copyout().
It is necessary to write the data from a device driver to the
array defined in user program.
I do it this way:
#define IOCTL_GET_B_IOWR("F", 127, 0x4)
driver
struct my_softc {
...
short unsigned int B;
};
15 matches
Mail list logo