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
Own Dynamic linking libraries
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: linking error new operator
The colours prove you didn't read the forum rules yet. They contain many more hints that prove helpful in getting a meaningful answer.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
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
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.
This is advanced. It is not relevant until you make a user-space. I suspect that's in a good while for you.
-
- Posts: 7
- Joined: Sun Nov 02, 2014 12:58 am
Own Dynamic linking libraries
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
how do i approach for this..?
like essentials, setup, knowledge..etc
help is greatly appreciated...Thanks in advance
Re: Own Dynamic linking libraries
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?
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?
Project: OZone
Source: GitHub
Current Task: LIB/OBJ file support
"The more they overthink the plumbing, the easier it is to stop up the drain." - Montgomery Scott
Source: GitHub
Current Task: LIB/OBJ file support
"The more they overthink the plumbing, the easier it is to stop up the drain." - Montgomery Scott
-
- Member
- Posts: 307
- Joined: Wed Oct 30, 2013 1:57 pm
- Libera.chat IRC: no92
- Location: Germany
- Contact:
Re: Own Dynamic linking libraries
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.
*.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.