base-nova: Synchronize output to serial console with the hypervisor.

This commit is contained in:
Michael Mueller
2024-01-30 17:56:51 +01:00
parent 1fd735989f
commit e7d6363362
3 changed files with 19 additions and 0 deletions

View File

@@ -18,6 +18,9 @@
#include <bios_data_area.h>
#include <drivers/uart/x86_pc.h>
/* NOVA includes */
#include <nova/syscalls.h>
void Genode::Core_log::out(char const c)
{
enum { CLOCK = 0, BAUDRATE = 115200 };
@@ -28,3 +31,13 @@ void Genode::Core_log::out(char const c)
uart.put_char('\r');
uart.put_char(c);
}
void Genode::Core_log::acquire()
{
Nova::acquire_console();
}
void Genode::Core_log::release()
{
Nova::release_console();
}

View File

@@ -45,8 +45,10 @@ void Genode::init_core_log(Core_log_range const &r) { range = r; }
void Genode::Core_log::output(char const * str)
{
acquire();
for (unsigned i = 0; i < Genode::strlen(str); i++) {
out(str[i]);
out_mem(str[i]);
}
release();
}

View File

@@ -31,6 +31,10 @@ namespace Genode {
struct Genode::Core_log
{
void acquire();
void release();
void out(char const c);
void output(char const * str);