Working on UDP, removed debug from some code, fixed ARP setting hwtype to 0x100 ...
[tpg/acess2.git] / Kernel / arch / x86 / errors.c
index 0c2da16..8b518f8 100644 (file)
@@ -3,7 +3,8 @@
  * arch/x86/errors.c
  * - CPU Error Handler
  */
-#include <common.h>
+#include <acess.h>
+#include <proc.h>
 
 // === CONSTANTS ===
 #define        MAX_BACKTRACE   8       //!< Maximum distance to trace the stack backwards
@@ -16,6 +17,12 @@ extern void Threads_Dump();
 void   Error_Backtrace(Uint eip, Uint ebp);
 
 // === CODE ===
+void __stack_chk_fail()
+{
+       Panic("FATAL ERROR: Stack Check Failed\n");
+       for(;;);
+}
+
 /**
  * \fn void ErrorHandler(tRegs *Regs)
  * \brief General Error Handler
@@ -111,3 +118,31 @@ void Error_Backtrace(Uint eip, Uint ebp)
        }
        LogF("\n");
 }
+
+/**
+ * \fn void StartupPrint(char *Str)
+ */
+void StartupPrint(char *Str)
+{
+       Uint16  *buf = (void*)0xC00B8000;
+        int    i = 0;
+       static int      line = 0;
+       while(*Str)
+       {
+               buf[line*80 + i++] = *Str | 0x0700;
+               Str ++;
+       }
+       
+       while(i < 80)   buf[line*80 + i++] = 0x0720;
+       
+       line ++;
+       if(line == 25)
+       {
+               line --;
+               memcpy(buf, &buf[80], 80*24*2);
+               memset(&buf[80*24], 0, 80*2);
+       }
+}
+
+// === EXPORTS ===
+EXPORT(__stack_chk_fail);

UCC git Repository :: git.ucc.asn.au