LF OS
Hobby operating system for amd64 with high ambitions
|
#include <config.h>
#include <stdint.h>
#include <string.h>
#include <panic.h>
#include <fbconsole.h>
#include <log.h>
#include <vm.h>
#include <scheduler.h>
#include <efi.h>
#include <io.h>
Go to the source code of this file.
Data Structures | |
struct | logging_page |
Functions | |
void | log_append_page (void) |
void | log_append (char level, char *component, char *message) |
void | log (char level, char *component, char *fmt,...) |
void | sc_handle_debug_print (char *message) |
Variables | |
const int | logging_page_size = 4080 |
struct logging_page | log_initial_page |
struct logging_page * | log_first = &log_initial_page |
struct logging_page * | log_last = &log_initial_page |
uint64_t | log_page_count = 1 |
uint64_t | log_count = 0 |
struct logging_page |
Data Fields | ||
---|---|---|
uint16_t | current_end | |
char | messages[logging_page_size - 18] | |
struct logging_page * | next | |
struct logging_page * | prev |
void log | ( | char | level, |
char * | component, | ||
char * | fmt, | ||
... | |||
) |
Append a log message to the kernel log buffer
level | Log level of the message (D, I, W, E, F -> debug, info, warning, error, fatal) |
component | Sub component (kernel, mm, vm, scheduler, ...) |
fmt | sprintf format string |
... | Variables to set in the resulting message |
Definition at line 120 of file log.c.
References kvsnprintf(), log_append(), logging_page_size, memset(), va_end, and va_start.
void log_append | ( | char | level, |
char * | component, | ||
char * | message | ||
) |
Append a log message to the kernel log buffer
level | Log level of the message (D, I, W, E, F -> debug, info, warning, error, fatal) |
component | Sub component (kernel, mm, vm, scheduler, ...) |
message | Message to log |
Definition at line 62 of file log.c.
References logging_page::current_end, efi_append_log(), fbconsole_active, fbconsole_write(), inb(), ksnprintf(), log_append_page(), log_count, log_first, log_last, message, logging_page::messages, outb(), and strlen().
void log_append_page | ( | void | ) |
Definition at line 34 of file log.c.
References logging_page::current_end, log_count, log_first, log_initial_page, log_last, log_page_count, logging_page_size, memset(), logging_page::messages, logging_page::next, logging_page::prev, vm_alloc(), and vm_free().
void sc_handle_debug_print | ( | char * | message | ) |
Definition at line 132 of file log.c.
References ksnprintf(), logd, message, scheduler_current_process, and strlen().
struct logging_page* log_first = &log_initial_page |
struct logging_page log_initial_page |
struct logging_page* log_last = &log_initial_page |