mirror of
https://github.com/mmueller41/genode.git
synced 2026-01-21 12:32:56 +01:00
base-nova: Synchronize output to serial console with the hypervisor.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -31,6 +31,10 @@ namespace Genode {
|
||||
|
||||
struct Genode::Core_log
|
||||
{
|
||||
void acquire();
|
||||
|
||||
void release();
|
||||
|
||||
void out(char const c);
|
||||
|
||||
void output(char const * str);
|
||||
|
||||
Reference in New Issue
Block a user