[Android Software Development] yuweng:
My Master Shifu [MENTION=4878287]_that[/MENTION], ref to this post, do you happened to know where i can get gdb static for Android-x86, did try out gdbserver previously but its not fast enough to capture anything at all... :o

Got an Intel x3 C3130, tried various flags, nothing boots except for stock 3e, though TWRP android-6.0 x86 builds fine on cm-11.0 repo.

Got adb root/ adb remount working on stock 3e, what i had in mind was to use your same technique to push TWRP to stock 3e & use gdb to capture where it goes wrong or you have a proper way to debug, pls advice... :o

TIA... :good:

Update info

Seems that TWRP is not booting up at all, no adb, no log but manage to grab the stock 3e recovery.log though, everything is build accordingly, i think... :cowboy:

Starting recovery on Thu Nov 5 23:45:23 2015
recovery filesystem table
=========================
0 /system ext4 /dev/block/platform/soc0/e0000000.noc/by-name/ImcPartID068 0
1 /data ext4 /dev/block/platform/soc0/e0000000.noc/by-name/ImcPartID069 0
2 /cache ext4 /dev/block/platform/soc0/e0000000.noc/by-name/ImcPartID070 0
3 /sdcard vfat /dev/block/mmcblk1p1 0
4 /nvm_fs_partition ext4 /dev/block/platform/soc0/e0000000.noc/by-name/ImcPartID076 0
5 /misc emmc /dev/block/platform/soc0/e0000000.noc/by-name/ImcPartID074 0
6 /boot emmc /dev/block/platform/soc0/e0000000.noc/by-name/ImcPartID071 0
7 /recovery emmc /dev/block/platform/soc0/e0000000.noc/by-name/ImcPartID119 0
8 /recoverym emmc /dev/block/platform/soc0/e0000000.noc/by-name/ImcPartID120 0
9 /mobilevisor emmc /dev/block/platform/soc0/e0000000.noc/by-name/ImcPartID001 0
10 /splash_screen emmc /dev/block/platform/soc0/e0000000.noc/by-name/ImcPartID013 0
11 /mvconfig emmc /dev/block/platform/soc0/e0000000.noc/by-name/ImcPartID115 0
12 /secvm emmc /dev/block/platform/soc0/e0000000.noc/by-name/ImcPartID118 0
13 /tmp ramdisk ramdisk 0

locale is [(null)]
stage is []
can't open /dev/tty0: No such file or directory
[COLOR="blue"]framebuffer: fd 3 (1024 x 600)[/COLOR]
cannot open /sys/class/display/mode: No such file or directory
gr_fb_blank: true
gr_fb_blank: flase
installing_text: (1 x 1 @ 1896)
erasing_text: (1 x 1 @ 1599)
no_command_text: (1 x 1 @ 1599)
error_text: (1 x 1 @ 1599)
Command: "/sbin/recovery"

