Linking in the C Runtime
Posted: Tue Mar 27, 2007 8:28 am
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
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