Page 1 of 1

Re: linking error new operator

Posted: Sat Nov 08, 2014 9:06 pm
by chinnambhrt
Okay thanks guys..i'm done with this..
but kicked off with a new problem again..
I wanted to define my own dynamic link libraries..with some new extension...say *.oslib...
how do i approach for this..?
like essentials, setup, knowledge..etc

Re: linking error new operator

Posted: Sun Nov 09, 2014 5:04 am
by Combuster
chinnambhrt wrote:Okay thanks guys..i'm done with this..
but kicked off with a new problem again..
I wanted to define my own dynamic link libraries..with some new extension...say *.oslib...
how do i approach for this..?
like essentials, setup, knowledge..etc
The colours prove you didn't read the forum rules yet. They contain many more hints that prove helpful in getting a meaningful answer.

Regardless, understanding the internals of the language is certainly a prerequisite and it would not be wise to consider shared libraries when you don't have a functional memory allocator either.

Re: linking error new operator

Posted: Sun Nov 09, 2014 8:12 am
by sortie
You can customize your toolchain by making a OS Specific Toolchain. There is nothing magical about the .so extension, though, so you can just name your output files that.

This is advanced. It is not relevant until you make a user-space. I suspect that's in a good while for you.

Own Dynamic linking libraries

Posted: Sun Nov 09, 2014 9:32 pm
by chinnambhrt
I wanted to define my own dynamic link libraries..with some new extension...say *.oslib...
how do i approach for this..?
like essentials, setup, knowledge..etc

help is greatly appreciated...Thanks in advance

Re: Own Dynamic linking libraries

Posted: Mon Nov 10, 2014 12:06 am
by SpyderTL
The Wikipedia entry for "DLL" is actually pretty helpful.

http://en.wikipedia.org/wiki/Dynamic-link_library

I would recommend starting there.

It would also be helpful if we knew the context of the environment that you are working in (or working on...).

Is this for a new OS that you are writing from scratch? Or is this going to be for an existing OS that you are modifying? Are you writing your own compiler/linker?

How far along are you? (Just getting started, almost finished, not even started, etc.)

You should get to know the PE file format inside and out, as that will give you a jump start on the kind of issues that you are going to need to deal with in your file structure.

Also, just to get it out of the way, because I know that someone is bound to ask... Why not just use an existing format (like ELF or PE) that is already supported by every other OS and compiler/linker?

Re: Own Dynamic linking libraries

Posted: Mon Nov 10, 2014 12:20 am
by no92
PE itself is not a requirement. What you should know is any executable format capable of some things you'll need for dynamic linking, e.g. symbol tables.

*.so, *.dylib and *.dll files are basically the same things as a kernel module, all four have to be linked at runtime. They are just four names for the same thing.

In order to do this, I usually create my own spec. Write your own one and be friends with it. Second off, you might want to put some information about the module (entry/exit point, name, whatever) in a dedicated section of the shared object. The methods that the module provides are called through special methods (dlsym for Linux). You have to pass the name of the method. What dlsym does it to look it up on the symbol table.

These ideas can get you started. Digging inside the kernel or some hobby OSs (given that it implements it) can help, too.