Galaxy S2 Compile a Kernel Module - Galaxy S II Q&A, Help & Troubleshooting

I'm having an issue insmoding a kernel I built for my rooted galaxy s2. My end game is to get USB-ethernet working by building the asix module but I cant even get a ko from the default build to insmod.
I compiled a kernel based on what I downloaded from samsungs website "GT-I9100_OpenSource_Update3.zip" and followed the instructions included (basically run make with defconfig) I chose scsi_wait_scan.ko as a test because it was built with the default config and currently wasn't loaded on my phone.
Here's some info that's pertinent. Any help would be appreciated. I'm running Ubuntu 11.
# lsmod
lsmod
dhd 242604 0 - Live 0xbf02e000
j4fs 65002 1 - Live 0xbf018000 (P)
Si4709_driver 17347 0 - Live 0xbf00d000
bthid 3384 0 - Live 0xbf007000
vibrator 6724 2 - Live 0xbf000000
# insmod scsi_wait_scan.ko
insmod scsi_wait_scan.ko
insmod: init_module 'scsi_wait_scan.ko' failed (Exec format error)
# dmesg
...
<4>[19668.986907] scsi_wait_scan: disagrees about version of symbol module_layout
# modinfo scsi_wait_scan.ko
modinfo scsi_wait_scan.ko
modinfo: can't open '/2.6.35.7-I9100XWKI4-CL575468/': No such file or directory
# pwd
/mnt/sdcard
# ls -l
...
-rwxrwxr-x system sdcard_rw 32484 2012-01-12 10:21 scsi_wait_scan.ko
$ file scsi_wait_scan.ko
scsi_wait_scan.ko: ELF 32-bit LSB relocatable, ARM, version 1 (SYSV), not stripped

Solved:
I actually got this working after I met another developer through work. You need a ramdisk to compile into the kernel.
I can't post links yet but you can search for the thread on the google forms by googling: 'Tal Alon kernel' and it should give you a pretty good description of what to do.
unpack a boot.img from a backup with unpack-bootimg.pl and uncpio the bootdisk.
The geist of what i learned is that there is a line in the .config file that should read CONFIG_INITRAMFS_SOURCE="/path/to/bootimg/boot.img-ramdisk"
After you build the kernel, copy your .ko's to the ram disk folder in boot.img-ramdisk/system/lib/modules
compile the kernel again then tar the zImage and load with odin.

njdevi11 said:
I actually got this working after I met another developer through work. You need a ramdisk to compile into the kernel.
I can't post links yet but you can search for the thread on the google forms by googling: 'Tal Alon kernel' and it should give you a pretty good description of what to do.
unpack a boot.img from a backup with unpack-bootimg.pl and uncpio the bootdisk.
The geist of what i learned is that there is a line in the .config file that should read CONFIG_INITRAMFS_SOURCE="/path/to/bootimg/boot.img-ramdisk"
After you build the kernel, copy your .ko's to the ram disk folder in boot.img-ramdisk/system/lib/modules
compile the kernel again then tar the zImage and load with odin.
Click to expand...
Click to collapse
Hi, did you get your asix.ko to work? I'm trying the same thing, got the module to compile and load, even eth0 showed up but now I'm stuck. I'm unable to get any communication going, i get "invalid rx length" errors in dmesg for the eth0 interface.
Thanks

Related

modinfo on Android

Hi, i need to know why modinfo isn't working on Android and if there is someother command that replaces it?
Thanks
You can try "insmod".
It needs the path the kernel module file as parameter. E.g.
insmod /path/to/module.ko
Trying to explore / understand installed modules
st_voss said:
You can try "insmod".
It needs the path the kernel module file as parameter. E.g.
insmod /path/to/module.ko
Click to expand...
Click to collapse
I have read that to understand all the drivers / modules installed on my Android device, I must look at everything in these two directories: /system/lib/modules and /sys/module
my device has no modules directory in the /system/lib directory.
in /sys/module, I have:
kernel
printk
wakelock
userwakelock
earlysuspend
spurious
omap3epfb
keyboard
vt
bridgedriver
scsi_mod
usbcore
musb_hdrc
omap_hdq
w1_bq27000
usbhid
binder
lowmemorykiller
snd
snd_timer
snd_pcm
snd_dummy
oprofile
tcp_cubic
rfkill
pvrsrvkm
omaplfb
bc_example
tiwlan_drv
None of these directories has any files ending in .ko? Using Root Explorer to search for *.ko, finds only these:
/etc/wifi/tiwlan_drv.ko
/system/bin/sgx/omaplfb.ko
/system/bin/sgx/pvrsrvkm.ko
Can someone help me figure out how to get the equivalent of modinfo details for these?
Thanks.
Environment info:
device runs Android 2.1 I use adbKonnect to connect wirelessly with my PC
PC is running XP

[DEV] netfilter for x8

