Where to put "glue" for Newlib

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
inixsoftware
Member
Member
Posts: 32
Joined: Fri Jan 31, 2014 8:21 am

Where to put "glue" for Newlib

Post by inixsoftware »

I looked at: http://wiki.osdev.org/Porting_Newlib and I am not really sure exactly where Newlib expects the "glue" between their library and my OS System Calls.

Also, when the article says:
Basically, in the libgloss directory you will find 17 files, all of which are the syscalls we wrote earlier. Put your code into these files, configure, build and then you'll have another library.
What exactly is supposed to be done?
Am I supposed to override those files with my system call references?
User avatar
skeen
Member
Member
Posts: 59
Joined: Tue Sep 27, 2011 6:45 am
Location: Denmark

Re: Where to put "glue" for Newlib

Post by skeen »

inixsoftware wrote:I looked at: http://wiki.osdev.org/Porting_Newlib and I am not really sure exactly where Newlib expects the "glue" between their library and my OS System Calls.

Also, when the article says:
Basically, in the libgloss directory you will find 17 files, all of which are the syscalls we wrote earlier. Put your code into these files, configure, build and then you'll have another library.
What exactly is supposed to be done?
Am I supposed to override those files with my system call references?
Newlib has 17 undefined references, when linked, namely the 17 functions found in libgloss.

What your supposed to do, when porting newlib, is to build newlib, without any changes, and then change the 17 files for libgloss, and then compile libgloss. Then link your executables with both libraries.

The motivation for the separation of newlib and libgloss is separation between platform independent and platform dependant code.

Ideally your implementation of the libgloss functions should just be wrappers around syscalls.
// Skeen
// Developing a yet unnamed microkernel in C++14.
inixsoftware
Member
Member
Posts: 32
Joined: Fri Jan 31, 2014 8:21 am

Re: Where to put "glue" for Newlib

Post by inixsoftware »

Thanks! Compiling newlib & libgloss right now... :D
Post Reply