UIO Kernel Driver with Buildroot and QEMU

Kenneth Adam Miller kennethadammiller at gmail.com
Tue Oct 20 16:29:10 EDT 2015


Am I missing something? Are those drivers, uio, and uio_dmem_genirq not
supposed to created device files in the linux VFS, either /dev or some
subfolder /sys?

I am using mdev (
http://buildroot.org/downloads/manual/manual.html#_dev_management), I can
 see the tty devices in /dev, so I know that the devices are being
recognized by the kernel. In addition, insmod'ing the same device more than
once gives an error where the kernel says that the file already exists.

I considered the possibility that these .c files are in fact skeleton
files, where users are supposed to create their own uio driver and rely on
the services or functions that these provide. But it doesn't explicitly say
that anywhere in the guide that I read; if this were the case, why wouldn't
it?

On Tue, Oct 20, 2015 at 11:58 AM, Kenneth Adam Miller <
kennethadammiller at gmail.com> wrote:

> So I'm building a uio kernel driver with buildroot, and I've gotten the
> driver to compile, installed it and can insmod it in the final buildroot
> target after booting the image with QEMU.
>
> I'm on linux kernel version 3.14, and I followed the guide here:
>
> https://www.kernel.org/doc/htmldocs/uio-howto/userspace_driver.html
>
> And it describes the location on where the device file that should be
> opened by userland code as either one of two locations:
>
> /dev/uioX, with X being a number
>
> or /sys/class/uio/uioX
>
> But the each of following returns nothing:
>
> ls /dev/uio*
> ls /sys/class/uio/
>
> After I compile the uio example that is provided in the linux source at
> source/drivers/uio/uio.c and uio_dmem_genirq.c, and insmod them, I do
> modprobe uio and modprobe uio_dmem_genirq and each of those return nothing.
> However, I do see that /sys/modules/uio and /sys/modules/uio_dmem_genirq
>
>
> What am I doing wrong? Or where are the respective device files that I'm
> supposed to use in my userland driver process?
>
> int fd = open("where is it!!?");
> mmap(...., fd,..);
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20151020/c952c659/attachment.html 


More information about the Kernelnewbies mailing list