Sorry for such a dumb question. I'm new to OS development. I've been looking up information on newlib and am interested in porting it to my OS. I don't really understand how this works. I've found some instructions detailing how to actually go about the porting, but once I've done that, do I link it with user space applications or not?
Basically what I am asking is that once I port newlib, can I use functions like malloc and free in my kernel code, or is libc designed specifically for use by user space applications?
libc in kernel space or user space?
- 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:
libc is originally built for userland applications, but you can use it for your kernel as well. Just be very careful with what you intend to do with it and how libc is going to help you solve it. You will need a memory manager before malloc will work, so you can't use it before that.
Also, please search the forum and wiki before posting. There is even a thread on porting newlib with posts over the last 24 hours which provides more of the details.
Also, please search the forum and wiki before posting. There is even a thread on porting newlib with posts over the last 24 hours which provides more of the details.