[MODULES][GSM] Smartass & Interactive CPU Gov for Gingerbread [Patch Included] - Galaxy Tab Android Development

100% tested and working!
FLASHABLE ZIP ATTACHED
Patch For GT-P1000 GB Source Attached
Smartass CPU Gov is tweaked by me to behave properly on the SGT and ill assume it works on the SGS. I was running this module (well i built it in to the overcome kernel source) on Froyo just fine. No Ramping issues. It has been modified a fair bit by Ziggy471 originally for my Bravo, and now has a working sysfs interface to change settings on the fly. Ramp up and down steps should always be multiples of 128000, this is default set at 256000 which i have found to be optimal. I would not recommend touching any of the other defaults i have set.
Interactive Gov has been modified to load properly with direction as its not finding a symbol. Smartass depends on Interactive.ko
To install:
Push to /system/lib/modules obviously and run these commands in an adb shell or via device terminal:
Code:
insmod /system/lib/modules/cpufreq_interactive.ko
insmod /system/lib/modules/cpufreq_smartass.ko
init.d:
add these lines to an existing init.d script or download the one attached, and remove.txt from it. Push it to the device and chmod 755 it.
Code:
insmod /system/lib/modules/cpufreq_interactive.ko
insmod /system/lib/modules/cpufreq_smartass.ko
Big thanks to Ziggy471 for helping me with my C code, and af974 and crisvillani for being the testers since my tab is busted!
Patches Are attached, one labled with GINGERBREAD was made from the newly released Galaxy Tab Gingerbread source. It is assuming that the kernel devs will include the 600MHz frequency so the table conforms to =< 250MHz step up or down on each level of frequency. Otherwise They will have to define 800MHz as a skipped frequency in the config when compiling the kernel. I have made the patch to also export the nr_running symbol in sched.c which is needed by both interactive and smartass.

I'm going to test it right now, thanks for sharing though.

Thanks, i would have liked to test them make sure they behave properly. But i'm unable to.

I don't know what i'm doing wrong but i can't insmod it, get: " unknow symbol in module or invalid parameter.Any advice?
Note: I have it under System/lib/modules
-Mr. X- said:
Thanks, i would have liked to test them make sure they behave properly. But i'm unable to.
Click to expand...
Click to collapse

af974 said:
I don't know what i'm doing wrong but i can't insmod it, get: " unknow symbol in module or invalid parameter.Any advice?
Note: I have it under System/lib/modules
Click to expand...
Click to collapse
The module is probably borked then, I will investigate. Does Interactive work?
If neither do i will pull them both.
can you do a dmesg and post it?

i'm testing it, wait a bit for a reply.
-Mr. X- said:
The module is probably borked then, I will investigate. Does Interactive work?
Click to expand...
Click to collapse

Interactive zip is empty, you forgot it

af974 said:
Interactive zip is empty, you forgot it
Click to expand...
Click to collapse
LOL damn, its fixed now and uploaded
also
dmesg | grep smartass
would be better to run to see what its complaining about when you try to install it.

Dmesg attached.
-Mr. X- said:
LOL damn, its fixed now and uploaded
also
dmesg | grep smartass
would be better to run to see what its complaining about when you try to install it.
Click to expand...
Click to collapse

I'm getting the same error with interactive, it could be that i'm doing something wrong?
I'm doing all by terminal, i'm gonna try another terminal app.

af974 said:
I'm getting the same error with interactive, it could be that i'm doing something wrong?
I'm doing all by terminal, i'm gonna try another terminal app.
Click to expand...
Click to collapse
Well thats not good, Smartass depends on interactive, i had a brain fart there and forgot to mention that. this is why i posted both in one shot.
But if you cant get interactive to install then you wont be able to get smartass too.
If you want to throw me a dmsg of the interactive as well fi you cant get it to install. and i don't think you are doing anything wrong.

This is dmesg for interactive:
Code:
dmesg | grep interactive
[ 2593.847022] cpufreq_interactive: Unknown symbol nr_running (err 0)

af974 said:
This is dmesg for interactive:
Code:
dmesg | grep interactive
[ 2593.847022] cpufreq_interactive: Unknown symbol nr_running (err 0)
Click to expand...
Click to collapse
Thank you, let me investigate this, thanks for the help!

Anytime buddy, thanks to you for this, i'm waiting for smartass from a long time.
Take your time, i will check this thread for any news and i will test asap.
-Mr. X- said:
Thank you, let me investigate this, thanks for the help!
Click to expand...
Click to collapse

af974 said:
Anytime buddy, thanks to you for this, i'm waiting for smartass from a long time.
Take your time, i will check this thread for any news and i will test asap.
Click to expand...
Click to collapse
Alright i recompiled unstripped versions.
These should work. Install in the order you see on first post
I hope lol

No luck my friend
Code:
dmesg | grep interactive
[ 7468.721184] cpufreq_interactive: Unknown symbol __put_task_struct (
[ 7468.725687] cpufreq_interactive: Unknown symbol sched_setscheduler_
rr 0)
[ 7468.726887] cpufreq_interactive: Unknown symbol nr_running (err 0)
[ 7726.910534] cpufreq_interactive: Unknown symbol __put_task_struct (
[ 7726.912113] cpufreq_interactive: Unknown symbol sched_setscheduler_
rr 0)
[ 7726.913255] cpufreq_interactive: Unknown symbol nr_running (err 0)
Here's my terminal command
Code:
#su
#insmod /system/lib/modules/cpufreq_interactive.ko

af974 said:
No luck my friend
Code:
dmesg | grep interactive
[ 7468.721184] cpufreq_interactive: Unknown symbol __put_task_struct (
[ 7468.725687] cpufreq_interactive: Unknown symbol sched_setscheduler_
rr 0)
[ 7468.726887] cpufreq_interactive: Unknown symbol nr_running (err 0)
[ 7726.910534] cpufreq_interactive: Unknown symbol __put_task_struct (
[ 7726.912113] cpufreq_interactive: Unknown symbol sched_setscheduler_
rr 0)
[ 7726.913255] cpufreq_interactive: Unknown symbol nr_running (err 0)
Here's my terminal command
Code:
#su
#insmod /system/lib/modules/cpufreq_interactive.ko
Click to expand...
Click to collapse
alright i think i may have actually tracked the issue down with interactive atleast. nr_running was undefined, the modules build fine with make modules but it threw the error if i atempted a full build.
so that should take care of the dmesg issue for that, unless its undefined in this kernel was compiled wiht it undefined in sched.c in if thats the case then i will have to work around that.
We could also try using richardtrips interactive module for the desire, just change the versionmagic. If this fails.

Alright attempt 3 is up, hope they suck less.

Don't mean to be a noob, but it seems may tab doesn't have a system/libs/modules folder
Will it work if i just create one or am I missing something ?

