Android driver module booting
I want to implement a hardware driver for my i2c accelerometer on my beagleboard-xm, I'd like it to load it at boot. There are a good amount of resources on the web to help me compile my module but I'm having a hard time finding any information on loading my module at boot.
It seems that there are two initialization scripts:
- init.rc in the root directory
- init.goldfish.rc in system/etc
This page describes the process of writing an init.rc script in order to perform a custom initialization: http://source.android.com/porting/bring_up.html
开发者_JS百科from previous research I am pretty sure the init.goldfish.rc in system/etc is for custom board loading.. where one would replace goldfish with the name of the hardware in /proc/cpuinfo
I've looked in these two scripts to see how other modules were loaded at boot but the only thing that is loaded is the console. I feel like I'm missing something here. Are uevents used in order to detect and load the modules? if so What are the triggers for those uevents?
Any help would be greatly appreciated.
Dave
I think you could refer to the changes done by 0xdroid: http://gitorious.org/0xdroid/vendor_0xlab/trees/master/beagleboard
Please check the files: init.rc, init.omap3.rc, init.omap3.sh, and then you should know how to customize the initialization process. However, you might need to add device node in source code "system/core/init/devices.c", otherwise it won't be applied automatically.
精彩评论