ah i think i understand, relocatable objects can still be used for programs calling the functions inside the file, whereas dynamically linking is used more for finding the function in seperate files.
is that right?
I would like to implement both at some point, but i have no real need for shared libraries at the moment, so i'll focus on getting my drivers in userland.
DLL's
Dynamic Linking allows you load libraries at runtime. It also allows you to share libraries among many processes (using position independent code) and has some nice other features (like lazy linking). If you just want to load a program to a random memory address, it is easier to have the program stored in an object file and then to relocate the object file after loading it.
- einsteinjunior
- Member
- Posts: 90
- Joined: Tue Sep 11, 2007 6:42 am
ELF uses a quite different approach to dynamic linking. In position independent elf libraries, the code does not only run from a random memory address, it can also be linked at runtime (i.e. while running the program and not before running the program). The same library can even be shared between processes without relocating it. DLLs are mostly equivalent to elf object files.
- einsteinjunior
- Member
- Posts: 90
- Joined: Tue Sep 11, 2007 6:42 am
For my drivers that need to be load anywhere, i assemble my code as a coff file, then i run them though a xp program called "coff2dex" this splits the obj file into two, one the driver and the other the reloc info.
This save have to place the reloc in at end of file, which would make the file much bigger (eg: no rb, rw, rd etc) or not making it backward compatable with DexOS old file type.
PS: One member of Team DexOS did some work on using Dll in DexOS (The old ver).
you can see the code here: http://www.dex4u.com/testdll.zip
NOTE: It will not run on the new ver of DexOS without mods.
This save have to place the reloc in at end of file, which would make the file much bigger (eg: no rb, rw, rd etc) or not making it backward compatable with DexOS old file type.
PS: One member of Team DexOS did some work on using Dll in DexOS (The old ver).
you can see the code here: http://www.dex4u.com/testdll.zip
NOTE: It will not run on the new ver of DexOS without mods.