Same as before with 3rd attempt.....sorry bud.
Code:
dmesg | grep smartass
[12953.735293] cpufreq_smartass: Unknown symbol __create_workqueue_key (err 0)
[12953.735839] cpufreq_smartass: Unknown symbol destroy_workqueue (err 0)
[12953.736346] cpufreq_smartass: Unknown symbol sysfs_create_group (err 0)
[12953.736835] cpufreq_smartass: Unknown symbol cpufreq_unregister_governor (err
0)
[12953.737393] cpufreq_smartass: Unknown symbol nr_running (err 0)
[12953.737827] cpufreq_smartass: Unknown symbol sysfs_remove_group (err 0)
[12953.738319] cpufreq_smartass: Unknown symbol __cpufreq_driver_target (err 0)
[12953.738768] cpufreq_smartass: Unknown symbol get_cpu_idle_time_us (err 0)
[12953.739365] cpufreq_smartass: Unknown symbol queue_work (err 0)
[12953.739854] cpufreq_smartass: Unknown symbol cpufreq_register_governor (err 0
Code:
dmesg | grep interactive
[12905.617134] cpufreq_interactive: Unknown symbol nr_running (err 0)
-Mr. X- said:
Alright attempt 3 is up, hope they suck less.
Click to expand...
Click to collapse

Related

Latest zImage...

Hello!
Cuz Dzo doesnt update zImage after every code change I decided to help us and compile fresh zImage after every patch
Attachment including "support for nordic keyboard" and "revert port BT II drivers from 2.6.32" patches too.
Info needed
Hi,
Can any one please tell me how to create a nbh file form zImage? I would like to flash my own kernel in Kaiser. I have tried to search for this info on the net but couldnt find any thing useful.
Thanks in advance.
Instructions for building nbh's are in the sticky at the top of the forum : http://forum.xda-developers.com/showthread.php?t=621001
pentagramII said:
Hello!
Cuz Dzo doesnt update zImage after every code change I decided to help us and compile fresh zImage after every patch
Attachment including "support for nordic keyboard" and "revert port BT II drivers from 2.6.32" patches too.
Click to expand...
Click to collapse
No need to do this by hand . My server runs a kernel compliation service, you can get a fresh zImage there (updated hourly): http://84.23.71.227/kerneloftheday/
It has a few patches for nike, but it should work on kaiser/vogue/polaris too. If anyone has problems with it send me a pm (can also add a vanilla kernel).
If it wouldn't be too tough, I would certainly appreciate an auto-compiled version of the vanilla zImage.
mblaster said:
No need to do this by hand . My server runs a kernel compliation service, you can get a fresh zImage there (updated hourly): http://84.23.71.227/kerneloftheday/
It has a few patches for nike, but it should work on kaiser/vogue/polaris too. If anyone has problems with it send me a pm (can also add a vanilla kernel).
Click to expand...
Click to collapse
Is it ok for WarmDonut also?
Its working with donut too Thats the same zimage like Dzo but it has also a few another patches for nike.
Alamei said:
If it wouldn't be too tough, I would certainly appreciate an auto-compiled version of the vanilla zImage.
Click to expand...
Click to collapse
OK, I will include it later.
The kernel works with both, eclair and donut. For eclair just add hw3d.version=1 to dafault.txt.
BTW: Yes, it is DZOs kernel, so credits go to him of course
error while loading new compiled Linux kernel image into the android emulator
I have successfully compiled Linux kernel for android:
[email protected]:~/common# ARCH=arm CROSS_COMPILE=~/mydroid/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi- make
CHK include/linux/version.h
make[1]: `include/asm-arm/mach-types.h' is up to date.
CHK include/linux/utsrelease.h
.
.
.
SYMLINK include/asm -> include/asm-arm
CALL scripts/checksyscalls.sh
<stdin>:1097:2: warning: #warning syscall fadvise64 not implemented
<stdin>:1265:2: warning: #warning syscall migrate_pages not implemented
<stdin>:1321:2: warning: #warning syscall pselect6 not implemented
<stdin>:1325:2: warning: #warning syscall ppoll not implemented
<stdin>:1365:2: warning: #warning syscall epoll_pwait not implemented
CHK include/linux/compile.h
Kernel: arch/arm/boot/Image is ready
Kernel: arch/arm/boot/zImage is ready
Building modules, stage 2.
MODPOST 157 modules
[email protected]:~/common#
but i get the following error while loading this images in the emulator:
[email protected]:~/android-sdk-linux_x86/tools# ./emulator -avd avd1.5 -kernel ~/common/arch/arm/boot/zImage -show-kernel -verbose
emulator: found SDK root at /home/preetam/android-sdk-linux_x86
emulator: root virtual device file at /home/preetam/.android/avd/avd1.5.ini
.
.
.
yaffs_read_super: isCheckpointed 0
sh: can't access tty; job control turned off
# init: cannot find '/system/bin/playmp3', disabling 'bootsound'
init: cannot find '/system/bin/dbus-daemon', disabling 'dbus'
eth0: link up
init: untracked pid 578 exited
init: untracked pid 579 exited
warning: `rild' uses 32-bit capabilities (legacy support in use)
init: untracked pid 601 exited
init: untracked pid 592 exited
init: untracked pid 605 exited
init: untracked pid 602 exited
init: untracked pid 609 exited
init: untracked pid 606 exited
init: critical process 'servicemanager' exited 4 times in 4 minutes; rebooting into recovery mode
save exit: isCheckpointed 1
save exit: isCheckpointed 1
Restarting system with command 'recovery'.
Reboot failed -- System halted
and the emulator didn't start with the new kernel image(emulator didn't reboot). what is the problem here..?? and how can i replace my emulator's image with newly compiled Linux permanently??
please help, i am stuck here from many days. thank you!
It's a bad idea release the code from git because developers up many "problematic code" and test it before release a kernel...
I release the kernel after testing on the link in my signaure and also dzo stopped working on from several weeks :-(

Building kernels from source

Right im trying to build flykernel from source but get this error...
Code:
[email protected]:~/android/kernel/hero-2.6.29-flykernel$ make ARCH=arm CROSS_COMPILE=$CCOMPILER -j`grep 'processor' /proc/cpuinfo | wc -l`
CHK include/linux/version.h
SYMLINK include/asm -> include/asm-arm
make[1]: `include/asm-arm/mach-types.h' is up to date.
CHK include/linux/utsrelease.h
CC scripts/mod/empty.o
cc1: error: unrecognized command line option "-mlittle-endian"
cc1: error: unrecognized command line option "-mapcs"
cc1: error: unrecognized command line option "-mno-sched-prolog"
cc1: error: unrecognized command line option "-mno-thumb-interwork"
scripts/mod/empty.c:1: error: unknown ABI (aapcs-linux) for -mabi= switch
scripts/mod/empty.c:1: error: bad value (armv5t) for -march= switch
scripts/mod/empty.c:1: error: bad value (strongarm) for -mtune= switch
make[2]: *** [scripts/mod/empty.o] Error 1
make[1]: *** [scripts/mod] Error 2
make: *** [scripts] Error 2
Any ideas? (Looking at you Erasmux )
bonesy said:
Any ideas?
Click to expand...
Click to collapse
Here's my kernel build script, wokrs well with flykernel sources.
You need to set variables at the beginning (CROSS_COMPILE, KERNEL_BUILD_PATH , and if needed - MAKEFLAGS),
and it will build the kernel and print how much time it took.
Code:
#!/bin/bash
MAKEFLAGS='-j4'
CROSS_COMPILE=/data/and/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-
ARCH=arm
KERNEL_BUILD_PATH=/data/kernel
export KERNEL_BUILD_PATH ARCH CROSS_COMPILE MAKEFLAGS
TIME_START=`date +%s`;
echo === Building kernel ===
cd $KERNEL_BUILD_PATH
#make clean
make prepare
make zImage
if [ $? -ne 0 ]; then
echo === Kernel build FAILED! ===
exit 1;
fi
make modules
if [ $? -ne 0 ]; then
echo ===Modules build FAILED! ===
exit 1;
fi
TIME_DONE=`date +%s`;
LAPSEDM=`echo "($TIME_DONE - $TIME_START)/60" | bc`
LAPSEDS=`echo "($TIME_DONE - $TIME_START)%60" | bc`
echo ''
echo == Build complete in $LAPSEDM m $LAPSEDS s ==
bonesy said:
Right im trying to build flykernel from source but get this error...
Code:
[email protected]:~/android/kernel/hero-2.6.29-flykernel$ make ARCH=arm CROSS_COMPILE=$CCOMPILER -j`grep 'processor' /proc/cpuinfo | wc -l`
CHK include/linux/version.h
SYMLINK include/asm -> include/asm-arm
make[1]: `include/asm-arm/mach-types.h' is up to date.
CHK include/linux/utsrelease.h
CC scripts/mod/empty.o
cc1: error: unrecognized command line option "-mlittle-endian"
cc1: error: unrecognized command line option "-mapcs"
cc1: error: unrecognized command line option "-mno-sched-prolog"
cc1: error: unrecognized command line option "-mno-thumb-interwork"
scripts/mod/empty.c:1: error: unknown ABI (aapcs-linux) for -mabi= switch
scripts/mod/empty.c:1: error: bad value (armv5t) for -march= switch
scripts/mod/empty.c:1: error: bad value (strongarm) for -mtune= switch
make[2]: *** [scripts/mod/empty.o] Error 1
make[1]: *** [scripts/mod] Error 2
make: *** [scripts] Error 2
Any ideas? (Looking at you Elelinux )
Click to expand...
Click to collapse
For general instructions see here:
https://github.com/erasmux/hero-2.6.29-flykernel/wiki/HOWTO:-Build-the-kernel
From your specific error I would guess maybe $CCOMPILER is not defined correctly? What does the following command return for you?
Code:
${CCOMPILER}gcc --version
Yea i think after i saw that script i figured it out
CROSS_COMPILE=/data/and/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-
Click to expand...
Click to collapse
Mine says
CROSS_COMPILE=arm-eabi-
Which isn't my directory!
Sorry im pretty new to this lol
Thanks ill try again, One more thing.Does it have to be 64-bit Linux? I've seen a few errors when building that say 64bit?
bonesy said:
Yea i think after i saw that script i figured it out
Mine says
CROSS_COMPILE=arm-eabi-
Which isn't my directory!
Sorry im pretty new to this lol
Thanks ill try again, One more thing.Does it have to be 64-bit Linux? I've seen a few errors when building that say 64bit?
Click to expand...
Click to collapse
No, 64-bit linux is not required - everything works fine on 32-bit.
k0rner said:
No, 64-bit linux is not required - everything works fine on 32-bit.
Click to expand...
Click to collapse
Yeah, it's a common misconception. Compiling AOSP for Gingerbread needs x64 (why on earth...), but everything else should be fine
pulser_g2 said:
Yeah, it's a common misconception. Compiling AOSP for Gingerbread needs x64 (why on earth...), but everything else should be fine
Click to expand...
Click to collapse
Yea see i did read you need x64 for AOSP GB but i compiled using x86 and it runs fine? Why should we use 64 bit?
bonesy said:
Yea see i did read you need x64 for AOSP GB but i compiled using x86 and it runs fine? Why should we use 64 bit?
Click to expand...
Click to collapse
Not too sure but I think that 64 bit runs calculations 2 twice as fast as 32 bit. Read that a LONG time ago so I could be wrong.
I believe it is more due library differences between 32bit/64bit.
Basically you want to support as less archs, otherwise you need to test everything under both.
I guess they just made the move to 64bit and dropped 32bit compile-support.
Ah that makes sense,Building from source seems to take ages for me but i guess thats down to my 512k connection.
bonesy said:
Ah that makes sense,Building from source seems to take ages for me but i guess thats down to my 512k connection.
Click to expand...
Click to collapse
Once you got it downloaded, it's up to your CPU speed...
Are you using make -jX, where X is the number of cores in your CPU, +1?
ie. I use make -j9
It runs it 9x faster by carrying out 8 jobs at once (plus the one keeping everything in sync) iirc

[SOLVED] 4.0.3 AOSP build stuck at google logo. Kernel problem?

Hey guys,
i have a problem when building 4.0.3 from source. When i flash the fresh compiled
OTA package to my device, the device ends in a bootloop stuck at the google logo.
Logcat says:
Code:
I/SystemServer( 238): Power Manager
I/SystemServer( 238): Activity Manager
I/ActivityManager( 238): Memory class: 64
I/SurfaceFlinger( 251): SurfaceFlinger is starting
I/SurfaceFlinger( 251): SurfaceFlinger's main thread ready to run. Initializing graphics H/W...
E/IMGSRV ( 251): :0: PVRSRVBridgeCall: Failed to access device. Function ID:3223086860 (Bad address).
E/IMGSRV ( 251): :0: OpenServices: PVRSRVBridgeCall failed.
E/IMGSRV ( 251): :0: PVRSRVConnect: Unable to open connection.
E/IMGSRV ( 251): :0: OpenPVRServices: Failed to open services connection
E/IMGSRV ( 251): :0: hal_init: Failed to open services (err=-14)
E/IMGSRV ( 251): :0: hal_open: Graphics HAL not initialized
E/FramebufferNativeWindow( 251): couldn't open framebuffer HAL (Not a typewriter)
E/IMGSRV ( 251): :0: hal_open: Graphics HAL not initialized
E/FramebufferNativeWindow( 251): couldn't open gralloc HAL (Not a typewriter)
E/SurfaceFlinger( 251): Display subsystem failed to initialize. check logs. exiting...
I/ServiceManager( 109): service 'sensorservice' died
I/ServiceManager( 109): service 'power' died
I/ServiceManager( 109): service 'entropy' died
D/AndroidRuntime( 259):
D/AndroidRuntime( 259): >>>>>> AndroidRuntime START com.android.internal.os.ZygoteInit <<<<<<
D/AndroidRuntime( 259): CheckJNI is OFF
I don't know whats going wrong. Can it be a kernel problem? I have tried different 4.0.3 kernels from the dev section, but the result is the same.
The device is a GSM device with PRIMEKK15 unlocked bootloader and I9250XXKK6 baseband.
After pulling the latest 4.0.3 sources with repo and setting up the proprietary files i'have compiled the system without errors:
Code:
~/android/4.0.3$ . build/envsetup.sh
~/android/4.0.3$ lunch full_maguro-userdebug
~/android/4.0.3$ make -j4 otapackage
I really don't understand what i am doing wrong ...
Thanks for any suggestions or answers.
i got this problem when I updated my phone using fastboot.
for me, it was an application installed from market. after wipe everything and redo the flash procedure, everything was fine.
don't know if it is the same problem here.
Did you pull in the proprietary files needed for the build?
At least you've got to the boot animation, my ROM fails at the flashing with a status 7 error mentioning the boot.img
PaulW21781 said:
Did you pull in the proprietary files needed for the build?
Click to expand...
Click to collapse
with ./extract-files.sh .correct?
PaulW21781 said:
Did you pull in the proprietary files needed for the build?
Click to expand...
Click to collapse
Yes, the files are pulled from the device ( if you mean the extract_files.sh from the device folder), compilation finishes without errors.
No boot animation, nothing...
Sent from my Galaxy Nexus using XDA App
Now at this point too, bootloops all the time. I think the code is ****ed
Ok, dmesg gave me this:
Code:
<6>[ 5.367248] PVR: Installing MISR with cookie c0833f74
<6>[ 5.367828] PVR: Installing device LISR SGX ISR on IRQ 53 with cookie c79f5700
<6>[ 5.368255] PVR: OSUnMapPhysToLin: unmapping 65535 bytes from c8be0000
<6>[ 5.368469] PVR: SysFinalise: Version string: SGX revision = 1.2.0
<6>[ 5.369171] PVR_K: (FAIL) SGXInit: Incompatible driver DDK revision (785978)/device DDK revision (780209).
<6>[ 5.369537] PVR_K:(Error): PVRSRVFinaliseSystem: Failed PVRSRVDevInitCompatCheck call (device index: 0) [449, drivers/gpu/pvr/pvrsrv.c]
<6>[ 5.370025] PVR_K:(Error): BridgedDispatchKM: Initialisation failed. Driver unusable. [4812, drivers/gpu/pvr/bridged_pvr_bridge.c]
<6>[ 5.552337] max17040 4-0036: online = 1 vcell = 4007500 soc = 77 status = 1 health = 1 temp = 340 charger status = 0
<3>[ 5.643005] init: sys_prop: permission denied uid:1001 name:net.rmnet1.dns1
<3>[ 5.643737] init: sys_prop: permission denied uid:1001 name:net.rmnet1.dns2
<3>[ 5.644287] init: sys_prop: permission denied uid:1001 name:net.rmnet1.gw
<3>[ 5.645263] init: sys_prop: permission denied uid:1001 name:net.rmnet2.dns1
<3>[ 5.645812] init: sys_prop: permission denied uid:1001 name:net.rmnet2.dns2
<3>[ 5.646484] init: sys_prop: permission denied uid:1001 name:net.rmnet2.gw
<6>[ 5.707031] [MODEM_IF] misc_open : umts_boot0
<6>[ 5.707153] omap_hsi omap_hsi.0: HSI clock is now 96000000
<6>[ 5.723510] omap_hsi omap_hsi.0: Entering RX wakeup in 3 wires mode (no CAWAKE)
<6>[ 5.723602] [MODEM_IF] xmm6260_off()
<6>[ 5.723724] [MODEM_IF] xmm6260_on()
<6>[ 5.724456] [MODEM_IF] PA EVENT : reset =0, pa=1
<6>[ 5.724548] [MODEM_IF] umts_ipc0 state changed: OFFLINE
<6>[ 5.835540] [MODEM_IF] PA EVENT : reset =1, pa=0
<6>[ 5.979125] virtio_rpmsg_bus virtio1: creating channel rpmsg-omx addr 0x3c
<6>[ 5.980194] rpmsg_omx rpmsg-omx1: new OMX connection srv channel: 1024 -> 60!
<6>[ 6.087188] PVR_K:(Error): BridgedDispatchKM: Initialisation failed. Driver unusable. [4812, drivers/gpu/pvr/bridged_pvr_bridge.c]
<3>[ 6.094604] init: untracked pid 118 exited
Anyone knows how to fix this issue?
Try reflashing the boot.img created by your build..
Did you also install the binaries from the google http://code.google.com/android/nexus/drivers.html#maguro into your AOSP source before building?
I built my own AOSP rom too, but haven't tried it yet.
also
Cleaning up when adding proprietary binaries
In order to make sure that the newly installed binaries are properly taken into account after being extracted, the existing output of any previous build needs to be deleted with
$ make clobber
Click to expand...
Click to collapse
http://source.android.com/source/building-devices.html
sorry if you did all this - I'm a noob to ASOP building
Did you wipe the device before installing the rom and kernel?
Luxferro said:
Did you also install the binaries from the google http://code.google.com/android/nexus/drivers.html#maguro into your AOSP source before building?
Click to expand...
Click to collapse
Hey man, that was the problem! Thank you very much... I didn't knew that such libraries exist for 4.0.3.
After installing the binaries and recompiling the phone boots up. Thanks again, also to all the people who tried to help me.
m0rph3us said:
Hey man, that was the problem! Thank you very much... I didn't knew that such libraries exist for 4.0.3.
After installing the binaries and recompiling the phone boots up. Thanks again, also to all the people who tried to help me.
Click to expand...
Click to collapse
No problem. Glad I can help
I guess that hopefully means my build would work too if I ever tried it. Was hoping official 4.0.3 OTA would be out by now. I might just have to try my build too.
Sent from my Galaxy Nexus using Tapatalk
I ran the script under /device/samsung/toro/
is that the correct place to run it, or should I be running it somewhere else?
Nevermind, I'm dumb. I read the post and got it now lol
I'm having the same issue, except for the toro (CDMA/LTE) galaxy nexus. Are these steps in the right order?
step 0: make clobber, step 1: run the extract-imgtec-toro.sh and make clobber, step 2: extract-files.sh, step 3: build/envsetup.sh, step 4: make?
jab416171 said:
I'm having the same issue, except for the toro (CDMA/LTE) galaxy nexus. Are these steps in the right order?
step 0: make clobber, step 1: run the extract-imgtec-toro.sh and make clobber, step 2: extract-files.sh, step 3: build/envsetup.sh, step 4: make?
Click to expand...
Click to collapse
you don't need to excessively run make clobber. all it really does is delete the out/ directory.
Here's how I was able to get a fully functional build ($ANDROID_SOURCE is your build dir):
0) make clobber; # just for the initial cleansing
1) cd $ANDROID_SOURCE/device/samsung/toro && ./extract-files.sh
2) run extract-imgtec-toro.sh OUTSIDE of your build directory (in a temporary location)
3) copy the contents of $TEMPDIR/vendor/imgtec/toro/proprietary/* into $ANDROID_SOURCE/vendor/samsung/toro/proprietary/
4) cd $ANDROID_SOURCE; . build/envsetup.sh
5) lunch #pick your desired toro build. Probably full_toro-userdebug
6) make
The reality is that extract-files.sh does everything well, except it doesn't include the gpu drivers (so we copy them manually). The make files that extract-files.sh creates DOES reference the gpu drivers, they're just not extracted by the script.
Messing with extract-imgtec-toro.sh will give you make files that don't reference any of the other binaries. Your image will boot, but won't have much else working.
Good luck!
Thanks for the quick reply. Here's my script, let me know if you see any errors.
The reason I did make clobber after the extract-imgtec-toro was because the documentation on google's site recommended doing that.
export TOP=/home/jab416171/android/dev/aosp
export GNEXTEMP=/home/jab416171/gnexproprietaryfiles
cd $TOP
repo sync
make clobber
adb wait-for-device
cd $TOP/device/samsung/toro && ./extract-files.sh
cd $GNEXTEMP && ./extract-imgtec-toro.sh
cp $GNEXTEMP/vendor/imgtec/toro/proprietary $TOP/vendor/samsung/toro/proprietary/
cd $TOP
source build/envsetup.sh
lunch full_toro-userdebug
make -j5
jab416171 said:
Thanks for the quick reply. Here's my script, let me know if you see any errors.
The reason I did make clobber after the extract-imgtec-toro was because the documentation on google's site recommended doing that.
export TOP=/home/jab416171/android/dev/aosp
export GNEXTEMP=/home/jab416171/gnexproprietaryfiles
cd $TOP
repo sync
make clobber
adb wait-for-device
cd $TOP/device/samsung/toro && ./extract-files.sh
cd $GNEXTEMP && ./extract-imgtec-toro.sh
cp $GNEXTEMP/vendor/imgtec/toro/proprietary $TOP/vendor/samsung/toro/proprietary/
cd $TOP
source build/envsetup.sh
lunch full_toro-userdebug
make -j5
Click to expand...
Click to collapse
I think your cp needs a '/*' after the first proprietary. The object is to copy the contents of one proprietary directory into the proprietary directory of another. Unless I'm mistaken, your cp will copy the proprietary source folder into the proprietary destination folder resulting in a $TOP/vendor/samsung/toro/proprietary/proprietary. Either that or error out because you specified to cp a dir without a -R.
You should certainly run a make clobber after extracting new binaries if you have files from a previous build still lying around. if you've already cleaned it out, then its just redundant (and not hurting anything).
Otherwise it looks good to me! Good luck!
Makes sense on the cp command. I haven't actually run the script yet, and thanks for taking your time to overlook it.
And do I need to run extract-files and extract-imgtec-toro *every time* I want to do a build, or can I just extract them once, and copy them from another location on my drive, or will the files they extract just stay in the repository?
jab416171 said:
Makes sense on the cp command. I haven't actually run the script yet, and thanks for taking your time to overlook it.
And do I need to run extract-files and extract-imgtec-toro *every time* I want to do a build, or can I just extract them once, and copy them from another location on my drive, or will the files they extract just stay in the repository?
Click to expand...
Click to collapse
Just once. I usually just tar up my vendor/samsung/toro directory and keep the tar in a safe location. No more extractions once you have it.

[MODULES][Xperia S] NLS_UTF8 | NTFS | TUN/TAP | CPU Governors

[ info ]
so since the kernel sources are now out (atleast for the Xperia NX) till we get kernel sorted out i think this should be useful for some users...
these are build using the vermagic based on this screenshot:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
i am providing the kernel modules for:
NLS_UTF8 - Native Language Support UTF8
NTFS support - support to mount NTFS formatted drives/devices
TUN/TAP support - VPN support (more info here)
CPU Governor: Interactive - from pyramid-bricked-kernel by showp1984
CPU Governor: SmartAssV2 - SMP MSM8x60 support by faux123 from pyramid-bricked-kernel by showp1984
CPU Governor: MinMax - from pyramid-kernel by LeeDroid-
CPU Governor: SmartAss - SMP MSM8x60 support by faux123 from pyramid-kernel by LeeDroid-
for info on what CPU Governors are read this
[ requirements ]
rooted device
busybox installed
adb access via PC/terminal emulator app
[ how to install ]
download the modules u want and save on sdcard
start adb shell on PC or use terminal emulator app
execute the following commands at shell
Code:
su
busybox insmod /sdcard/modulename.ko
where modulename is the name of the module u want activated
hopefully u shouldnt get any errors/outputs
now check if the module is properly working/live
Code:
su
busybox lsmod
it show now give output of module name followed by word "Live"
thats it!
enjoy the module of ur choice!
if u want these modules to be autoloaded at startup u can now create an init.d script for the same!
be sure to first flash the init.d support: http://forum.xda-developers.com/showthread.php?t=1547238
[ donations/device fund ]
i dont yet have this device but i plan to buy it.... if u guys want to donate to me to get this device OR if u feel that this work has helped u OR u think that the work i put into making this is worthy of donations, then click on the following link for buying me some coffee/beer/etc
i am currently channeling all my donations to get this phone asap and to avoid selling my ARC!!!
PAYPAL DONATION LINK
[ download link ]
NLS_UTF8
MD5HASH: 720e137e1698a95f2b86825c0311ff75
NTFS
MD5HASH: d1761a11634ba304a25e7a56c1635e77
TUN/TAP
MD5HASH: 03bda2927114fb892a82e09bccf6617c
CPU Governor: Interactive
MD5HASH: 29b3458ef19c60c7200fba02863d3fcb
CPU Governor: SmartAssV2
MD5HASH: 977720659947fda3e721075f9323a86d
CPU Governor: MinMax
MD5HASH: 29cfcba76e126b3ab155b8112a6cc6be
CPU Governor: SmartAss
MD5HASH: aa0c9d90284190b7659ca59bf389b95d
since i dont yet have device with me i cant test out if these work properly... please test out and report back!
if u guys need any other modules let me know
I will start adding modules for CPU governors soon!!!
Sent from my LT18i using XDA
UPDATE!
added new modules:
CPU Governors
Interactive - from pyramid-bricked-kernel by showp1984
SmartAssV2 - SMP MSM8x60 support by faux123 from pyramid-bricked-kernel by showp1984
MinMax - from pyramid-kernel by LeeDroid-
SmartAss - SMP MSM8x60 support by faux123 from pyramid-kernel by LeeDroid-
for info on what CPU Governors are read this
download links & how to install at first post
these are untested kindly test them out and let me know asap!
Thanks a lot DooMLoRD, worked well with init script !
howver i encountered a very weird problem:
# ls
ls
tun.ko
ntfs.ko
nls_utf8.ko
cpufreq_smartass22.ko
cpufreq_smartass.ko
cpufreq_minmax.ko
cpufreq_interactive.ko
# insmod cpufreq_smartass2.ko
insmod cpufreq_smartass2.ko
insmod: init_module 'cpufreq_smartass2.ko' failed (No such file or directory)
# insmod tun.ko
insmod tun.ko
# insmod ntfs.ko
insmod ntfs.ko
# insmod nls_utf8.ko
insmod nls_utf8.ko
# insmod cpufreq_minmax.ko
insmod cpufreq_minmax.ko
# insmod cpufreq_interative.ko
insmod cpufreq_interative.ko
insmod: can't open 'cpufreq_interative.ko'
as u can see from ls the files are there. wonder why it's not picking up the modules?
---------- Post added at 11:55 AM ---------- Previous post was at 11:53 AM ----------
I've tried using absolute path, it gives a different error:
su
busybox insmod /mnt/sdcard/xps_modules/cpufreq_interactive.ko
insmod: can't insert '/mnt/sdcard/xps_modules/cpufreq_interactive.ko': unknown symbol in module, or unknown parameter
---------- Post added at 11:57 AM ---------- Previous post was at 11:55 AM ----------
I've tried using absolute path, it gives a different error:
su
busybox insmod /mnt/sdcard/xps_modules/cpufreq_interactive.ko
insmod: can't insert '/mnt/sdcard/xps_modules/cpufreq_interactive.ko': unknown symbol in module, or unknown parameter
kazuni said:
Thanks a lot DooMLoRD, worked well with init script !
howver i encountered a very weird problem:
# ls
ls
tun.ko
ntfs.ko
nls_utf8.ko
cpufreq_smartass22.ko
cpufreq_smartass.ko
cpufreq_minmax.ko
cpufreq_interactive.ko
# insmod cpufreq_smartass2.ko
insmod cpufreq_smartass2.ko
insmod: init_module 'cpufreq_smartass2.ko' failed (No such file or directory)
# insmod tun.ko
insmod tun.ko
# insmod ntfs.ko
insmod ntfs.ko
# insmod nls_utf8.ko
insmod nls_utf8.ko
# insmod cpufreq_minmax.ko
insmod cpufreq_minmax.ko
# insmod cpufreq_interative.ko
insmod cpufreq_interative.ko
insmod: can't open 'cpufreq_interative.ko'
as u can see from ls the files are there. wonder why it's not picking up the modules?
---------- Post added at 11:55 AM ---------- Previous post was at 11:53 AM ----------
I've tried using absolute path, it gives a different error:
su
busybox insmod /mnt/sdcard/xps_modules/cpufreq_interactive.ko
insmod: can't insert '/mnt/sdcard/xps_modules/cpufreq_interactive.ko': unknown symbol in module, or unknown parameter
---------- Post added at 11:57 AM ---------- Previous post was at 11:55 AM ----------
I've tried using absolute path, it gives a different error:
su
busybox insmod /mnt/sdcard/xps_modules/cpufreq_interactive.ko
insmod: can't insert '/mnt/sdcard/xps_modules/cpufreq_interactive.ko': unknown symbol in module, or unknown parameter
Click to expand...
Click to collapse
so interactive module is the only one giving issues?
can u post dmesg?
DooMLoRD said:
so interactive module is the only one giving issues?
can u post dmesg?
Click to expand...
Click to collapse
Nope, all CPU governor modules besides minmax are failed.
<4>[26283.872145] cpufreq_interactive: Unknown symbol __put_task_struct (err 0)
<4>[26283.872754] cpufreq_interactive: Unknown symbol sched_setscheduler_nocheck
(err 0)
<4>[26283.873596] cpufreq_interactive: Unknown symbol nr_running (err 0)
<6>[26289.090458] cpufreq: cpu 1 is not active.
<4>[26289.556946] cpufreq_interactive: Unknown symbol __put_task_struct (err 0)
<4>[26289.557479] cpufreq_interactive: Unknown symbol sched_setscheduler_nocheck
(err 0)
<4>[26289.558689] cpufreq_interactive: Unknown symbol nr_running (err 0)
<4>[26317.921173] cpufreq_smartass2: Unknown symbol nr_running (err 0)
<6>[26331.490507] cpufreq: cpu 1 is not active.
<4>[26339.682453] cpufreq_smartass2: Unknown symbol nr_running (err 0)
<4>[26379.330527] cpufreq_smartass: Unknown symbol nr_running (err 0)
mankindtw said:
Nope, all CPU governor modules besides minmax are failed.
[26283.872145] cpufreq_interactive: Unknown symbol __put_task_struct (err 0)
[26283.872754] cpufreq_interactive: Unknown symbol sched_setscheduler_nocheck
(err 0)
[26283.873596] cpufreq_interactive: Unknown symbol nr_running (err 0)
[26289.090458] cpufreq: cpu 1 is not active.
[26289.556946] cpufreq_interactive: Unknown symbol __put_task_struct (err 0)
[26289.557479] cpufreq_interactive: Unknown symbol sched_setscheduler_nocheck
(err 0)
[26289.558689] cpufreq_interactive: Unknown symbol nr_running (err 0)
[26317.921173] cpufreq_smartass2: Unknown symbol nr_running (err 0)
[26331.490507] cpufreq: cpu 1 is not active.
[26339.682453] cpufreq_smartass2: Unknown symbol nr_running (err 0)
[26379.330527] cpufreq_smartass: Unknown symbol nr_running (err 0)
Click to expand...
Click to collapse
i am not really an expert in creating modules but this all will be fixed when we make custom kernel
Sent from my HTC Flyer P510e using XDA
I want to make a init script for the ntfs.ko
But i cant get it to work, help?
DooMLoRD said:
if u guys need any other modules let me know [/B][/I]
Click to expand...
Click to collapse
Can we have the "CIFS Modules"
Thank you
maxx228 said:
Can we have the "CIFS Modules"
Thank you
Click to expand...
Click to collapse
from what i saw in the defconfig CIFS is already enabled in stock kernel
lorddusk said:
I want to make a init script for the ntfs.ko
But i cant get it to work, help?
Click to expand...
Click to collapse
Yeah I have problems using the init.d script as well...
Sent from my LT26i using xda premium
Long Live DoomLord
Great to see you here
I used Japan FW from XDA thread
I want insert modules but i get "invalid module format"
How can i fix this problem?
or Jp FW can't use thosw modules?
sigma9988 said:
I used Japan FW from XDA thread
I want insert modules but i get "invalid module format"
How can i fix this problem?
or Jp FW can't use thosw modules?
Click to expand...
Click to collapse
two things:
1) check ur kernel version - these modules are built with specific vermagic string corresponding to kernel
2) the kernel on JAPAN FW might be different
well, i dont know if anyone has succeeded or its a usual problem but i also get this error:
su
busybox insmod /sdcard/xps_modules/cpufreq_interactive.ko
insmod: can't insert '/sdcard/xps_modules/cpufreq_interactive.ko': unknown symbol in module, or unknown parameter
but i think something is missing, when i type just "busybox insmod" i get this:
usage: insmod FILE [SYMBOL=VALUE]
so.. what is that symbol and balue? i'll google it xD
EDIT: Maybe pushing the modiles to /system/lib/modules/ ?
here they had the same problem: http://forum.xda-developers.com/showthread.php?t=1085441
TUN/TAP with ICS rom fails
TUN/TAP does not seem to work with the new ICS ROM. Got exec format error when doing insmod tun.ko. Any idea?
Sorry if I understand well, this modules doesn't work currently ?
Of course it won't work under ICS.
A kernel module is built for kernel with exactly same version.
Yakandu said:
well, i dont know if anyone has succeeded or its a usual problem but i also get this error:
su
busybox insmod /sdcard/xps_modules/cpufreq_interactive.ko
insmod: can't insert '/sdcard/xps_modules/cpufreq_interactive.ko': unknown symbol in module, or unknown parameter
but i think something is missing, when i type just "busybox insmod" i get this:
usage: insmod FILE [SYMBOL=VALUE]
so.. what is that symbol and balue? i'll google it xD
EDIT: Maybe pushing the modiles to /system/lib/modules/ ?
here they had the same problem: http://forum.xda-developers.com/sho....ko
'nls_utf8.ko': invalid module format
:(
Click to expand...
Click to collapse
Yes I'm on ICS and when I put modules in system/lib/modules and I use module loader I don't see it in SetCPU. So I'll just wait for somedy find a solution.

[DEV] Building a custom kernel and kernel modules for stock kernel

Since fire phone doesn't have a bootloader unlock at the moment. There is no point in building a custom kernel. But By building a kernel we can build kernel modules which work on the stock kernel. And yes you can load unsigned kernel modules without a problem since fire phone doesn't use tz apps to verify kernel modules like Samsung does.
Setup
Source
Download the fire phone sources for firmware 4.6.1 from here. And extract the platfrom.tar inside the archive to somewhere(KERNEL_DIR).
toolchain
You can use the android ndk from google, But it requires some setup. I'm using linaro toolchain from here. You can use compiler version 4.7, 4.8 or 4.9. Kernel I'm using (Firmware 4.6.3 - Linux 3.4-perf-g280c96c) is built with gcc-4.7. But I'm using this gcc-4.9. Download it, extract is somewhere(TOOLCHAIN_DIR) and add the $TOOLCHAIN_DIR/bin to your PATH. Theoretically you would be able to build the kernel on windows using Cygwin or MSYS tools but using Linux is better.
config
Connect your phone trough adb and run
Code:
adb pull /proc/config.gz
zcat config.gz > $KERNEL_DIR/kernel/qcom/3.4/.config
With this config you will run into some problems because of a missing "trapz_generated_kernel.h". I don't know if this is an auto generated file when they build android as a whole or amazon removed this explicitly(can they do that without violating GPL?). Anyway It looks trapz is some low level kernel debugging function(comment here if you know more about it). We can safely disable it. Open $KERNEL_DIR/kernel/qcom/3.4/.config in a text editor and change the lines
Code:
CONFIG_TRAPZ=y
CONFIG_TRAPZ_TP=y
CONFIG_TRAPZ_TRIGGER=y
CONFIG_HAVOK=y
to
Code:
#CONFIG_TRAPZ=y
#CONFIG_TRAPZ_TP=y
#CONFIG_TRAPZ_TRIGGER=y
#CONFIG_HAVOK=y
building
Now edit the $KERNEL_DIR/kernel/qcom/3.4/Makefile and add this changes
Code:
EXTRAVERSION = -perf-g280c96c
This is at the top of the makefile. If we don't add this, vermagic for the modules will differ from stock kernel and they won't load.
ARCH=arm
CROSS_COMPILE=arm-linux-gnueabihf-
Click to expand...
Click to collapse
Here arm-linux-gnueabihf- is my cross compiler frefix. Look in $TOOLCHAIN_DIR/bin/ to find it.
Now cd into $KERNEL_DIR/kernel/qcom/3.4/ and do
Code:
make
The build will fail a few times complaining about missing headers. Most of the time it's just
Code:
#include <myheader.h>
instead of
Code:
#include "myheader.h"
Edit the source file where the build fails and change <>s to ""s. (maybe android ndk ignores the difference and include the headers anyway)
After kernel compiles, we are good to go. We can use this kernel sources to build kernel modules for stock kernel.
Kernel modules
To build the kernel modules, we basically need two things. An approximate kernel source and the Module.symvers file from the original kernel. We can get the Module.symvers file by building the complete kernel as explained above or Just extract it from our stock kernel.
To extract the Module.symvers from the stock kernel, extract the boot.img file from firmware update image. Get mkbootimg tools from here compile it and run
Code:
unmkbootimg --kernel zImage ---ramdisk ramdisk.cpio.gz -i boot.img
After you get the zImage. Download extract-symvers script from here and run
Code:
python2 extract-symvers.py -B 0xc0008000 zImage > Module.symvers
place this file in $KERNEL_DIR/kernel/qcom/3.4/ (You still have to do the changes mentioned above in kernel config and building section run make in the $KERNEL_DIR/kernel/qcom/3.4 and intrupt it after few seconds)
Now you can build loadable modules against this source. Here is a hello world kernel module.
Code:
//hello.c
#include<linux/module.h>
#include<linux/kernel.h>
#include<linux/init.h>
static int __init hello_start(void)
{
printk("hello to the world from module");
return 0;
}
static void __exit hello_end(void)
{
printk("heloo exit");
}
module_init(hello_start);
module_exit(hello_end);
Code:
#Makefile
KERNEL_DIR=<your kernel dir>/kernel/qcom/3.4
obj-m := hello.o
PWD := $(shell pwd)
default:
$(MAKE) ARCH=arm CROSS_COMPILE=armeb-linux-gnueabi- -C $(KERNEL_DIR) SUBDIRS=$(PWD) modules
Put this files in a folder and run make in it. Change the paths and cross compiler prefix according to your setup. and run make.
After the build push the hello.ko to the phone.
Code:
adb push hello.ko /sdcard/
adb shell
su
cd sdcard
insmod hello.ko
run dmesg and you'll see the message.
I'm currently trying to build kexec module from hashcode's sources and USB OTG modules.
I'm attaching a few thing helped me do this.
since they have released this version of the fire os they have to provide the source code
see
http://www.gnu.org/licenses/gpl-faq.html#GPLRequireSourcePostedPublic
you have just shown that the source code they releases for the kernel does not match the one used to build the kernel. This means it is a clear violation of the gpl and amazon is in breach and can be sued.
on another note.
are the drivers for the nfc and camera compiled as a module or into the kernel?
They have yet to provide 4.6.3 and 4.6.4 kernel sources too.
I don't know exactly but in order for NFC and camera to work drivers are required and they are in fact compiled into the kernel.
The problem we currently have with NFC and camera is proprietary hal (hardware abstraction libraries) They are a part of Android and does not subject to GPL. Amazon changed the original android way how hal works and didn't release the sources!
by looking at the kernel drivers maybe we would be able to implement hal from scratch. But I don't see that intense dev support for fire phone. If you are up for it camera sources are at $KERNEL_DIR/kernel/qcom/3.4/drivers/media/platform/msm/camera_v2/
Major MAJOR respect for all of you making the Fire Phone even better!
@madushan1000
Could we do something like this to install a custom boot.img?
http://forum.xda-developers.com/optimus-l9/general/guide-install-custom-roms-locked-t3249828
I don't own this device but has anyone tried to see if kexec works?
spudowiar said:
I don't own this device but has anyone tried to see if kexec works?
Click to expand...
Click to collapse
Nope, I was working on it. But then I got a job. It will be sometime before I can start working on it again.
Could someone please provide the config extracted from /proc/config.gz?
I can't find this on CM11 rom for some reason.
Building the kernel now.
Some bugs are in the code and -Wall and gcc-wrapper.py escalate the warnings.
I wonder if those errors are there on purpose XD
helloworld.ko loaded successfully
I was able to execute kexec without anything. Just the binary.
Will keep you posted - this hacking might take a while to figure it all out.
I already have 3.4 kernel from the amazon sources.
I have the kexec userland program.
What is left is a loadable kexec kernel module (if that is possible at all).
removed
Okarin said:
Are we even sure those Amazon Kernel Sources are correct?
Those errors caught by the wrapper scripts are giving me the creeps.
Git the kexec_load.ko build.
Currently hands on insmod.
Phone doesn't do a reboot any longer:
insmod kexec_load.ko
init_module(0xb6e6c008, 408241, "") = -1 ENOENT (No such file or directory)
write(2, "insmod: init_module '/sdcard/kex"..., 79insmod: init_module '/sdcard/kexec_load.ko' failed (No such file or directory)
) = 79
munmap(0xb6e6c000, 409600) = 0
mprotect(0xb6f8c000, 4096, PROT_READ|PROT_WRITE) = 0
mprotect(0xb6f8c000, 4096, PROT_READ) = 0
close(0) = 0
close(1) = 0
close(2) = 0
futex(0xb6f6cd74, FUTEX_WAKE_PRIVATE, 2147483647) = 0
munmap(0xb6f8c000, 4096) = 0
exit_group(-1) = ?
First goal is to get module loaded.
Goal reached:
kexec_load 27813 0 - Live 0x00000000 (O)
procfs_rw 12770 0 - Live 0x00000000 (O)
wlan 3793980 0 - Live 0x00000000 (O)
Shouldn't be functional at all..
I disabled some function calls just to get the module loaded.
The missing symbols are:
soft_restart
arch_kexec
machine_shutdown
And the version I use does some insane function hooking ..
More rework is needed.
[email protected]:/data/local # ./kexec /sdcard/vmlinux
kernel: 0xaf12d008 kernel_size: 7e1354c
unrecoverable error: could not scan "/proc/device-tree/": No such file or directory
<6>[ 97.681256] Kexec_load: Replacement... :
<6>[ 97.681344] kexec_load : my_syscall_table : c0106244
<6>[ 97.681405] kexec_load : kexec_load before replacement : c01b346c
<6>[ 97.681480] kexec_load : kexec_load after replacement : bf3a5650
<6>[ 97.681546] kexec_load : reboot before replacement : c01a83f0
<6>[ 97.681616] kexec_load : reboot after replacement : bf3a6348
<6>[ 97.681675] Kexec_load: End replacement... :
<6>[ 202.694691] Kexec: - Starting kexec_load...
<6>[ 202.694849] Kexec: - ---- kexec_load - result : '0'
It gets better:
255|[email protected]:/data/local # ./kexec --dtb=/sdcard/zImage-dtb /sdcard/vmlinux
kernel: 0xaf1b1008 kernel_size: 7e1354c
kexec-zImage-arm : dtb.img BEFORE CUT : Start : '0xae66f008' - Length : '0xb411e9' - End : '0xaf1b01f1'
Segmentation fault
More tomorrow.
Click to expand...
Click to collapse
Where are you getting your kexec module sources from? BTW try using the original amazon kernal binary the phone is shipped with (we are sure it works). Don't use the custom kernel for the kexec tests (We don't know the custom kernel actually works)
madushan1000 said:
Where are you getting your kexec module sources from? BTW try using the original amazon kernal binary the phone is shipped with (we are sure it works). Don't use the custom kernel for the kexec tests (We don't know the custom kernel actually works)
Click to expand...
Click to collapse
Here is the thread I used as a starting point.
I will put up my "fork" on github after I get permission to do that
The userland part build like a charm once I took the compiler you recommended.
The kernel-module was tricky because the whole thing is modded like hell.
To be able to load I had to comment out some hard coded addresses and the calls to unresolvable symbols.
removed
Okay the kernel gets loaded.
But
kexec -e shuts off the device.
strace doesn't help.
On the plus side:
Devices are shutdown
Look promising
I need a way to tail dmesg ...
Okay a lot of digging around and I found out that the reboot syscall doesn't work properly..
It doesn't look like it hits the kexec_module it looks more like it hits the actualy sys_reboot
Okay reboot syscall hits my reboot-hook.
But the softreboot doesn't work now.
Okay there is some kind of watchdog runnig which doesn't like my kexec.
I need to kill it - that should happen tomorrow.
removed
I hit the same wall when I tried to isolate the kexec code from the kernel itself to a module. I stopped working on it because I lacked the time. BTW the error you are facing now
<3>[ 80.580644] BUG: scheduling while atomic: kexec/4067/0x00000002
Click to expand...
Click to collapse
is because memory allocator is trying to switch threads while you are in a syscall. it's because of lines like this
image = kzalloc(sizeof(*image), GFP_KERNEL);
Click to expand...
Click to collapse
Try changing GFP_KERNEL to GFP_ATOMIC. Other than that, I have another suggestion. Try to get the kernel to run in a single core mode before running kexec code. This might simplify things. I don't know how to do this though.
madushan1000 said:
I hit the same wall when I tried to isolate the kexec code from the kernel itself to a module. I stopped working on it because I lacked the time. BTW the error you are facing now
is because memory allocator is trying to switch threads while you are in a syscall. it's because of lines like this
Try changing GFP_KERNEL to GFP_ATOMIC. Other than that, I have another suggestion. Try to get the kernel to run in a single core mode before running kexec code. This might simplify things. I don't know how to do this though.
Click to expand...
Click to collapse
The atmic error is gone now. It went away after I disabled the watchtog.
smp_disable() is what you are looking for - but this causes the system to hard_reboot ATM XD
what happens if you kill every userlevel program before smp_disable()?
removed
#define tomorrow
Okay .. I worked out the preemption thing.
At least it does something.
Still a black screen and the MSM_WATCHDOG is a ***** again.
It needs to be suspended .. at least that what I get from the code I read here.
If I remove the driver too early the output in /proc/kmsg stops ..
If I try to remove it too late ... well it causes a resched while atomic.

Categories

Resources