2

I'm creating a camera driver for Android. I've got my mydriver.c file. Apparently I need to compile it into a .ko, is that right ?

And then to load it I should do a #insmod ./mymodule.ko, will it work ?

Do I need to be root ? And how I put the .ko file on my Android tablet ?

Armand
  • 726
  • 11
  • 29

2 Answers2

3

Yes, you need to be root. And, insmod ./yourmodule.ko should work fine.

rakib_
  • 136,911
  • 4
  • 20
  • 26
  • So, I need to root my device ? And how I transfer my .ko file ? – Armand Jun 27 '13 at 15:41
  • Yes, must be root. You can keep it on any available storage you have. Note, you've to compile your module with appropriate Android toolchain. – rakib_ Jun 27 '13 at 15:45
  • What do you mean ? Can you explain plz? – Armand Jun 27 '13 at 15:46
  • :) you might've to use Android NDK to compile your module. – rakib_ Jun 27 '13 at 15:48
  • Just need to install it for libraries or things like that ? Nothing else to do ? – Armand Jun 27 '13 at 15:52
  • Well to learn how can you cross compile a module, use google to find out, "cross compile kernel module". Hope this will clarify – rakib_ Jun 27 '13 at 15:54
  • Just one more question: Does Android NDK install the prebuilt for arm-eabi ? If it doesn't, do you know where can I get it for iMX 6 tablet ? – Armand Jun 27 '13 at 17:17
  • Yes Android NDK has prebuilt for arm-eabi. Sorry, can't tell about iMX6 table, don't have much idea about that platform. – rakib_ Jun 28 '13 at 08:47
  • You will a kernel source tree corresponding to the kernel on your device. The toolchain in the NDK ought to be able to compile it. – marko Jun 28 '13 at 16:36
0

Are you trying to make this new camera work as a standard camera through Android's camera API?

In that case, unless your tablet has a particularly unusual configuration, simply installing a new kernel driver will do nothing. You still need an Android camera HAL module implementation that converts commands and data between your driver's kernel interface and Android's camera framework code.

Eddy Talvala
  • 17,243
  • 2
  • 42
  • 47
  • Can you explain ? Because I don't understand ... What's the difference between HAL and driver ? – Armand Jun 28 '13 at 12:05