WITS a81e and Milestone Overclock - Android Software/Hacking General [Developers Only]

.I have been trying to get my tablet wits a81e uses a omap3 chipset to load a module. it uses Android 2.2 and the uname -r on the unit is 2.6.32 instead of 2.6.32.9 like the other modules droid_22 and milestone leak that are supplied. i am trying to compile the module and when it creates it it appears to be based on the overclock-mod.c file instead of the overclock.c file. Is there somthing special I should be doing?
I am using ubuntu and the google ndk. I compile and I end up with the .ko file which will load. There are no kern messages other than the kernel is tained. If I run strings overclock.ko I only can basically see the .modinfo from the file.
I have worked on this forever....Can you give any suggestions?
TY
Bruce

Related

Compiling kernel modules?

I'm trying to compile bnep as a module (needed for Bluetooth PAN), but I keep running into the following error when I try to load it:
insmod: init_module 'bnep.ko' failed (Exec format error)
Click to expand...
Click to collapse
I'm using kernel-android-msm-htc-2.6.25 and arm-eabi-4.2.1-gcc from the android source, so I'm not sure what's wrong. Anyone have any pointers?
rale00 said:
I'm trying to compile bnep as a module (needed for Bluetooth PAN), but I keep running into the following error when I try to load it:
I'm using kernel-android-msm-htc-2.6.25 and arm-eabi-4.2.1-gcc from the android source, so I'm not sure what's wrong. Anyone have any pointers?
Click to expand...
Click to collapse
hmm. good question. Unfortunately I don't have any advice right now :\. But it sounds interesting and now I want to see if I can build a minimal do-nothing kernel module and get it to load.
More to come
No joy here. I couldn't even figure out how to get it to compile a minimal "hello world" kernel module.
I am trying to make a driver too. But I am still not sure how to compile a module.
I was trying to make the whole source tree from my redhat machine, but no luck.
So instead, I plan to just compile my driver by using the toolchain from android source.
But I am sure how to make a makefile for this.
Could you share it?
Thanks,
Blues
The "exec format error" means that you compiled it for the wrong architecture.
For a quick reference to seeing what arch for which a binary is compiled, use the "file" command found on any Linux computer (but not present on the phone itself).
The file command is an extremely useful function for identifying files -- including files that are packaged together, such as the .img files in the updates (see the -k option).
Dynamically linked executable:
"ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), not stripped"
Statically linked executable:
"ELF 32-bit LSB executable, ARM, version 1 (SYSV), statically linked, stripped"
Object file:
"ELF 32-bit LSB relocatable, ARM, version 1 (SYSV), not stripped"
More specifically, if it doesn't say 32bit ARM, it will not work.
This may prove useful to some:
http://www.gentoo.org/proj/en/base/embedded/handbook/index.xml?part=1&chap=6
(And the compilers references in "CROSS_COMPILING" must be in your path -- see also the CC variable)
This is file on wlan.ko pulled directly from the phone - a known working module:
wlan.ko: ELF 32-bit LSB relocatable, ARM, version 1 (SYSV), not stripped
This is the module I compiled:
bnep.ko: ELF 32-bit LSB relocatable, ARM, version 1 (SYSV), not stripped
There must be something else at work here...
I am having same problem now. I am also using the toolchain from Android source...
I haven't gotten this deep into Android yet, but make sure the kernel source tree you're compiling against is the same version as the kernel on the phone. Modules compiled for a different kernel version will not load on another one (usually).
rale00 said:
This is file on wlan.ko pulled directly from the phone - a known working module:
wlan.ko: ELF 32-bit LSB relocatable, ARM, version 1 (SYSV), not stripped
This is the module I compiled:
bnep.ko: ELF 32-bit LSB relocatable, ARM, version 1 (SYSV), not stripped
There must be something else at work here...
Click to expand...
Click to collapse
Right after you try to insmod the module, type dmesg. Look through the last part of the output and see if there is anything helpful..
yeah, that's the problem.
The version magic number doesn't match.
May I know where to get the RC19 source tree? Thanks.
JesusFreke said:
Right after you try to insmod the module, type dmesg. Look through the last part of the output and see if there is anything helpful..
Click to expand...
Click to collapse
Thanks, that was the key. Apparently kernel/scripts/setlocalversion queries git for part of the version string. I ended up just changing it to print "-01843-gfea26b0", which is the string for RC30, and the module worked fine.
Any Help for Compiling and Debug Native Apps is here
http://honeypod.blogspot.com/2008/01/debug-native-application-for-android.html

[Q] Cross compiling C software for my android

Hi,
I've download the Android source with "repo", and it includes cross compiler toolchains for various architectures.
I want to build a package (for now, mtd-utils) for my android phone (a htc hero), but I'm having limited success understanding how to get this working. I was thinking there was something I could do, like change my $PATH and set up some other environment variables, that would use the tools from the toolchain instead of the system default ones, so that the binaries would be built for the phone instead of for my computer. But it certainly doesn't seem to be that easy...
I've reverted to attempting a "Hello world" program, but when I try to compile even that using the included toolchain tools, I run into trouble:
Code:
$ $HOME/src/mydroid/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-gcc -static -o hello hello.c
hello.c:1:19: error: stdio.h: No such file or directory
hello.c: In function 'main':
hello.c:5: warning: incompatible implicit declaration of built-in function 'printf'
so I tried a couple of other variants:
Code:
$ $HOME/src/mydroid/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-gcc -static -I $HOME/src/mydroid/bionic/libc/include -o hello hello.c
$ $HOME/src/mydroid/prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin/arm-eabi-gcc -static -I $HOME/src/mydroid/ndk/build/platforms/android-8/arch-x86/usr/include/ -o hello hello.c
but they both give (different) errors about what other include files are missing when referenced from somewhere.
Is there some "easy" way to android-ify a source tree, so that I can build sources using the cross compiler toolchains? Or should I fetch a different cross compiler toolchain to use, like benno did in his document from 2007? He uses a codesourcery toolchain and builds with that instead (as referenced in other articles here on the subject).
Would much appreciate any shared tips or experiences on how to accomplish this.
The tool chain is fine the problem is non of the include/lib are set up correctly to find the needed version of the includes. Remember the default includes under linux depend on glibc and android only supplies bionic.
Have a look here for more info on setting up bionic:
http://android-dls.com/wiki/index.php?title=Compiling_for_Android
Though if you get the full source for glibc (or precompiled arm binaries) you could compile a dependant program staticly (I think that's what busybox does)
Building for older versions of Android
I was actually able to compile a program manually today, specifically one of the programs in the mtd-utils package. After lots of jumping back and forth, I have found out that the 64 bit version of Ubuntu is what I needed, and also sun-java-1.6, contrary to almost all information I found out there. Then I was able to build AOSP, and then I was able to get "agcc" working, the wrapper that sets environment variables automatically as needed.
So I compiled the app, but it didn't work on my Android. Trying to run it in an adb shell gave approximately this error (from memory):
/bin/sh: ./program: No such file or directory
though the program was there. I didn't use strace, but concluded that this is because of a missing shared library. I have a very recent version of AOSP, while the phone is running Android 2.0 or something like that, so that's a plausable reason why this is happening.
I tried to rebuild the program using "agcc -static ...", but that doesn't work because I don't have the static version of libc after building AOSP, so it just dies with a linker error complaining that it can't find -lc.
So now I need to figure out how to build for old Android version using my checked out version of AOSP, or I need to figure out how to check out an old version of AOSP using repo.
Any tips would be much appreciated.

Need help installing Fedora 17 arm on Folio 100

Hi all,
there's some fantastic stuff on your forum and I would like to thank you all for work being done here!
Now, to my point. I need kernel source (or update.zip or zImage or boot.img or whatever ) that can support systemd so I can run Fedora 17 arm on my Toshiba Folio 100.
I tried using kernel 3.1 form DerArtem (the guy who has done amazing work with folio) but it has no framebuffer console. I tried adding support for this myself (following this guide: kernel.org/doc/Documentation/fb/fbcon.txt) but it didn't work. There's no surprise there as I am newbie when it comes to compiling kernel and changing its options.
I succeeded in starting Fedora 12 arm with older kernel using this guide (lguegan.free.fr/article.php3?id_article=29) which is inspired by you guys. It worked all right, but I didn't want to go deeper with it because F12 arm didn't have LibreOffice (or OpenOffice) in its repos and Fedora 17 did. Also, Fedora 17 has core support for multi-touch - apps do need to implement this feature though, but the funcionality is there.
And if there is someone who can help me, I can point you in a few directions:
Kernel source for 3.1: github.com/DerArtem/android_kernel_toshiba_betelgeuse
Fedora 17 arm rootfs: fr2.rpmfind.net/linux/fedora-secondary/releases/17/Images/
I am not sure which image you should use SFP or HFP as I don't know what kind of floating point Folio uses.
I am making boot.img with this command:
Code:
#mkbootimg --kernel arch/arm/boot/zImage --cmdline "[email protected] [email protected] vmalloc=192M video=tegrafb usbcore.old_scheme_first=1 tegrapart=recovery:122000:a00:800,linux:a0e00:1000:800,loader:300:400:800,mbr:700:200:800,system:900:20000:800,cache:20900:80000:800,misc:a0900:400:800,userdata:a1f00:80000:800 boardtype=PR root=/dev/mmcblk1p1 init=/sbin/init usb-storage.delay_use=0 rootdelay=10" -o boot.img --ramdisk boot.img-ramdisk.gz
maybe there is something wrong right there, but I don't know what half of these kernel parameters do
Also, maybe I am using wrong config file: arch/arm/configs/tegra_betelgeuse_android_defconfig, please do correct me.
Now that I think, I just need config file for this 3.1 kernel, so basicaly that's the help I need.
Thanks in advance and again thank you for all the good stuff here
Momcilo
Hmmm interesting project. Mabey some day you can tell us how you got Fedora 12 to work. I saw that DerArtem is working on a kernel over on his github page: https://github.com/DerArtem/, mabey it will work with your build?
Did you also read through the linux post in the general section? (link)
Hi friend!
Well, getting Fedora 12 arm to work was fairly easy. Just flashed with kernel from that page you posted and copied Fedora 12 rootfs to an mmc and it booted with console. X was not even installed in rootfs so before I tried to make it work I realized that there was no office for that version of Fedora arm so I dropped it.
Reason I can't use kernel from that page you posted is: it's too old. Fedora 17 uses systemd which requires newer kernel. That's why I came here, to try and contact DerArtem to see if his new kernel 3 for Folio could be configured to boot up other OSes, because I tried reconfiguring myself but got stuck.
Thanks for your interest in this
Its been a while since i build my own kernel, but it seems to me that you need to have a F17 build system and then build the kernel with the config for the Folio 100 (Fedora arm Kernel building)
I'm currently trying to get Archlinux working on my folio (Still i know).
I don't have problem building a kernel. It builds just fine, and I do get zImage and I can flash my Folio with it and it boots up. Only problem I have at the moment is that I can't seem to get framebuffer console working so I can debug booting Fedora from MMC.
and then build the kernel with the config for the Folio 100
Click to expand...
Click to collapse
Yeah, that's what I am missing
The config for the kernel is in:
arch/arm/configs/tegra_betelgeuse_android_defconfig
You will have to enable the framebuffer console as it is disabled it the kernel.
Hi DerArtem,
thanks for taking time to look at my work.
I think there was a mistake in my earlier efforts that I didn't realize, because now I did it from start and framebuffer works like a charm. I also added support for systemd (devtmpfs, cgroups, etc...) and now my Fedora 17 arm boots to console.
I am so happy right now I can't even try to debug why X doesn't work, but I'll get there.
If I make this work completely I will make a guide and post it here.
Thanks guys!
May I suggest u post your issues here, perhaps we can help you with these ?
thanks
P.S. Fedora is not really my distribution of choice(prefer debian or arch), but nevertheless make it working is a great advance
Thanks sader0!
I will need help with this.
Here are the logs:
dmesg - dm.txt
lsusb - lsusb.txt
/var/log/messages - messages.txt
Xorg -configure - Xorg.0.txt
lspci - doesn't produce anything.
And another thing, I didn't copy anything from kernel tree after compiling. I noticed during kernel build that something compiles as module but I had trouble finding any modules.
Is there anything I should copy to filesystem from kernel tree?
Best regards,
Momcilo.

[Q] Compiling kernel for Desire HD on ARM system (not cross compiled)

Hello. I am trying to compile and boot a Cyanogenmod-7 kernel for the HTC Desire HD. My first attempt was from a Debian chroot running on the phone. I managed to compile the kernel, but was unable to boot it. For testing, I unpacked boot.img, and repacked it with the original files and kernel, and was able to boot that... this confirmed the problem was the kernel, and nothing else. I believe I tried the Kali- and Cyanogenmod-msm7x30 sources.
Realizing that compiling on the phone was impractical, I decided to buy a Trim Slice embedded system (an A9 cpu, 1gb memory, 500gb storage). I also realize that Android kernels are cross compiled, but I preferred native architecture because there are some advantages (regression tests). This Trim Slice runs Ubuntu Natty, with GCC Linaro 4.5.2.
I can not cross compile from my workstation because it is OpenBSD, and does not do such things.
Now, more carefully, I downloaded the Cyangenmod 7 kernel sources, with the same git pull version as the shipped kernel. /proc/config.gz and cyanogen_msm7230_defconfig are identical. I made no changes to the config. I used 'make CROSS_COMPILE='. I compiled mkbootimg natively, and did flash_image on the phone, rebooted, and same thing... the HTC screen for infinity.
So then I built GNU Patch-2.7 statically linked (it's a balance between a complex program and a simple program), and copied it to the phone, and './patch --version' works fine. So my compiler is fine... it is compiling for the correct platform.
What could be going wrong with my kernels? Is my GCC version to blame?.. /proc/version says the phone's kernel was built with gcc-4.4.3.
Is there a boot loader that can turn my phone's usb port into a serial port/console so I can see what is going on?

[Q] Compat Wireless Drivers for infinity

Has anyone compiled the compat-wirelss package for the Infinity running the lastest JB update? I have been working with both the Ubuntu distro and cross compiling directives and the chrooted ubuntu on the tablet running backtrack for ARM. I ran in to the same problem on both with the ASUS android kernel compilation. First I had to modify an include file entry for ril.c because it had ../../ in the path and the compilers didnt seem to like that in either. Once fixed it compiles and I ran make_prepare. I am trying to get an external rtl8187L up and running within backtrack but just can't get the driver to compile.
It tells me that there is an error in usb.h 'THIS_MODULE' is undeclared and compiling fails.
Anyone have any insight or tips? Has anyone successfully compiled compat-wireless for their tablet?
Thanks!
And yes, I have searched my butt off for days before asking.
To add to this I know the build environment and kernel sources are good because I bought EDS from sovworks and wanted to mount truecrypt containers with it. I got the kernel module source from them and compiled it just fine and am using it on my tablet now.
I'm trying to get my alfa awus036h working for my tf700t and need help compiling the kernel with the compat wireless drivers, I try using the modules loader app but no luck, when I'm in chroot and try insmoding the .ko files it says unknown symbol in rtl8187.ko and if I try to install the compat wireless with make and make install it has trouble locating the kernel source 3.1.10, any tips on preparing or installing the kernel source from asus so that I can use it in my backtrack 5 chroot for the compat wireless package? Thankyou

Categories

Resources