Char device initialization

Alexandru Juncu alex.juncu at rosedu.org
Wed Nov 9 08:52:45 EST 2011


On Wed, Nov 9, 2011 at 3:41 PM, Daniel Hilst Selli
<danielhilst at gmail.com> wrote:
> I'm trying to create a example char device. The example compiles fine,
> but when I try to "cat" I got "No such device or address". I have
> reviewed the code thousend times and can't see what I'm missing
>
> Here is the code -> http://pastebin.com/Td03U0fK
>
> The read method is not good, I know, but is never called.
>
> I use my own running kenrel to test, I know that is danger. I'm building
> a qemu enviroment to test this better.
>
> Here is uname -a:
> Linux archlinux 3.0-ARCH #1 SMP PREEMPT Fri Oct 7 11:35:34 CEST 2011
> x86_64 Intel(R) Core(TM) i3 CPU M 370 @ 2.40GHz GenuineIntel GNU/Linux
>
> Any idea?
>
> Thanks

You tried to 'cat' a /dev/my_device file, right?
Was that device file created with the mknod command?

-- 
Alexandru Juncu

ROSEdu
http://rosedu.org



More information about the Kernelnewbies mailing list