[Q] Add driver to kernel - Miscellaneous Android Development

Hi,
I'm building a custom rom and everything works great except one driver!
I made a "make menuconfig" in kernel and the driver is not listed under device drivers. How can I add the driver?
I downloaded the Linux driver and successfully made .ko modules. Should I add the .ko module to kernel or the files "as is"?
After some hours of google this problem I found something about "linux-headers packages" insted of kompiling kernel.
"Reasons for NOT compiling a custom kernel - You merely need to compile a special driver. For this, you only need to install the linux-headers packages" - How?
Please help

Related

CifsManager works on SGS Galaxy 3 (CIFS module compiled successfull for Android 2.1)

What is CIFS module ?
It is needed to mount SAMBA/CIFS filesystems (windows directories share over network)
Requirements:
- Naos or Teos phone ROOTED
- Android 2.1 (Eclair)
- CifsManager (with root access, available on market)
- Cifs module compiled successfull (cifs.ko, you can download it below)
Follow these steps:
1. Put cifs.ko on your phone on your sdcard (or better on "/lib/modules")
2. Open CifsManager.
3. Go to "Settings..." then tick "Load via insmod", configure "Path to cifs.ko" to where you put cifs.ko file on your phone and close "Settings..."
4. Finally go to "Add New Share..." and enter your information.
Note: Share Path -> Carefull to put an IP not a dns name (invalid argument error) and it is case sensitive.
Now you can browse your share docs with an explorer app.
Very useful to play video, music without download the file (seeking works).
Removed : Module compiled for kernel 2.6.32 (Froyo)... I am workin on it.
psyckotic said:
- Naos or Teos phone ROOTED
Click to expand...
Click to collapse
What does that mean?
Nice... How have you build the module ?
psyckotic said:
What is CIFS module ?
It is needed to mount SAMBA/CIFS filesystems (windows directories share over network)
Requirements:
- Naos or Teos phone ROOTED
- Tested only on firmware [I5800XXJH1]
- CifsManager (with root access, available on market)
- Cifs module compiled successfull (cifs.ko, you can download it below)
Follow these steps:
1. Put cifs.ko on your phone on your sdcard (or better on "/lib/modules")
2. Open CifsManager.
3. Go to "Settings..." then tick "Load via insmod", configure "Path to cifs.ko" to where you put cifs.ko file on your phone and close "Settings..."
4. Finally go to "Add New Share..." and enter your information.
Note: Share Path -> Carefull to put an IP not a dns name (invalid argument error) and it is case sensitive.
Now you can browse your share docs with an explorer app.
Very useful to play video, music without download the file (seeking works).
Click to expand...
Click to collapse
plz provide detail instruction in comp and phone
I will create a new thread to explain that.
I am workin on optimize that module and try to compile other modules.
I have test the module on a Naos phone (GT-5801) with firmware [I5800XXJH1] with root access.
I don't want to test other firmware.
But i think it works with all firmware with kernel 2.6.29 (without extraversion added).
Also works with XXJK1 (Kernel 2.6.29 #2).
For all those asking what this is all about: just have a look into the description of CIFSManager.
psyckotic said:
I will create a new thread to explain that.
I am workin on optimize that module and try to compile other modules.
I have test the module on a Naos phone (GT-5801) with firmware [I5800XXJH1] with root access.
I don't want to test other firmware.
But i think it works with all firmware with kernel 2.6.29 (without extraversion added).
Click to expand...
Click to collapse
Mh.. I think there might be a way to boot a Froyo firmware with 2.6.29 kernel no ? Since the SDK emulator use a 2.6.29 kernel..
psyckotic said:
I will create a new thread to explain that.
I am workin on optimize that module and try to compile other modules.
I have test the module on a Naos phone (GT-5801) with firmware [I5800XXJH1] with root access.
I don't want to test other firmware.
But i think it works with all firmware with kernel 2.6.29 (without extraversion added).
Click to expand...
Click to collapse
hey willing to try on froyo but need tute for that cas cant get a thing do we need usb or wifi will work plz give a detailed tutorial
I think it is possible to compile it for kernel 2.6.32 because it depends only from kernel source and arch-type cpu (armv6l for sgs galaxy 3)
psyckotic said:
I think it is possible to compile it for kernel 2.6.32 because it depends only from kernel source and arch-type cpu (armv6l for sgs galaxy 3)
Click to expand...
Click to collapse
If you compile i am willing to test...
psyckotic said:
I think it is possible to compile it for kernel 2.6.32 because it depends only from kernel source and arch-type cpu (armv6l for sgs galaxy 3)
Click to expand...
Click to collapse
AFAIK Samsung didn't publish (yet) the kernel sources which belong to the leaked firmwares (you cannot use a stock kernel as it is a derived (patched) version).
dude we need a guide for this
psyckotic said:
What is CIFS module ?
It is needed to mount SAMBA/CIFS filesystems (windows directories share over network)
Requirements:
- Naos or Teos phone ROOTED
- Tested only on firmware [I5800XXJH1]
- CifsManager (with root access, available on market)
- Cifs module compiled successfull (cifs.ko, you can download it below)
Follow these steps:
1. Put cifs.ko on your phone on your sdcard (or better on "/lib/modules")
2. Open CifsManager.
3. Go to "Settings..." then tick "Load via insmod", configure "Path to cifs.ko" to where you put cifs.ko file on your phone and close "Settings..."
4. Finally go to "Add New Share..." and enter your information.
Note: Share Path -> Carefull to put an IP not a dns name (invalid argument error) and it is case sensitive.
Now you can browse your share docs with an explorer app.
Very useful to play video, music without download the file (seeking works).
UPDATE: Module stripped: Size 270ko instead of 3Mo
Click to expand...
Click to collapse
divinesahil said:
dude we need a guide for this
Click to expand...
Click to collapse
indeed! This would be nice! As i found out by now you need to download the cross compiler and kernel sources from samsung open source:
opensource.samsung.com and search for i5800!
let's hope that they publish the sources for 2.6.32 soon!
mizch said:
AFAIK Samsung didn't publish (yet) the kernel sources which belong to the leaked firmwares (you cannot use a stock kernel as it is a derived (patched) version).
Click to expand...
Click to collapse
I don't their sources for this module.
This module works in software mode not in hardware.
I only need to know the cpu used in the phone...
I compiled it with the original kernel sources.
dabubu said:
indeed! This would be nice! As i found out by now you need to download the cross compiler and kernel sources from samsung open source:
opensource.samsung.com and search for i5800!
let's hope that they publish the sources for 2.6.32 soon!
Click to expand...
Click to collapse
Let's try the module compiled for 2.6.32 kernel (Froyo)
PS: How can i change the thread title (pm me)
got pm... ;-)
do you compile against aosp sources or where you got 2.2 kernel sources from?
FadeFx said:
got pm... ;-)
do you compile against aosp sources or where you got 2.2 kernel sources from?
Click to expand...
Click to collapse
Like i said before i don't need all the kernel sources for this module. I only need cpu information because there aren't many differences between kernel 2.6.29 and 2.6.32
But it needs to be tested... i don't try it on froyo.
Google has modified the Linux kernel in some regions and in not necessarily compatible ways, e.g. in terms of power saving techniques. So a stock kernel's module may work, but it is not guaranteed in all situations. However, I see no adverse effects from your cifs.ko.
But as long as Samsung sources are available (as they are for Eclair on opensource.samsung.com), I would always prefer their kernel sources. They come with a compiler and all the needed tools which guarantee full binary compatibility.
On the other side -- your module is working, so it's probably unnecessary to bother. Thank you for your time to build a module I now use on a daily basis to mount my Linux/Samba home server.
I'm getting a "no such device" error with froyo! But it never worked for me so i don't know if it is the module or my fault somewhere else.
"mount: Invalid Agrument" error. Pls help!!!!
- My phone firmware DDJG6 kernel 2.6.29 #2
- rooted
- copied cifs.ko to /sdcard/cifs/cifs.ko (change to insmod and edit path to /sdcard/cifs/cifs.ko) as well. My cifs manager version: 1.4.1 by F3d0r @ XDA 2010
@ my PC ip 192.168.0.226 (windows 7) share full read/write (everyone) folder name: test and this folder only content 01 mp3 file, so my share path must be:
192.168.0.226/test
mount point: /sdcard/cifs/test (cifsmanager automatically generate folders)
save => mount => error "mount: Invalid agrument"
Pls help.
TIA
P/S: using es file explorer i still can browse inside 192.168.0.226 but offcourse audio and video must be download to the phone NO direct playing!!!!! CIFS is the only and the best solution.

