I have had success following tutorials for developing kernel modules, running them on a Ubuntu 12.04 LTS virtual machine. Particularly the example in this tutorial works fine on Ubuntu on a 3.2.0 kernel. However when cross compiled for the current Raspbian kernel, the module does not remove the entry in /dev/
during rmmod
, leaving a device file that complains No such device or address
when used. All other aspects of the module seem to work correctly, including the removal of entries in sysfs.
The tutorial was developed for kernel version 3.0.3, so I cannot see this being an API difference between 3.1.9 and 3.2.0. Are there any Pi specific changes/workarounds that I should be aware of?
Tell me more
×
Raspberry Pi Stack Exchange is a question and answer site for
users and developers of hardware and software for Raspberry Pi. It's 100% free, no registration required.
|
|||
The kernel does not create device files. The kernel creates and destroys the actual device, but something in userspace - typically either udev or you the sysadmin - must create/remove the device files. Device files are ultimately just a handle for major/minor number pairs - you can give them any name you like. It's entirely possible to have a device file with no device, or a device with no device file. |
|||||||||
|
device_create
/device_destroy
. I'm compiling on Ubuntu 12.04 LTS using arm-linux-gnueabi-gcc 4.6 from the Ubuntu repositories and the latest (as of yesterday) Raspberry Pi kernel. The device itself is running a fully up to date (including firmware) Raspbian "wheezy" distribution. – Dylan Aug 9 '12 at 15:19dmesg
does not show any errors/warnings from the module. – Dylan Aug 9 '12 at 15:23