diff options
| author | Miguel <m.i@gmx.at> | 2018-09-09 13:21:47 +0200 |
|---|---|---|
| committer | Miguel <m.i@gmx.at> | 2018-09-09 13:21:47 +0200 |
| commit | c2ef64149849fcae608b1c6010303eca86229d22 (patch) | |
| tree | 30d69313b6975a7c1bfc80859117124a6a5a10e7 /kernel/log.c | |
| parent | e85a68e1536a0f6505300e1cb79f06b9743b00f7 (diff) | |
cleaning logs, docs, interrupts
Diffstat (limited to 'kernel/log.c')
| -rw-r--r-- | kernel/log.c | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/kernel/log.c b/kernel/log.c index b0eeab5..952c271 100644 --- a/kernel/log.c +++ b/kernel/log.c @@ -24,7 +24,7 @@ static void log_string(char *str) } } -void log(char *module_name, int prio, char *format_string, ...) +void log(bool color,char *module_name, int prio, char *format_string, ...) { #ifdef FOOLOS_LOG_OFF return; @@ -45,27 +45,10 @@ void log(char *module_name, int prio, char *format_string, ...) tfp_vsprintf(buf_info,format_string,va); va_end(va); - tfp_sprintf(buf_log,"\033[36;40m%s\033[31;40m %s:\033[37;40m %s\n",buf_time,module_name,buf_info); + if(color) tfp_sprintf(buf_log,"\033[36;40m%s\033[31;40m %s:\033[37;40m %s\n",buf_time,module_name,buf_info); + else tfp_sprintf(buf_log,"%s %s: %s\n",buf_time,module_name,buf_info); spinlock_spin(SPINLOCK_LOG); log_string(buf_log); spinlock_release(SPINLOCK_LOG); } - -/* -void panic(char *module_name, char *format_string) -{ - char buf_log[256]; - tfp_sprintf(buf_log,"\033[41;37m\n !! KERNEL PANIC !! %s: %s\n\n\033[37;40m",module_name,message); - - //PANIC DIRECTLY TO STDOUT// - syscall_write(1,buf_log,strlen(buf_log)); - log_string(buf_log); - - while(1) - { - asm volatile("cli"); - asm volatile("hlt"); - } -} -*/ |
