Board.KolibriOS.org
http://board.kolibrios.org/

Newlib
http://board.kolibrios.org/viewtopic.php?f=24&t=1587
Страница 16 из 16

Автор:  ashmew2 [ Вс май 21, 2017 1:02 pm ]
Заголовок сообщения:  Re: Newlib

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.

Код:
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));
     };


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

Страница 16 из 16 Часовой пояс: UTC+03:00
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/