Subject: Re: How to program in kernel ?
To: Amiga NetBSD <port-amiga@NetBSD.ORG>
From: Eric Delcamp <edelcamp@easynet.fr>
List: port-amiga
Date: 08/21/1997 16:13:22
 ----
From: Ignatios Souvatzis <ignatios@cs.uni-bonn.de>
Cc: port-amiga@NetBSD.ORG
Date: jeudi 21 août 1997 12:24
Subject: Re: How to program in kernel ?

>> I try to implement a minimun set of IOCTL in kernel, for the amiga
graphic
>> chipset (grf_cc.c).
>I don't understand what you're trying to do with ioctl(). Like any other
>system call, thats a userland C library function which passes parameters
>to the kernel through a special trap. The functions called inside the
kernel
>have to deal with getting data out of user space, so they won't work if
>called from inside the kernel.

For example, to set or get the colormap, I use viewioctl(fd, VIOCGCMAP,
&cm, -1, NULL). But it doesn't work. Could I use this call inside the
kernel ?
Maybe the problem is the fd (dev_t) ? I use the descriptor that came from
ioctl() call, gp I think (something like gp->d_grfdev).

Could someone help me ?

Thanks.