This is Android Module Kernel Driver info is for the Photon 4g, but the info could easily be modded to fit your individual needs
1) Format an sdcard to ext3
2) copy the phones kernel stuff to sdcard
see:[Guide] Quick start compiling guides-cm9-kernels - xda-developers
pre-setup
Okay first of all you need to complete the above tutorial up to the getting source. so you wont have to do the building portion.
3)get an Android Ubuntu .img and install it to your android (as we will be building kernels on modules on the phone for the phone)
If you got Ubuntu installed and it can see your ext3 sdcard your good to go!
Note: one portion of the ubuntu.sh script has a mount -t ext2 CHANGE THIS TO EXT3
for the devpts mounting...
AND AFTER UBUNTU IS INSTALLED change the DEPMOD portion of the build script (FOR EACH DEPMOD)
DEPMOD=out/host/linux-x86/bin/depmod
to whatever file its under with Ubuntu
i think if memory serves correctly its
/etc/sbin/depmod
apt-get upgrade
apt-get install all these:
git-core gnupg sun-java6-jdk flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev
from:Building Kernel from source - CyanogenMod Wiki
If java complains about not found keep going as the phone has java and javac installed with ubuntu
once the kernel is built (watch your output directory as /external_sd because of ubuntu) and modules built we can compile a quick hello world like this
ANDMOD.C
Makefile
run make and check the symbols
root@localhost:/external_sd# make
make -C /external_sd/Photon/kernel/tegra-temp M=/external_sd modules
make[1]: Entering directory `/external_sd/Photon/kernel/tegra-temp' make -C /external_sd/Photon O=/external_sd/Photon/kernel/tegra-temp/. modules
Building modules, stage 2.
MODPOST 1 modules
make[1]: Leaving directory `/external_sd/Photon/kernel/tegra-temp'
root@localhost:/external_sd# strings andmod.ko
<1> 999999
<1> 1111
depends=
vermagic=2.6.32.9 SMP preempt mod_unload modversions ARMv7
~module_layout
printk
andmod
rU(hr
root@localhost:/external_sd#insmod andmod.ko
4060.939072] nvmap_release: pid=19329, org_pid=19329
[ 4063.812310] 1111
rmmod andmod.ko
[ 4111.178690] nvmap_release: pid=19583, org_pid=19583
[ 4115.682776] 999999
sorry if this tutorial sucks
1) Format an sdcard to ext3
2) copy the phones kernel stuff to sdcard
see:[Guide] Quick start compiling guides-cm9-kernels - xda-developers
pre-setup
Okay first of all you need to complete the above tutorial up to the getting source. so you wont have to do the building portion.
3)get an Android Ubuntu .img and install it to your android (as we will be building kernels on modules on the phone for the phone)
If you got Ubuntu installed and it can see your ext3 sdcard your good to go!
Note: one portion of the ubuntu.sh script has a mount -t ext2 CHANGE THIS TO EXT3
for the devpts mounting...
AND AFTER UBUNTU IS INSTALLED change the DEPMOD portion of the build script (FOR EACH DEPMOD)
DEPMOD=out/host/linux-x86/bin/depmod
to whatever file its under with Ubuntu
i think if memory serves correctly its
/etc/sbin/depmod
apt-get upgrade
apt-get install all these:
git-core gnupg sun-java6-jdk flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev
from:Building Kernel from source - CyanogenMod Wiki
If java complains about not found keep going as the phone has java and javac installed with ubuntu
once the kernel is built (watch your output directory as /external_sd because of ubuntu) and modules built we can compile a quick hello world like this
ANDMOD.C
Code:
#include <linux/module.h>
#include <linux/kernel.h>
int init_module(void)
{
printk("<1> 1111");
return 0;
}
void cleanup_module(void)
{
printk("<1> 999999");
}
Code:
KERNELDIR := /external_sd/Photon/kernel/tegra-temp
obj-m := andmod.o
all:; make -C $(KERNELDIR) M=$(PWD) modules
clean: make -C $(KERNELDIR) M=$(PWD) clean
root@localhost:/external_sd# make
make -C /external_sd/Photon/kernel/tegra-temp M=/external_sd modules
make[1]: Entering directory `/external_sd/Photon/kernel/tegra-temp' make -C /external_sd/Photon O=/external_sd/Photon/kernel/tegra-temp/. modules
Building modules, stage 2.
MODPOST 1 modules
make[1]: Leaving directory `/external_sd/Photon/kernel/tegra-temp'
root@localhost:/external_sd# strings andmod.ko
<1> 999999
<1> 1111
depends=
vermagic=2.6.32.9 SMP preempt mod_unload modversions ARMv7
~module_layout
printk
andmod
rU(hr
root@localhost:/external_sd#insmod andmod.ko
4060.939072] nvmap_release: pid=19329, org_pid=19329
[ 4063.812310] 1111
rmmod andmod.ko
[ 4111.178690] nvmap_release: pid=19583, org_pid=19583
[ 4115.682776] 999999
sorry if this tutorial sucks