vbox: support routing serial output to Genode

Fixes #1308
This commit is contained in:
Alexander Boettcher 2014-11-28 17:14:54 +01:00 committed by Christian Helmuth
parent f970e4a71b
commit 6d391aae10
8 changed files with 45 additions and 12 deletions

View File

@ -1 +1 @@
fd1a0bb3692bfb4448f3b3f8978fc1c5d037e2c4
612b4fbfc6cea5442ce7dd96997789e15f987cb1

View File

@ -11,7 +11,7 @@ SHA(virtualbox) := e4c23b713e8715b8e0172fa066f2197756e901fe
PATCHES_LIST := acpi_drv dev_e1000 eminternal fake_pci_vendor iconv mouse
PATCHES_LIST += pdm_driver pdm_queue_irqs sharedfolder_pagelist timer
PATCHES_LIST += time-log-deadlock vbetables-gen vbox_inc vbox_main network
PATCHES_LIST += vga_fb vga_vbva vmdk vmmdev avoid_yield
PATCHES_LIST += vga_fb vga_vbva vmdk vmmdev avoid_yield serial
PATCHES := $(addsuffix .patch, $(PATCHES_LIST))
PATCHES := $(addprefix src/virtualbox/patches/, $(PATCHES))

View File

@ -123,7 +123,7 @@
</Adapter>
</Network>
<UART>
<Port slot="0" enabled="false" IOBase="0x3f8" IRQ="4" hostMode="Disconnected"/>
<Port slot="0" enabled="false" IOBase="0x3f8" IRQ="4" path="/dev/terminal" hostMode="HostDevice"/>
<Port slot="1" enabled="false" IOBase="0x2f8" IRQ="3" hostMode="Disconnected"/>
</UART>
<LPT>

View File

@ -1,4 +1,5 @@
set use_net 0
set use_serial 0
set build_components {
core init virtualbox
@ -7,11 +8,12 @@ set build_components {
drivers/timer
}
lappend_if [have_spec acpi] build_components drivers/acpi
lappend_if [have_spec pci] build_components drivers/pci
lappend_if [have_spec x86] build_components drivers/rtc
lappend_if [expr $use_serial] build_components server/log_terminal
lappend_if [have_spec acpi] build_components drivers/acpi
lappend_if [have_spec pci] build_components drivers/pci
lappend_if [have_spec x86] build_components drivers/rtc
lappend_if [expr $use_net] build_components drivers/nic
lappend_if [expr $use_net] build_components drivers/nic
build $build_components
@ -96,13 +98,27 @@ append_if [expr $use_net] config {
</start>
}
append_if [expr $use_serial] config {
<start name="log_terminal">
<resource name="RAM" quantum="2M"/>
<provides>
<service name="Terminal"/>
</provides>
</start>
}
append config {
<start name="virtualbox" priority="-2">
<resource name="RAM" quantum="448M"/>
<config vbox_file="test.vbox" vm_name="TestVM">
<libc stdout="/dev/log" stderr="/dev/log">
<vfs>
<dir name="dev"> <log/> </dir>
<dir name="dev"> <log/> </dir>}
append_if [expr $use_serial] config {
<dir name="dev"> <terminal/> </dir>}
append config {
<rom name="test.vbox" />
<dir name="VirtualBox VMs">
<dir name="TestVM">
@ -136,7 +152,8 @@ append boot_modules {
libc_terminal.lib.so libiconv.lib.so stdcxx.lib.so
}
append_if [expr $use_net] boot_modules { nic_drv }
append_if [expr $use_net] boot_modules { nic_drv }
append_if [expr $use_serial] boot_modules { log_terminal }
build_boot_image $boot_modules

View File

@ -201,7 +201,7 @@ class DummyClass {
void fireHostNameResolutionConfigurationChangeEvent(const ComObjPtr<EventSource>&);
void fireHostPCIDevicePlugEvent(ComPtr<EventSource>&, BSTR, bool, bool, ComObjPtr<PCIDeviceAttachment>&, void *);
void fireStateChangedEvent(const ComObjPtr<EventSource>&, MachineState_T);
void fireRuntimeErrorEvent(const ComObjPtr<EventSource>&, BOOL&, short unsigned int*&, short unsigned int*&);
void fireRuntimeErrorEvent(const ComObjPtr<EventSource>&, BOOL, IN_BSTR, IN_BSTR);
};
#define ATL_NO_VTABLE

View File

@ -102,8 +102,14 @@ void DummyClass<Console>::fireStateChangedEvent(ComObjPtr<EventSource> const&,
MachineState_T) TRACE()
template<>
void DummyClass<Console>::fireRuntimeErrorEvent(ComObjPtr<EventSource> const&,
bool&, unsigned short*&,
unsigned short*&) DUMMY()
bool aFatal, IN_BSTR aErrorID,
IN_BSTR aMessage)
{
PERR("%s : %u %s %s", __func__, aFatal,
Utf8Str(aErrorID).c_str(), Utf8Str(aMessage).c_str());
TRACE();
}
template<>
void DummyClass<Machine>::fireHostPCIDevicePlugEvent(ComPtr<EventSource>&,

View File

@ -118,6 +118,7 @@ extern "C" char *getenv(const char *name)
// "+main.e.l.f"
// "+hgcm.e.l.f"
// "+shared_folders.e.l.f"
// "+drv_host_serial.e.l.f"
;
if (Genode::strcmp(name, "VBOX_LOG_FLAGS") == 0 ||

View File

@ -0,0 +1,9 @@
+++ src/app/virtualbox/src/VBox/Devices/Serial/DrvHostSerial.cpp
@@ -903,6 +903,7 @@
PDMDrvHlpVMSetRuntimeError(pDrvIns, 0 /*fFlags*/, "DrvHostSerialFail",
N_("Ioctl failed for serial host device '%s' (%Rrc). The device will not work properly"),
pThis->pszDevicePath, RTErrConvertFromErrno(errno));
+ pThread->enmState = PDMTHREADSTATE_TERMINATING;
break;
}