menix-os / menix

A minimal and expandable Unix-like kernel
https://menix-os.org
GNU Lesser General Public License v2.1
15 stars 3 forks source link

[Bug] Dynamic module dependencies are not read in the right order #20

Closed marv7000 closed 1 month ago

marv7000 commented 1 month ago

Architecture

N/A

Menix Version

No response

Affected Area

Drivers

Bug Description

Modules with dependencies expect symbols from other modules to be loaded and registered before they can do relocations and/or loading. Currently, the module dependencies only get respected in the final loading loop. But for ELF modules, this needs to happen before they even get registered.

Expected Behavior

When loading an ELF module, its dependencies should be parsable without any relocations. It's currently not possible, since the strings are stored in a different table outside of ".mod". Consider adding a ".mod.deps" section or something like that.

Steps to Reproduce

  1. Enable a module with a dependency on another modules' symbols
  2. If the modules aren't loaded from disk in the correct order by coincidence, the message [Module] Failed to find symbol "<symbol>" will pop up
marv7000 commented 1 month ago

Fixed in d0358960702c93a986560fc07233d165de327431