B. Hirawat, As a first step you must start writing the proper Makefile for your module. Pick any sample Hello World driver Makefile from web and build your test.ko. This is pretty much independent of Android and like writing a sample driver/module in linux.
Primarily you must ensure giving standard kernel path via KDIR against which you want this module to be built and later inserted. Later doing insmod of your test.ko and verifying via lsmod would finish the formality. You may verify your kernel prints via dmesg once your module has been successfully inserted .. Best Regards, Arun K. Singh www.crazydaks.com On Fri, Dec 24, 2010 at 1:17 PM, b_hirawat <[email protected]> wrote: > Hi, > > I am very new to Android programming.I am trying to add a module in > Android Froyo kerkel. Can anybody help me out in this,plaese let me > know which all file I need to change for this integration. > > For Example: I have a folder caled 'Test' which contail a 'C' file > test.c and a make file 'Makefile'. I need to inegrate this folder into > Android kernel folder. > > > Please let me know what all I need to write in my Makefile and how can > I check whether my module is working or note. > > Below is the code of my test file test.c.. > > #include <linux/module.h> > #include <linux/config.h> > #include <linux/init.h> > > static int __init mymodule_init(void) > { > printk ("My module worked!\n"); > return 0; > } > > static void __exit mymodule_exit(void) > { > printk ("Unloading my module.\n"); > return; > } > > module_init(mymodule_init); > module_exit(mymodule_exit); > > I was trying to get these printk statements in 'adb logcate'. But it's > not coming. Please help me out in this integration. > > Thanks in Advance.. > > Thanks, > > B. Hirawat > > -- > unsubscribe: > [email protected]<android-kernel%[email protected]> > website: http://groups.google.com/group/android-kernel -- unsubscribe: [email protected] website: http://groups.google.com/group/android-kernel
