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++

loadable modules

Altera_Forum
Honored Contributor II
2,166 Views

does the nios II uClinux port support loadable modules? 

 

Adrian
0 Kudos
6 Replies
Altera_Forum
Honored Contributor II
867 Views

Hi adac, 

 

The NiosII Linux distribution does support loadable modules. We use the insmod et al in busybox. The busybox application that is pre-built in the distribution does not have those applets enabled so you would need to re-build busybox. Unfortunately, due to an oversight, the busybox source code did not make v1.0. So, the options are: 

 

1) i can re-build busybox for you with this support and pass you the executable 

2) i can zip up the busybox source and pass that to you 

3) v1.1 of the distribution will be released July 9th -- busybox source will be present 

 

mike
0 Kudos
Altera_Forum
Honored Contributor II
867 Views

Thanks for posting that. 

 

It appears as though the modules stuff is broken, lsmod returns: 

 

lsmod: QM_MODULES: Function not implemented 

 

A quick google took me to the busybox mailing list where they said: 

<div class='quotetop'>QUOTE </div> 

--- Quote Start ---  

>  and my one cent. The QM_MODULES releated modutils are broken in 

> 1.00-pre8: lsmod, insmod does not work at least for mips. 1.00-pre7 works 

> fine. And I&#39;m also using uclibc. Have not figured out what exactly 

> happens... 

 

If it is the problem I&#39;m thinking of, it is due to the change in 

libbb/module_syscalls.c and the fact that uClibc&#39;s syscall() function 

is broken for number of args > 4 (?).  There&#39;s a workaround in 

current busybox cvs.[/b] 

--- Quote End ---  

 

 

Given that the version here is pre8 I&#39;m guessing this is the same problem, does it work for you there? Is there something I&#39;ve missed here?! (very possibly!) 

 

Thanks. 

 

Adrian
0 Kudos
Altera_Forum
Honored Contributor II
867 Views

Hi, 

 

Just disable the query_module (sub)feature of &#39;lsmod&#39; in the busybox configuration. Busybox supports several major kernel versions; for 2.6, the sys_query_module system call is no longer supported. 

 

&#39;lsmod&#39; is essentially &#39;cat /proc/modules&#39; 

 

mike
0 Kudos
Altera_Forum
Honored Contributor II
867 Views

Humn. Tried that, had a drive nfs mounted on the PC and kept trying various options to try to get lsmod to work - pretty sure I tried the query modules option both on and off and it still gave the error. 

 

Knew about /proc/modules anyway so that&#39;s not an issue, just wondered why lsmod itself didn&#39;t work. 

 

Adrian
0 Kudos
Altera_Forum
Honored Contributor II
867 Views

Hi, 

 

A "make clean" might be necessary after you changed the configuration of busybox. As I observed, "lsmod" is not automatically rebuilt. 

 

wentao
0 Kudos
Altera_Forum
Honored Contributor II
867 Views

Thanks wentao, that was the problem! I just expected that a change to the configuration would cause a recompile, strangly enough something does get recompiled after a change - next time i&#39;ll inspect exactly what compiles rather than take it as doing what I expect. 

 

Oh well, stage 1 complete now! 

 

Adrian
0 Kudos
Reply