I am wondering if I can compile/link a library one of the standard c libraries into my os.
I always compile/link with nodefaultlibs switch so that my output kernel.bin file doesn't depend on any outside dll ,...etc
My whole os is written from my functions...etc no outside libraries but now I am wondering if I can use outside libraries and what the extend of using outside stuff is? Plus how to use outside libraries in my os if it is possible duno maybe all it takes is adding the library with a linker switch at command line to ld.
My problem now is
is their away to compile/link a library and all it's dependences into my kernel.
In theory what would go wrong in compiling all the microsoft dll's ,...etc into my kernel won't it just have all the functionalites of microsofts os's ?
Either way I am new to compiling third party dll into a kernel what can go wrong?
I have my linker script set to binary output so if I provided the libraries on the command line to ld will it copy all the dependences of those libraries,..etc into my kernel.bin
Will I be all set or will their still be dependences , errors , problems in my kernel from this that I am not aware of???
using librarys in your os?
Re: using librarys in your os?
Most of the functionality depends on Windows. There are only a very few functions that don't depend on anything else, such as strcpy, strlen, etc. Everything nontrivial ends up depending on the entire Windows kernel in some way or another.
Re: using librarys in your os?
Even if you just want to compile math.h , cmath, or cstring , string.h ,....the standard c/c++ libraries not stuff that depends on the os or drivers to display it ,...etc etc?
And why would it fail if you tried to compile/link the whole windows kernel functions and libraries and everything?
Question 2 if I made my own library that didn't depend on any other libraries would includeding it for the linker to link with my kernel cause any problems? In my kernel.bin...
I am just get confused on what can be linked into your kernel and what cann't ?
And how to tell if it can or cann't be used. Seems the math.h is pretty independent?
Thanks
And why would it fail if you tried to compile/link the whole windows kernel functions and libraries and everything?
Question 2 if I made my own library that didn't depend on any other libraries would includeding it for the linker to link with my kernel cause any problems? In my kernel.bin...
I am just get confused on what can be linked into your kernel and what cann't ?
And how to tell if it can or cann't be used. Seems the math.h is pretty independent?
Thanks
Re: using librarys in your os?
The sentence that claims to be question 2 follows 2 previous sentences with question marks. So it would be question 3. But I notice you left the question mark off in the final sentence.Even if you just want to compile math.h , cmath, or cstring , string.h ,....the standard c/c++ libraries not stuff that depends on the os or drivers to display it ,...etc etc?
And why would it fail if you tried to compile/link the whole windows kernel functions and libraries and everything?
Question 2 if I made my own library that didn't depend on any other libraries would includeding it for the linker to link with my kernel cause any problems? In my kernel.bin...
My answer to all your questions is to follow the wiki recommendation to beginners to use newlib.
If a trainstation is where trains stop, what is a workstation ?
Re: using librarys in your os?
When a question begins with, "If I", then you should be able to answer it by simply trying it out yourself. And, obviously you should write your own code.
Visit the Montrom user page for more info.