[Asus  Eee Pad Transformer Prime] yousefs:
Explain to Kernel and Kernel Modules and how to build them

For everyone who didn't Understand Step 2, I Will explain and tell you how to do that, Please read it all to Understand:highfive::

What is Kernel?

A Kernel is Simply a Bridge Between Software and Hardware.

So The Drivers are Inside the Kernel itself?

For Short, Yes. In Linux Overall (Android, Ubuntu, etc.), Drivers are Included Inside the Kernel it self, Some say for Performance Improvements.

Your Phone's Android Kernel Include all the Drivers required for your phone to function, And for the Devices that Support USB-OTG there are a Plenty of Drivers Included, However, Drivers like the one's for the RTL8187 Most likely won't be included.

What are Kernel Modules?

Kernel Modules are Files that have *KO Extension That can be loaded Through insmod and Unloaded through rmmod Command-Line Commands, These files is to Extend the Functionality of the Kernel Without Touching/Editing it at all,It Just does some effect Until the Modules are Unloaded/Device Rebooted, Kernel Modules useful Either by Adding a Driver or by adding other things..[/B]

What are the Disadvantages of Kernel Modules?

Well, There's no Difference Expect you need to reload the Kernel Modules after a Reboot or Module Unload, Some Tutorials Show you how can you add a command to load these Modules after each boot up

So A Kernel Module is the Solution for adding a driver without modifying the kernel?

Yes, Kernel Modules is the Solution here, Each USB Device needs it's own Kernel Modules, so you can't Download a Module and Use it, You need to Compile yours.

What is the Requirements to build a Kernel Modules?

1.You need Linux Environment, Use either the Chrooted Linux On you phone, or, better use Ubuntu or any linux Distro on a Computer, Build the Module, and load it on the Chrooted Linux on your phone,

2.You need an Internet Connection in the Linux Environment.

3.You need the Driver Source code for your USB Device. Get them from the Manufacturer if he offer them, if he doesn't, You need to Look in the internet until you find one, if you were unable to find the Source code for you Device but found similar Devices Driver source code, see if the Other Device Driver is Compatible with yours usually a Single Driver work on many Devices, you need to look by your own way

4.You Also need some Programs to install in Order to be able to Compile the Kernel Module, Enter these Commands in a Terminal, Pressing Enter after each Line, and make sure you have the Internet Connection:

sudo apt-get install fakeroot
sudo apt-get install build-essential
sudo apt-get install dpkg-dev
sudo apt-get install linux-headers-$(uname -r)

For the most Important Part, make the Kernel Module?

1.Unpack the Kernel source code, if it's Extension is bz2 then use:

tar jxvf <package-name>

Where <package-name> is the Compressed File name, and make sure you put it in the Home Folder, if it's Extension is gz or tgz the Unpack it with:

tar zxvf <package-name>

2. Second, Find config.mk and Open it with gedit or whatever Text editor you like, at first, there is two lines about WPA Support, make sure they end with y rather than n, Save and close.

3.Third, and last, is to Compile the Kernel Module, Open Terminal and use cd command to get inside the folder that contains the Source code, and Simply Execute:

sudo make

And now you own the Kernel module, Now copy the Kernel Module to the root of your Internal Storage, Open up a Terminal and Type:

cd /mnt/sdcard
insmod <kernel-module-name>.ko

And make sure Internal Wi-Fi is OFF and now your Kernel Module works, Follow the Guys steps to get it working on Chrooted distro

Troubleshooting:

If you find a similar Device Driver Source Code and after Compiling it doesn't work plug the Device in, Open a Terminal and type:

sudo lsusb

and Find your Device in the Output and you should find Numbers for it Looks Like 0x148F,0x2070 or whatever, Write them down.

After Step 2 Follow These Steps:

Find usb_main_dev.c and Under #ifdef Section add the Following Line:

{USB_DEVICE(0x148F,0x2070)}, /* Your Device name, this is just a Comment. */

Where You should replace 0x148F,0x2070 with the String you just wrote down.

And then Continue Other Steps and it should work.

Please Click "Thanks" Button if i Helped you

Also, if you had any Problems and fixed them Just tell me so i can add them to Troubleshooting Section.