Hello,
I'm currently trying to port newlib to my O/S following this tutorial from the wiki
My problem may seem stupid but: where do you write the glue?
I am supposed to write functions calling the kernel but where in the newlib source code should I write them?
Is there no file dedicated to this in the source code?
I don't know much about compiling in linux, and thus I don't want to try things that would break the compilation
The glue between newlib and your O/S
The glue between newlib and your O/S
MysteriOS
Currently working on: TCP/IP
Currently working on: TCP/IP
- piranha
- Member
- Posts: 1391
- Joined: Thu Dec 21, 2006 7:42 pm
- Location: Unknown. Momentum is pretty certain, however.
- Contact:
Re: The glue between newlib and your O/S
If you looking the directory 'libgloss' there are some files (named like, open, close). Thats where you put the systemcalls for the library.
-JL
-JL
SeaOS: Adding VT-x, networking, and ARM support
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
Re: The glue between newlib and your O/S
Thanks
But I see there are some functions (like fork, wait) with no corresponding file
Moreover, the content of these files is like this: (for example write.c)
What does _DEFUN mean? (there's nothing in glue.h and I don't find _ansi.h)
I can't just modify the content of the function because for the moment I get unresolved symbols when trying to link with newlib
Modifying the content won't resolve this
But I see there are some functions (like fork, wait) with no corresponding file
Moreover, the content of these files is like this: (for example write.c)
Code: Select all
int
_DEFUN (write, (fd, buf, nbytes),
int fd _AND
char *buf _AND
int nbytes)
{
int i;
for (i = 0; i < nbytes; i++) {
if (*(buf + i) == '\n') {
outbyte ('\r');
}
outbyte (*(buf + i));
}
return (nbytes);
}
I can't just modify the content of the function because for the moment I get unresolved symbols when trying to link with newlib
Modifying the content won't resolve this
MysteriOS
Currently working on: TCP/IP
Currently working on: TCP/IP
-
- Member
- Posts: 2566
- Joined: Sun Jan 14, 2007 9:15 pm
- Libera.chat IRC: miselin
- Location: Sydney, Australia (I come from a land down under!)
- Contact:
Re: The glue between newlib and your O/S
I wrote the article and there are some problems with it - especially this "glue" stuff. The OS Specific Toolchain article in the wiki covers how to create a new system for newlib to target, which allows you to write all your glue functions and have them linked in automatically (unlike what my Porting Newlib article does, which requires you to link to an extra library).