Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to access a character device in kernel space (in a module)

37 views
Skip to first unread message

edd...@gmail.com

unread,
Aug 30, 2012, 6:41:07 PM8/30/12
to
Hi all, I've googled for hours for this problem and still can't find a solution, maybe someone knows how to do it.
Actually I'm writing a driver to transform a tape device(that is a character device) in a block device. I know it's totally unuseful but i like to play with it, and it can be educational.

So I need to write a module that create a block device and access the tape's character device and send command like "seek" and to read and write data.
I've already found how to get access to another block device within a module (i found some examples that uses functions like blkdev_get_by_path()) but not how to get a character device.

I already found someone suggesting to use flip_open() and vfs_read()/write, I've tried but it crash writing, ad I'm quite sure there is a better way without passing trough user-space files and filesystem.

Do you have any clue?
0 new messages