Is there a libnfc android loadable kernel module? - android

Does someone have the source for Android loadable kernel module for libnfc?
If not, can someone tell me how it can be done?
As final option, if you have it build already, can you share its download URL?
On a side lining question, i read that linux kernel 3.1 actually has NFC support in it. Does that mean if kernel 3.1 was ported to android then it would have inbuilt support? If so, do you know anyone who has a kernel 3.1 version for android?

Linux kernel 3.3 has merged the Android kernel features, and therefore now u have Android kernel 3.3 potentially to come out very soon. NFC supports is in the drivers/nfc (kernel source) directory, take a look at the files that. Another resource found is this: http://appelmelk.wordpress.com/2011/02/17/porting-libnfc-to-android/ and another document: https://docs.google.com/open?id=160clTJ-sSgHiNKd-IsFHGzZY8M9HQudYqHnp0mD09NBTPfZmm9mP_NEMV3E3 (not written by me).

Related

Samsung Open Source for Android, its usage?

I downloaded android device open source from Samsung OSRC.
It was composed with Platform.tar.gz and Kernel.tar.gz
It seems to do with building AOSP, found mk files.
I'm curious whether it can be used(directly or indirectly) to build newer android version for device and whether I have to build new kernel based on this files.
Thank you.
If you want to build for a newer Android version, you do not need to build another kernel. Just use the kernel provided by Samsung for your device (or the prebuilt kernel from your phone).
When porting a device to a newer Android version you need to adjust the init configuration (init.rc files from your product configuration located in device/<vendor>/<your_device>), but not the kernel specific parts of your init.rc files.
You also need to add the hardware specific vendor binaries to your resulting flash image. Therefore you can extract these libraries from your device. Most of them are located in /system/vendor/lib, but there could be also some libraries in /system/lib and all subdirectories.
It is also possible that some vendor binaries does not work within another software stack. Possible reasons are incompatible HAL interfaces and incompatible libraries. The solution for these cases can be very different and should be evaluated individually.
If you are facing such issues you can have a look at the CyanogenMod sources for a hint. There you can find lots of ports. Best place to look is the product configuration of the particular device. You can also look into another of my answers regarding this topic.

how to check whether the kernel is for android or linux?

I have the source code of a kernel. but i don't know whether the kernel is android kernel or Linux kernel. I have searched about it on google but i haven't found any proper answer. As i know ,android kernel is Linux kernel and some patches applied on it. so i think we can identify the kernel is for Linux or android.
1.Can i know this by seeing the source code, or by running any command or by any other method?
2.if it is android kernel, whether will it able to mount the Ubuntu file system?
A simple method to check if a kernel is for android.
If there is a file named "android.c" in "drivers/usb/gadget" folder, the kernel seems to be a android kernel, otherwise, it is not for android.
Though not very accurate, but very simple
Look for AndroidKernel.mk in the kernel source root, if it's an Android kernel, it should be there.
The Ubuntu file system is ext4 by default. I'm pretty sure all default kernel configurations include support for this filesystem. What is the motivation behind this?
BTW the presence of binder does NOT mean it is an Android kernel. The binder exists in the staging directory for all Linux kernels

SCTP protocol support in android

How can I use SCTP protocol in Android?
I'm already aware that that Android systems don't support SCTP by default, however it's may be possible to enable it by inserting SCTP kernel module, or rebuilding the kernel with SCTP enabled in modules configuration.
I need some insight on this issue. Is it possible? How to make android support the protocol? How to build kernel module and insert it correctly? If we could succeed in making the system to support it, how we can use the protocol? Does the Java API on android support SCTP?
Going about it with a module is the right way. To answer your questions:
SCTP is already provided as a kernel module in the Linux source tree - "CONFIG_IP_SCTP=m" would enable that module. And you can change that to a "y" to hard link, though that is probably unfeasible, since you'd have to rebuild the entire kernel for that.
The module would have to still be built per kernel version. So basically per vendor, you'd need to get their kernel sources (doable), and then compile your module against it.
To use: In User mode - would create the socket by calling s = socket (AF_INET[6], SOCK_STREAM, IPPROTO_SCTP); From that point, socket APIs work exactly the same, with a few exceptions (namely setsockopt, which is particular for the protocol type).
From Java - does in fact support the protocol in its latest incarnations (JDK7 as of milestone 3), but that Java supports it doesn't mean that Dalvik (the "java vm" of Android) does. Though Android does have SCTP support "in the ready", it's not yet in Dalvik (at least not in 4.2). You could create a Java class, though, as in a package, that would wrap a native library with SCTP calls. It's a bit trickier in Android because of the NET permissions, but still manageable (from experience).

Android Kernel modifying

I'm a Android application developer. For some reasons, I should change the Android kernel a bit. But I don't know anything about kernel. I will be appreciated if someone introduce me a website who explain android kernel modules and other info about it.
In the standard Android open source distribution the kernel is distributed as a pre-built binary in the mydroid/prebuilt/android-arm/kernel folder and the source code is not included. The kernel source was removed from the default manifest for two reasons as I take it. One is that it takes a lot of bandwith and diskspace for a platform component that most people will not work with much. The other reason is that since the kernel is built with the kernel build system and not as part of the aosp build system it makes sense to keep it separated. The common branch for the kernel is the one used by the emulator. There are also branches for experimental, msm (Qualcomm platforms) and Omap (TI platform) and maybe some more. If you want to use the Android kernel with hardware these may be more interesting to you.
Get the Android kernel either by adding it to your repo manifest or manually by running:
git clone git://android.git.kernel.org/kernel/common.git
The kernel built this way should end up in the arch/arm/boot folder of your kernel tree (where you put the code from git clone)
Note that I have used the default paths in the above description, you need to change them to what applies to your setup. It has been a some time since last time I tested this but I think it should work.
Go through the following sites which will also give u some ideas.
Android Porting, Android Platform, Android-Pdk,
Android porting in real target, Build-compile-linux-kernel-android
I guess that since you are talking about kernel programming you are also looking for ways to hook up new hardware with the platform and expose that functionality using your framework extensions to the applications. Hardware is basically added as a standard Linux driver so getting it to work under Linux is a good first step. How to hook it into the Android framework after that depends on what type of hardware it is. You could either use a native process to control it (compare the camera service or radio daemon in the current platform) or just spawn a thread in the application that uses your framework extension. For hardware that does not require that much attention plugging it in using an Android HAL library could also be an option

Where to find Android patches?

I have vanilla linux kernel version 2.6.27. I want to apply android specific patches and convert it to android linux kernel 2.6.27. Where can a user find the patches to convert a normal vanilla kernel into android kernel?
The Android git repos might have what you want here: https://android.googlesource.com/
Alternatively, I advise you check http://developer.android.com and look at the SDK for clues. Does this help?

Categories

Resources