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.
But this code doesn't display anything on the screen unless I explicitly clear stdout. I debugged a bit my program with gdb and I realized that no destructor was called (there is no one) when exit is called, why ? Normally the buffers are emptied when the program ends, right?
If I read that right, there is a function called __sinit() that should be called from the stdio code. It will set GLOBAL_REENT->__cleanup to _cleanup_r(). exit(), then, will call that function through the pointer. There are not many ways this can go wrong. Find out if __sinit() is called and what GLOBAL_REENT->__cleanup is when exit is called.
Thanks a lot, everything works fine, the answer was given in this topic (viewtopic.php?f=1&t=31261) but due to a bug in the implementation of the system calls it was not working.
And sorry for the late response but my IP has been blacklisted by osdev, no idea why