Driver on Linux

Jean-Denis Boyer jdboyer at
Sat Jun 28 03:18:06 EST 2003

> I thought I could make fd=open("/dev/visu", 0) in init of the
> driver 2 but I
> get ooops.

To open a device from kernel mode, you need to:

  /* Bypass argument validity check in FS calls. See <asm/uaccess.h> */
  mm_segment_t oldfs = get_fs();
  fd=open("/dev/visu", 0)

  /* Restore argument validity check */

> I also need to make something like ioctl(fd, IO_Special...
> )but the function
> ioctl is unknown in the kernel.

To have the ioctl, you should add to the beginning of your source file:

#include <linux/unistd.h>
/* Declare "ioctl" system call */
static inline _syscall3(int,ioctl,int,fd,int,request,void*,arg1)

 Jean-Denis Boyer, Software Designer
 M5T Centre d'Excellence en Télécom Inc.
 4283 Garlock Street
 Sherbrooke (Québec)
 (819)829-3972 x241

** Sent via the linuxppc-embedded mail list. See

More information about the Linuxppc-embedded mailing list