What is the replacement for the stdlib I can use in my OS?

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
mrjbom
Member
Member
Posts: 322
Joined: Sun Jul 21, 2019 7:34 am

What is the replacement for the stdlib I can use in my OS?

Post by mrjbom »

I saw the article on the wiki, but have not yet tried to implement anything of what is written there.
My question is: can I use the cross compiler library? If so, how do I replace / find analogues of some header files, such as stdlib.h?
Which of the listed libraries will be more suitable and will they work on my kernel.
nullplan
Member
Member
Posts: 2054
Joined: Wed Aug 30, 2017 8:24 am

Re: What is the replacement for the stdlib I can use in my O

Post by nullplan »

You are working on a kernel. There is no library. There is only the kernel. OK, in GCC, there is also libgcc, but otherwise, there is no library. And libgcc only contains small utility functions, references to which are emitted by GCC automatically. You want a memcpy() function? Write it yourself, it is not hard. For GCC, you will have to define memcpy(), memmove(), memcmp(), and memset() yourself. Otherwise you are entirely free to write whatever functions you desire.

Those libraries come into play once you get the ball rolling on userspace. That might be a while off for you.
Carpe diem!
User avatar
mrjbom
Member
Member
Posts: 322
Joined: Sun Jul 21, 2019 7:34 am

Re: What is the replacement for the stdlib I can use in my O

Post by mrjbom »

nullplan wrote:You are working on a kernel. There is no library. There is only the kernel. OK, in GCC, there is also libgcc, but otherwise, there is no library. And libgcc only contains small utility functions, references to which are emitted by GCC automatically. You want a memcpy() function? Write it yourself, it is not hard. For GCC, you will have to define memcpy(), memmove(), memcmp(), and memset() yourself. Otherwise you are entirely free to write whatever functions you desire.

Those libraries come into play once you get the ball rolling on userspace. That might be a while off for you.
Understand, thanks.
Post Reply