[MODULES][Xperia S] NLS_UTF8 | NTFS | TUN/TAP | CPU Governors - Sony Xperia S, Acro S, Ion

[ 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.

Related

DZO Please help me !!!!!

I have update the kernel to 2.6.32.9
but there is some problem
I cannot run follow command
insmod /system/lib/modules/lzo_compress.ko
insmod /system/lib/modules/lzo_decompress.ko
insmod /system/lib/modules/xvmalloc.ko
insmod /system/lib/modules/ramzswap.ko disksize_kb=32768 memlimit_kb=24576
echo insmod /system/lib/modules/ramzswap.ko disksize_kb=32768 memlimit_kb=24576
swapon /dev/block/ramzswap0
Click to expand...
Click to collapse
here is the *.ko
Please help me
may be i fix it
sorry just fix like
swapon /dev/block/mmcblk0p3
...

[MODULES][GSM] Smartass & Interactive CPU Gov for Gingerbread [Patch Included]

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

[DEV] tun.ko for openvpn using on HTC genuine ROM

Since the European genuine HTC ROM
Code:
# uname -a
Linux localhost 2.6.35.10-g60b2609 #1 PREEMPT Sun Apr 17 01:15:33 CST 2011 armv6l GNU/Linux
has tun support disabled according to the /proc/config.gz I got with scp from my marvel,
Code:
# CONFIG_TUN is not set
I just build one
using the wildfire S kernel source code from htcdev
and
http://marakana.com/forums/android/examples/111.html
http://wiki.cyanogenmod.com/wiki/Building_Kernel_from_source
but with arm toolchain from http://www.emdebian.org/crosstools.html
Code:
$ gunzip config.gz
$ cp -vp config .config
$ make xconfig -> enable tun, set CONFIG_CROSS_COMPILE="arm-linux-gnueabi-"
or use the patch in zipfile.
Code:
$ make modules_prepare
$ make modules
$ make modules_install INSTALL_MOD_PATH='../install'
Module Binary is attached, please test. Copyright is GPL >= V. 2,
md5sum
10fd212186ee8506d72d14b00aa15bf5 tun.ko.zip
a8f6e2bd1f7bab19f02371955b9eda0d tun.ko
I got problems dependency checking without building the whole kernel:
Code:
$ /sbin/depmod -ae -b ../install/modules -E ./Module.symvers 2.6.35.10
WARNING: ../install/modules/lib/modules/2.6.35.10/kernel/drivers/net/tun.ko needs unknown symbol register_netdevice
... dozens more...
$ /sbin/depmod -n /usr/local/src/htc-kernel/install/modules/lib/modules/2.6.35.10/kernel/drivers/net/tun.ko
/usr/local/src/htc-kernel/install/modules/lib/modules/2.6.35.10/kernel/drivers/net/tun.ko:
# Aliases extracted from modules themselves.
alias devname:net/tun tun
alias char-major-10-200 tun
# Soft dependencies extracted from modules themselves.
# Copy, with a .conf extension, to /etc/modprobe.d to use it with modprobe.
# Aliases for symbols, used by symbol_request().
alias symbol:tun_get_socket tun
# Device nodes to trigger on-demand module loading.
tun net/tun c10:200
No questions or Support par PM or E-Mail. Report and ask here, pls.
Or tell me an IRC channel where android devs meet.
Thanks, but I suggest preference of stability and integrity before performance at experimental state kernels
Well, I start my Android world with smaller steps.
And as a conservative engineer I wouldn't overclock.
Ok, thanks.
BTW: Noone has been chasing me with an axe yet, so I assume the tun.ko module works?
Thank you for your work.
I try to load this tun.ko on Wildfire S, but module don't load.
Code:
insmod: init_module '/system/lib/modules/tun.ko' failed (Exec format error)
When I check magic number of module, here is only '2.6.35.10', but maybe right is '2.6.35.10-g60b2609'.
Please, is it possible to fix it?
(I need tun.ko because openvpn...)
Thx
Hmm, thx, I've expected the emdebian gcc is not compatible with armv6l.
You need to use the toolchain from the android sdk or the one from the CM guys site.

[Driver] Asix AX88772 kernel module (USB Ethernet)

Hello, this is my first dev posting, so let me know if there is anything missing...
I have a Samsung Galaxy SIII S3 SGH-I747M (Bell) with Jelly Bean 4.1.1 kernel 3.0.31 (stock rooted, root66_BMC_I747MVLDLK4.7z). I also have an Asix USB LAN adapter (from monoprice) + USB OTG cable which did not work out of the box... but i am a software engineer... so I made it work. The process below should work for other carriers / modules if you find the proper kernel source. Compiling latest drivers directly from Asix is the best method... Read that part first!
Read the README that comes with your kernel source, you may need a different compiler! https://github.com/AdiPat/Android_Toolchains is where I got mine...
Details about the Asix AX88772 USB lan RJ45 adapter chipset can be found here:
http://www.asix.com.tw/products.php?op=pItemdetail&PItemID=86;71;101
You can skip to "Usage instructions" section and download pre-compiled modules, if you have identical kernel + phone
built from SGH-I747M_BMC_JB_Opensource.zip (I747MVLDLK4, my phone) + latest Asix driver, works great!!!
https://www.dropbox.com/sh/3lrhwdf2vxe5z90/Hr3-nYX4Ff​
built from SGH-I747M_BMC_JB_Opensource.zip (I747MVLDLK4, my phone) stock kernel driver, 'insmod's, but 'ping' is flaky?
https://www.dropbox.com/sh/u068760ytpsn0k1/3di6Wg44ja​
built from GT-I930_JB_Opensource_Update7.zip (I9300XXELLA, requested by gingerneil), stock kernel driver, works great!!!
https://www.dropbox.com/sh/5emvafthv061fp6/BKcakiOie8​
built from GT-I930_JB_Opensource_Update8.zip (EMR2, requested by gingerneil), stock kernel driver, untested
https://www.dropbox.com/sh/rmc1n4yxckg01zy/a2V5hvIp20​
built from Cyanogenmod 10 for i9300, git commit 43aaedbcde478c8e032771d62a1956133b29b1d4, untested
https://www.dropbox.com/sh/n1tdiap4pi2vzm8/TKAj_lChXA​
built from Android 4.1.1 for Galaxy Tab 2 (GT-P5110) kernel 3.0.31-523998, contact 'patelkes' if you have questions.
https://www.dropbox.com/sh/r0zkg5do2n3lyg3/fWWyhsz2qy​
built from Android 4.? for Xperia Tablet Z ROM (10.3.1.C.0.136), contact 'kristouf666' if you have questions.
https://www.dropbox.com/sh/nxqo1ipkbojakls/eDLHXJzl5s​
built from Cyanogenmod 10.1.3 for SGH-i747m, git commit ?
Work in progress​
Build environment setup:
-Get root access on a Ubuntu Natty (11.04) or similar linux build machine / virtual machine
-Install standard unix compiler tools
apt-get install build-essential​-Install library for menuconfig
apt-get install libncurses5-dev​-Install lzop (android compression util)
apt-get install lzop​-Install git
apt-get install git​-Download Android toolchains using git
cd /root
git clone https://github.com/AdiPat/Android_Toolchains.git​-Download samsung kernel SGH-I747M_BMC_JB_Opensource.zip (international model, etc, also available)... Or download your 3rd party Cyanogenmod,etc kernel SOURCE instead.
-Extract to /root/kernel
mkdir /root/kernel
cd /root/kernel
unzip SGH-I747M_BMC_JB_Opensource.zip​-Set path so Android compiler can be found
export CROSS_COMPILE=/root/Android_Toolchains/arm-eabi-4.4.3/bin/arm-eabi-​**EDIT: newer kernels, such as Cyanogenmod 10.2.1, use this
export CROSS_COMPILE=/root/Android_Toolchains/arm-eabi-4.6/bin/arm-eabi-​
Compiling built-in kernel modules: (left for documentation sake, the better method is "Compiling latest drivers directly from Asix")
-Generate '.config' file in kernel folder (replace 'm2_att_defconfig' with name of file in 'arch\arm\configs\')
make arch=arm m2_att_defconfig​-Modify kernel config to include Asix module and usbnet module
make menuconfig
[Navigate using arrow keys and enter]
Device Drivers ->
Network device support ->
USB Network Adapters ->
Multi-Purpose USB Networking Framework ->
[PRESS SPACEBAR until an M appears on the left]
[M] Multi-purpose USB Networking Framework
[M] ASIX AX88xxx Based USB 2.0 Ethernet Adapters​
For reference here is the help info for the 2 options that are now set to 'M'
-Compile modules, where 2 is the number of CPU cores you have (speeds it up)
make -j2 && make -j2 modules​-Once finished, grab your modules
/root/kernel/drivers/net/usb/usbnet.ko
/root/kernel/drivers/net/usb/asix.ko​
Usage instructions:
-Use a root explorer such as ES File manager
Mount /system as rw in ES File manager root settings
copy asix.ko and usbnet.ko to /system/lib/modules/​-Use a terminal emulator / adb shell to load modules (asix depends on usbnet, so load usbnet first)
su
cd /system/lib/modules
insmod usbnet.ko
insmod asix.ko​-If there are errors, run 'dmesg' and see section called "Insmod errors"
-If there are no errors, you should see 'eth0' in 'netcfg'
-'lsmod' lists modules loaded
-Connect your USB ethernet adapter to an ethernet network
-netcfg should show eth0 as connected
-Setup ethernet settings, if you want static address, for typical internet router at 192.168.1.1
ifconfig eth0 192.168.1.100 netmask 255.255.255.0
route add default gw 192.168.1.1 dev eth0
setprop net.dns1 192.168.1.1
ip addr show
ip route show​-Setup ethernet settings, if you want automatic dhcp address
dhcpcd eth0​-If you want one-click enable of your USB, see section "usbnet widget"
Insmod errors:
exec format error : wrong compiler / wrong kernel source / wrong phone
init_module failed usbnet.ko (file exists) : module already loaded or built into kernel
no such file or directory : run dmesg immediately after attempt... you are missing module dependency
can't open usbnet.ko : are you root?​
usbnet widget
Install Smanager
Download my usbnet script http://pastebin.com/zQRQ6Kdj
Use a quality notepad editor such as notepad ++ to edit, ensure line endings are "Unix"
Place in /system/lib/modules/usbnet *cannot be on sdcard, as sdcard is a windows filesystem*
In terminal emulator / adb: "chmod 777 /system/lib/modules/usbnet"
Open Smanager
-Menu -> Scripts
-Menu -> Browser -> /system/lib/modules/usbnet
-Ensure "Fav", "SU" and "is executable" are checked and give it a name 'usbnet', press save.
On homescreen, add widget, Smanager, pick your script 'usbnet'
You now have 1 click access to loading the modules, setting IP address, and testing connectivity to your router.​
GT-9300 differences (thanks gingerneil)
Kernel source
GT-I930_JB_Opensource_Update7.zip​
While building the kernel, the make config step is different
make arch=arm m0_00_defconfig​
There is a third module built,
/root/kernel/drivers/net/mii.ko​
Usage instructions, new order of operations
insmod mii.ko
insmod usbnet.ko
insmod asix.ko​
/system/lib/modules is not persistent on this phone, instead store modules + usbnet script
/system/media​
Compiling latest drivers directly from Asix
For some reason on my phone the stock kernel asix module did not work 100%.
I could insmod both modules, and using Wireshark, I verified my computer was receiving 'ping' packets, but the phone wasn't getting any 'ping reply' packets. This latest Asix driver works perfectly for me.
UPDATE:: http://www.asix.com.tw/FrootAttach/...0_772_178_LINUX_DRIVER_v4.13.0_Source.tar.bz2 is available, but I have not tried it!
Follow "Environment setup" above
Code:
cd kernel_src_folder
Generate kernel '.config' file (replace 'm2_att_defconfig' with name of file in 'arch\arm\configs\')
Code:
make arch=arm m2_att_defconfig
Code:
mkdir /root/asix && cd /root/asix
Code:
wget http://www.asix.com.tw/FrootAttach/driver/AX88772B_772A_760_772_178_LINUX_Driver_v4.4.1_Source.zip
Code:
unzip AX88772B_772A_760_772_178_LINUX_Driver_v4.4.1_Source.zip
Code:
rm -rf Makefile
# we are replacing the Makefile with a new one.... if you edit, ensure indents = TABS
Code:
wget [url]http://pastebin.com/raw.php?i=4xLxksX3[/url] -O Makefile
Code:
CROSS_COMPILE=/root/Android_Toolchains/arm-eabi-4.4.3/bin/arm-eabi- make
**EDIT: newer kernels, such as Cyanogenmod 10.2.1, use this
Code:
CROSS_COMPILE=/root/Android_Toolchains/arm-eabi-4.6/bin/arm-eabi- make
Follow the "usage instructions" above, but since this is an "all-in-one" module, remove references to 'usbnet' ​
Other informational Links
Thanks to viulian for his inspirational post here in regards to compiling external module.
If you want to compare your phone's kernel configuration to the one in the download source from Samsung, read this post:
To see the list of loadable and built-in modules, see this.
More information about compiling kernel modules / asix / other usb chipsets / other devices
Did you know that Asix now manages Moschip products? Looking for MCS7830 drivers?
Thanks to zhlvf for pointing this , there is a way to hack android to think Wifi is connected when an USB ethernet is plugged in... (solves issues in some apps, like google play / market, which ignore USB ethernet as a valid connection).
Make errors documentation
Model number and version code explanation (how to tell which samsung.opensource.com zip file to download)
https://www.kernel.org/doc/Documentation/kbuild/modules.txt
To get the active .config from a Cyanogen mod android,
Code:
adb pull /proc/config.gz
kevinf28 said:
Usage instructions:
-Use a root explorer such as ES File manager
Mount /system as rw in ES File manager root settings
copy asix.ko and usbnet.ko to /system/lib/modules/​-Use a terminal emulator / adb shell to load modules (asix depends on usbnet, so load usbnet first)
su
cd /system/lib/modules
insmod usbnet.ko
insmod asix.ko​-If there are errors, run 'dmesg'
-If there are no errors, you should see 'eth0' in 'netcfg'
-Connect your USB ethernet adapter to an ethernet network
-netcfg should show eth0 as connected
-Setup ethernet settings, if you want static address, for typical internet router at 192.168.1.1
ifconfig eth0 192.168.1.100 netmask 255.255.255.0
route add default gw 192.168.1.1 dev eth0
setprop net.dns1 192.168.1.1​-Setup ethernet settings, if you want automatic dhcp address
dhcpd eth0​
Click to expand...
Click to collapse
Hi,
I have tried to insert your modules (I have the 3.0.31 kernel on the international S3) - but I get "exec format error". This is after placing your files in right place, and running under root through terminal emulator. Any idea why I am getting this error, and how to get around it ?
gingerneil said:
Hi,
I have tried to insert your modules (I have the 3.0.31 kernel on the international S3) - but I get "exec format error". This is after placing your files in right place, and running under root through terminal emulator. Any idea why I am getting this error, and how to get around it ?
Click to expand...
Click to collapse
Unfortunately, you are not running an "identical" kernel. Linux is particularly fussy with kernel modules, it has to be a perfect match.
Android takes a generic 3.0.31 linux kernel and applies device specific patches. So my i747 3.0.31 kernel is not identical to your i9300 3.0.31.
I can build the modules for you, since I already have the environment setup. Please visit http://opensource.samsung.com/reception/receptionSub.do?method=search&searchValue=i9300 and let me know which one sounds correct..
kevinf28 said:
I can build the modules for you, since I already have the environment setup. Please visit http://opensource.samsung.com/reception/receptionSub.do?method=search&searchValue=i9300 and let me know which one sounds correct..
Click to expand...
Click to collapse
That would be fantastic - thanks. I am running the internation i9300 - so I would go with the top one -
GT-I9300_JB_Opensource_Update7.zip
But I'm not sure what may be different across the updates.
I assume that is doesnt matter which ROM I am running, and that a full Rom Manager backup would also backup my stock kernel ?
gingerneil said:
That would be fantastic - thanks. I am running the internation i9300 - so I would go with the top one -
GT-I9300_JB_Opensource_Update7.zip
But I'm not sure what may be different across the updates.
I assume that is doesnt matter which ROM I am running, and that a full Rom Manager backup would also backup my stock kernel ?
Click to expand...
Click to collapse
Kernel loadable modules are completely inert by themselves, so there is no need to worry about your phone bricking [but a backup never hurts].
If you build modules into the kernel itself on the other hand, its possible for the kernel to fail / panic / etc, so I don't plan on building any kernel packages.
Please see the OP for the 9300 modules. Hope they work! What is your full kernel version string and baseband version from "About Device" page?
kevinf28 said:
Kernel loadable modules are completely inert by themselves, so there is no need to worry about your phone bricking [but a backup never hurts].
If you build modules into the kernel itself on the other hand, its possible for the kernel to fail / panic / etc, so I don't plan on building any kernel packages.
Please see the OP for the 9300 modules. Hope they work! What is your full kernel version string and baseband version from "About Device" page?
Click to expand...
Click to collapse
It's giving a ' no such file or directory' error - even though the files are there and I'm running insmod from the dir as su. See terminal screen shot. thanks for the help!
Re: [Driver] Asix AX88772 kernel module
I updated the OP with insmod errors
It does look like GT-I9300_JB_Opensource_Update7.zip JB 4.1.2 matches your I9300XXELLA baseband version.
http://www.androidgalaxys.net/news-...gente-samsung-per-galaxy-s3-di-android-4-1-2/
http://www.androidgalaxys.net/appro...punto-esclamativo-rosso-come-nuovo-controllo/
kevinf28 said:
I updated the OP with insmod errors
It does look like GT-I9300_JB_Opensource_Update7.zip JB 4.1.2 matches your I9300XXELLA baseband version.
http://www.androidgalaxys.net/news-...gente-samsung-per-galaxy-s3-di-android-4-1-2/
http://www.androidgalaxys.net/appro...punto-esclamativo-rosso-come-nuovo-controllo/
Click to expand...
Click to collapse
Thanks - so it looks like I have some module dependancy issues. I'll take a look at dmesg and see whats going on. Seems strange though, if the zip does match everything...
Maybe I should go back to a stock ROM as I am currently running a de-odexed stock.
gingerneil said:
Thanks - so it looks like I have some module dependancy issues. I'll take a look at dmesg and see whats going on. Seems strange though, if the zip does match everything...
Maybe I should go back to a stock ROM as I am currently running a de-odexed stock.
Click to expand...
Click to collapse
It may be something trival, perhaps there is a third module you need for the international version.. I can't load your modules to test them, I get the exec format error . In regular linux, ldd is an amazing tool to list all the module deps, but unfortunately, it doesn't work for ARM, and arm-eabi-ldd does not exist in my toolchain.
[Edit: I have edited the OP, I rebuilt the modules and they do have some binary differences... give them a try as well]
Just curious... what are you using the USB-LAN adapter for with the USB-OTG?
CZ Eddie said:
Just curious... what are you using the USB-LAN adapter for with the USB-OTG?
Click to expand...
Click to collapse
Work does not allow wifi. I want to be able to download stuff without using data.
kevinf28 said:
It may be something trival, perhaps there is a third module you need for the international version.. I can't load your modules to test them, I get the exec format error . In regular linux, ldd is an amazing tool to list all the module deps, but unfortunately, it doesn't work for ARM, and arm-eabi-ldd does not exist in my toolchain.
[Edit: I have edited the OP, I rebuilt the modules and they do have some binary differences... give them a try as well]
Click to expand...
Click to collapse
Thanks - I'll give them a go. I went back to stock LLA ROM and it still didnt work.
---------- Post added at 03:24 PM ---------- Previous post was at 03:22 PM ----------
CZ Eddie said:
Just curious... what are you using the USB-LAN adapter for with the USB-OTG?
Click to expand...
Click to collapse
I'd like to use it for syncing files from my server without having to dig out my laptop to piggy back of its ethernet. Films can take an age to copy over wifi compared to LAN.
Having another go at getting the modules in. I am setting up the environment with the aim of compiling with the modules in and flashing the full kernel rather than adding via insmod....
gingerneil said:
Having another go at getting the modules in. I am setting up the environment with the aim of compiling with the modules in and flashing the full kernel rather than adding via insmod....
Click to expand...
Click to collapse
Cool. README_Kernel.txt is important, the make configure step is slightly different.
kevinf28 said:
Cool. README_Kernel.txt is important, the make configure step is slightly different.
Click to expand...
Click to collapse
OK - will see how I get on. Any tips would be great, as this will be my first attempt at compiling! The only linux based system I have it a raspberry pi connected to my TV running raspbmc. Currently seems to be running through the steps ok though.
Dmesg log attached - couldnt see how to attach on a pm!
gingerneil said:
Dmesg log attached - couldnt see how to attach on a pm!
Click to expand...
Click to collapse
Easy one, you are missing the 'mii' module,
<4>[ 3929.962119] c1 usbnet: Unknown symbol mii_nway_restart (err 0)
<4>[ 3929.962173] c1 usbnet: Unknown symbol mii_link_ok (err 0)
<4>[ 3929.962225] c1 usbnet: Unknown symbol mii_ethtool_sset (err 0)
<4>[ 3929.962270] c1 usbnet: Unknown symbol mii_ethtool_gset (err 0)
The pastebin link http://pastebin.com/wNaBWvZG references "Selects: MII [=m]"
On my phone, it didn't complain about mii, so i didn't think it was needed
https://www.dropbox.com/sh/5emvafthv061fp6/BKcakiOie8 has mii.ko, so load that first, then usbnet, then asix.
I also updated the OP to include a usbnet widget for one click module loading... that script would have to be modified to include insmod mii.ko
kevinf28 said:
Easy one, you are missing the 'mii' module,
<4>[ 3929.962119] c1 usbnet: Unknown symbol mii_nway_restart (err 0)
<4>[ 3929.962173] c1 usbnet: Unknown symbol mii_link_ok (err 0)
<4>[ 3929.962225] c1 usbnet: Unknown symbol mii_ethtool_sset (err 0)
<4>[ 3929.962270] c1 usbnet: Unknown symbol mii_ethtool_gset (err 0)
The pastebin link http://pastebin.com/wNaBWvZG references "Selects: MII [=m]"
On my phone, it didn't complain about mii, so i didn't think it was needed
https://www.dropbox.com/sh/5emvafthv061fp6/BKcakiOie8 has mii.ko, so load that first, then usbnet, then asix.
I also updated the OP to include a usbnet widget for one click module loading... that script would have to be modified to include insmod mii.ko
Click to expand...
Click to collapse
Fantastic - mods loaded, will test when I get home. Thanks too for the widget script!
Mods loaded and ethernet up and running - brilliant!
Only one issue now - I can't get the script to persist after a reboot unless it's somewhere like /sdcard0/download or on the extsdcard. It just gets deleted. I then can't get it to execute from there as I can't change the permission. Need to keep fiddling to find something that works. Minor issue tho!
Do the mods persist in /system/lib/modules ?
What about /data? That is your sdcard as ext4.
If all else fails...have you tried remounting /system as read only to force writes to disk? (Cache issue)
Sent from my SGH-I747M using xda app-developers app

[dev][kernel][kexec]

Last Update : August, 19, 2014
Hi,
I'm still try to bypass the MMU protection.
I have fixe a lot of bug, like memory misalignment, bad adresses allocation, dtb correction, etc...
Last sources and binaries here :
kexec-tools V11.zip : http://forum.xda-developers.com/attachment.php?attachmentid=2902912&stc=1&d=1408401794
kexec-tools binaries V11.zip : http://forum.xda-developers.com/attachment.php?attachmentid=2902913&stc=1&d=1408401794
Sorry, i have always 13 sec reboot after new kernel boot.
"cpu_proc_fin" use a "mcr p15" to init cache and proc that cause freeze.
I try to find solution for that.
Last Update : June, 22, 2014
Hi,
My sources are horrible... but i give something new.
This kexec is for stock kernel only (tested on .757). I thinks theses sources work on other kernel too.
In "kexec-tools V10.zip", you have all my sources. It's highly recommended to mod them to have something OK.
In "kexec binaries.zip", you have binaries to install
=> "kexec_load.ko" and "procfs_rw.ko" must be placed in "/system/lib/modules" folder with "chmod 777"
=> "kexec" must be placed in /system/bin" folder with "chmod 777"
=> cd /system/lib/modules
=> insmod kexec_load.ko
For sources :
Mod and adapt all you want, it's free.
You have 2 scripts in Zip : "./compil-kexec" in "kexec-tools" folder to rebuild and send in device directly (install Adbtcp on device and send by tcp with : adb connect xxx.xxx.xxx.xxx) = work perfectly with me.
"scriptZ1" is for compil stock kernel or another kernel (doomlord kernel for eg)
You must rename "custom_final_files" folder after compil to "final_file" manually ; You can have guest kernel in "custom_final_files" and stock kernel in "final_files" for "kexec-tools" path ... Don't mix a guest and host kernel please ^^
I am tired... i let you test and say if it's ok for you...
Thank a lot to munjeni for his help.
kexec-tools V10.zip : http://forum.xda-developers.com/attachment.php?attachmentid=2811994&stc=1&d=1403456181
kexec binaries.zip : http://forum.xda-developers.com/attachment.php?attachmentid=2811995&stc=1&d=1403456181
Last Update : November, 23, 2013
Hi,
For few days now, i haven't no more kernel panic with my kexec.
I have fixed few stuffs into sources, and add a lot.
These adds are, to include a "dt.img" image file into kexec load process.
This image file is a "device_tree" image to match hardware to software.
So, i assume to don't include atags into boot process, but pass bootloader informations by this DT.
I have programmed a little scan memory to found dynamicly all magic tags, because i found 3 device_tree into memory (magic is "0xd00dfeed").
These 2 device_tree are echo from first and nice structure.
The boot process need to have informations from this DT, and need all informations to initialize hardware (no HDW initialisation by the kernel)
I must first fix issues ; Regroup zImage and dt.img into memory to load a solid bloc to kexec_load module to boot into, and second, fix an offset i can't explain, 0x800 in memory causing misalignment memory
Keep tuned..
Last Update : November, 17, 2013
Hi everybody,
My kexec-tools work for Sony Xperia Z1 stock kernel "3.4.0-perf"
This tools can work on all locked bootloader for all locked device, not only Sony or Z1 models.
This kexec-tools add a kexec_load kernel module (LKM) and use a driver to grant a communication between "kexec" user program and kexec_load.ko module
what is for ?
"kexec" user program load in memory a custom kernel in zImage format, but can load ".tar" image too
This user tool load ramdisk in memory if necessary
This tool is for this purpose only, and don't keep in memory the custom kernel at device reboot.
It is a "user" program, not a "kernel" extension... So, to really do the magic, we need the host kernel (stock sony locked kernel) have a kexec_load capability to reboot in a new gest kernel (custom kernel).
Infortuntly, stock kernel don't have kexec_load capability.
Sony have compiled his stock kernel without this option, and "standard" kexec-tools "need" this option to work.
To see all system call capability of kernel, you can run theses command :
Code:
echo 0 > /proc/sys/kernel/dmesg_restrict
echo 0 > /proc/sys/kernel/kptr_restrict
cat /proc/kallsyms
Do all grep you want here.
The "echo 0" "restrict" is here to unmask logical adresses to "system calls"
Like you can see, "__NR_kexec_load" capability isn't here.
To add kexec_load capability in stock locked kernel, we need to add manualy a kernel module wich add this function into the kernel.
Why ? Because the way to keep in memory a custom kernel need to know a lot of parameters, and keep a specific memory range alive at reboot.
Only kernel can do this.
All user program will be terminated at reboot.
"Standard" kexec_load.ko module use a method to implement the "__NR_kexec_load" function in system call table.
Since 2.6.0 kernel, linux for security reason, have locked in memory the "system_call_table" ; No more add or modification is authorized.
If kexec tool try to add a value, "kexec_load" for us, we causes a kernel panic, and reboot device.
For this reason, i have modify kexec user program and kexec_load module to implement a driver to talk to each other.
this driver replace syscall method, and we no more need to use a system call table.
For this reason, this tool is now compatible with modern kernel like our "3.4.0"
For this reason, this tool must work for other device (Xperia X, P, S, etc...) and another brand
For this reason, if kernel is locked, we can bootstrap to run a new kernel.
Installation
First, you can compil your own kexec tool
Here, sources : http://forum.xda-developers.com/attachment.php?attachmentid=2397299&stc=1&d=1384689174
And here, the binaries : http://forum.xda-developers.com/attachment.php?attachmentid=2397305&stc=1&d=1384689406
(it's not a cwm zip, i have no time to create an installer for now ; use "./compil-kexec" if you want an automatic install)
Install *.ko in /system/lib/modules
Install kexec and kdump in /system/bin
Grant with "chmod 777"
Unzip in kexec-tools folder
Install a toolchain (sudo apt-get install gcc-arm-linux-gnueabi)
launch => ./compil-kexec
what's all
This script can do everythinks for you
- Compilation of tools
- Compilation of modules
- installation in device
This script can compil for every brand you have.
Except you must remove or adapt the patch (see below why)
Patch ??
This patch is because a module must be compiled in the same time the kernel himself.
For this reason a "vermagic", an identifier, is used by system to block every module not compil with kernel
Some custom kernel bypass this to authorize every modules.
But for stock kernel, it is not allowed.
You can easely strapp this by busybox.
"busybox modprobe" for help
"-f" to force load without vermagic
To see this vermagic :
Code:
# uname -r
This "uname -r" must be the same that
Code:
# strings kexec_load.ko | grep vermagic
vermagic=3.4.0-perf-g66807d4-02450-g9a218f1 SMP preempt mod_unload modversions ARMv7
If you want use automaticaly this vermagic, you can modify into the custom kernel this file :
Code:
"include/config/kernel.release" and add :
"3.4.0-perf-g66807d4-02450-g9a218f1"
This file will be use at module compil to match the vermagic.
Infortunatly, it is not enought. :silly:
The infamous "no symbol version for module_layout"
When a module compil is created, it use symbols link to system call function, translate by adresses
Theses symbols are not at same physical adresses in stock kernel and modules (compiled from DooMLoRD kernel).
So, theses adresses must be convert into modules itself to match with stock symbols adress.
A patch is needed.
If you use my script, modules are automatically patched.
Here patches :
Code:
sed -i 's/\x32\x76\x86\x29/\x72\xFF\x5E\x20/' procfs_rw.ko
sed -i 's/\x32\x76\x86\x29/\x72\xFF\x5E\x20/' kexec_load.ko
sed -i 's/\xBB\xD0\xF8\x4D/\x0E\x1C\x63\x77/' kexec_load.ko
sed -i 's/\xA6\x26\x81\x1A/\xD4\x56\x02\x7E/' kexec_load.ko
sed -i 's/\xA3\xD1\xEC\x96/\xEC\x43\x28\x1A/' kexec_load.ko
sed -i 's/\x8C\xE6\x6A\x5F/\x3D\xDF\x02\xF2/' kexec_load.ko
sed -i 's/\x3E\xF3\xEF\xE9/\x18\x7F\xA6\x8A/' kexec_load.ko
sed -i 's/\x8B\xD2\x92\x10/\xC8\x19\x08\x9C/' kexec_load.ko
sed -i 's/\x1C\xE8\x18\xE1/\x7C\x71\x9E\xEF/' kexec_load.ko
sed -i 's/\xAB\x2C\x2F\x8B/\x8E\xD7\x63\xC0/' kexec_load.ko
sed -i 's/\xF5\x62\xAA\x4B/\x34\x80\x1B\x74/' kexec_load.ko
sed -i 's/\x00\x52\xD6\xD7/\x6F\x80\x91\x20/' kexec_load.ko
sed -i 's/\x4F\x77\x57\x6A/\x0C\x57\xC7\x63/' kexec_load.ko
sed -i 's/\xCA\x2F\x65\x71/\x92\xB8\x7F\x53/' kexec_load.ko
sed -i 's/\x0F\xD0\xA0\x91/\xFA\x80\x15\xB4/' kexec_load.ko
sed -i 's/\x29\xA0\x6D\x48/\x6C\x6B\x96\x54/' kexec_load.ko
sed -i 's/\x6D\x1F\x1F\x37/\xCC\x5E\x79\x8B/' kexec_load.ko
sed -i 's/\xFD\x23\xD0\xFB/\xE3\xE3\x68\x52/' kexec_load.ko
You can use hexedit or hexdump to see these adresses :
Code:
hexdump kexec_load.ko | grep ff72
0003d50 b0b0 80ac ff72 205e 6f6d 7564 656c 6c5f
how does it work ?
# kexec --help
For kexec help... nothing more to say.
# lsmod
List loaded modules... You must see
kexec_load 31369 0 - Live 0x00000000 (O)
# rmmod kexec_load.ko
Remove kexec_load module from memory.
# grep kexec /proc/device
To see installed driver.
You must see :
100 kexec_driver
First number is "major" number to identify your driver in system.
# mknod /dev/kexec_driver c 100 0
Install driver.
Major number (here 100), is important for module.
This Major must be the same between module and driver.
By default, 100 is used.
# insmod kexec_load.ko
To install "LKM", kexec_load kernel module.
If another Major is needed, you can use "insmod kexec_load.ko 101" for Major 101
You can use "modprob" if you want, but you must configure the module folder.
How kexec and module exchange informations ?
By the driver.
Normal output for a kernel module is to write in "dmsg" file.
To see kernel output, launch this command :
Code:
# dmesg
To see last kernel log, see in :
Code:
# cat /proc/last_kmsg
For kexec module, this normal way still exist, and give a lot of informations, but to speak with, you must use the driver.
/dev/kexec_driver
You can yourself test communication:
Code:
# cat /dev/kexec_driver
You can send kernel by this communication channel.
Type following commands for help
=> echo help >/dev/kexec_driver
=> dmesg | grep Kexec
Code:
# echo help >/dev/kexec_driver
# cat /dev/kexec_driver
Last command : 'help'
Please type following command :
=> dmesg|grep Kexec
Every command send into driver is receive by kexec_load.ko module and running into the kernel.
The answer can by read thru the driver
Here, you can see that normal way to see messages is allway dmesg.
Code:
# dmesg|grep Kexec
<4>[15050.521628] Kexec: Starting kexec_module...
<6>[15050.521656] Kexec: kexec_driver_contener allocation
<6>[15050.521673] Kexec: kexec_memory_buffer allocation
<4>[15050.521691] Kexec:----------------------------------------------------
<4>[15050.521710] Kexec: kexec_driver created with major : '100'
<4>[15050.521728] Kexec: Please, prepare by typing the following commands :
<4>[15050.521746] Kexec: => mknod /dev/kexec_driver c 100 0
<4>[15050.521761] Kexec: => cat /dev/kexec_driver
<4>[15050.521775] Kexec:-----------------------------------------------------
<4>[15050.521791] Kexec: For help
<4>[15050.521803] Kexec: => echo help >/dev/kexec_driver
(...)
I have add a lot of informations to help to configure kexec.
rdtags, atags ??
Not sure for this part of kernel.
"atags" is the most used method to bootloader to parse commands and informations to kernel at boot.
"atags" is a form of structure in memory to organise informations.
At boot, a address chain is created and can be compulse in /proc/atags file.
This file is read only system.
"rdtags" is another way to bootloader to parse information to kernel.
"rdtags" is not stocked in "/proc"
But, as i see, stock kernel can use "atags" from bootloader.
kexec can substitute bootloader function to create fromscratch a atags chain, and parse to new kernel.
I have change this part to stock atags in "/data/atags", and reuse or change if need.
If this don't work, i must create a rdtags chain to replace atags ; It's not a hard work.
Status
For the moment, kexec tools works.
=> Phase one OK.
I can start Phase Two : new kernel patch.
If you want to help me...
Actually, load a custom kernel and boot into with kexec tools work.
But at boot into, a kernel panic occurs.
It seems, a part of kexec patch is missing in custom kernel.
Hi new thread created for kernel kexec development.
Status: not working: wrong values for mem defines under the kernel is giving segmentation fault as its attempting to write to memory areas that are currently being used byyyyy the system
Instructions:
Make kernel compatible?:
1. Download kernel diff patch from below
2. Terminal - diff patch > diff.txt
How to use:
1. Download kexec-tools (kexec binary) from below
2. Copy into system/bin directory and give it executable permission
3. Download compatible kernel
4. Terminal - kexec --load-hardboot zImage --initrd=initrd.img --mem-min=0x20000000 --command-line="$(cat /proc/cmdline)"
kexec -e
Download links:
Kexec tool- https://db.tt/8DZXQ9eV
Ramdisk firmware 1.548 : https://db.tt/8DZXQ9eV
zImage (kernel):
Source code:
Kernel diff patch: https://db.tt/Xi2htT7Q (currently contains wrong values for mem defines)
Kexec-tools: https://db.tt/I22ofr3b
Special thanks: @delewer @krabappel2548
Reserved
Please move this thread to Xda Devdb, then I can also edit first post etc if I find new stuff
Sent from my C6903 using xda app-developers app
krabappel2548 said:
Please move this thread to Xda Devdb, then I can also edit first post etc if I find new stuff
Sent from my C6903 using xda app-developers app
Click to expand...
Click to collapse
Devdb?
Pm me i dont know what Devdb is lol
Recieved segmentation fault with delewers calculated mem values too
We need to write to memory where we have write access to, maybe lockedbootloader is not allowing us to write? Orrr we are just writing to wrong area of memory
If kexec works on the Z1, can it be ported over to Xperia Z/ZL/T/Ultra? I believe they don't all share the same processor.
Shaky156 said:
Devdb?
Pm me i dont know what Devdb is lol
Click to expand...
Click to collapse
Shaky156 said:
Recieved segmentation fault with delewers calculated mem values too
We need to write to memory where we have write access to, maybe lockedbootloader is not allowing us to write? Orrr we are just writing to wrong area of memory
Click to expand...
Click to collapse
I'll discuss with Kali- today if he's available.
Knucklessg1 said:
If kexec works on the Z1, can it be ported over to Xperia Z/ZL/T/Ultra? I believe they don't all share the same processor.
Click to expand...
Click to collapse
Doesn't need to be same processor, can be ported
Sent from my C6903 using xda app-developers app
Knucklessg1 said:
If kexec works on the Z1, can it be ported over to Xperia Z/ZL/T/Ultra? I believe they don't all share the same processor.
Click to expand...
Click to collapse
Yes it wont matter much, since its not s800 it should be easier for you guys , take the kexec-tool use that, implement the patch write to the correct mem addresses which is free, it should boot if you guys have issues let me know,
I need to calculate the correct addresses.
Ive noticed s800 uses a dt.img, might need to modify kexec-tool to support dt.img, not sure what dt.img does yet, only know it holds values
Shaky156 said:
I need to calculate the correct addresses.
Ive noticed s800 uses a dt.img, might need to modify kexec-tool to support dt.img, not sure what dt.img does yet, only know it holds values
Click to expand...
Click to collapse
the dt.img is needed by the kernel to boot, so I guess we need to load that too in kexec.
EDIT: people that wanna try add kexec patch to their kernel, check github: android_kernel_sony_msm8974/commits/kexec
krabappel2548, i have compil your kernel by my script (fromscratch)
My script (instruction in "DoomLord Build kernel thread" : scriptZ1 http://forum.xda-developers.com/attachment.php?attachmentid=2346163&d=1382568778
(for thoses who want to help us...)
You have a little mod to do here (bad compil) :
In "sound/soc/msm/qdsp6v2/rtac.c"
you must change
#include <q6voice.h>
by
#include "q6voice.h"
btw : no more ideas to load kexec for the moment ...
delewer said:
krabappel2548, i have compil your kernel by my script (fromscratch)
My script (instruction in "DoomLord Build kernel thread" : scriptZ1 http://forum.xda-developers.com/attachment.php?attachmentid=2346163&d=1382568778
(for thoses who want to help us...)
You have a little mod to do here (bad compil) :
In "sound/soc/msm/qdsp6v2/rtac.c"
you must change
#include <q6voice.h>
by
#include "q6voice.h"
btw : no more ideas to load kexec for the moment ...
Click to expand...
Click to collapse
Sorry, I'm trying to get caught up on the forum, but what seems to be the current standing issue to get kexec working?
Knucklessg1 said:
Sorry, I'm trying to get caught up on the forum, but what seems to be the current standing issue to get kexec working?
Click to expand...
Click to collapse
Read the OP
Status paragraph
Memory regions
00000000-07afffff : System RAM
00008000-00b79383 : Kernel code
00d04000-00f0cddb : Kernel data
0ff00000-779fffff : System RAM
7ff00000-7ff3ffff : rdtags_mem
7ff80000-7ffa0fff : last_kmsg
7ffa1000-7ffa5fff : last_amsslog
System RAM MEM = 00000000
So --min-mem=0x20000000
Now need to find a free memory area thatll allow us to write and hopefully the mmu/pmu on locked bootloader wont cancel it
@delewer? @DooMLoRD @kali @Bin4ry
I know I shouldn't disturb, but i must ask: if You achieve Your goal, would it be possible to port it to devices like Xperia P, S, T, U and other NXT? It would be great, many ppl are ready to give a prize for it. Thanks in advance, good luck and sorry again.
Sent from my LT22i using xda app-developers app
king960 said:
I know I shouldn't disturb, but i must ask: if You achieve Your goal, would it be possible to port it to devices like Xperia P, S, T, U and other NXT? It would be great, many ppl are ready to give a prize for it. Thanks in advance, good luck and sorry again.
Sent from my LT22i using xda app-developers app
Click to expand...
Click to collapse
These devices are not 2013 devices, they arent s800 socs, so they are much easier to do, simply take the kexec-tools from op, implement the patch in your kernel, write the correct memory values for your specific device and execute in terminal via the command in op, minmem depends on your device too, good luck
I think some1 tried it already, but it works only for unlocked devices... Anyway, thanks for help.
Sent from my LT22i using xda app-developers app
king960 said:
I know I shouldn't disturb, but i must ask: if You achieve Your goal, would it be possible to port it to devices like Xperia P, S, T, U and other NXT? It would be great, many ppl are ready to give a prize for it. Thanks in advance, good luck and sorry again.
Sent from my LT22i using xda app-developers app
Click to expand...
Click to collapse
Does doing this require having an Unlocked Boot loader prior to implementation?
Sent from my C6603 using xda app-developers app
A few informations about kexec-tools debug
in kexec.c
Fonction :
if (file_type.load(argc, argv, kernel_buf,
kernel_size, &info) < 0) {
fprintf(stderr, "Cannot load %s\n", kernel);
return -1;
}
With a forced execution of kexec (bypass error to see...)
--mem-min=0x90000000
kernel: 0xb6b9d008 kernel_size: 3e9340
debug: 1 - after get memory range
debug: 2 - after type test
debug: 3 - after type test
debug: 4 - after info.kexec
debug: Focus 1 - argc '5' ; argv 'be856774' ; kernel_buf 'b6b9d008' ; kernel_size '3e9340' ; info 'be856548' ; i '1' ; file_type.name 'zImage'
Could not find a free area of memory of 3f1340 bytes...
Cannot load zImage
debug: 10 - before trampoline
debug: 11 - after trampoline
debug: 12 - before segment load
debug: 13 - after segment load
debug: 8 - before sort_segment
debug: 9 - after sort_segment
debug: 6 - before purgatory
debug: 7 - after purgatory
kexec_load: entry = (nil) flags = 280004
nr_segments = 0
kexec_load failed: Function not implemented
entry = (nil) flags = 280004
nr_segments = 0
debug: 5 - return result : ffffffff
With a forced bypass on file_type.load , we have this :
--mem-min=0x20000000
debug: Focus 1 - argc '5' ; argv 'bef18774' ; kernel_buf 'b6bc7008' ; kernel_size '3e9340' ; info 'bef18548' ; i '1' ; file_type.name 'zImage'
Segmentation fault
delewer said:
A few informations about kexec-tools debug
in kexec.c
Fonction :
if (file_type.load(argc, argv, kernel_buf,
kernel_size, &info) < 0) {
fprintf(stderr, "Cannot load %s\n", kernel);
return -1;
}
With a forced execution of kexec (bypass error to see...)
--mem-min=0x90000000
kernel: 0xb6b9d008 kernel_size: 3e9340
debug: 1 - after get memory range
debug: 2 - after type test
debug: 3 - after type test
debug: 4 - after info.kexec
debug: Focus 1 - argc '5' ; argv 'be856774' ; kernel_buf 'b6b9d008' ; kernel_size '3e9340' ; info 'be856548' ; i '1' ; file_type.name 'zImage'
Could not find a free area of memory of 3f1340 bytes...
Cannot load zImage
debug: 10 - before trampoline
debug: 11 - after trampoline
debug: 12 - before segment load
debug: 13 - after segment load
debug: 8 - before sort_segment
debug: 9 - after sort_segment
debug: 6 - before purgatory
debug: 7 - after purgatory
kexec_load: entry = (nil) flags = 280004
nr_segments = 0
kexec_load failed: Function not implemented
entry = (nil) flags = 280004
nr_segments = 0
debug: 5 - return result : ffffffff
With a forced bypass on file_type.load , we have this :
--mem-min=0x20000000
debug: Focus 1 - argc '5' ; argv 'bef18774' ; kernel_buf 'b6bc7008' ; kernel_size '3e9340' ; info 'bef18548' ; i '1' ; file_type.name 'zImage'
Segmentation fault
Click to expand...
Click to collapse
Did you compile this kexec yourself? Or did you get this from krapabbel? I issued krapabbel to compile a new debug version have gave him the code but never heard back from him :/
Anywayz so cannot find free memory is the issue

Categories

Resources