af.resampler.quality=4
ro.sf.lcd_density=160
ro.adb.secure=0
ro.com.google.gmsversion=4.4_r5
ro.com.android.dateformat=MM-dd-yyyy
ro.com.android.dataroaming=0
ro.boot.selinux=enforcing
ro.boot.hardware=sofia3g
ro.boot.serialno=
ro.boot.bootloader=1532.100_M1S1
ro.wifi.channels=
ro.allow.mock.location=1
ro.board.platform=sofia3g
ro.build.id=KTU84P
ro.build.date=Sat Jul 4 17:40:48 CST 2015
ro.build.date.utc=1436002848
ro.build.host=pb27-desktop
ro.build.tags=dev-keys
ro.build.type=user
ro.build.user=pb27
ro.build.display.id=KTU84P dev-keys
ro.build.product=Sf3g_mrd5_p1_v2
ro.build.version.wh=V1.05_20150704
ro.build.version.sdk=19
ro.build.version.release=4.4.4
ro.build.version.codename=REL
ro.build.version.incremental=eng.pb27.20150704.173941
ro.build.description=Sf3g_mrd5_p1_v2-user 4.4.4 KTU84P eng.pb27.20150704.173941 dev-keys
ro.build.fingerprint=Intel/Sf3g_mrd5_p1_v2/Sf3g_mrd5_p1_v2:4.4.4/KTU84P/eng.pb27.20150704.173941:user/dev-keys
ro.build.characteristics=tablet
ro.config.low_ram=false
ro.config.ringtone=Ring_Synth_04.ogg
ro.config.alarm_alert=Alarm_Classic.ogg
ro.config.personality=compat_layout
ro.config.notification_sound=pixiedust.ogg
ro.secure=0
ro.carrier=unknown
ro.product.cpu.abi=[COLOR="blue"]x86[/COLOR]
ro.product.cpu.abi2=[COLOR="blue"]armeabi-v7a[/COLOR]
ro.product.name=Sf3g_mrd5_p1_v2
ro.product.board=teclast
ro.product.brand=Teclast
ro.product.model=X70(C6F9)
ro.product.device=x70_c6f9
ro.product.locale.region=CN
ro.product.locale.language=zh
ro.product.firmware=1.05
ro.product.manufacturer=Intel
ro.setting.kernel_info.wh=3.14.10
ro.windows.mtp.name.wh=X70(C6F9)
ro.baseband=unknown
ro.bootmode=unknown
ro.hardware=sofia3g
ro.open_dev.wh=false
ro.opengles.version=131072
ro.revision=0
ro.serialno=356848060631753
ro.settings.model.number.wh=X70(C6F9)
ro.open_wifi.wh=false
ro.sofia_ota=true
ro.bootloader=1532.100_M1S1
ro.debuggable=1
ro.def_volume.wh=15
ro.force_show.debug_opt.wh=true
ro.hwrotation.wh=270
ro.factorytest=0
ro.reboot_item.wh=true
ro.setupwizard.mode=OPTIONAL
ro.defsleeptime.wh=60000
ro.homepage_base.wh=http://www.uu11.net/teclast.aspx
ro.def_font_scale.wh=1.0
ro.open_bluetooth.wh=false
ro.show_nand_info.wb=true
ro.smile_rotation.back=90
ro.smile_rotation.front=270
ro.def_time_format.wh=yyyy-MM-dd
ro.hwrotation_touch.wh=270
ro.install_nonGapps.wh=true
ro.defaultbrightness.wh=100
ro.hwrotation_camera.wh=270
ro.defaultinputmethod.wh=com.tencent.qqpinyin/.QQPYInputMethodService
ro.hwrotation_gsensor.wh=270
ro.modify_app_version.wb=true
ro.def_google_keyboard.wh=com.android.inputmethod.latin/.LatinIME;-921088104
ro.force_show_ddr_size.wb=1024
ro.OpenMobileDataNetwork.wb=0
ro.quick_enable_power_key.wb=true
rw.bt.name.wh=JOI 7 Lite
rw.statusbar.munu.wh=true
rw.statusbar.volume.wh=true
rw.statusbar.screenshot.wh=true
drm.service.enabled=true
net.bt.name=Android
net.change=net.bt.name
init.svc.adbd=running
init.svc.healthd=running
init.svc.ueventd=running
init.svc.recovery=running
init.svc.thermald=running
init.svc.watchdog=running
rild.libpath=/system/lib/librpc-ril.so
wifi.interface=wlan0
debug.hwui.render_dirty_regions=false
dalvik.vm.heapsize=256m
dalvik.vm.heapmaxfree=8m
dalvik.vm.heapminfree=512k
dalvik.vm.heapstartsize=8m
dalvik.vm.heapgrowthlimit=96m
dalvik.vm.stack-trace-file=/data/anr/traces.txt
dalvik.vm.heaptargetutilization=0.75
persist.wh.custom=has_cp
persist.wh.custom_time=1
persist.sys.usb.config=mtp,adb
persist.sys.dalvik.vm.lib=libdvm.so
persist.sys.country=GB
persist.sys.language=en
persist.sys.timezone=Asia/Kuala_Lumpur
persist.sys.localevar=
persist.sys.strictmode.visual=0
persist.sys.strictmode.disable=1
persist.sys.profiler_ms=0
persist.tel.hot_swap.support=true
persist.audio.log=0
persist.service.bdroid.bdaddr=22:22:3c:c5:97:88
persist.dual_sim=dsds
persist.mxplayer=1
persist.ril-daemon.disable=dsds
persist.cp_data_app=1
keyguard.no_require_sim=true

BoardConfig.mk

USE_CAMERA_STUB := true

# inherit from the proprietary version
-include vendor/JOI/7_lite/BoardConfigVendor.mk

TARGET_ARCH := x86
TARGET_ARCH_VARIANT := x86-atom
TARGET_NO_BOOTLOADER := true
TARGET_BOARD_PLATFORM := sofia3g
TARGET_CPU_ABI := x86
TARGET_CPU_ABI2 := armeabi-v7a
TARGET_CPU_VARIANT := x86
TARGET_CPU_SMP := true