Well, another module. A guy called me a module man
If we can compile this module we can (hopefully) have native usb/wifi tether on our phone.
Other benefits:
- Firewall apps
- Transparent proxies
- NAT
I'll start trying to make this work on our current kernel. Contribution is appreciated.
Github repo is here : https://github.com/doixanh/X8Features
PLEASE DON'T SPAM THIS DEV THREAD WITH UNCONTRIBUTED POSTS
Once again, great work!
Continue with the modules, you are solving many things extremely fast!
Big thank you from me for contributing to the X8 community!
All u need to do is implement the needed hooks missing from the stock kernel for iptables to attach on.
Sent from my GB MiniCM
Hello. If this module get worked, will be able the reverse usb tether(PC -> phone). I.e to have internet on my phone from the computer via USB.
Can someone explain what is this?
Great job! I use third-party programs, but is good to have native tether. One question. Will I need drivers for PC with native tether?
http://www.google.com/url?sa=t&sour...sg=AFQjCNGsYN4VLe4oQLOtuPksDb87g537lg&cad=rja
maybe it help
He3aBuCuM said:
Hello. If this module get worked, will be able the reverse usb tether(PC -> phone). I.e to have internet on my phone from the computer via USB.
Click to expand...
Click to collapse
no this would allow your phone to become a wifi hot spot, why would you need it the other way? if you have no wifi network you can download APK's to your computer and move to phone and install from your SD card
it would also allow you to use firewall apps to block all apps but the ones you want from connecting to your mobile internet to save you money.
So far, I managed to compile and insmod "netfilter.ko" with no error. But whenever I try to insmod iptable_filter.ko, I got a kernel crash.
The following modules has been insmoded - ordered to solve module dependencies.
insmod netfilter.ko
insmod x_tables.ko
insmod xt_tcpudp.ko
insmod nf_sockopt.ko
insmod ip_tables.ko
insmod ipt_addrtype.ko
insmod iptable_filter.ko <--- crashed here
Kernel crash message:
Code:
[ 466.135716] [<bf06b354>] (nf_register_hook+0x0/0x90 [netfilter]) from [<bf06b408>] (nf_register_hooks+0x24/0x64 [netfilter])
It seems the our nf_register_hook is not working.
Some logs:
Code:
[ 163.394843] nf_register_hook reg=BF059844
[ 163.395055] mutex locking
[ 163.395905] list for each entry pf=2, hooknum=1
<1>Unable to handle kernel NULL pointer dereference at virtual address 00000000
Could u share sources for those? Thanks.
Sent from my X10mini using XDA App
I'm at home now, I put all sources at work I changed lots of things to be able to compile it as module. Maybe I will need to upload whole /kernel/net/ipv4 and /kernel/net/netfilter branches.
I'll upload tomorrow.
It seems that the linked list is empty, that's why it couldn't initialize the list.
nobodyAtall: I've just created a github repo for X8Netfilter, I will push modifications soon.
doixanh said:
It seems that the linked list is empty, that's why it couldn't initialize the list.
nobodyAtall: I've just created a github repo for X8Netfilter, I will push modifications soon.
Click to expand...
Click to collapse
Thanks mate. I'll take a look and see if I can help.
Ok, everything pushed. Let's have fun with it my friend.
Repo is here : https://github.com/doixanh/X8Netfilter
The last time there were null pointers in linked lists because the initialization code (netfilter_init) was not executed. I forgot that now it's a module, so we have to declare module_init.
I added module_init into it. Insmoded fine now, but iptables tool still complains:
iptables v1.3.7: can't initialize iptables table `filter'
Click to expand...
Click to collapse
What are we missing?
/edit : post #200
/edit #2 : during xRecovery to switch to another ROM for testing, I bricked my lovely phone. There are lots of junk files in /system. Now I have to save my X8
/edit #3 : oh and I forgot that x10 mini has another offset for synchronize_rcu() - it should be 0xC0098F88. You have to modify it in netfilter.h
In the kernel config I didn't include xtables (required by iptable_filter) so maybe it's a problem.
I included, compiled, but still the same. I think the problem comes from the iptables userspace tool.
@nobodyAtall: can you modify and compile iptables.c (included in CM6/7 source). We need to know the reason that TC_INIT returns null. Before each "return NULL" you can put a printf so we can know why it's unable to load the table.
I cannot compile android iptables now (at work, the PC is really really slow).
I also pushed kernel config for my current kernel build, and a script to load the modules in order to solve dependencies.
Thanks.
doixanh said:
In the kernel config I didn't include xtables (required by iptable_filter) so maybe it's a problem.
I included, compiled, but still the same. I think the problem comes from the iptables userspace tool.
@nobodyAtall: can you modify and compile iptables.c (included in CM6/7 source). We need to know the reason that TC_INIT returns null. Before each "return NULL" you can put a printf so we can know why it's unable to load the table.
I cannot compile android iptables now (at work, the PC is really really slow).
I also pushed kernel config for my current kernel build, and a script to load the modules in order to solve dependencies.
Thanks.
Click to expand...
Click to collapse
I'm getting undefined references when building the kernel with your github files / .config file. Specifically:
kernel/include/linux/netfilter.h:193: undefined reference to `nf_hook_slow'
kernel/net/ipv4/ip_input.c:270: undefined reference to `nf_hooks'
kernel/net/ipv4/ip_input.c:270: undefined reference to `nf_hooks'
and many more.
Strange, I don't have any problem at all. I compiled those modules with
Code:
ARCH=arm CROSS_COMPILE=arm-eabi- make modules
oh and btw, I compiled with this kernel from SE: x10_x10mini_x10minipro_x8_eclair_2.1.A.0.390.tar.gz
doixanh said:
Strange, I don't have any problem at all. I compiled those modules with
Code:
ARCH=arm CROSS_COMPILE=arm-eabi- make modules
oh and btw, I compiled with this kernel from SE: x10_x10mini_x10minipro_x8_eclair_2.1.A.0.390.tar.gz
Click to expand...
Click to collapse
Ok, it wont make the kernel image but makes the modules.
Here's what's loaded:
Code:
localhost netfilter # ls
arp_tables.ko nfnetlink.ko xt_hashlimit.ko xt_realm.ko
ip_tables.ko nfnetlink_log.ko xt_iprange.ko xt_recent.ko
ipt_LOG.ko x_tables.ko xt_length.ko xt_sctp.ko
ipt_ULOG.ko xt_CLASSIFY.ko xt_limit.ko xt_statistic.ko
ipt_addrtype.ko xt_NFLOG.ko xt_mac.ko xt_string.ko
ipt_ah.ko xt_NFQUEUE.ko xt_multiport.ko xt_tcpudp.ko
iptable_filter.ko xt_TCPOPTSTRIP.ko xt_owner.ko xt_time.ko
iptable_mangle.ko xt_TRACE.ko xt_pkttype.ko xt_u32.ko
iptable_raw.ko xt_comment.ko xt_policy.ko
netfilter.ko xt_esp.ko xt_quota.ko
localhost netfilter # sh /sdcard/insmodnet
[B]insmod: init_module 'xt_NFLOG.ko' failed (No such file or directory)
insmod: init_module 'xt_string.ko' failed (No such file or directory)[/B]
localhost netfilter # lsmod
iptable_filter 2700 0 - Live 0xbf1e7000
ipt_addrtype 2388 0 - Live 0xbf1e1000
ip_tables 11264 1 iptable_filter, Live 0xbf1d9000
xt_u32 2036 0 - Live 0xbf1d3000
xt_time 2880 0 - Live 0xbf1cd000
xt_tcpudp 3016 0 - Live 0xbf1c7000
xt_statistic 1844 0 - Live 0xbf1bb000
xt_sctp 2672 0 - Live 0xbf1b5000
xt_recent 9308 0 - Live 0xbf1ad000
xt_realm 1492 0 - Live 0xbf1a7000
xt_quota 1752 0 - Live 0xbf1a1000
xt_policy 3120 0 - Live 0xbf19b000
xt_pkttype 1596 0 - Live 0xbf195000
xt_owner 2668 0 - Live 0xbf18f000
xt_multiport 3160 0 - Live 0xbf189000
xt_mac 1576 0 - Live 0xbf183000
xt_limit 2224 0 - Live 0xbf17d000
xt_length 1760 0 - Live 0xbf177000
xt_iprange 2640 0 - Live 0xbf171000
xt_hashlimit 9964 0 - Live 0xbf169000
xt_esp 1852 0 - Live 0xbf163000
xt_comment 1492 0 - Live 0xbf15d000
xt_TRACE 1484 0 - Live 0xbf157000
xt_TCPOPTSTRIP 1956 0 - Live 0xbf151000
xt_NFQUEUE 1716 0 - Live 0xbf070000
xt_CLASSIFY 1536 0 - Live 0xbf023000
x_tables 14212 25 ipt_addrtype,ip_tables,xt_u32,xt_time,xt_tcpudp,xt_statistic,xt_sctp,xt_recent,xt_realm,xt_quota,xt_policy,xt_pkttype,xt_owner,xt_multiport,xt_mac,xt_limit,xt_length,xt_iprange,xt_hashlimit,xt_esp,xt_comment,xt_TRACE,xt_TCPOPTSTRIP,xt_NFQUEUE,xt_CLASSIFY, Live 0xbf148000
netfilter 13564 3 iptable_filter,ip_tables,xt_TCPOPTSTRIP,[permanent], Live 0xbf142000
tiwlan_drv 838420 0 - Live 0xbf073000
ext3 110952 1 - Live 0xbf052000
jbd 49480 1 ext3, Live 0xbf040000
x8oc 6664 0 - Live 0xbf039000
synaptics_i2c_rmi4 11068 0 - Live 0xbf034000
twofish 9308 0 - Live 0xbf02c000
twofish_common 15740 1 twofish, Live 0xbf026000
dm_crypt 13052 0 - Live 0xbf01d000
dm_mod 53216 1 dm_crypt, Live 0xbf00b000
sdio 20724 1 tiwlan_drv, Live 0xbf000000
Do we need all there modules?
xt_NFLOG fails with:
xt_NFLOG: Unknown symbol nfulnl_log_packet
xt_string fails with:
xt_string: Unknown symbol textsearch_destroy
xt_string: Unknown symbol textsearch_prepare
I'm not sure, but I tried to compile and load all those modules to make it work first.
iptables tool still gives out error with
iptables -L
doixanh said:
I'm not sure, but I tried to compile and load all those modules to make it work first.
iptables tool still gives out error with
iptables -L
Click to expand...
Click to collapse
The actual error is:
iptables v1.4.7: can't initialize iptables table `filter': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
Which is quite *disturbing*
The actual error reported from kernel space is ENOENT (see file libiptc.c in CM sources).

