Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++

modules again!

Altera_Forum
Honored Contributor II
1,268 Views

Ok, having spent a while getting everything in order and getting a makefile that compiles a module, I get to the stage of insmodding it. 

 

I insmod by module (hello world, init_module & cleanup_module) and I'm greeted by "no module information found", wrong format. 

 

I then dig around on the web and find that compiling a module under 2.6 is completely different to 2.4 and I can't figure out how you do it - seems a big of a backward step to me what they've done. I think things are complicated here by the kernel source being in 2 different places. 

 

Does anybody have a 2.6 hello world module that compiles under uClinux for Nios II?  

 

Adrian
0 Kudos
1 Reply
Altera_Forum
Honored Contributor II
606 Views

It's becoming a bit of a habit me answering my own questions, but for anybody who's interested in building modules, here's what I did to do it. 

 

Firstly, the eclipse plugin for the kernel has a "vanilla" directory, when you build your own kernel a seperate source tree is build which contains the files specific for what you want (in the workspaces folder), this is how you'd want it to work. 

 

This causes a problem (as far as I can see) when trying to build 2.6 modules, because the make command for modules expects the kernel to be in one folder.  

 

My "solution" for this is to copy the vanilla source to a temporary folder, and then copy the generated source over the top. This seems a bit of a "kludge", I'm sure there's probably a better way to do it, but I can't see it and this works. 

 

You can then issue the "make -C /cygdrive/c/temp/kernel SUBDIRS=$PWD modules" from your module directory and it'll build, and more importantly work! 

 

Interesting to know if the microtronix guys have a less painful way of building modules. 

 

Adrian
0 Kudos
Reply