Loading external modules..

If you have any questions on programming, this is the place to ask them, whether you're a newbie or an experienced programmer. Discussion on programming in general is also welcome. We will help you with programming homework, but we will not do your work for you! Any porting requests must be made in Developmental Ideas.
Post Reply
dospro
Insane DCEmu
Insane DCEmu
Posts: 147
https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
Joined: Thu Dec 30, 2004 7:12 pm
Has thanked: 0
Been thanked: 0
Contact:

Loading external modules..

Post by dospro »

Hi. I have a question.
How can i load routines from other files, like if they were dlls?

In windows is using LoadLibrary(...) and GetProcAddress(....).
In KOS how can i make something like this?
Check the BioGB emulator any help me get it much better!!
http://www.geocities.com/instructivus
BlackAura
DC Developer
DC Developer
Posts: 9951
Joined: Sun Dec 30, 2001 9:02 am
Has thanked: 0
Been thanked: 1 time

Post by BlackAura »

I don't think you really can. KOS used to have the ability to do that, but I think it may have decayed a bit.

Some of the code still seems to be there (have a look at kos/kernel/fs/elf.c, for example), but I don't know how well it'd work. It looks like you should be able to use the elf_load function to load an ELF file into memory, but I don't really know what you could do with it once you've loaded it.
User avatar
semicolo
Mental DCEmu
Mental DCEmu
Posts: 328
Joined: Mon Apr 25, 2005 1:02 pm
Location: Three-rivers canada
Has thanked: 0
Been thanked: 0
Contact:

Post by semicolo »

what about dlopen/dlsym ?
dospro
Insane DCEmu
Insane DCEmu
Posts: 147
Joined: Thu Dec 30, 2004 7:12 pm
Has thanked: 0
Been thanked: 0
Contact:

Post by dospro »

I will try them, and see how htey work.
Check the BioGB emulator any help me get it much better!!
http://www.geocities.com/instructivus
BlackAura
DC Developer
DC Developer
Posts: 9951
Joined: Sun Dec 30, 2001 9:02 am
Has thanked: 0
Been thanked: 1 time

Post by BlackAura »

semicolo wrote:what about dlopen/dlsym ?
They're Unix system calls. KOS is not Unix.
GPF
DC Developer
DC Developer
Posts: 529
Joined: Wed Oct 17, 2001 7:44 pm
Location: Texas
Has thanked: 0
Been thanked: 0
Contact:

Post by GPF »

there was some example code on the dcdev maillist that dan wrote an example of doing that with the image loading libraries, i tried to make it work but it either there is some functions missing now or i was missing something.

Troy(GPF)
Post Reply