I have a Galaxy S3 that is an android phone. I want to develop a USB Device Driver for it.
So I made a simple driver that is compiled with Galaxy S3 Linux Kernel. But I can’t execute ‘insmod’ command without root permission.
Is it possible to develop a device driver for android phone?
Additionally, a driver source code is a typical character device driver sample which has open(), close(), read(), write() functions.
And an error message are:
-
insmod: Permission denied
(have not a root permission ) -
insmod: invalid module format
(have a root permission through ‘rooting’. I think that the kernel was changed because of ‘rooting’. And device driver compiled with original Galaxy S3 Linux Kernel which is released by samsung. )
Yes it IS possible to develop a device driver for any android phone as long as you have:
– access to the linux kernel source for that particular phone.
– have access to a root shell on the device.
Access to the kernel source is required so that one can build a kernel-module against that particular kernel. A root shell is required to insmod the kernel-module.
Regarding USB host support on android phones, certain phones have the USB-host support built-in to the kernel and will support the USB-host mode. But one needs to have the proper USB-cables to connect the peripherals.
Also to overcome the error,
you might want to try the –force-vermagic flag as follows :
As you have rightly guessed, it is in fact an error due to mismatch of version numbers between the kernel running on the device and the kernel that the module is built against.
More details here.