Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
21 years ago

loadable modules

does the nios II uClinux port support loadable modules?

Adrian

6 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi,

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

    wentao
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    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