Log如下:
I/InputReader( 1223): Device reconfigured: id=0x10000, name=ADS7846 Touchscreen, display size is now 1024x600
I/InputManager-Callbacks( 1223): No virtual keys found for device ADS7846 Touchscreen.
[ 63.370635] Unable to handle kernel NULL pointer dereference at virtual address 00000078
[ 63.379119] pgd = c0004000
[ 63.381958] [00000078] *pgd=00000000
[ 63.385681] Internal error: Oops: 17 [#1]
[ 63.389862] last sysfs file: /sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state
[ 63.398010] Modules linked in: wl12xx omaplfb mac80211 pvrsrvkm cfg80211 compat
[ 63.405639] CPU: 0 Not tainted (2.6.37-gd5c352a #1)
[ 63.411102] PC is at irq_thread+0x98/0x1e4
[ 63.415374] LR is at try_to_wake_up+0x24/0xe0
[ 63.419891] pc : [<c00ac52c>] lr : [<c0071ee8>] psr: 28000113
上网搜了一阵,发现是内核空间和用户空间交换数据的时候,判断数据不安全而导致了。
我分析是,用户空间触摸屏读进来数据后,在传送到内核的时候,发现数据不安全,而导致的空指针错误。
这个bug卡了我好几天,试了各种原因,最后发现,原来是交叉编译工具的问题。内核的交叉编译工具和wifi模块的交叉编译工具不是同一个。
内核交叉编译工具定义在 BoardConfig.mk 中:
TARGET_KERNEL_IMAGE := kernel/arch/arm/boot/uImage
TARGET_KERNEL_CONFIG := omap3_$(TARGET_PRODUCT)_android_defconfig
TARGET_KERNEL_CROSSCOMPILE := prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-
KERNEL_DIR := kernel
wifi模块的交叉编译工具:
wl12xx_compat: droid | ~
$(MAKE) -C hardware/ti/wlan/WL1271_compat/drivers ANDROID_ROOT_DIR=$(ANDROID_INSTALL_DIR) TOOLS_PREFIX=$($(| ~
combo_target)TOOLS_PREFIX) ARCH=arm install
这里 TOOLS_PREFIX = prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-
只要把内核交叉编译工具改成prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-, 就没有这个问题了。