SimpleOS

LXR

Navigation



Site hébergé par : enix

The LXR Cross Referencer for SOS

source navigation ]
diff markup ]
identifier search ]
general search ]
 
 
Article:1 ] [ 2 ] [ 3 ] [ 4 ] [ 5 ] [ 6 ] [ 6.5 ] [ 7 ] [ 7.5 ] [ 8 ] [ 9 ] [ 9.5 ]

Diff markup

Differences between /sos/assert.c (Article 6) and /sos/assert.c (Article 7.5)


001 /* Copyright (C) 2004  The KOS Team               001 /* Copyright (C) 2004  The KOS Team
002                                                   002 
003    This program is free software; you can redi    003    This program is free software; you can redistribute it and/or
004    modify it under the terms of the GNU Genera    004    modify it under the terms of the GNU General Public License
005    as published by the Free Software Foundatio    005    as published by the Free Software Foundation; either version 2
006    of the License, or (at your option) any lat    006    of the License, or (at your option) any later version.
007                                                   007    
008    This program is distributed in the hope tha    008    This program is distributed in the hope that it will be useful,
009    but WITHOUT ANY WARRANTY; without even the     009    but WITHOUT ANY WARRANTY; without even the implied warranty of
010    MERCHANTABILITY or FITNESS FOR A PARTICULAR    010    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
011    GNU General Public License for more details    011    GNU General Public License for more details.
012                                                   012    
013    You should have received a copy of the GNU     013    You should have received a copy of the GNU General Public License
014    along with this program; if not, write to t    014    along with this program; if not, write to the Free Software
015    Foundation, Inc., 59 Temple Place - Suite 3    015    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
016    USA.                                           016    USA. 
017 */                                                017 */
018                                                   018 
019 #include <sos/klibc.h>                            019 #include <sos/klibc.h>
020 #include <drivers/bochs.h>                        020 #include <drivers/bochs.h>
021 #include <drivers/x86_videomem.h>                 021 #include <drivers/x86_videomem.h>
                                                   >> 022 #include <sos/thread.h> // backtrace
022                                                   023 
023 #include "assert.h"                               024 #include "assert.h"
024                                                   025 
025 void sos_display_fatal_error(const char *forma    026 void sos_display_fatal_error(const char *format, /* args */...)
026 {                                                 027 {
027   char buff[256];                                 028   char buff[256];
028   va_list ap;                                     029   va_list ap;
029                                                   030   
030   asm("cli\n"); /* disable interrupts -- x86 o    031   asm("cli\n"); /* disable interrupts -- x86 only */ \
031                                                   032 
032   va_start(ap, format);                           033   va_start(ap, format);
033   vsnprintf(buff, sizeof(buff), format, ap);      034   vsnprintf(buff, sizeof(buff), format, ap);
034   va_end(ap);                                     035   va_end(ap);
035                                                   036 
036   sos_bochs_putstring(buff); sos_bochs_putstri    037   sos_bochs_putstring(buff); sos_bochs_putstring("\n");
037   sos_x86_videomem_putstring(24, 0,            !! 038   sos_x86_videomem_putstring(23, 0,
038                              SOS_X86_VIDEO_BG_    039                              SOS_X86_VIDEO_BG_BLACK
039                              | SOS_X86_VIDEO_F    040                              | SOS_X86_VIDEO_FG_LTRED , buff);
                                                   >> 041 
                                                   >> 042   sos_thread_dump_backtrace(TRUE, TRUE);
040                                                   043 
041   /* Infinite loop: processor halted */           044   /* Infinite loop: processor halted */
042   for ( ; ; )                                     045   for ( ; ; )
043     asm("hlt\n");                                 046     asm("hlt\n");
044 }                                                 047 }
                                                      

source navigation ] diff markup ] identifier search ] general search ]