[CM 10.2] linux headers for building a kernel module?

I'm trying to compile a kernel module for Cyanogenmod 10.2.1 on a Nexus 7 tablet (tilapia). I'm using for this task an ARM virtual machine with Debian installed on it.
To compile the module I need the CM linux headers, but I can't find where to get them. Can you please link me the source repo?
PS: I want to compile a driver for a usb to lan adapter:
http://www.asix.com.tw/download.php?sub=driverdetail&PItemID=105
http://www.lindy-usa.com/usb-20-fast-ethernet-adapter-usb-micro-b-42948.html
Lucas Malor said:
I'm trying to compile a kernel module for Cyanogenmod 10.2.1 on a Nexus 7 tablet (tilapia). I'm using for this task an ARM virtual machine with Debian installed on it.
To compile the module I need the CM linux headers, but I can't find where to get them. Can you please link me the source repo?
PS: I want to compile a driver for a usb to lan adapter:
http://www.asix.com.tw/download.php?sub=driverdetail&PItemID=105
http://www.lindy-usa.com/usb-20-fast-ethernet-adapter-usb-micro-b-42948.html
Click to expand...
Click to collapse
You don't need "cm linux" headers. There is no such thing. What you need is to compile from source the kernel you are using....which is some 3.1.10 kernel. Then you need to have the "3.1.10 kernel headers" installed. Finally you cross compile the USB to Lan driver against the sources of the kernel you compiled. If the compiled kernel is there....then the cross compiler must be properly linked to the source...and it will find the header files it needs and warn you of missing dependencies. It could be that you'll need to enable some things in the kernel build in order to have all the needed support for your driver.

