Re: Newlib
Posted: Sun May 21, 2017 1:02 pm
hi,
Found this missing error reporting when a user was trying to run Netsurf and it wouldnt load.
With some debugging, and realizing that the main() function was not called, finally I figured out it's because of loading the libc.dll
With this change in contrib/toolchain/, the users who run C applications and dont have a libc.dll will see an error message in the DEBUG BOARD.
I've Pushed this to SVN as well.
In case you disagree with these changes, please let me know
Found this missing error reporting when a user was trying to run Netsurf and it wouldnt load.
With some debugging, and realizing that the main() function was not called, finally I figured out it's because of loading the libc.dll
With this change in contrib/toolchain/, the users who run C applications and dont have a libc.dll will see an error message in the DEBUG BOARD.
Code: Select all
Index: gcc/5x/libgcc/config/i386/kos32-app.c
===================================================================
--- gcc/5x/libgcc/config/i386/kos32-app.c (revision 6898)
+++ gcc/5x/libgcc/config/i386/kos32-app.c (working copy)
@@ -21,6 +21,14 @@
if(!img)
{
+ // Inform the user via BOARD that libc could not be loaded.
+ char *errormsg = "[ERROR] libc.dll failed to load. is /kolibrios folder configured?\n";
+ while (*errormsg) {
+ __asm__ __volatile__("int $0x40"::"a"(63), "b"(1), "c"(*errormsg));
+ ++errormsg;
+ }
+
+ // Exit
asm ("int $0x40" ::"a"(-1));
};
In case you disagree with these changes, please let me know