Page 1 of 1
Where to put "glue" for Newlib
Posted: Tue Mar 04, 2014 6:12 pm
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?
Re: Where to put "glue" for Newlib
Posted: Tue Mar 04, 2014 8:35 pm
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.
Re: Where to put "glue" for Newlib
Posted: Tue Mar 04, 2014 8:39 pm
by inixsoftware
Thanks! Compiling newlib & libgloss right now...