Raw IO Device Drivers

Raw IO Device Drivers

Post by ken subrat » Sat, 22 Dec 2001 06:43:15

Good day,
   Does anyone know of any sample code or docs which covers Linux's
raw IO device drivers?
   I have a kernel process which reads/writes data usng ll_rw_block.
However, I would like to by-pass the request queue and the buffering
it provides. Any suggestion?

1. Partial devfs support for raw IO devices

I hacked together this quick patch to make the "master" raw IO device
appear in devfs. It seems odd that I need *both* devfs_register...()
calls but the first one only seems to make the entry appear in

The logical corollary to this patch is to make raw IO devices
magically appear in devfs as they are bound to block devices. However,
this presents namespacing issues. Would it be reasonable to assume
that they should appear in a subdirectory called /dev/rawIO, e.g.

/dev/rawIO/2  ... etc?

devfsd could then provide compatibility links.

Anyway, first things first :-)

--- linux-2.4.5/drivers/char/raw.c.orig Sat May 26 11:58:45 2001

 #include <linux/raw.h>
 #include <linux/capability.h>
 #include <linux/smp_lock.h>
+#include <linux/devfs_fs_kernel.h>
 #include <asm/uaccess.h>

 } raw_device_data_t;

 static raw_device_data_t raw_devices[256];
+static const char RAW_DEVICE_NAME[] = "raw";

 static ssize_t rw_raw_dev(int rw, struct file *, char *, size_t, loff_t *);

 static int __init raw_init(void)
        int i;
-       register_chrdev(RAW_MAJOR, "raw", &raw_fops);
+       devfs_register_chrdev(RAW_MAJOR, RAW_DEVICE_NAME, &raw_fops);
+       devfs_register(NULL, RAW_DEVICE_NAME, DEVFS_FL_DEFAULT,
+                      RAW_MAJOR, 0,
+                      S_IFCHR | S_IRUSR | S_IWUSR,
+                      &raw_fops, NULL);

        for (i = 0; i < 256; i++)
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in

More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

2. DCC for Linux/Win95

3. Raw Devices and Asynch IO on Sybase/Linux

4. Enhanced Port Replicator


6. Win95 access to Linux tape drive?

7. raw vs quick-io vs direct io

8. Dial-up / Dial-In Linux Server to Windows Network for Mobile Users

9. character device, block device , raw device?

10. Any people have device driver for 8255 IO Card?

11. blocking IO device driver implementation

12. port io from device driver examples