List of Touchpanel driver name needed

I have android device with mediatek Soc, I don't have kernel source code it so I have compiled kernel for other MTK6575 device and Managed to get run on my device,I have done following modification to run kernel from other device to my device
1) Fixed partition table issue
2)Fixed LCM driver
3)Fixed keypad driver
Now I need to enable touchpanel driver ,I have also compiled set of touchpanel driver from kernel source but none of worked for me.
So can you give me list of touchpanel drivers used in MTK6575 soc?
I don't have device specification so I need to do it by trial and run method, I have check touchpanel driver name in original running kernel but
didn't find any usefull information
Please help.

[Q] Installing USB Ethernet Adapter drivers

I recently got an ASIX AX88179 USB 3.0 to Gigabit Ethernet adapter for my Android device running CyanogenMod based on Android 5.1.1 and the 3.4.* kernel.
The drivers for the device are provided as source code and are available:
http://www.asix.com.tw/FrootAttach/driver/AX88179_178A_LINUX_DRIVER_v1.14.2_SOURCE.tar.gz
ASIX represents that the drivers are "For Android 1.x/2.x/3.x/4.x/5.x, Linux kernel 2.6.25 and later".
I attempted to compile the drivers using the CyanogenMod-included Terminal emulator App, but could not get anything to compile. It seemed that the "make" command or tool is not recognized.
I found a note in the drivers source readme file:
Code:
Prepare to build the driver, you need the Linux kernel sources installed on the
build machine, and make sure that the version of the running kernel must match
the installed kernel sources.
I found kernel sources on https://www.kernel.org/ . How do I make use of the kernel sources?
The version 3.4.* kernel is frequently updated. Should I be recompiling the driver with new, updated kernel sources every time a new kernel version is installed?
Must the drivers be compiled on the system they are to be used on?
Is there a better way to handle driver preparations or acquisitions?

Matching a kernel's config for compatible kernel modules

I have:
Downloaded the exact kernel version running on my device from an AOSP mirror (4.9.170) (https://github.com/aosp-mirror/kernel_common.git)
Downloaded the exact compiler used to compile the kernel from my device:
Ran `cat /proc/version`, which returns "Linaro GCC 5.3-2016.05", which I downloaded from https://releases.linaro.org/components/toolchain/binaries/5.3-2016.05/aarch64-linux-gnu/
Took the kernel configuration from `/proc/config.gz`, copied it to the kernel source directory `kernel_common` as `.config`
Ran `make ARCH=arm64 CROSS_COMPILE=xxx oldconfig`
What I'm seeing:
First, the downloaded kernel source for 4.9.170 seems to think that my `config` is incomplete, since it will prompt me to answer ~15 extra configuration questions.
Second, this old Linaro compiled doesn't appear to support `-fstack-protector-strong` despite it being explicitly enabled in the `/proc/config.gz` file. So I end up disabling it with `./scripts/config --disable CONFIG_CC_STACKPROTECTOR_STRONG`
Finally, after successfully compiling, I take `net/ipv4/tcp_westwood.ko`, just as a test module, and try to load it on my Android device, and it fails:
`insmod: failed to load tcp_westwood_5.ko: Exec format error`
And in dmesg output: `tcp_westwood: disagrees about version of symbol module_layout`
My questions:
Can I assume that the `/proc/config.gz` file is not the actual file used to compile the running kernel, considering it doesn't completely configure the 4.9.170 kernel?
Am I on the right path to getting a kernel module that my kernel will load?
Background information:
I'm hoping this isn't very relevant, but just to head off some questions
This is a T95 Android TV device running what appears to be, to this newbie's eyes, a very Frankenstein'd Android 10 install (See https://www.cnx-software.com/2020/0...-comes-with-mali-g31-gpu-supports-android-10/)
I can't find any official - or unofficial - source for this device, which is why I'm going to all the trouble above.
I really appreciate any help, thank you!

Categories

Resources