Quote:
Forget about a general solution, instead use a special module format, where you'd have some code at the beginning of the module to check from some table whether it's already loaded, then return a table of functions it provides. If you keep names in that table, you get by name lookup of function pointers, which you can then call normally. You might need a second table for functions the module imports, which you fill in by querying the exports of other functions. This way you don't need to lookup a name every time you want to call a function, just once.
I'm actually using this solution, but i don't like it
Quote:
You can also do what Linux does: read normal .o files, which already contain such a table, parse that, and proceed as in the previous option. In this case you do the imports by "linking" the object into your running kernel.
this is what I m planning to do in the future since i want to implement a fully modulable kernel.
Quote:
Finally, you could implement full dlopen/dlsym/dlclose if you want, and use something like ELF .so files, which is designed to to mostly what described above. A hack (such as that in Linux) for .o files might be easier though, but YMMV.
I think this is a good solution, but it's not too important at the moment. coze this is used for libraries and what I want to do is only calling "internal modules" (compiled with the kernel).