Modestus Moon OS
R4
CS 450 project
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
system.c
Go to the documentation of this file.
1
#include <
string.h
>
2
#include <
system.h
>
3
4
#include <
core/serial.h
>
5
6
/*
7
Procedure..: klogv
8
Description..: Kernel log messages. Sent to active
9
serial device.
10
*/
11
void
klogv
(
const
char
*msg)
12
{
13
char
logmsg[64] = {
'\0'
}, prefix[] =
"klogv: "
;
14
strcat
(logmsg, prefix);
15
strcat
(logmsg, msg);
16
serial_println
(logmsg);
17
}
18
19
/*
20
Procedure..: kpanic
21
Description..: Kernel panic. Prints an error message
22
and halts.
23
*/
24
void
kpanic
(
const
char
*msg)
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
}
string.h
hlt
#define hlt()
Definition:
system.h:17
klogv
void klogv(const char *msg)
Definition:
system.c:11
cli
#define cli()
Definition:
system.h:15
kpanic
void kpanic(const char *msg)
Definition:
system.c:24
strcat
char * strcat(char *s1, const char *s2)
strcat concatenates the contents of one string onto another.
Definition:
string.c:101
serial.h
serial_println
int serial_println(const char *msg)
Definition:
serial.c:44
system.h
mpx_core
kernel
core
system.c
Generated by
1.8.11