OS toolchain for non Unix like 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
nexos
Member
Member
Posts: 1081
Joined: Tue Feb 18, 2020 3:29 pm
Libera.chat IRC: nexos

OS toolchain for non Unix like OS

Post by nexos »

Hello,
NexOS is ready for an OS specific toolchain. However being non Unix-like, how would I port Newlib? My API is going to different then POSIX. Could I just stub the functions required for libgcc?
Thanks,
nexos
"How did you do this?"
"It's very simple — you read the protocol and write the code." - Bill Joy
Projects: NexNix | libnex | nnpkg
User avatar
crosssans
Member
Member
Posts: 39
Joined: Fri Mar 01, 2019 3:50 pm
Location: France

Re: OS toolchain for non Unix like OS

Post by crosssans »

I think it's one of the disadvantages of making a unique API (but don't get me wrong, I don't say this is bad practice - I also plan on making my own API) - One way to address this problem is by providing a bridge between your API and POSIX. That way, you can then provide the headers required & link the program against your bridge (which would be a separate library on it's own). The other solution would be to literally develop your tools (which can be fun to do BUT time consuming ALTHOUGH this would be a good thing anyways since that way you would test your API as you develop it; see this article on the OSDev Wiki that talks about on how to create a compiler from scratch: https://wiki.osdev.org/Making_a_Compiler)

Note: I may be wrong in what I'm saying here, correct me if I'm wrong - I'll be happy to hear a correct answer to this question :D
User avatar
iansjack
Member
Member
Posts: 4703
Joined: Sat Mar 31, 2012 3:07 am
Location: Chichester, UK

Re: OS toolchain for non Unix like OS

Post by iansjack »

Are you getting confused between libgcc (provided by gcc) and libc (provided by newlib)?

If you are going to use your own api then you could always just write your own libc to fit your api. Having your own api and then trying to shoehorn it into a library that is Posix-based seems a bit pointless to me.
User avatar
crosssans
Member
Member
Posts: 39
Joined: Fri Mar 01, 2019 3:50 pm
Location: France

Re: OS toolchain for non Unix like OS

Post by crosssans »

iansjack wrote:If you are going to use your own api then you could always just write your own libc to fit your api. Having your own api and then trying to shoehorn it into a library that is Posix-based seems a bit pointless to me.
Oh well, fair enough - I also though that this was not the best solution to choose from although I couldn't find much better when I wrote my answer :P
User avatar
Octacone
Member
Member
Posts: 1138
Joined: Fri Aug 07, 2015 6:13 am

Re: OS toolchain for non Unix like OS

Post by Octacone »

Porting newlib... Just write your own. Go big or go home. POSIX sucks anyways, why would you want to have a custom api with newlib, ewww.
OS: Basic OS
About: 32 Bit Monolithic Kernel Written in C++ and Assembly, Custom FAT 32 Bootloader
nexos
Member
Member
Posts: 1081
Joined: Tue Feb 18, 2020 3:29 pm
Libera.chat IRC: nexos

Re: OS toolchain for non Unix like OS

Post by nexos »

I just read the wiki article Hosted GCC Cross-Compiler, and that answered my question.
"How did you do this?"
"It's very simple — you read the protocol and write the code." - Bill Joy
Projects: NexNix | libnex | nnpkg
ITchimp
Member
Member
Posts: 134
Joined: Sat Aug 18, 2018 8:44 pm

Re: OS toolchain for non Unix like OS

Post by ITchimp »

nexos can you help me on this question?

viewtopic.php?f=1&t=37051
Post Reply