OSDev.org

The Place to Start for Operating System Developers
It is currently Thu Apr 18, 2024 11:07 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: OS toolchain for non Unix like OS
PostPosted: Thu Jul 23, 2020 1:49 pm 
Offline
Member
Member

Joined: Tue Feb 18, 2020 3:29 pm
Posts: 1071
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


Top
 Profile  
 
 Post subject: Re: OS toolchain for non Unix like OS
PostPosted: Thu Jul 23, 2020 2:02 pm 
Offline
Member
Member
User avatar

Joined: Fri Mar 01, 2019 3:50 pm
Posts: 39
Location: France
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


Top
 Profile  
 
 Post subject: Re: OS toolchain for non Unix like OS
PostPosted: Thu Jul 23, 2020 2:30 pm 
Offline
Member
Member
User avatar

Joined: Sat Mar 31, 2012 3:07 am
Posts: 4594
Location: Chichester, UK
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.


Top
 Profile  
 
 Post subject: Re: OS toolchain for non Unix like OS
PostPosted: Thu Jul 23, 2020 2:36 pm 
Offline
Member
Member
User avatar

Joined: Fri Mar 01, 2019 3:50 pm
Posts: 39
Location: France
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


Top
 Profile  
 
 Post subject: Re: OS toolchain for non Unix like OS
PostPosted: Thu Jul 23, 2020 3:44 pm 
Offline
Member
Member
User avatar

Joined: Fri Aug 07, 2015 6:13 am
Posts: 1134
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


Top
 Profile  
 
 Post subject: Re: OS toolchain for non Unix like OS
PostPosted: Thu Jul 23, 2020 4:55 pm 
Offline
Member
Member

Joined: Tue Feb 18, 2020 3:29 pm
Posts: 1071
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


Top
 Profile  
 
 Post subject: Re: OS toolchain for non Unix like OS
PostPosted: Wed Jul 29, 2020 1:57 am 
Offline
Member
Member

Joined: Sat Aug 18, 2018 8:44 pm
Posts: 127
nexos can you help me on this question?

viewtopic.php?f=1&t=37051


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 59 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group