[Click] Adding Linux 2.6 kernel support for Click.

Francis Bogsanyi fbogsany at metabunny.com
Mon Sep 27 15:31:14 EDT 2004


Hi Kishore,

I did some preliminary work that I've been meaning to post to the list 
for several weeks now.  I'm busy with other things at the moment, but 
I've attached the relevant patches & comments I've sent to others here 
(see below).

Cheers,
Francis.

On 26-Sep-04, at 11:42 AM, Kishore Ramachandran wrote:

> Hi:
>
> I am interested in running Click on Linux kernel v2.6 and was wondering
> whether anyone is working on adding support for the same.
>
> I request inputs on what is involved so as to see whether it is 
> feasible
> for me to port Click.
>
> Thanks,
> Kishore


On 15-Sep-04, at 7:40 PM, Francis Bogsanyi wrote:

> I've attached a patch for Click 1.4.1 (original at 
> http://www.pdos.lcs.mit.edu/click/click-1.4.1.tar.gz) and another for 
> Linux 2.6.7 (original at 
> http://www.kernel.org/pub/linux/kernel/v2.6/linux-2.6.7.tar.bz2).  
> These represent the current state of my work.  More info below.
>
> Right now, I'm having problems fixing up the Makefile in 
> click/linuxmodule to build click as a kernel module in Linux 2.6.7.  
> I've attached a test module that demonstrates how to build a C++ 
> module for Linux 2.6.7.  This seems to work OK (it compiles, loads & 
> prints the appropriate messages).  I haven't been able to come up with 
> appropriate perversions of the Makefile to build click.  Specifically, 
> the VPATH seems to be ignored & I can't convince the Linux build 
> system to look in the right directories for stuff like string.cc (for 
> starters).
>
> Note that I scarfed the cxxprotect.h and cxxunprotect.h files from 
> Click & hacked the Makefile together from parts of 
> linux/scripts/Makefile.build, appropriately modified for C++.
>
> The process in Linux 2.6 goes something like this:
>
> create a Makefile with:
>
> objs-m += xxx.o yyy.o
> xxx-objs := xxx1.o xxx2.o
> yyy-objs := yyy1.o yyy2.o
>
> Then add an "all" target with a command: "$(MAKE) -C $(linuxdir) 
> M=$(shell pwd) modules"
>
> Thus, when make is called, make is called recursively in $linuxdir, 
> which eventually includes the original Makefile.  Then make picks up 
> the preceding declarations (objs-m, et al.) and uses a bunch of 
> predefined commands to make xxx1.o from xxx1.c, etc, then xxx.o from 
> xxx1.o and xxx2.o, then automagically builds the xxx.ko file from 
> xxx.o and an autogenerated file called xxx.mod.c.
>
> I've included a Makefile that's my initial attempt to fix these 
> problems.  The current situation is that the Linux Makefiles will only 
> build files in the local directory.  VPATH seems to be ignored and 
> files in other directories are assumed to have their own Makefiles.  
> So if you call "make" in the linuxmodule directory, it complains that 
> it can't find string.s (it should be picking up string.cc from another 
> directory in the click tree).  The Makefile is called 
> click-linuxmodule-Makefile and should be copied into the linuxmodule 
> directory and renamed to Makefile (after running ./configure).
>
> Sorry for the delay in getting this out.  Any insights (or preferably 
> a working makefile!) you can offer would be great!
>
> Thanks,
> Francis.
>


More information about the click mailing list