Linking in the C Runtime

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Linking in the C Runtime

Post by AJ »

Hi All,

I now have a COFF loader which relocates and runs exe files as separate processes. It can also pass argc, argv and jump straight to a C I also have system calls enabling me to get the standard IO buffers etc...

What I would like to do now is create a C runtime which automatically gets linked to the entry point of every user app created, so that I can create my standard buffers, call main(), and then tidy up when the app closes. I have a basic ASM version which already does the stack tidy ups etc... in ring 0.

Is there a neat way to do this without requiring a user to rely on a linker script to do it for them? (i.e. get DJGPP to automatically assume the runtime function, which is part of my libc.a is the entry point?)

Thanks,
Adam
Post Reply