Building Linux Modules with Parallels

While I am working on driver development for Linux kernel, I faced couple of problems which took some time and wanted to tell you my way of building modules. In this post, I used  parallels virtual machine on my Mac. 

First download a cool linux virtual appliance from Parallels Virtual Appliance.  
 


I recommend gentoo, it includes linux kernel headers so you  don’t have to download or configure anything before you build modules, everything is ready.

After you download and run it, check the ip with ifconfig.
In my example, It’s 192.168.2.3

 

ssh connection to gentoo
Now connect to gentoo Linux with ssh.

ssh root@192.168.2.3 
password 123

 

After that you can start  compiling your modules and drivers, I choose writing code in mac os x with my fav text editor (textmate) then secure copy to gentoo directory Example command:
scp username@192.168.2.2:/moduleOnMac.c  moduleOnGentoo.c

After I copied my module to Linux directory, (don’t forget to create your Makefile ) I built it with,

make -C /lib/modules/2.6.21-gentoo-r4/build M=`pwd` modules

Why should I do these steps rather than developing directly on linux appliance? 
It’s a choice, of course there are many ways of doing this operation,  but rather than opening linux text editors, terminals and other interfaces I use only one mac os x terminal and textmate to make everything  done. 

Overview
This post is just for working with linux modules comfortably on Mac.
I appreciate all new ideas, please offer new ways and post links.

If you enjoyed this post, make sure you subscribe to my RSS feed!

Post Metadata

Date
December 28th, 2008

Author
Guvener Gokce

Category


Leave a Reply