Project

General

Profile

Actions

Bug #941

closed

can not load kernel module with dependencies

Added by nthery about 16 years ago. Updated over 14 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:

Description

"kldload foo" fails if foo depends on other modules that have not yet
been loaded.

The kernel includes code to automatically loads dependencies but it
seems designed for an older ABI (cf load_dependancies()).

I'm working on a fix inspired from FreeBSD...

Actions #1

Updated by corecode about 16 years ago

there are two dependency systems in place:

1. the "old" one, using the DL_NEEDED entry in the ELF headers.

2. the "new" one, using linker sets.

loader does (2), the kernel does (1). required modules specified in the
source set (2), Makefile sets (1).

I personally think that (1) is the correct choice, but I'm open for
discussion. Maybe the nicest thing would be to use the sources and (2) to
generate (1).

cheers
simon

Actions #2

Updated by nthery about 16 years ago

Thanks for this info. That clarifies things a bit. I focused on
implementing (2) in the kernel so far but I've got no strong opinion.
I'll try to grok (1).

Cheers,
Nicolas

Actions #3

Updated by corecode about 15 years ago

Did you ever finish this?

Actions #4

Updated by nthery about 15 years ago

Hello Simon,

2009/1/24 Simon 'corecode' Schubert (via DragonFly issue tracker)
<>:

Simon 'corecode' Schubert <> added the comment:

Did you ever finish this?

Sorry for the late answer. My home ADSL connexion is broken and I'm
quite busy at my day job.

The short answer is no.

I hacked the kernel-side module loading code to add dependency and I
had sth that worked at least in simple cases but needs lots of
cleanup. I didn't check complex cases like cycles in the dependencies
graph.

I also tried your approach which if my memory served well involved no
changes kernel-side but changes in the makefiles. I gave up because I
needed to dynamically generate part of the makefile and didn't know
how to do that (or if make supports this).

Cheers,
Nicolas

Actions #5

Updated by alexh over 14 years ago

Mh, seems to work fine for me. What exactly is the problem and how can I
reproduce it?

I do the following and it works fine as one can see:

19:18:38 :/usr/src devfs
  1. kldstat
    Id Refs Address Size Name
    1 4 0xc0100000 6bd840 kernel
    2 1 0xc07be000 68c14 acpi.ko
    3 1 0xd0894000 3000 null.ko
    19:18:41 :/usr/src devfs
  2. kldload snd_hda
    19:18:44 :/usr/src devfs
  3. kldstat
    Id Refs Address Size Name
    1 6 0xc0100000 6bd840 kernel
    2 1 0xc07be000 68c14 acpi.ko
    3 1 0xd0894000 3000 null.ko
    4 1 0xd34e0000 11000 snd_hda.ko
    5 1 0xd34f1000 1d000 sound.ko
Actions #6

Updated by nthery over 14 years ago

2009/8/18 Alex Hornung (via DragonFly issue tracker)
<>:

Alex Hornung <> added the comment:

Mh, seems to work fine for me. What exactly is the problem and how can I
reproduce it?

Your test case below should have reproduced it. Maybe that was fixed
at some point.

I do the following and it works fine as one can see:

19:18:38 :/usr/src devfs
  1. kldstat
    Id Refs Address    Size     Name
     1    4 0xc0100000 6bd840   kernel
     2    1 0xc07be000 68c14    acpi.ko
     3    1 0xd0894000 3000     null.ko
    19:18:41 :/usr/src devfs
  2. kldload snd_hda
    19:18:44 :/usr/src devfs
  3. kldstat
    Id Refs Address    Size     Name
     1    6 0xc0100000 6bd840   kernel
     2    1 0xc07be000 68c14    acpi.ko
     3    1 0xd0894000 3000     null.ko
     4    1 0xd34e0000 11000    snd_hda.ko
     5    1 0xd34f1000 1d000    sound.ko

_____________________________________________
DragonFly issue tracker <>
<http://bugs.dragonflybsd.org/issue941>
_____________________________________________

Actions #7

Updated by corecode over 14 years ago

Nicolas Thery wrote:

2009/8/18 Alex Hornung (via DragonFly issue tracker)
<>:

Alex Hornung <> added the comment:

Mh, seems to work fine for me. What exactly is the problem and how can I
reproduce it?

Your test case below should have reproduced it. Maybe that was fixed
at some point.

I do the following and it works fine as one can see:

19:18:38 :/usr/src devfs
  1. kldstat
    Id Refs Address Size Name
    1 4 0xc0100000 6bd840 kernel
    2 1 0xc07be000 68c14 acpi.ko
    3 1 0xd0894000 3000 null.ko
    19:18:41 :/usr/src devfs
  2. kldload snd_hda

snd_hda contains a makefile fragment to depend on sound.ko.

cheers
simon

Actions #8

Updated by alexh over 14 years ago

so what is a good example?

Actions #9

Updated by nthery over 14 years ago

2009/8/18 Alex Hornung (via DragonFly issue tracker)
<>:

Alex Hornung <> added the comment:

so what is a good example?

kldload smbfs

(it depends on libiconv.ko and another .ko)

Actions #10

Updated by alexh over 14 years ago

afaik this is solved with corecode's module work.

Actions

Also available in: Atom PDF