mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 09:17:35 +00:00
LibBareMetal: Add support for kernel log stream
This commit is contained in:
parent
214f934465
commit
dc01a71fac
2 changed files with 14 additions and 1 deletions
|
@ -96,7 +96,7 @@ static void serial_putch(char ch)
|
||||||
was_cr = false;
|
was_cr = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void console_putch(char*&, char ch)
|
static void console_out(char ch)
|
||||||
{
|
{
|
||||||
if (serial_debug)
|
if (serial_debug)
|
||||||
serial_putch(ch);
|
serial_putch(ch);
|
||||||
|
@ -110,6 +110,11 @@ static void console_putch(char*&, char ch)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void console_putch(char*&, char ch)
|
||||||
|
{
|
||||||
|
console_out(ch);
|
||||||
|
}
|
||||||
|
|
||||||
int kprintf(const char* fmt, ...)
|
int kprintf(const char* fmt, ...)
|
||||||
{
|
{
|
||||||
color_on();
|
color_on();
|
||||||
|
@ -155,6 +160,13 @@ extern "C" int dbgputstr(const char* characters, int length)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern "C" int kernelputstr(const char* characters, int length)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < length; ++i)
|
||||||
|
console_out(characters[i]);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
extern "C" int dbgprintf(const char* fmt, ...)
|
extern "C" int dbgprintf(const char* fmt, ...)
|
||||||
{
|
{
|
||||||
color_on();
|
color_on();
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
extern "C" {
|
extern "C" {
|
||||||
int dbgprintf(const char* fmt, ...);
|
int dbgprintf(const char* fmt, ...);
|
||||||
int dbgputstr(const char*, int);
|
int dbgputstr(const char*, int);
|
||||||
|
int kernelputstr(const char*, int);
|
||||||
int kprintf(const char* fmt, ...);
|
int kprintf(const char* fmt, ...);
|
||||||
int sprintf(char* buf, const char* fmt, ...);
|
int sprintf(char* buf, const char* fmt, ...);
|
||||||
void set_serial_debug(bool on_or_off);
|
void set_serial_debug(bool on_or_off);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue