7th Chapter Android HAL Instance parsing
Through this chapterAndroidof theHALknowHALis for some hardware providers to protect the patented driver is generated to avoidLinuxof theGPLbondage. HALThe main storage directories are:1,Libhardware_legany 2,Libhardware:3,Ril 4,msm7k. Mainly includes the following modules:Gps,Vibrator,Wifi,Copybit,Audio,Camera,Lights,Ril,Overlayand so on. Probably understood.Android HAL.
The implementation of the service method is called directly by the method in section 1
In general,HAL moudle needs to be involved in the following 3 key structures:
struct hw_module_t;
struct hw_module_methods_t;
struct hw_device_t;
In the JNI layer file:mokoid-read-only/frameworks/base/service/jni/com_mokoid_server_ledserver.cpp .
Service ( belonging to the Framework layer) file:frameworks/base/service/java/com/mokoid/server/ Ledservice.java. app test program (belongs to app layer) file:apps/ledclient/src/com/mokoid/ledclient/ Ledclient.java.
the method in section 2 ------- call service through Manger
Manger (Belonging to the Framework layer)
The APP communicates through this Manger and service .
File:Mokoid-read-only/framework/base/core/java/mokoid/hardware/ledmanager.java.
Systemserver ( belongs to the APP layer)
File:Mokoid-read-only/apps/ledtest/src/com/mokoid/ledtest/src/com/mokoid/ledtest/ledsystemserver.java.
App test program (belongs to app layer)
File:Mokoid-read-only/apps/ledtest/src/com/mokoid/ledttest/ledtest.java.
Finally fs-s5pc experiment platform led Light Experiment, (1) Copy Experiment Code mokoid-read-only to the Android Source Root Path:
~/eclair_2.1_farsight/$ CD Mokoid-read-only
~/eclair_2.1_farsight/mokoid-read-only$ mm
(2) Update the root file system:
~/eclair_2.1_farsight/$./make_fs100_yaffs2_image.sh
(3) compiling the driver module
(4) power on the Development Board, start the Android system, load the driver module, and create the device node.
(5) go to the main program menu, but do not see the two applications we added by executing the following command:
Logcat-s Packagemanager &
(6) Go to the main program menu, you can see there are two newly added applications (com.mokoid.LedClientLedClienthe and com.mokoid.LedTest.LedTest), The two programs can be executed to see the led light on the control board.
This chapter provides a more in-depth understanding of this chapter by mastering the Android HAL effectively.
7th Chapter Android HAL Instance parsing