Quick Steps to hosted libc
Posted: Sun Sep 11, 2005 1:45 am
Hi,
I just want to make sure I'm going about things the right way, so please forgive me if I sound a bit naive.
Anyways, I'm building an OS that uses the O'Caml language, and associated runtime. I've finally come to a wall where glibc code getting linked into my kernel is hurting DST (hardware exceptions and the like).
So, my thought is to get a libc compiled for DST, and then rebuild the O'Caml runtime using this libc instead of system one.
I'm not sure what the best libc implementation is to use for this task, so I've chosen newlib for now. Just want something that's easy to port. I had a look at dietlibc, but I think that might have some linux dependencies in it...
Anyways, I'm looking at osfaq2 to see how to do this. Are the steps as follows:
1. Build a custom binutils and gcc with newlib headers.
2. Compile newlib into a static library (do I use my new gcc?)
3. [Re]Build O'Caml runtime using this new gcc toolchain.
4. Build DST using this gcc toolchain, the new libc, and new ocaml runtime.
5. Run, and hope life will be very merry.
I assume then, I can just define the OS interfaces in some libc-interface.c file that's part of my kernel? And the linker will fix everything up so it's all good?
Kindest Regards,
Jonathan
I just want to make sure I'm going about things the right way, so please forgive me if I sound a bit naive.
Anyways, I'm building an OS that uses the O'Caml language, and associated runtime. I've finally come to a wall where glibc code getting linked into my kernel is hurting DST (hardware exceptions and the like).
So, my thought is to get a libc compiled for DST, and then rebuild the O'Caml runtime using this libc instead of system one.
I'm not sure what the best libc implementation is to use for this task, so I've chosen newlib for now. Just want something that's easy to port. I had a look at dietlibc, but I think that might have some linux dependencies in it...
Anyways, I'm looking at osfaq2 to see how to do this. Are the steps as follows:
1. Build a custom binutils and gcc with newlib headers.
2. Compile newlib into a static library (do I use my new gcc?)
3. [Re]Build O'Caml runtime using this new gcc toolchain.
4. Build DST using this gcc toolchain, the new libc, and new ocaml runtime.
5. Run, and hope life will be very merry.
I assume then, I can just define the OS interfaces in some libc-interface.c file that's part of my kernel? And the linker will fix everything up so it's all good?
Kindest Regards,
Jonathan