[Q] xpad.ko

hello, i got the cifs module to work, but when i try to add the xpad.ko in the terminal it says read only. then when i do insmod it says can not find directory. i placed the xpad.ko where i placed the cifs.ko . the cifs works fine. i have cm7 with pershots 2.6.32.41 kernel. everything is placed in /system/lib/modules/2.6.32.41-cyanogenmod/.... what am i doing wrong ??
It would help if you gave us the exact command you used and the exact error message you got back.
this is what i did. placed xpad.ko in /system/lib/modules/2.6.32.41-cyanogenmod/ , then in terminal chmod 644 /system/lib/modules/2.6.32.41-cyanogenmod/xpad.ko , terminal replys chmod 644 /system/lib/modules/2.6.32.41-cyanogenmod/xpad.ko: Read-only file system ... then in terminal insmod /system/lib/modules/2.6.32.41-cyanogenmod/xpad.ko , reply from terminal, insmod: init_module '/system/lib/modules/2.6.32,41-cyanogenmod/xpad.ko' failed (no such file or directory) ....i followed pershots directions from droid basement. i had no problems installing the cifs module, that works fine.
Save yourself a lot of trouble:
Don't copy the xpad.ko file (or any other kernel module file for that matter) into /system--just leave it on the SD card.
You can also skip the chmod command. Since the insmod command needs to be run as superuser, permissions for the kernel module files don't matter.
All you have to do is specify the correct path to the .ko file when giving the insmod command which you must run as root--loading modules into a running kernel is a privileged operation, and normal users cannot do it.
Assuming your xpad.ko file is in /mnt/sdcard/tmp/, do:
Code:
$ su [I]# become superuser[/I]
# insmod /mnt/sdcard/tmp/xpad.ko
thank you for your help... tried doing it like you wrote , but it keeps telling me no such file or directory . i don't get it , why does it work for the cifs module and not the xpad module ?? if i can set up the cifs correctly, i should be able to do the xpad , it's all the same commands you just add in the module ko. , right? thanks for your time.. tired of messing with trying to get a game pad to work. i give up on this . at least i got the cifs to work..... thanks
The xpad.ko module needs another module to be loaded first, before it can be loaded. Otherwise you get this error:
Code:
$ su
# insmod /mnt/sdcard/tmp/xpad.ko
insmod: can't insert 'xpad.ko': unknown symbol in module or invalid parameter
I ran modinfo (on a Linux machine) on the xpad.ko file and it told me that xpad.ko depends on a ff-memless module. So load that module first (this module is also available in lib-2632.41_gb.tar.gz):
Code:
$ su
# insmod /mnt/sdcard/tmp/ff-memless.ko
# insmod /mnt/sdcard/tmp/xpad.ko
# dmesg | tail -n5
[79594.956918] CPU1 attaching NULL sched-domain.
[79595.074521] CPU0 attaching NULL sched-domain.
[79595.075957] CPU1: clean shutdown
[79608.912964] usbcore: registered new interface driver xpad
[79608.918576] xpad: X-Box pad driver
Looks like the drivers loaded successfully.
thank you, thank you, thank you, that worked....this is a really easy way to load in the modules , so much faster... just have to set up gscript lite now to do the work for me. thank you so much for your time ... thanks
Forgive my ignorance but in Pershoot's kernel would that xpad.ko file have to be compiled for the Android flavor you have? For instance on his blog he has both the Froyo and GB kernels, but I have seen his latest kernel on a few Honeycomb roms. Just wondering because I've tried to load the xpad.ko file in terminal with admin rights on a few and can't get them to work. Again, forgive my ignorance I'm trying to learn. Feel free to smack me about.
sixvoltsystem said:
Just wondering because I've tried to load the xpad.ko file in terminal with admin rights on a few and can't get them to work.
Click to expand...
Click to collapse
Did you load the ff-memless.ko module before loading xpad.ko as per post #6 in this thread?
rajeevvp said:
Did you load the ff-memless.ko module before loading xpad.ko as per post #6 in this thread?
Click to expand...
Click to collapse
Yes sir. Running Flashback Alpha 5.4 Rom. I can't get either one to run. My ff-memless.ko module is located in:
/system/lib/modules/2.6.32.42-cyanogenmod/kernel/drivers/input/ff-memless.ko
My Xpad.ko file is located in:
/system/lib/modules/2.6.32.42-cyanogenmod/kernel/drivers/input/joystick/xpad.ko
I get this:
Permission Denied even though I have "Needs SU" checked in Gscript
Thank you for the help I'm a bit of an idiot so I appreciate the look see
sixvoltsystem said:
I get this:
Permission Denied even though I have "Needs SU" checked in Gscript
Click to expand...
Click to collapse
Send me the output of these commands. Open the Terminal app on the gTablet and then type:
Code:
gTablet$ [B]su[/B]
gTablet# [B]find / -name ff-memless*[/B]
gTablet# [B]find / -name xpad.ko[/B]
EDIT: Just ran these exact commands in the terminal and the modules appear to have loaded just fine on my gTab (I'm running GtabComb beta 3.1):
Code:
gTablet$ [B]su[/B]
gTablet# [B]insmod /system/lib/modules/2.6.32.42-cyanogenmod/kernel/drivers/input/ff-memless.ko[/B]
gTablet# [B]insmod /system/lib/modules/2.6.32.42-cyanogenmod/kernel/drivers/input/joystick/xpad.ko[/B]
gTablet# [B]dmesg | tail -n 5[/B]
[ 1073.826181] CPU1 attaching NULL sched-domain.
[ 1073.942055] CPU0 attaching NULL sched-domain.
[ 1073.945705] CPU1: clean shutdown
[ 1283.649241] usbcore: registered new interface driver xpad
[ 1283.654886] xpad: X-Box pad driver
/system/lib/modules/2.6.32.42-cyanogenmod/kernel/drivers/input/ff-memless.ko
Then if I try running it in terminal it says failed ( File exists )
both the ff-memless.ko & xpad.ko files are located in the same place yours are. Should I format and start over? Odd
By the way much appreciated for the help
sixvoltsystem said:
Then if I try running it in terminal it says failed ( File exists )
Click to expand...
Click to collapse
That means that the modules are already loaded. Check using the dmesg command I gave previously, and also check using lsmod like this:
Code:
gTablet$ [B]su[/B]
gTablet# [B]lsmod[/B]
Module Size Used by Tainted: G
xpad 8315 0
ff_memless 4200 1 xpad
dhd 201288 0
tun 10899 0
nls_utf8 1143 0
ntfs 207149 0
cifs 235684 0
As you can see, both xpad.ko and ff_memless.ko are loaded and xpad.ko is using ff_memless.ko as it should. You should be good to go at this point.
rajeevvp said:
That means that the modules are already loaded. Check using the dmesg command I gave previously, and also check using lsmod like this:
Code:
gTablet$ [B]su[/B]
gTablet# [B]lsmod[/B]
Module Size Used by Tainted: G
xpad 8315 0
ff_memless 4200 1 xpad
dhd 201288 0
tun 10899 0
nls_utf8 1143 0
ntfs 207149 0
cifs 235684 0
As you can see, both xpad.ko and ff_memless.ko are loaded and xpad.ko is using ff_memless.ko as it should. You should be good to go at this point.
Click to expand...
Click to collapse
dmesg command gave this:
nvrm_notifier_show: blocking
CPU0 attaching NULL sched-domain.
CPU1 attaching NULL sched-domain.
CPU0 attaching NULL sched-domain.
CPU1: clean shutdown
lsmod command shows:
xpad 8315 0 - Live 0xbf043000
ff_memless 4200 1 xpad, Live oxbf03c000
dhd 201288 0 - Live 0xbf000000
You sir are awesome for helping me, it works! Wired Xbox 360 controller is working perfectly!! I thanked you in every post here.
sixvoltsystem said:
dmesg command gave this:
nvrm_notifier_show: blocking
CPU0 attaching NULL sched-domain.
CPU1 attaching NULL sched-domain.
CPU0 attaching NULL sched-domain.
CPU1: clean shutdown
Click to expand...
Click to collapse
You were too late with that dmesg command. It should've been executed right after the insmod stuff. Or, just plain dmesg without the tail and then look through its output.
Wired Xbox 360 controller is working perfectly!! I thanked you in every post here.
Click to expand...
Click to collapse
Oh, boy! And I don't even own an Xbox. Of any variety.
Really, you should be thanking the guy(s) who wrote the code.
rajeevvp said:
You were too late with that dmesg command. It should've been executed right after the insmod stuff. Or, just plain dmesg without the tail and then look through its output.
Oh, boy! And I don't even own an Xbox. Of any variety.
Really, you should be thanking the guy(s) who wrote the code.
Click to expand...
Click to collapse
No problem, I will thank them. Thank you for helping me understand it a bit more. You were very helpful and patient. We have an xbox, but it is my son's, I'd rather play some Atari or 8-bit Nintendo....which is what I'll do now that this works
Hello all of you, maybe anyone can help with this...
Im trying to use a generic usb gamepad with the gtab but only work the buttons and not the direction pad. Anyone have any idea? I dont have any wired xbox controller...
Thanks a lot!
first off, a million thank yous to rajeevp and everyone else on this thread. I'm not all that knowledgeable with this stuff but after coming across these posts I was able to install xpad.ko, using terminal emulator that I got of the android market and now I can use the xbox wireless gaming adapter and xbox360 wireless controller on my rooted gtablet. I'm using gtabcomb 3.3 bootloader 1.1 and I play nest, snes, n64, Sega roms and emulators that I got free from 4shared.com,. I was cracking my head trying to get the 360 controller to work with the usb adapter and now it all works. The thank god I found this thread!! You hackers and developers out there are awesome!!!
after the drivers loaded. Whats next
rajeevvp said:
The xpad.ko module needs another module to be loaded first, before it can be loaded. Otherwise you get this error:
Code:
$ su
# insmod /mnt/sdcard/tmp/xpad.ko
insmod: can't insert 'xpad.ko': unknown symbol in module or invalid parameter
I ran modinfo (on a Linux machine) on the xpad.ko file and it told me that xpad.ko depends on a ff-memless module. So load that module first (this module is also available in lib-2632.41_gb.tar.gz):
Code:
$ su
# insmod /mnt/sdcard/tmp/ff-memless.ko
# insmod /mnt/sdcard/tmp/xpad.ko
# dmesg | tail -n5
[79594.956918] CPU1 attaching NULL sched-domain.
[79595.074521] CPU0 attaching NULL sched-domain.
[79595.075957] CPU1: clean shutdown
[79608.912964] usbcore: registered new interface driver xpad
[79608.918576] xpad: X-Box pad driver
Looks like the drivers loaded successfully.
Click to expand...
Click to collapse
So what would the next step be after the ff-memless.ko and xpad.ko drivers have been installed????

use USB WiFi dongle on TF201

Hi folks!
one user ask if there is a method for using USB WiFi dongle on TF201, I've a working WG111v3 [RTL8187] which i use for connect when signal is weak, sniffing wifi packets , dump WPA handshakes and make some love ;P.
however i get all this working on TF201 by compile the kernel modules.
because not all users have a chroot with a stock kernel tree, i think to realease a package with all these modules inside.
so, for extract the modules from the package :
tar xzf wifi_ko.tar.gz -C path/to/
or
tar xjf wifi_ko.tar.bz2 -C path/to/
and all you have to do for use the wifi dongle is:
1) open termianl emulator
2) su
3) insmod path/to/module.ko
4) ifconfig wlan1 up
5) wpa_supplicant -i wlan1 -c /path/to/wpa_supplicant.conf -B
6) dhcpcd wlan1
i suppose that the new device is wlan1.
the step 5 and 6 is for connecting to a wireless Access Point, but if you use the dongle for other purposes just skip these.
I make these modules with debug information, so, if you have some problem look at `dmesg | grep "$module" ' output.
for a working wpa_supplicant.conf file take the /data/misc/wifi/wpa_supplicant.conf and remove extra information such as device-id and other android stuff.
Here you are the packages: ( if someone want to upload to another hoster will be better )
https://docs.google.com/open?id=0B0RHupHzEorHWkRheUMxNjRPTGc
https://docs.google.com/open?id=0B0RHupHzEorHZ21NZ3dTNzNHYTQ
Hope this help.
Regeards.
( sorry for my doggish english , i will update it soon )
tux_mind said:
Hi folks!
one user ask if there is a method for using USB WiFi dongle on TF201, I've a working WG111v3 [RTL8187] which i use for connect when signal is weak, sniffing wifi packets , dump WPA handshakes and make some love ;P.
however i get all this working on TF201 by compile the kernel modules.
because not all users have a chroot with a stock kernel tree, i think to realease a package with all these modules inside.
so, for extract the modules from the package :
tar xzf wifi_ko.tar.gz -C path/to/
or
tar xjf wifi_ko.tar.bz2 -C path/to/
and all you have to do for use the wifi dongle is:
1) open termianl emulator
2) su
3) insmod path/to/module.ko
4) ifconfig wlan1 up
5) wpa_supplicant -i wlan1 -c /path/to/wpa_supplicant.conf -B
6) dhcpcd wlan1
i suppose that the new device is wlan1.
the step 5 and 6 is for connecting to a wireless Access Point, but if you use the dongle for other purposes just skip these.
I make these modules with debug information, so, if you have some problem look at `dmesg | grep "$module" ' output.
for a working wpa_supplicant.conf file take the /data/misc/wifi/wpa_supplicant.conf and remove extra information such as device-id and other android stuff.
Click to expand...
Click to collapse
is it possible to use this on Aurora 2??? thanks for the post!
This is great.. But have a question
tux_mind said:
Hi folks!
one user ask if there is a method for using USB WiFi dongle on TF201, I've a working WG111v3 [RTL8187] which i use for connect when signal is weak, sniffing wifi packets , dump WPA handshakes and make some love ;P.
however i get all this working on TF201 by compile the kernel modules.
because not all users have a chroot with a stock kernel tree, i think to realease a package with all these modules inside.
so, for extract the modules from the package :
tar xzf wifi_ko.tar.gz -C path/to/
or
tar xjf wifi_ko.tar.bz2 -C path/to/
and all you have to do for use the wifi dongle is:
1) open termianl emulator
2) su
3) insmod path/to/module.ko
4) ifconfig wlan1 up
5) wpa_supplicant -i wlan1 -c /path/to/wpa_supplicant.conf -B
6) dhcpcd wlan1
i suppose that the new device is wlan1.
the step 5 and 6 is for connecting to a wireless Access Point, but if you use the dongle for other purposes just skip these.
I make these modules with debug information, so, if you have some problem look at `dmesg | grep "$module" ' output.
for a working wpa_supplicant.conf file take the /data/misc/wifi/wpa_supplicant.conf and remove extra information such as device-id and other android stuff.
Hope this help.
Regeards.
( sorry for my doggish english , i will update it soon )
Click to expand...
Click to collapse
What kernel did you use to compile these drivers on?
Cannot insmod
Hello,
could you please answer what kernel version is this working with? Any chance you could re-compile with newest kernel? When trying to ismod, I'm getting error:
insmod: init_module '...path...' failed (No such file or directory)
Before you ask - yes, the path is correct, just init_module returns non-zero.
Thanks for any help,
Martin
Is it possible to have a Atheros AR9271 driver?
I tried all athXX.ko, but "init_module '...path...' failed (No such file or directory)"always happened.
tux_mind said:
Hi folks!
one user ask if there is a method for using USB WiFi dongle on TF201, I've a working WG111v3 [RTL8187] which i use for connect when signal is weak, sniffing wifi packets , dump WPA handshakes and make some love ;P.
however i get all this working on TF201 by compile the kernel modules.
because not all users have a chroot with a stock kernel tree, i think to realease a package with all these modules inside.
Click to expand...
Click to collapse
tennyleaz said:
Is it possible to have a Atheros AR9271 driver?
I tried all athXX.ko, but "init_module '...path...' failed (No such file or directory)"always happened.
Click to expand...
Click to collapse
if i remember fine you need the ath9k or the ath9k_htc module.
btw the main trouble is that the module fails to load the device firmware.
it is probably due to wrong path.
module was probably compiled with "/system/lib/firmware/htc_9271.fw" but you have "/lib/firmware/htc_9271.fw".
please check dmesg immediately after the modprobe, you will see the path used by the module.
i solved by doing a symlink from /system/lib to /lib.
sorry for late replies but i never comes on XDA.
i read now all the previous questions.
the kernel i use is this: https://github.com/tux-mind/tf201-kernel
insmod
Like a previous post I am getting: init_module rtl8192ce.ko failed (no such file or directory)
1) I could not find a path/to so I just made one on the MicroSD and extracted the files.
2) I am executing insmod rtl8192ce.ko from the path/to/ directory
3) To me the issue is that the insmod is trying to write to a location that does not exist.
4) Per a previous post I added a directory "firmware" under system/lib still no luck.
Any help would be appreciated.

[Q] pmid10c boot image help

I am looking to compile a new kernel for this device. I have pulled off the boot.img file from /dev/block/nandc and used split_bootimg.pl to pull apart the kernel and the boot ramdisk. I have used extract-ikconfig to get the kernel config and built my new 3.4 kernel (with modules). So far so good...
I have tried to build the new boot.img file with no avail. My concern is with the original kernel as the new one should be build the same (I think). It looks like it is not compressed as I run the command
file boot.img-kernel
It returns
boot.img-kernel: data
So it is not a Linux kernel ARM boot executable zImage
Is this correct? Can Android boot with this or is the split_bootimg.pl tool not creating the file correctly (it does pull the ramdisk as I have uncompressed it fine! and the file does contain the kernel config)
Ok So assuming I can create a proper boot.img with my built zImage and the old ramdisk, what do I need to do with the modules? Do I update the boot.img on the tablet and copy the modules over to the existing /system/lib/modules? (this appears to not work)
I did not find an exact guide on android kernel and the modules....
Domenic
link to the old (working) boot.img hxxps://docs.google.com/file/d/0B0c1jpaziDZ-NU5Sd18wbUVjN1E/edit?usp=sharing
some progress
domenictroilo said:
I am looking to compile a new kernel for this device. I have pulled off the boot.img file from /dev/block/nandc and used split_bootimg.pl to pull apart the kernel and the boot ramdisk. I have used extract-ikconfig to get the kernel config and built my new 3.4 kernel (with modules). So far so good...
I have tried to build the new boot.img file with no avail. My concern is with the original kernel as the new one should be build the same (I think). It looks like it is not compressed as I run the command
file boot.img-kernel
It returns
boot.img-kernel: data
So it is not a Linux kernel ARM boot executable zImage
Is this correct? Can Android boot with this or is the split_bootimg.pl tool not creating the file correctly (it does pull the ramdisk as I have uncompressed it fine! and the file does contain the kernel config)
Ok So assuming I can create a proper boot.img with my built zImage and the old ramdisk, what do I need to do with the modules? Do I update the boot.img on the tablet and copy the modules over to the existing /system/lib/modules? (this appears to not work)
I did not find an exact guide on android kernel and the modules....
Domenic
link to the old (working) boot.img hxxps://docs.google.com/file/d/0B0c1jpaziDZ-NU5Sd18wbUVjN1E/edit?usp=sharing
Click to expand...
Click to collapse
Ok so the mkimage command can be used to pull the uImage out of the Kernel Part of the file like this:
mkimage -A arm -O linux -T kernel -C none -a 0x40008000 -e 0x40008000 -n "Linux 3.0.8" -d uImage boot.img-kernel2
The only question is where in the boot process can I find the "Load Address" and "Entry Point" values that are required to create my uImage. I would think that these are going to be needed as options when I build my new kernel, and I will need to change the boot process or add a boot.scr file with my options. I have mounted the /dev/block/nanda partition (uBoot partition) but am not certain on where I would find the current environment values.
I did find this little snippet on the net that referes to the base address for this device xxx.tabletroms.com/forums/all-other-android-tablets-general-discussion/5791-full-specs-whatever-else-polaroid-pmid10c-tablet-2.htmlx
mkbootimg --kernel boot.img-kernel --ramdisk boot.img-ramdisk.cpio.gz --cmdline 'console=ttyS0,115200 rw init=/init loglevel=8' --board sun4i --base 0x40000000 -o boot.img
But he never discusses where he found the -base address. Is this the same as the Load Address and Entry Point?
Domenic
domenictroilo said:
Ok so the mkimage command can be used to pull the uImage out of the Kernel Part of the file like this:
mkimage -A arm -O linux -T kernel -C none -a 0x40008000 -e 0x40008000 -n "Linux 3.0.8" -d uImage boot.img-kernel2
The only question is where in the boot process can I find the "Load Address" and "Entry Point" values that are required to create my uImage. I would think that these are going to be needed as options when I build my new kernel, and I will need to change the boot process or add a boot.scr file with my options. I have mounted the /dev/block/nanda partition (uBoot partition) but am not certain on where I would find the current environment values.
I did find this little snippet on the net that referes to the base address for this device xxx.tabletroms.com/forums/all-other-android-tablets-general-discussion/5791-full-specs-whatever-else-polaroid-pmid10c-tablet-2.htmlx
mkbootimg --kernel boot.img-kernel --ramdisk boot.img-ramdisk.cpio.gz --cmdline 'console=ttyS0,115200 rw init=/init loglevel=8' --board sun4i --base 0x40000000 -o boot.img
But he never discusses where he found the -base address. Is this the same as the Load Address and Entry Point?
Domenic
Click to expand...
Click to collapse
So the base address is found in script.bin (converted to text file with bin2fex tool). This is the information found in it:
[dram_para]
dram_baseaddr = 0x40000000
Still how do I find the "Load Address" and "Entry Point" for the current kernel...
unmkbootimg
domenictroilo said:
So the base address is found in script.bin (converted to text file with bin2fex tool). This is the information found in it:
[dram_para]
dram_baseaddr = 0x40000000
Still how do I find the "Load Address" and "Entry Point" for the current kernel...
Click to expand...
Click to collapse
Well more reading leads me to use unmkbootimg but on my linux 32bit system all I get is:
# strace ./unmkbootimg
execve("./unmkbootimg", ["./unmkbootimg"], [/* 20 vars */]) = 0
--- SIGILL (Illegal instruction) @ 0 (0) ---
+++ killed by SIGILL +++
Illegal instruction
Too bad I can see the souce code to find out what this program is doing or compile it for myself.....
split_bootimg.pl should give you the parameters i listed on tabletroms.
What source are you using? Polaroid never coughed any up and i last harassed them in February.
bigsupersquid said:
split_bootimg.pl should give you the parameters i listed on tabletroms.
What source are you using? Polaroid never coughed any up and i last harassed them in February.
Click to expand...
Click to collapse
Here is the split:
letourneau:~/tmp# ../split_bootimg.pl /root/boot.img
Page size: 2048 (0x00000800)
Kernel size: 8112836 (0x007bcac4)
Ramdisk size: 210343 (0x000335a7)
Second size: 0 (0x00000000)
Board name:
Command line: console=ttyS0,115200 rw init=/init loglevel=8
Writing boot.img-kernel ... complete.
Writing boot.img-ramdisk.gz ... complete.
I am using the linux--sunxi kernel for now with an additional patch for dmard06.ko (which I do not expect to work!) I emailed them for the kernel source but just received a form email saying they will get back to me..... oh well I will as again.
Just playing around for now to see if a newer kernel will tweek up the speed on this device as it is very laggy.
Domenic
I may be using an older version of split_bootimg.pl?
On another note, I was able to execute unmkbootimg on a different linux server. I was attempting to run it on a PIII 800 so it needs something > a pentium (I guess).
./unmkbootimg boot.img
unmkbootimg version 1.2 - Mikael Q Kuisma <[email protected]>
Kernel size 8112836
Kernel address 0x40008000
Ramdisk size 210343
Ramdisk address 0x41000000
Secondary size 0
Secondary address 0x40f00000
Kernel tags address 0x40000100
Flash page size 2048
Board name is ""
Command line "console=ttyS0,115200 rw init=/init loglevel=8"
This image is built using standard mkbootimg
Extracting kernel to file zImage ...
Extracting root filesystem to file initramfs.cpio.gz ...
All done.
---------------
To recompile this image, use:
mkbootimg --kernel zImage --ramdisk initramfs.cpio.gz --base 0x40000000 --cmdline 'console=ttyS0,115200 rw init=/init loglevel=8' -o new_boot.img
---------------
Domenic
think the parameters you're searching for are specific for building the new kernel without proper source code to extract them from?
maybe you could get them from dmesg while the tablet is running?
else think there might be a way to grep the variable names in the existing kernel binary or headers?
i also would like a fresh kernel.
maybe useful stuff here:
https://vilimpoc.org/research/sh3dev/kernel-hacking.html
http://forum.xda-developers.com/showpost.php?p=46668556&postcount=31
thanks jjchico
i haven't checked this out yet, but may be useful.
Well I have build a new kernel and copied the modules over, but I does not boot. It appears that it never mounts the ramdisk as it never gets to the second splash screen, but I am flying blind as there is no serial port to debug with. I suspect that I do not quite understand the boot process for this tablet.... here is what is on the nanda vfat partition: (good information here http://rhombus-tech.net/allwinner_a10/a10_boot_process/)
since this is in my linux.ini
cat linux.ini
[segment]
img_name = c:\linux\u-boot.bin
img_size = 0x80000
img_base = 0x4A000000
[script_info]
script_base = 0x43000000
script_size = 0x10000
[logo_info]
logo_name = c:\linux\linux.bmp
logo_show = 1
Not quite certain how to setup img_base on my compile I guess.
I have tried the linix.ini from the link above but the tablet booted to livesuite image... that is a fail.
Not being a kernel developer.... I am wondering if the option to setup SUNXI_NAND_COMPAT_DEV is creating /dev/block/nandX or /dev/nandX as this will definatly impact the init.sun4i.rc file as it is mounting /dev/block/nandX This could be my first issue.... but then does /init first display the initlogo.rle or start processing init.sun4i.rc. Well if the first thing it does in load initlogo.rle then I am not even getting this far....below is the description of SUNXI_NAND_COMPAT_DEV
Symbol: SUNXI_NAND_COMPAT_DEV [=y] │
│ Type : boolean │
│ Prompt: Create old nand device names (nanda-nandz) │
│ Defined at drivers/block/Kconfig:564 │
│ Depends on: BLK_DEV [=y] && SUNXI_NAND [=y] │
│ Location: │
│ -> Device Drivers │
│ -> Block devices (BLK_DEV [=y]) │
│ -> SUNXI Nandflash Driver (SUNXI_NAND [=y]) │
well a little more reading leads me to this page on the CarbonRom http://www.slatedroid.com/topic/64378-rom-carbonrom-422/ turns out that if you want to run a 3.4 kernel you MUST update u-boot (http://www.mediafire...4ro667xcfkd2dv7).... so I have flashed the CarbonRom and it does boot with the u-boot update. Not to worry the new u-boot will still boot the old kernel. The only issue I have with the CarbonRom kernel is the missing dmard06 driver so no touch screen..... I may get a new kernel working yet!
domenictroilo said:
well a little more reading leads me to this page on the CarbonRom http://www.slatedroid.com/topic/64378-rom-carbonrom-422/ turns out that if you want to run a 3.4 kernel you MUST update u-boot (http://www.mediafire...4ro667xcfkd2dv7).... so I have flashed the CarbonRom and it does boot with the u-boot update. Not to worry the new u-boot will still boot the old kernel. The only issue I have with the CarbonRom kernel is the missing dmard06 driver so no touch screen..... I may get a new kernel working yet!
Click to expand...
Click to collapse
https://github.com/fsebentley/linux_allwinner_drivers_input_touchscreen_mods
https://groups.google.com/forum/#!topic/linux-sunxi/D0n8dyaVA34
?
bigsupersquid said:
https://github.com/fsebentley/linux_allwinner_drivers_input_touchscreen_mods
https://groups.google.com/forum/#!topic/linux-sunxi/D0n8dyaVA34
?
Click to expand...
Click to collapse
the patch compiles,you need to comment out #include <linux/earlysuspend.h> as it is not supported on the newer kernel and not required by the driver anyway. I just need to get the kernel to actually load lol..... I have at least gotten past the boot screen now, but it hangs.... I will try a different arm tool chain and see what happens next.....
So close but yet so far..... well I have the new kernel installed and booted with adb shell available but it turns out the new mma7660.ko is not compatable with my device I get this error from dmesg over and over and over....
<4>[ 3254.934675] incomplete xfer (0x20)
<3>[ 3254.938093] Assertion failed! drivers/hwmon/mma7660.c,196,mma7660_read_xyz,result>=0
Will rename the driver and see if I can get past init further in the boot....
Edit
Well more issues with drivers the dmard06 is not compatible either, I had more success with the Carbon Kernel I will see if I can find the source git, should be around....
dmesg | busybox grep dmard
<4>[ 5.408528] dmard06: init
<3>[ 5.447835] dmard06gsensor_fetch_sysconfig_para: after: gsensor_twi_addr is 0x4c, dirty_addr_buf: 0x4c. dirty_addr_buf[1]: 0xfffe
<4>[ 5.488546] dmard06_init: after fetch_sysconfig_para: normal_i2c: 0x4c. normal_i2c[1]: 0xfffe
<6>[ 5.508612] gsensor_detect: Detected chip dmard06 at adapter 1, address 0x4c
<4>[ 5.601533] dmard06 gsensor I2C err = 0!
<4>[ 5.613430] dmard06 probe failed
<4>[ 5.624926] dmard06: probe of 1-004c failed with error -1
This all makes some sense as Polaroid has not get gotten me the kernel and the drivers they load (their kernel have very unique names:
Module Size Used by Not tainted
8192cu 575431 0
rtl8150 8910 0
mcs7830 6557 0
qf9700 8513 0
asix 22500 0
usbnet 23745 3 mcs7830,qf9700,asix
dmard06_gl 8202 2
mma7660 6541 0
mali 130177 14
ump 42178 19 mali
gt811_ts_828 19947 0
sun4i_csi0 27946 0
nt99250 14254 1
gc0308 12848 1
videobuf_dma_contig 5659 1 sun4i_csi0
videobuf_core 18067 2 sun4i_csi0,videobuf_dma_contig
Well more issues with drivers the dmard06 is not compatible either, I had more success with the Carbon Kernel I will see if I can find the kernel source git, should be around....
dmesg | busybox grep dmard
<4>[ 5.408528] dmard06: init
<3>[ 5.447835] dmard06gsensor_fetch_sysconfig_para: after: gsensor_twi_addr is 0x4c, dirty_addr_buf: 0x4c. dirty_addr_buf[1]: 0xfffe
<4>[ 5.488546] dmard06_init: after fetch_sysconfig_para: normal_i2c: 0x4c. normal_i2c[1]: 0xfffe
<6>[ 5.508612] gsensor_detect: Detected chip dmard06 at adapter 1, address 0x4c
<4>[ 5.601533] dmard06 gsensor I2C err = 0!
<4>[ 5.613430] dmard06 probe failed
<4>[ 5.624926] dmard06: probe of 1-004c failed with error -1
This all makes some sense as Polaroid has not provided me the kernel they used and the drivers they load have unique names see below from the original stock rom:
Module Size Used by Not tainted
8192cu 575431 0
rtl8150 8910 0
mcs7830 6557 0
qf9700 8513 0
asix 22500 0
usbnet 23745 3 mcs7830,qf9700,asix
dmard06_gl 8202 2
mma7660 6541 0
mali 130177 14
ump 42178 19 mali
gt811_ts_828 19947 0
sun4i_csi0 27946 0
nt99250 14254 1
gc0308 12848 1
videobuf_dma_contig 5659 1 sun4i_csi0
videobuf_core 18067 2 sun4i_csi0,videobuf_dma_contig
I suspect after all the trouble I had with LG source that there are device-specific bits in the drivers.
Polaroid will most likely have to cough up source to get it all working.
Have you considered trying punchmod to use the old drivers? I dunno if that'd work considering the stock kernel is a lower version... but it might be worth a try.
bigsupersquid said:
I suspect after all the trouble I had with LG source that there are device-specific bits in the drivers.
Polaroid will most likely have to cough up source to get it all working.
Have you considered trying punchmod to use the old drivers? I dunno if that'd work considering the stock kernel is a lower version... but it might be worth a try.
Click to expand...
Click to collapse
I have changed the vermagic on the old modules and tried with the newer kernel but no go.... the latest 3.0 sunxi kernel is at 3.0.96 so I will build this one and see if I can get the special 3.0.8 polaroid modules to load.
I have a ticket open with Polaroid lol I guess we will see if the cough up a kernel or not.... I would not put money on it...
domenictroilo said:
I have changed the vermagic on the old modules and tried with the newer kernel but no go.... the latest 3.0 sunxi kernel is at 3.0.96 so I will build this one and see if I can get the special 3.0.8 polaroid modules to load.
I have a ticket open with Polaroid lol I guess we will see if the cough up a kernel or not.... I would not put money on it...
Click to expand...
Click to collapse
I've had an open ticket since November from talking on the phone after email did nothing.
nothing but autoresponder.
bigsupersquid said:
I've had an open ticket since November from talking on the phone after email did nothing.
nothing but autoresponder.
Click to expand...
Click to collapse
Do you believe that something like this http://gpl-violations.org/faq/violation-faq.html could force them to provide the source code? I could try to get the group at "FreakTab" to make the same requests for the kernel sources. Maybe with enough requests the gpl-violations group could take it on?
(K I am getting off topic here sorry anyone out there......)
I have attempted to build the 3.0.96 kernel but it did not boot.... back to hacking at the .config to see what I have missed (I need to move my build environment off this old p3 800 lol)

Categories

Resources