Page 16 of 16

Author:  ashmew2 [ Sun May 21, 2017 1:02 pm ]
Post subject:  Re: Newlib


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.

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 @@
+        // 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));

I've Pushed this to SVN as well.
In case you disagree with these changes, please let me know :)

Page 16 of 16 All times are UTC+03:00
Powered by phpBB® Forum Software © phpBB Limited