TARGET_BOOTLOADER_BOARD_NAME := 7_lite

BOARD_KERNEL_CMDLINE := rootfstype=ramfs console=ttyS0,115200n8 idle=halt earlyprintk=xgold kmemleak=off notsc androidboot.hardware=sofia3g cma=128M nolapic_pm firmware_class.path=/system/vendor/firmware androidboot.selinux=enforcing slub_max_order=0 loglevel=0
BOARD_KERNEL_BASE := 0x007f8000
BOARD_KERNEL_PAGESIZE := 4096

# fix this up by examining /proc/mtd on a running device
BOARD_BOOTIMAGE_PARTITION_SIZE := 0x105c0000
BOARD_RECOVERYIMAGE_PARTITION_SIZE := 0x105c0000
BOARD_SYSTEMIMAGE_PARTITION_SIZE := 0x105c0000
BOARD_USERDATAIMAGE_PARTITION_SIZE := 0x105c0000
BOARD_FLASH_BLOCK_SIZE := 131072

TARGET_PREBUILT_KERNEL := device/JOI/7_lite/kernel

BOARD_HAS_NO_SELECT_BUTTON := true

BOARD_MKBOOTIMG_ARGS := --base 0x007f8000 --pagesize 4096 --kernel_offset 0x00008000 --ramdisk_offset 0xffc08000 --second device/JOI/7_lite/recovery.img-second --second_offset 0xffe08010 --tags_offset 0xff808100 --cmdline 'rootfstype=ramfs console=ttyS0,115200n8 idle=halt earlyprintk=xgold kmemleak=off notsc androidboot.hardware=sofia3g cma=128M nolapic_pm firmware_class.path=/system/vendor/firmware androidboot.selinux=enforcing slub_max_order=0 loglevel=0'

#TWRP build flags
RECOVERY_GRAPHICS_USE_LINELENGTH := true
RECOVERY_SDCARD_ON_DATA := true
TW_USE_TOOLBOX := true
TARGET_PREBUILT_RECOVERY_KERNEL := device/JOI/7_lite/kernel
TARGET_RECOVERY_PIXEL_FORMAT := "BGRA_8888"
TARGET_USERIMAGES_USE_EXT4 := true
TWHAVE_SELINUX := true
TW_BRIGHTNESS_PATH := /sys/class/leds/lcd-backlight/brightness
TW_MAX_BRIGHTNESS := 255
TW_THEME := landscape_mdpi

[yuweng@BBQLinux sbin]$ file recovery

stock 3e

recovery: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, not stripped

TWRP

recovery: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /sbin/linker, not stripped

Update info

Execute the binary init, both TWRP & stock 3e seems to work on my PC... :cowboy:

TWRP init

[yuweng@BBQLinux]$ file init
init: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, not stripped
[yuweng@BBQLinux]$ init
Startup finished in 29ms.

Stock 3e init

[yuweng@BBQLinux]$ file init
init: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), statically linked, not stripped
[yuweng@BBQLinux]$ init
Startup finished in 27ms.

Swap TWRP init to stock 3e & it boots but not TWRP... :confused:

Execute the stock 3e binary charger seems to blank screen first but TW_SCREEN_BLANK_ON_BOOT or TW_NO_SCREEN_BLANK doesn't seems to have any effect, TWRP still doesn't boot...

[yuweng@BBQLinux]$ ./charger
failed to read font: res=-1
can't open /dev/tty0: Permission denied
cannot open fb0: No such file or directory
gr_fb_blank: true
open brightness sys node failed
gr_fb_blank: flase
open brightness sys node failed
gr_fb_blank: true
open brightness sys node failed
gr_fb_blank: flase
open brightness sys node failed
gr_fb_blank: true
open brightness sys node failed
gr_fb_blank: flase
open brightness sys node failed
gr_fb_blank: true
open brightness sys node failed
gr_fb_blank: flase

However, adb command does change the brightness...

adb shell
su
echo 5 > /sys/class/leds/lcd-backlight/brightness
echo 255 > /sys/class/leds/lcd-backlight/brightness

For those who are interested, the stock 3e recovery is here => View attachment recovery.zip... :cowboy:

Final Conclusion

it turns out that Intel limit the recovery image to 8MB only while the recovery partition is 17MB & the compiled TWRP is 12MB, thats why it doesn't boot.... :rolleyes:

Anyway, i'll leave the static x86 gdb here for everyone that requires it for debugging x86 TWRP... :cool: