Kernel questions - Gen8, Gen9, Gen10 Q&A, Help & Troubleshooting

Is it possible to compile modules into it?
After some searching i've read reports on the joydev module being the only thing needed for gamepads or joysticks to work, could it be compiled into the android kernel? I've read about something similar being done to Maemo
EXT4 was added to the kernel, could the same thing be done with ntfs-3g?
How about additional drivers for webcams? I have no idea if this is remotely possible I'd like to have some answers on this?^^
I know I should and could find these answers myself but I thought it'd be easier to ask since I don't need the answer right now.

Tzbob said:
Is it possible to compile modules into it?
After some searching i've read reports on the joydev module being the only thing needed for gamepads or joysticks to work, could it be compiled into the android kernel? I've read about something similar being done to Maemo
EXT4 was added to the kernel, could the same thing be done with ntfs-3g?
How about additional drivers for webcams? I have no idea if this is remotely possible I'd like to have some answers on this?^^
Click to expand...
Click to collapse
You can rebuild your own kernel with your own options, either by "embedding" the module into the kernel, or just by building the corresponding .ko file that you will load when needed.
I did it to include ext4+btrfs+reiserfs+nfs+ntfs+cifs+...+/proc/config.gz support, you can do it by following chulri's post at http://forum.xda-developers.com/showthread.php?t=891056

Moved to general, as not rom development

Related

[Q] LIRC module for Gen8

So I've been trying to build a kernel module for LIRC using the Gen8 source, but I keep getting issues when trying to compile the module. Since the setup scripts from LIRC keep going to my host Ubuntu source rather then the Gen8 stuff.
Has anyone had experience cross compiling LIRC or any modules for that matter and can help me out or knows where to go? Google hasn't been good to me in this regard.
TIA
Moved to general as not andorid development
Mr. Clown said:
Moved to general as not andorid development
Click to expand...
Click to collapse
Erm, yeah it is... Developing a kernel module for android....
Have you read that howto? [HOWTO] Build custom kernel, libraries and applications on your own
If you have any issues compiling kernel stuff, feel free to PM me or post it in your topic here and I'll try to help you.
I'll take a look at your guide and try it out over the next day or so

[Q] Making a custom Kernel?

I've had a search and a look around but can't see anything specific enough to answer this.
I have read that the SGS2 uses the new BCM4330 chipset for it's WiFi-N support.
It looks to me that for existing kernels they are using either the existing kernel support or possibly the b43 driver.
I need to find out, and while I have compiled custom kernels in nix in the past, I have never done so in Android, so I'm a little out of my comfort zone here.
I want to compile a kernel where the WiFI driver will support monitor mode, ideally it would be the CM7 kernel with just this extra functionality added, however a number of the tools that I would use to identify the existing configuration do not seem to be available in the standard CM7 build (lspci being one).
I don't want to frack around too much without having read up first so could anyone point me at a good guide for creating my own Android Kernel, even better if the guide was specific to the CM7 version.
Lastly I mostly run a Fedora environment, however the bits I have read seem to suggest a number of tools are only available in a Ubuntu guise (heimdall springs to mind and while I'm sure it's possible to recreate it for Fedora I'm trying to reduce the number of dependencies I'll have to recreate as much as possible). Therefore can I get some advice regarding the least complicated way to generate an Android build environment in Linux.
Thanks
For kernel compilation on android, you can check the several repositories there are for the several kernels. Depending on each kernel/repository/user, you can find a predefined .config inside them, so you can get the basic configuration to compile the kernel, don't know if CM7 has it in its repository...
As for the enviorment, I haven't tried compiling a kernel, but I did compile some ROM on Gentoo Linux, so I suppose it could also be done in Fedora without many problems. The main thing about using Ubuntu is that is very extended, so they're using it as main Linux base, but that doesn't mean it can't be done in other linux distros. You can check CM7 wiki for building from source to install the required packages for your enviorment. In my case I cross checked the Ubuntu packages with Gentoo to install gentoo's version of that packages/tools to be able to compile without problems.
Also in the case of building kernels, you need a toolchain to be able to compile, but there are several webs/tutorials with info on how to use that.
EDIT: You have a complete tutorial for CM7 in their wiki with the needed packages for both Debian and Red Hat based distributions...
Very useful, thanks for the info.
Very useful info.
Hi,
I'm interested in compiling a custom kernel to support wifi monitor mode, but I read in a previous post that it can be a hardware limitation which makes it impossible to use monitor mode. Can anyone confirm that? Maybe a statement/answer from Broadcom?
I'm just asking it because I don't want to start playing with kernel compilation and driver hacking if it can't be done because of some missing code on the chipset or something.
Thanks.
kepten said:
Can anyone confirm that? Maybe a statement/answer from Broadcom?
Click to expand...
Click to collapse
I doubt Broadcom will answer that, but you can try to search the chipset info in Broadcom's web and see if its supported. Also you can check kernel modules if they can compile against that version.
AzureusPT said:
I doubt Broadcom will answer that, but you can try to search the chipset info in Broadcom's web and see if its supported. Also you can check kernel modules if they can compile against that version.
Click to expand...
Click to collapse
Well, Broadcom's website says nothing about monitor mode but I've found a driver (https:// github.com/cyanogen/galaxy-2636/blob/ics/drivers/net/wireless/bcm4330/src/include/wlioctl.h#L1153) which at least mentions it. This is for Galaxy Tab 10.1 which has the same chipset so maybe someone with a Tab 10.1 could verify if monitor mode works with that kernel/driver? ??

[Q] Kernel Compiling

Hello! I just recently got a brand new MyTouch4GSlide ($5 from t-mobile xD) Anyhow since the lack of development going on for this phone I decided to join in and do my part... My original plan was to create a simple CM7 Kernel with support for UV and OC + Smartass... I have successfully in the past week set up my ubuntu virtual machine, kernel source, kitchen (boot.img extract/compile), voltage table & have successfully compiled a custom working kernel for my device, but i just need a bit of help.... I have 3 specific questions wich hopefully someone will be able to answer so I may get better with developing and continue developing in the future...
1) Adding new frequencies to the kernel
-I have created my voltage table and have added it to the file acpuclock-8x60.c (Which is corresponding to my device) located in /arch/arm/mach-msm O have also disabled the performance lock in the .config file using the make menuconfig command but when I compile the kernel and flash it setcpu does not recognize the frequencies... Did I not edit the correct file? Am I missing a lock placed by HTC somewhere else?
2) Adding Smartass
-I have found 1 source for the smartass module but whenever I try to compile the module I get #define OFS_KALLSYMS_LOOKUP_NAME 0xc009684c // kallsyms_lookup_name any reason why this is? am I using the wrong source? is there an easier way?
3) WiFi Module
-Whenever I compile my kernel the WiFi does not turn on... Probably because I have not compiled a Wifi module -_- but how can I compile a WiFi module? do I use the same source as the kernel? how would I go about doing this? how do I pack it with the boot.img?
Thats all for now... I shall edit this if I have more questions... I shall constantly be checking this thread hoping for some responses... I am eager to get this working!
Thanks in advanced! ~GiGoO
P.S. If you want you may add me on Skype if you would like to help me with this xD (robster105)
gigoo25 said:
Hello! I just recently got a brand new MyTouch4GSlide ($5 from t-mobile xD) Anyhow since the lack of development going on for this phone I decided to join in and do my part... My original plan was to create a simple CM7 Kernel with support for UV and OC + Smartass... I have successfully in the past week set up my ubuntu virtual machine, kernel source, kitchen (boot.img extract/compile), voltage table & have successfully compiled a custom working kernel for my device, but i just need a bit of help.... I have 3 specific questions wich hopefully someone will be able to answer so I may get better with developing and continue developing in the future...
1) Adding new frequencies to the kernel
-I have created my voltage table and have added it to the file acpuclock-8x60.c (Which is corresponding to my device) located in /arch/arm/mach-msm O have also disabled the performance lock in the .config file using the make menuconfig command but when I compile the kernel and flash it setcpu does not recognize the frequencies... Did I not edit the correct file? Am I missing a lock placed by HTC somewhere else?
2) Adding Smartass
-I have found 1 source for the smartass module but whenever I try to compile the module I get #define OFS_KALLSYMS_LOOKUP_NAME 0xc009684c // kallsyms_lookup_name any reason why this is? am I using the wrong source? is there an easier way?
3) WiFi Module
-Whenever I compile my kernel the WiFi does not turn on... Probably because I have not compiled a Wifi module -_- but how can I compile a WiFi module? do I use the same source as the kernel? how would I go about doing this? how do I pack it with the boot.img?
Thats all for now... I shall edit this if I have more questions... I shall constantly be checking this thread hoping for some responses... I am eager to get this working!
Thanks in advanced! ~GiGoO
P.S. If you want you may add me on Skype if you would like to help me with this xD (robster105)
Click to expand...
Click to collapse
Hey Rob, I wish you the best of luck and don't give up!
The one thing I can say is when I was compiling my own kernels a while back and when I was trying to do the exact same thing and add different frequencies, if I remember correctly, there is a couple files that need to be changed, not just one, but don't quote me on that
I would also try getting help from other phone developers too. Post in the Q&A section of the phones, you might get more help that way.
Other then that good luck!
Questions or Problems Should Not Be Posted in the Development Forum
Please Post in the Correct Forums
Moving to Q&A

[Q] USB Ethernet adapter / Can't build MCS7830 kernel module

Hi everyone!
I have a rooted Galaxy S2 i9100 with ICS 4.0.3
Kernel version is 3.0.31-Siyah-s2-v5.0.1+
I just bought a USB-ethernet adapter, and I'm trying to make it work with my i9100.
The chipset on the adapter is a MCS7830, and I found the drivers for Linux kernel 3.x here:
( asix.com.tw / FrootAttach / driver / MCS783x_Linux_driver_v1.11.zip ) - sorry, I can't post links yet.
When I plug the adapter, the android recognizes it, but it doesn't generate an eth0 nor an usb0 connection on netcfg.
I've found on other threads that it could be a driver fault, and a possible solution would be to build these drivers as a kernel module. Is it possible? I'm trying to build a .ko module for it, but I still can't even handle the "hello_world.ko". I'd really appreciate and be thankful if someone could build a .ko for this driver.
Thank you in advance!
Any ideas?
Just to let you guys know, I just did it. I'll try to post a tutorial as soon as possible to help people that might have faced the same issues with similar dongles.
I recompiled the needed drivers as modules ("make modules") with the ARM compiler that comes with the Android NDK;
Set up the .config and Makefile from SiyahKernel 5.0.1+ with some values;
Pushed the modules to my phone and loaded manually the modules.
Siyah Kernel actually has many drivers (including other usb-ethernet chipsets)! Learning how to compile specific drivers as modules might be useful for many people.
nice to know that there is someone how found a solution. please post a detailed tutorial! I am desperately trying to get this work for 3 weeks now, without success. i ordered different usb-ethernet-adapters from amazon, i have just 5 days left to send them all back...
a tutorial would be very helpful! btw: does your solution only work with the siyah-kernel or with every kernel on a rooted phone?
thanx in advance, alex
mc.escher said:
Just to let you guys know, I just did it. I'll try to post a tutorial as soon as possible to help people that might have faced the same issues with similar dongles.
I recompiled the needed drivers as modules ("make modules") with the ARM compiler that comes with the Android NDK;
Set up the .config and Makefile from SiyahKernel 5.0.1+ with some values;
Pushed the modules to my phone and loaded manually the modules.
Siyah Kernel actually has many drivers (including other usb-ethernet chipsets)! Learning how to compile specific drivers as modules might be useful for many people.
Click to expand...
Click to collapse

Help: Understanding Basics of Building and Compiling?

Hi all,
In short i want to modify Android 4.2.2 on my MK802IIIS to allow me to use an external USB WIFI Adapter. The one i have uses a Ralink (MediaTek) RT5372 chipset.
I'm not a beginner, but by no means an expert. I have compiled firmware for my Linux based routers. But compiling Android, or parts of, seems much more complicated. I only want to add support for a USB adapter. Do i need to build the kernel from scratch, or can i create a module? Do i need to cross compile a module or can it be "made" in Ubunutu and just copied across?
I have searched for a RT5372.ko file online, finding references to RT5370, but i dont think it's the same.
I downloaded the driver from the Mediatek website and proceeded to attempt to create a .ko file by making it in Ubuntu but it only created a RT5372STA.dat file. Does this driver need to be cross compilied for android? Also how do i turn it in to a module that i can just load into my currently installed ROM?
I have been poking around for a while so i havent covered everhything i've tried. I'd really like to understand how building for Android works. If anyone can answer any of these questions for me, it'd help me imensely. Or if there is a resource covering these topics that i have yet to come across please point me at it. I know there are a lot of very detailed How-To's for compliling but i seem to get lost with the amount of detail.
Many thanks
More info regarding my setup:
Building in Ubuntu 14.04, 64bit.
The current ROM appears to have been built using the Linaro 4.6.2 toolchain, so u have downloaded that, currently stored in /home/wriggerz/RK3066/Toolchains
Also downloaded the RK3066 Kernel Source, stored in /home/wriggerz/RK3066/RK3066-Kernel
The RT5372 driver has been extracted to /home/wriggerz/RT5572NEW
I've been mashing bits of different guides and suggestions found on other forums together to try and frankenstien this KO module. From within the drivers folder i ran the two commands below. From what i've read this needs to be done to specify which "Toolchain" and "Compiler" to use.
Code:
export CROSS_COMPILE=~/home/wriggerz/rk3066/toolchains/arm-eabi-linaro-4.6.2/bin/arm-eabi-
export ARCH=arm
Then i ran the make command like below to try and have the driver built for the correct Toolchain with the correct Compiler:
Code:
make ARCH=arm CROSS_COMPILE=arm-eabi-linaro-4.6.2
However i get the following response:
Code:
make -C tools
make[1]: Entering directory `/home/wriggerz/RT5572NEW/tools'
gcc -g bin2h.c -o bin2h
make[1]: Leaving directory `/home/wriggerz/RT5572NEW/tools'
/home/wriggerz/RT5572NEW/tools/bin2h
cp -f os/linux/Makefile.6 /home/wriggerz/RT5572NEW/os/linux/Makefile
make -C /lib/modules/3.16.0-30-generic/build SUBDIRS=/home/wriggerz/RT5572NEW/os/linux modules
make[1]: Entering directory `/usr/src/linux-headers-3.16.0-30-generic'
Makefile:652: Cannot use CONFIG_CC_STACKPROTECTOR_REGULAR: -fstack-protector not supported by compiler
make[1]: arm-eabi-linaro-4.6.2-gcc: Command not found
CC [M] /home/wriggerz/RT5572NEW/os/linux/../../common/crypt_md5.o
/bin/sh: 1: arm-eabi-linaro-4.6.2-gcc: not found
make[2]: *** [/home/wriggerz/RT5572NEW/os/linux/../../common/crypt_md5.o] Error 127
make[1]: *** [_module_/home/wriggerz/RT5572NEW/os/linux] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-3.16.0-30-generic'
make: *** [LINUX] Error 2
Someone knowledgeable will hopefully look at the steps i have just taken to rip it to shreds...... :fingers-crossed:
If not, is there anyone with any ideas of where i'm going wrong?
I think i've put this in the wrong section....
If anyone has to go out of their way to move it they have my sincere apologies.
J Double You said:
I think i've put this in the wrong section....
If anyone has to go out of their way to move it they have my sincere apologies.
Click to expand...
Click to collapse
First of all, I would suggest to recompile the kernel and the entire source code (like when building CM), it is way better than insmodding modules every time, and you have less errors to solve. I'm currently writing a guide about building Cyanogenmod to support awus036h wireless adapter, maybe I can have a look for yours too, shouldn't be too hard. There are two or there good references around, however I'm trying to out all of them together in this new one I want to publish. Hope this will help you too.
Don't download a .KO from internet, it's not going to work. You would not only need to build for the specific device, but also for the specific kernel, which may vary from build to build, that's why I recommend to compile the whole kernel. Please consider to download a ROM's source code or your device kernel.
Ciuffy's SM-G900F CM 12.1 spirit hath marked this way. Thank if helped your soul.
Thanks for the helpful response Ciuffy.
Before i ask any more potetnially stupid questions i will do some research on that approach. I look forward to seeing your guide. For now i may be back for some direction.
Thanks again
I do like the ROM i'm on at the minute. NeoTV CR 2.0 (4.2.2), works really well, snappier than others i;ve tried and the benchmark results are pretty good too, but there are a couple of issues with it:
Busybox isnt installed and doesnt install.
Commands dont seem to work in terminal.
Now it doesnt really matter, as i wont be Insmodding the driver now, but it would be nice to have. How do i stay as cose to my current ROM as possible while re-compiling? Do i need to contact the ROM creator and ask them for the source? Should it be available on the web somewhere? Or can i "rip" it off the device? My main goal is to add driver support to the kernel from the drivers srouce files. But it would be nice to have busybox installed too. Was thinking i might re-comile the whole rom, but that be like trying to run before i can stand..... But, learning is amazing, and i learn best by doing!!
Main question: Whats the easiest way to re-compile my current kernel? Do i need source files from the ROM creator? I have asked but havent had a repsonse yet, but it's only been about 16 hours, not even that.
J Double You said:
I do like the ROM i'm on at the minute. NeoTV CR 2.0 (4.2.2), works really well, snappier than others i;ve tried and the benchmark results are pretty good too, but there are a couple of issues with it:
Busybox isnt installed and doesnt install.
Commands dont seem to work in terminal.
Now it doesnt really matter, as i wont be Insmodding the driver now, but it would be nice to have. How do i stay as cose to my current ROM as possible while re-compiling? Do i need to contact the ROM creator and ask them for the source? Should it be available on the web somewhere? Or can i "rip" it off the device? My main goal is to add driver support to the kernel from the drivers srouce files. But it would be nice to have busybox installed too. Was thinking i might re-comile the whole rom, but that be like trying to run before i can stand..... But, learning is amazing, and i learn best by doing!!
Main question: Whats the easiest way to re-compile my current kernel? Do i need source files from the ROM creator? I have asked but havent had a repsonse yet, but it's only been about 16 hours, not even that.
Click to expand...
Click to collapse
Definetely, you should find the kernel source code, I think you can find it on Github, I'll give a look at it. I honestly don't think you can reverse engineer the kernel and recompile it.
Edit: I can't seem to find it. It is also possibile that the source code was not released.
Ciuffy's SM-G900F CM 12.1 spirit hath marked this way. Thank if helped your soul.
Stupid Question: Is the SDK the same thing as the source?
If so i think i found what i need to build from scratch here: http://www.cnx-software.com/2013/08/20/rockchip-rk3066-android-4-2-2-hdmi-tv-stick-sdk-leaked/
If thats right, i need to find a way to add the driver i found to the source so it's included in the compilation.
Boom, think i found my base... And answered my previous question. SDK is not source.
http://freaktab.com/forum/tv-player...73-full-1080p-modded-kit-kat-4-4-2-rk3066-rom
The OP kindly links to the kernel source.
Apologies for spamming my own thread, i like to keep anyone watching up to date with progress so they dont waste their time replying to old stuff.
J Double You said:
Boom, think i found my base... And answered my previous question. SDK is not source.
http://freaktab.com/forum/tv-player...73-full-1080p-modded-kit-kat-4-4-2-rk3066-rom
The OP kindly links to the kernel source.
Apologies for spamming my own thread, i like to keep anyone watching up to date with progress so they dont waste their time replying to old stuff.
Click to expand...
Click to collapse
SDK stands for Software Development Kit, in other words the environment that lets you build applications and related for a specific platform.
So, you found the source you were looking for?
Ciuffy's SM-G900F CM 12.1 spirit hath marked this way. Thank if helped your soul.
Sure did, i also now know which compiler i need.... arm-linux-gnueabi-4.7.
Now to find out how to add the driver i have downloaded to the kernel.
From what i've read i need to "make" the driver, cross compiling in the process, then put some of the resulting files in situ within the kernel source. (along these lines: http://stackoverflow.com/questions/11710022/adding-new-driver-code-to-linux-source-code).
J Double You said:
Sure did, i also now know which compiler i need.... arm-linux-gnueabi-4.7.
Now to find out how to add the driver i have downloaded to the kernel.
From what i've read i need to "make" the driver, cross compiling in the process, then put some of the resulting files in situ within the kernel source. (along these lines: http://stackoverflow.com/questions/11710022/adding-new-driver-code-to-linux-source-code).
Click to expand...
Click to collapse
Excuse me, are you then going to compile the enitre kernel? Waiting for your answer, there should be an easier way to do this.
Ciuffy's SM-G900F CM 12.1 spirit hath marked this way. Thank if helped your soul.
I was going to, based on your suggestion to compile from scratch, but i have most likely mis-understood what it was you were getting at.
Also, i have downloaded a bunch of toolchains and i have arm-linux-androideabi-4.7, but is that the same as arm-linux-gnueabi-4.7
Again, i could be barking up the completely wrong tree. Which is a shame, as i thought i was actually getting somewhere..... hahaha!
As always, your continued input is greatly appreciated Ciuffy.
J Double You said:
As always, your continued input is greatly appreciated Ciuffy.
Click to expand...
Click to collapse
Yes, I was in fact suggesting you to build from scratch, thinking you could include modules for your adapter in the kernel configuration. However, I can't find what kernel module is exactly going to do it. I found rt2800usb, however I am not sure. You may try to include support for rt2800 and also build the kernel module from the driver source code, as explained in that link for example.
Ciuffy's SM-G900F CM 12.1 spirit hath marked this way. Thank if helped your soul.
Ciuffy said:
Yes, I was in fact suggesting you to build from scratch, thinking you could include modules for your adapter in the kernel configuration. However, I can't find what kernel module is exactly going to do it. I found rt2800usb, however I am not sure. You may try to include support for rt2800 and also build the kernel module from the driver source code, as explained in that link for example.
Ciuffy's SM-G900F CM 12.1 spirit hath marked this way. Thank if helped your soul.
Click to expand...
Click to collapse
Ah.... I have downloaded the Linux driver from the MediaTek websitefor the RT5372, but it needs "making". Would cross compiling the driver not give me the modules i need to load in to the kernel?
That link explains how to add the required files, but doesnt explain how they're created. I dont think....
J Double You said:
Ah.... I have downloaded the Linux driver from the MediaTek websitefor the RT5372, but it needs "making". Would cross compiling the driver not give me the modules i need to load in to the kernel?
That link explains how to add the required files, but doesnt explain how they're created. I dont think....
Click to expand...
Click to collapse
If by cross compiling you mean building the kernel module while also compiling the source code and then loading it in the running kernel, yes, as long as you downloaded the drivers compatible with the Linux kernel on your Android.
You can either use the instruction on that link on StackExchange, or follow the "How to build them?" section here:
http://forum.xda-developers.com/showthread.php?t=1455382
Ciuffy's SM-G900F CM 12.1 spirit hath marked this way. Thank if helped your soul.
Thanks Ciuffy.
Seems i've still got some stuff to get my head around. I'll re-read up and come back.
FAIL!!!
Tried flashing the unit with the ROM i was going to compile a kernel for. Looked to go well, but wouldn't boot past the boot splash screen. And after rebooting wouldnt boot at all. Obviously some fundamental incompatibility, or the fact that it cant handle the overclock....
Problem is i have previously broken the OTG port so i have no way to flash using ADB, not until i get a cable soldered in it's place.
Really just wanted to explain why i may be absent from this topic for a bit. I'm going to make some calls to see if any nearby electronics shops can do the job. Once done i'll be back.
J Double You said:
FAIL!!!
Tried flashing the unit with the ROM i was going to compile a kernel for. Looked to go well, but wouldn't boot past the boot splash screen. And after rebooting wouldnt boot at all. Obviously some fundamental incompatibility, or the fact that it cant handle the overclock....
Problem is i have previously broken the OTG port so i have no way to flash using ADB, not until i get a cable soldered in it's place.
Really just wanted to explain why i may be absent from this topic for a bit. I'm going to make some calls to see if any nearby electronics shops can do the job. Once done i'll be back.
Click to expand...
Click to collapse
In case you misunderstood: I just wanted to point out that once compiled the kernel modules along with the kernel, you don't keed to flash the kernel, only insmod the modules.
Hope you can solve the OTG problem, waiting for your response.
Ciuffy's SM-G900F CM 12.1 spirit hath marked this way. Thank if helped your soul.

Categories

Resources