It seems that I have found the solution. I tried to print some debug msg in keypad driver goldfish_events.c and re-compiled the kernel. Then I put zImage to my product directory and compiled it as before I can see the compile result at out/target/product/project_name/ as kernl, system.img, userdata.img ... use emulator command to hook the kernel, then I see the debug msg was printed when emulator is booting $emulator -kernel <path-to-kernel> -system <path-to-system> -show- kernel -verbose
The part of emulator booting msg is as the following: goldfish nand dev0: size 4000000, page 2048, extra 64, erase 131072 goldfish nand dev1: size 4000000, page 2048, extra 64, erase 131072 goldfish nand dev2: size 4000000, page 2048, extra 64, erase 131072 mice: PS/2 mouse device common for all mice *** events probe *** >>>>> bryan add this dbg msg ## 1 >>>>> bryan add this dbg msg ## 2 >>>>> bryan add this dbg msg ## 3 >>>>> bryan add this dbg msg ## 4 >>>>> bryan add this dbg msg ## 5 events_probe() addr=0xc6854000 irq=16 events_probe() keymap=qwerty2 input: qwerty2 as /devices/virtual/input/input0 goldfish_rtc goldfish_rtc: rtc core: registered goldfish_rtc as rtc0 device-mapper: uevent: version 1.0.3 device-mapper: ioctl: 4.14.0-ioctl (2008-04-23) initialised: dm- [email protected] On 12月22日, 下午3時21分, bryan <[email protected]> wrote: > Hi every one, > > I am a very new beginner in Android and try to port a keypad driver on > emulator. > > I follow the > linkhttp://source.android.com/porting/build_new_device.html#androidBuildN... > to construct my product directory and make it can be compiled > successfully. > > I also follow the > linkhttp://source.android.com/porting/keymaps_keyboard_input.html > to register my system.prop keylayout.kl and keychar.kcm successfully > in > /out/target/product/project_name/system/build.prop > > My questions is: where can I put the keypad driver (such as the > example pguide_events.c) if I have already wrote one driver and hook > it to system.img which compiled from my product directory? > > I also follow the > linkhttp://linuxclues.blogspot.com/2010/05/build-compile-linux-kernel-and... > to download the kernel source code and compiled it successfully > But it is for eclair version (now is froyo), I am not sure if it still > useful for me. > If I can use the kernel, I think maybe I can add a new keypad driver > into path: common/drivers/input/keyboard/, > or I can modify the content of goldfish_events.c to my driver content. > and re-compile the kernel to get the zImage, then use the emulator > command to run the system.img and kernel.img > Is my idea right? Can someone give any idea to do this? > > The final question is: how can check the log such as the following: > I/EventHub( 1548): New device: path=/dev/input/event0 > name=partnerxx_keypad id=0x10000 (of 0x1) index=1 fd=30 > I/EventHub( 1548): new keyboard input device added, name = > partnerxx_keypad > D/WindowManager( 1548): Starting input thread. > D/WindowManager( 1548): Startup complete! > I/EventHub( 1548): New keyboard: name=partnerxx_keypad > keymap=partnerxx_keypad.kl > keymapPath=/system/usr/keychars/partnerxx_keypad.kcm.bin > I/ServiceManager( 1535): ServiceManager: addService(window, 0x13610) > I/EventHub( 1548): Reporting device opened: id=0x10000, name=/dev/ > input/event0 > I/KeyInputQueue( 1548): Device added: id=0x10000, > name=partnerxx_keypad, classes=1 > I/KeyInputQueue( 1548): Keymap: partnerxx_keypad.kl > > Actually I don't know what steps I can do and see the above log. > > Thanks for every one's opinion. -- unsubscribe: [email protected] website: http://groups.google.com/group/android-porting
