Modestus Moon OS  R4
CS 450 project
system.c File Reference
#include <string.h>
#include <system.h>
#include <core/serial.h>
Include dependency graph for system.c:

Go to the source code of this file.

Functions

void klogv (const char *msg)
 
void kpanic (const char *msg)
 

Function Documentation

void klogv ( const char *  msg)

Definition at line 11 of file system.c.

References serial_println(), and strcat().

Referenced by kmain(), and kpanic().

12 {
13  char logmsg[64] = {'\0'}, prefix[] = "klogv: ";
14  strcat(logmsg, prefix);
15  strcat(logmsg, msg);
16  serial_println(logmsg);
17 }
char * strcat(char *s1, const char *s2)
strcat concatenates the contents of one string onto another.
Definition: string.c:101
int serial_println(const char *msg)
Definition: serial.c:44
void kpanic ( const char *  msg)

Definition at line 24 of file system.c.

References cli, hlt, klogv(), and strcat().

Referenced by do_bounds(), do_breakpoint(), do_coprocessor(), do_coprocessor_segment(), do_debug(), do_device_not_available(), do_divide_error(), do_double_fault(), do_general_protection(), do_invalid_op(), do_invalid_tss(), do_nmi(), do_overflow(), do_page_fault(), do_segment_not_present(), do_stack_segment(), new_frame(), and sys_call().

25 {
26  cli(); //disable interrupts
27  char logmsg[64] = {'\0'}, prefix[] = "Panic: ";
28  strcat(logmsg, prefix);
29  strcat(logmsg, msg);
30  klogv(logmsg);
31  hlt(); //halt
32 }
#define hlt()
Definition: system.h:17
void klogv(const char *msg)
Definition: system.c:11
#define cli()
Definition: system.h:15
char * strcat(char *s1, const char *s2)
strcat concatenates the contents of one string onto another.
Definition: string.c:101