vbox: update to virtualbox 4.3.16

Fixes #1296
This commit is contained in:
Alexander Boettcher 2014-09-23 13:01:47 +02:00 committed by Christian Helmuth
parent c40aa45d86
commit 604b831e1e
103 changed files with 6848 additions and 1844 deletions

View File

@ -34,6 +34,9 @@ VBOX_CC_OPT += -DVBOXBFE_WITHOUT_COM
VBOX_CC_OPT += -DVBOX_WITHOUT_TESTING_FEATURES
VBOX_CC_OPT += -DUSE_SDL
VBOX_CC_OPT += -DVBOX_WITH_VIDEOHWACCEL
VBOX_CC_OPT += -DVBOX_WITH_XPCOM
VBOX_CC_OPT += -DRTLOG_REL_ENABLED -DRT_STRICT -DVBOX_STRICT
@ -44,10 +47,19 @@ VIRTUALBOX_VERSION_MAJOR := $(shell cat $(VIRTUALBOX_DIR)/Config.kmk | grep "VBO
VIRTUALBOX_VERSION_MINOR := $(shell cat $(VIRTUALBOX_DIR)/Config.kmk | grep "VBOX_VERSION_MINOR = " | grep -v "'VBOX_VERSION_MINOR" | sed "s/^.*= //")
VIRTUALBOX_VERSION_BUILD := $(shell cat $(VIRTUALBOX_DIR)/Config.kmk | grep "VBOX_VERSION_BUILD = " | grep -v "'VBOX_VERSION_BUILD" | sed "s/^.*= //")
ifeq ($(VBOX_MACH),x86_32)
VIRTUALBOX_PACKAGE_STRING = GenodeOS_32BIT_GENERIC
else
VIRTUALBOX_PACKAGE_STRING = GenodeOS_64BIT_GENERIC
endif
VBOX_CC_OPT += -DVBOX_VERSION_MAJOR=$(VIRTUALBOX_VERSION_MAJOR) \
-DVBOX_VERSION_MINOR=$(VIRTUALBOX_VERSION_MINOR) \
-DVBOX_VERSION_BUILD=$(VIRTUALBOX_VERSION_BUILD) \
-DVBOX_VERSION_STRING=\"$(VIRTUALBOX_VERSION_MAJOR).$(VIRTUALBOX_VERSION_MINOR).$(VIRTUALBOX_VERSION_BUILD)_OSE\"
-DVBOX_VERSION_STRING=\"$(VIRTUALBOX_VERSION_MAJOR).$(VIRTUALBOX_VERSION_MINOR).$(VIRTUALBOX_VERSION_BUILD)_OSE\" \
-DVBOX_PACKAGE_STRING=\"$(VIRTUALBOX_PACKAGE_STRING)\" \
-DVBOX_API_VERSION_STRING=\"$(VIRTUALBOX_VERSION_MAJOR)_$(VIRTUALBOX_VERSION_MINOR)\" \
-DIPRT_BLDCFG_VERSION_STRING=\"$(VIRTUALBOX_VERSION_MAJOR).$(VIRTUALBOX_VERSION_MINOR).$(VIRTUALBOX_VERSION_BUILD)_OSE\"
VBOX_CC_OPT += -DVBOX_HDD_NO_DYNAMIC_BACKENDS

View File

@ -16,12 +16,14 @@ SRC_CC += Devices/PC/DevAPIC.cpp
SRC_CC += Devices/Graphics/DevVGA.cpp
SRC_CC += Devices/Graphics/DevVGA_VBVA.cpp
SRC_CC += Devices/Graphics/DevVGA_VDMA.cpp
SRC_CC += Devices/Graphics/DevVGA-SVGA.cpp
SRC_CC += Devices/Graphics/HGSMI/HGSMIHost.cpp
SRC_CC += Devices/Graphics/HGSMI/HGSMIHostHlp.cpp
SRC_CC += Devices/Graphics/HGSMI/SHGSMIHost.cpp
SRC_CC += Devices/Storage/ATAPIPassthrough.cpp
SRC_CC += Devices/Storage/DevATA.cpp
SRC_CC += Devices/Storage/Debug.cpp
SRC_CC += Devices/Storage/fdc.c
SRC_CC += Devices/Storage/DevFdc.c
SRC_CC += Devices/Storage/DrvRawImage.cpp
SRC_CC += Devices/Network/DevE1000.cpp
SRC_CC += Devices/Network/DevE1000Phy.cpp
@ -39,14 +41,9 @@ INC_DIR += $(VBOX_DIR)/Devices/Bus
CC_WARN += -Wno-unused-but-set-variable
#
# Definitions needed to compile DevVGA.cpp
#
# VBOX_WITH_VDMA is needed because otherwise, the alignment of the
# VGASTATE::lock member would violate the assertion
# '!((uintptr_t)pvSample & 7)' in 'stamR3RegisterU'.
#
CC_OPT += -DVBOX_WITH_WDDM -DVBOX_WITH_VDMA
CC_OPT += -DVBOX_WITH_WDDM -DVBOX_WITH_WDDM_W8 -DVBOXWDDM_WITH_VBVA
CC_OPT += -DVBOX_WITH_VDMA
CC_OPT += -DVBOX_WITH_VMSVGA
Devices/Graphics/DevVGA.o: vbetables.h

View File

@ -9,12 +9,12 @@ SRC_CC += Devices/PC/DrvACPI.cpp
SRC_CC += Devices/Serial/DrvChar.cpp
SRC_CC += Devices/Serial/DrvRawFile.cpp
SRC_CC += Devices/Serial/DrvHostSerial.cpp
SRC_CC += Main/src-client/MouseImpl.cpp
#SRC_CC += Main/src-client/MouseImpl.cpp
SRC_CC += network.cpp
vpath network.cpp $(REP_DIR)/src/virtualbox
# includes needed by 'MouseImpl.cpp'
INC_DIR += $(VBOX_DIR)/Main/include
INC_DIR += $(VBOX_DIR)/Frontends/VBoxBFE
#INC_DIR += $(VBOX_DIR)/Main/include
#INC_DIR += $(VBOX_DIR)/Frontends/VBoxBFE

View File

@ -0,0 +1,67 @@
include $(REP_DIR)/lib/mk/virtualbox-common.inc
VBOX_CC_OPT += -DVBOX_COM_INPROC_API_CLIENT
LIBS += stdcxx
SRC_CC += Main/xml/Settings.cpp
SRC_CC += Main/src-all/EventImpl.cpp
SRC_CC += Main/src-all/DisplayResampleImage.cpp
SRC_CC += Main/src-all/DisplayUtils.cpp
SRC_CC += Main/src-all/Global.cpp
SRC_CC += Main/src-all/HashedPw.cpp
SRC_CC += Main/src-all/PCIDeviceAttachmentImpl.cpp
SRC_CC += Main/src-all/ProgressImpl.cpp
SRC_CC += Main/src-all/SharedFolderImpl.cpp
SRC_CC += Main/src-all/VirtualBoxBase.cpp
SRC_CC += Main/src-client/AdditionsFacilityImpl.cpp
SRC_CC += Main/src-client/BusAssignmentManager.cpp
SRC_CC += Main/src-client/ConsoleImpl.cpp
SRC_CC += Main/src-client/ConsoleImpl2.cpp
SRC_CC += Main/src-client/DisplayImpl.cpp
SRC_CC += Main/src-client/GuestImpl.cpp
SRC_CC += Main/src-client/HGCM.cpp
SRC_CC += Main/src-client/HGCMObjects.cpp
SRC_CC += Main/src-client/HGCMThread.cpp
SRC_CC += Main/src-client/KeyboardImpl.cpp
SRC_CC += Main/src-client/MouseImpl.cpp
SRC_CC += Main/src-client/VBoxDriversRegister.cpp
SRC_CC += Main/src-client/VMMDevInterface.cpp
SRC_CC += Main/src-client/SessionImpl.cpp
SRC_CC += Main/src-server/AudioAdapterImpl.cpp
SRC_CC += Main/src-server/BandwidthControlImpl.cpp
SRC_CC += Main/src-server/BandwidthGroupImpl.cpp
SRC_CC += Main/src-server/BIOSSettingsImpl.cpp
SRC_CC += Main/src-server/DHCPServerImpl.cpp
SRC_CC += Main/src-server/GuestOSTypeImpl.cpp
SRC_CC += Main/src-server/MachineImpl.cpp
SRC_CC += Main/src-server/MachineImplCloneVM.cpp
SRC_CC += Main/src-server/MediumAttachmentImpl.cpp
SRC_CC += Main/src-server/MediumImpl.cpp
SRC_CC += Main/src-server/MediumFormatImpl.cpp
SRC_CC += Main/src-server/MediumLock.cpp
SRC_CC += Main/src-server/NATEngineImpl.cpp
SRC_CC += Main/src-server/NetworkAdapterImpl.cpp
SRC_CC += Main/src-server/NetworkServiceRunner.cpp
SRC_CC += Main/src-server/ParallelPortImpl.cpp
SRC_CC += Main/src-server/SerialPortImpl.cpp
SRC_CC += Main/src-server/SnapshotImpl.cpp
SRC_CC += Main/src-server/StorageControllerImpl.cpp
SRC_CC += Main/src-server/SystemPropertiesImpl.cpp
SRC_CC += Main/src-server/TokenImpl.cpp
SRC_CC += Main/src-server/USBControllerImpl.cpp
SRC_CC += Main/src-server/USBDeviceFiltersImpl.cpp
SRC_CC += Main/src-server/VirtualBoxImpl.cpp
SRC_CC += Main/src-server/VRDEServerImpl.cpp
SRC_CC += Main/glue/AutoLock.cpp
SRC_CC += Main/glue/EventQueue.cpp
SRC_CC += Main/glue/string.cpp
SRC_CC += Main/glue/xpcom/helpers.cpp
INC_DIR += $(VBOX_DIR)/Main/xml
INC_DIR += $(VBOX_DIR)/Main/include
INC_DIR += $(REP_DIR)/src/virtualbox/frontend

View File

@ -12,6 +12,7 @@ FILTERED_OUT_SRC_CC = RTLogDefaultInit-generic.cpp \
RTTimeLocalExplode-generic.cpp \
semrw-lockless-generic.cpp \
tls-generic.cpp \
fs-stubs-generic.cpp \
RTSemEventMultiWait-2-ex-generic.cpp \
RTLogWriteStdErr-generic.cpp \
RTLogWriteStdOut-generic.cpp \
@ -34,15 +35,18 @@ SRC_CC += Runtime/common/log/logrel.cpp \
SRC_CC += Runtime/common/err/RTErrConvertFromErrno.cpp
SRC_CC += Runtime/common/alloc/memcache.cpp
SRC_CC += Runtime/common/alloc/heapoffset.cpp
SRC_CC += Runtime/common/checksum/alt-md5.cpp
SRC_CC += Runtime/common/checksum/alt-sha512.cpp
SRC_CC += Runtime/common/checksum/crc32.cpp
SRC_CC += Runtime/common/checksum/md5.cpp
SRC_CC += Runtime/common/checksum/ipv4.cpp
SRC_CC += Runtime/common/checksum/sha512str.cpp
SRC_CC += Runtime/common/log/log.cpp
SRC_CC += Runtime/common/log/log.cpp
SRC_CC += Runtime/common/log/logellipsis.cpp
SRC_CC += Runtime/common/log/logrelellipsis.cpp
SRC_CC += Runtime/common/log/logformat.cpp
SRC_CC += Runtime/common/misc/assert.cpp
SRC_CC += Runtime/common/misc/buildconfig.cpp
SRC_CC += Runtime/common/misc/lockvalidator.cpp
SRC_CC += Runtime/common/misc/once.cpp
SRC_CC += Runtime/common/misc/sg.cpp
@ -52,29 +56,36 @@ SRC_CC += Runtime/common/misc/RTAssertMsg2AddWeak.cpp
SRC_CC += Runtime/common/misc/RTAssertMsg2AddWeakV.cpp
SRC_CC += Runtime/common/misc/RTAssertMsg2Weak.cpp
SRC_CC += Runtime/common/misc/RTAssertMsg2WeakV.cpp
SRC_CC += Runtime/common/misc/RTMemWipeThoroughly.cpp
SRC_CC += Runtime/common/path/comparepaths.cpp
SRC_CC += Runtime/common/path/RTPathAbsDup.cpp
SRC_CC += Runtime/common/path/RTPathAbsEx.cpp
SRC_CC += Runtime/common/path/RTPathAppendEx.cpp
SRC_CC += Runtime/common/path/RTPathCalcRelative.cpp
SRC_CC += Runtime/common/path/RTPathExt.cpp
SRC_CC += Runtime/common/path/RTPathFilename.cpp
SRC_CC += Runtime/common/path/RTPathHasPath.cpp
SRC_CC += Runtime/common/path/RTPathJoinA.cpp
SRC_CC += Runtime/common/path/RTPathJoinEx.cpp
SRC_CC += Runtime/common/path/RTPathParse.cpp
SRC_CC += Runtime/common/path/RTPathParseSimple.cpp
SRC_CC += Runtime/common/path/RTPathRealDup.cpp
SRC_CC += Runtime/common/path/RTPathStartsWithRoot.cpp
SRC_CC += Runtime/common/path/RTPathStripExt.cpp
SRC_CC += Runtime/common/path/RTPathStripFilename.cpp
SRC_CC += Runtime/common/path/RTPathStripTrailingSlash.cpp
SRC_CC += Runtime/common/path/rtPathVolumeSpecLen.cpp
SRC_CC += Runtime/common/path/rtPathRootSpecLen.cpp
SRC_CC += Runtime/common/rand/rand.cpp
SRC_CC += Runtime/common/rand/randadv.cpp
SRC_CC += Runtime/common/rand/randparkmiller.cpp
SRC_CC += Runtime/common/zip/zip.cpp
SRC_CC += Runtime/common/string/base64.cpp
SRC_CC += Runtime/common/string/RTStrCmp.cpp
SRC_CC += Runtime/common/string/RTStrCopy.cpp
SRC_CC += Runtime/common/string/RTStrCopyEx.cpp
SRC_CC += Runtime/common/string/RTStrNCmp.cpp
SRC_CC += Runtime/common/string/RTStrNLen.cpp
SRC_CC += Runtime/common/string/RTStrPrintHexBytes.cpp
SRC_CC += Runtime/common/string/simplepattern.cpp
SRC_CC += Runtime/common/string/straprintf.cpp
SRC_CC += Runtime/common/string/strformat.cpp
@ -84,10 +95,12 @@ SRC_CC += Runtime/common/string/stringalloc.cpp
SRC_CC += Runtime/common/string/strprintf.cpp
SRC_CC += Runtime/common/string/strstrip.cpp
SRC_CC += Runtime/common/string/strtonum.cpp
SRC_CC += Runtime/common/string/unidata.cpp
SRC_CC += Runtime/common/string/utf-16.cpp
SRC_CC += Runtime/common/string/utf-8-case.cpp
SRC_CC += Runtime/common/string/unidata-lower.cpp
SRC_CC += Runtime/common/string/unidata-upper.cpp
SRC_CC += Runtime/common/string/utf-8.cpp
SRC_CC += Runtime/common/string/utf-8-case.cpp
SRC_CC += Runtime/common/string/utf-16.cpp
SRC_CC += Runtime/common/string/utf-16-case.cpp
SRC_CC += Runtime/common/table/avlpv.cpp
SRC_CC += Runtime/common/table/avlroioport.cpp
SRC_CC += Runtime/common/table/avlrogcphys.cpp
@ -96,6 +109,8 @@ SRC_CC += Runtime/common/time/time.cpp
SRC_CC += Runtime/common/time/timeprog.cpp
SRC_CC += Runtime/common/time/timesup.cpp
SRC_CC += Runtime/common/time/timesupref.cpp
SRC_CC += Runtime/common/vfs/vfsbase.cpp
SRC_CC += Runtime/common/zip/zip.cpp
SRC_CC += Runtime/r3/alloc.cpp
SRC_CC += Runtime/r3/dir.cpp
SRC_CC += Runtime/r3/fileio.cpp
@ -106,12 +121,12 @@ SRC_CC += Runtime/r3/posix/dir-posix.cpp
SRC_CC += Runtime/r3/posix/env-posix.cpp
SRC_CC += Runtime/r3/posix/fileio-posix.cpp
SRC_CC += Runtime/r3/posix/fileio2-posix.cpp
SRC_CC += Runtime/r3/posix/fs-posix.cpp
SRC_CC += Runtime/r3/posix/fs2-posix.cpp
SRC_CC += Runtime/r3/posix/fs3-posix.cpp
SRC_CC += Runtime/r3/posix/path-posix.cpp
SRC_CC += Runtime/r3/posix/path2-posix.cpp
SRC_CC += Runtime/r3/posix/pipe-posix.cpp
SRC_CC += Runtime/r3/posix/poll-posix.cpp
SRC_CC += Runtime/r3/posix/RTTimeNow-posix.cpp
SRC_CC += Runtime/r3/posix/semeventmulti-posix.cpp
SRC_CC += Runtime/r3/posix/semevent-posix.cpp
@ -128,6 +143,7 @@ SRC_S += Runtime/common/asm/ASMAtomicCmpXchgU64.asm
SRC_S += Runtime/common/asm/ASMAtomicReadU64.asm
SRC_S += Runtime/common/asm/ASMAtomicUoReadU64.as
SRC_S += Runtime/common/asm/ASMAtomicXchgU64.asm
SRC_S += Runtime/common/asm/ASMCpuIdExSlow.asm
SRC_CC += Runtime/common/err/errmsg.cpp
Runtime/common/err/errmsg.o: errmsgdata.h

View File

@ -11,6 +11,7 @@ SRC_CC += Storage/QED.cpp
SRC_CC += Storage/RAW.cpp
SRC_CC += Storage/VD.cpp
SRC_CC += Storage/VDI.cpp
SRC_CC += Storage/VDIfVfs.cpp
SRC_CC += Storage/VHD.cpp
SRC_CC += Storage/VHDX.cpp
SRC_CC += Storage/VMDK.cpp

View File

@ -17,6 +17,7 @@ SRC_CC += VMM/VMMR3/PDMCritSect.cpp
SRC_CC += VMM/VMMAll/PDMAll.cpp
SRC_CC += VMM/VMMAll/PDMAllQueue.cpp
SRC_CC += VMM/VMMAll/PDMAllCritSect.cpp
SRC_CC += VMM/VMMAll/PDMAllCritSectRw.cpp
SRC_CC += VMM/VMMR3/TM.cpp
SRC_CC += VMM/VMMAll/TMAll.cpp
@ -32,33 +33,26 @@ SRC_CC += VMM/VMMR3/PDMDevMiscHlp.cpp
SRC_CC += VMM/VMMR3/PDMDriver.cpp
SRC_CC += VMM/VMMR3/PDMThread.cpp
SRC_CC += VMM/VMMAll/CPUMAllMsrs.cpp
SRC_CC += VMM/VMMAll/CPUMAllRegs.cpp
SRC_CC += VMM/VMMR3/VMEmt.cpp
SRC_CC += VMM/VMMR3/VMReq.cpp
SRC_CC += VMM/VMMAll/DBGFAll.cpp
SRC_CC += VMM/VMMR3/DBGFInfo.cpp
SRC_CC += VMM/VMMR3/CPUM.cpp
SRC_CC += VMM/VMMR3/CPUMR3CpuId.cpp
SRC_CC += VMM/VMMR3/CPUMR3Db.cpp
SRC_CC += VMM/VMMAll/EMAll.cpp
SRC_CC += VMM/VMMR3/EM.cpp
SRC_CC += VMM/VMMR3/EMHM.cpp
SRC_CC += VMM/VMMR3/TRPM.cpp
SRC_CC += VMM/VMMAll/SELMAll.cpp
SRC_CC += VMM/VMMAll/PATMAll.cpp
SRC_CC += VMM/VMMR3/PATM.cpp
SRC_CC += VMM/VMMR3/PATMPatch.cpp
SRC_CC += VMM/VMMR3/PATMA.asm
SRC_CC += VMM/VMMR3/PATMSSM.cpp
SRC_CC += VMM/VMMR3/PATMGuest.cpp
SRC_CC += VMM/VMMAll/CSAMAll.cpp
SRC_CC += VMM/VMMR3/CSAM.cpp
SRC_CC += VMM/VMMR3/EMHwaccm.cpp
SRC_CC += VMM/VMMAll/REMAll.cpp
CC_OPT += -DVBOX_IN_VMM

View File

@ -0,0 +1,23 @@
include $(REP_DIR)/lib/mk/virtualbox-common.inc
ZLIB_DIR = $(VIRTUALBOX_DIR)/src/libs/zlib-1.2.6
LIBXML_DIR = $(VIRTUALBOX_DIR)/src/libs/libxml2-2.6.31
INC_DIR += $(ZLIB_DIR)
INC_DIR += $(LIBXML_DIR)/include
INC_DIR += $(call select_from_ports,libiconv)/include/iconv
LIBS += stdcxx
VBOX_CC_OPT += -DLIBXML_THREAD_ENABLED
SRC_C += catalog.c chvalid.c debugXML.c dict.c encoding.c error.c entities.c
SRC_C += globals.c hash.c list.c parser.c parserInternals.c pattern.c
SRC_C += relaxng.c threads.c tree.c uri.c valid.c HTMLtree.c HTMLparser.c
SRC_C += SAX.c SAX2.c xmlIO.c xmlmemory.c xmlreader.c xmlregexp.c xmlschemas.c
SRC_C += xmlschemastypes.c xmlsave.c xmlstring.c xmlunicode.c xpath.c xpointer.c
SRC_CC += Runtime/r3/xml.cpp
SRC_CC += Runtime/common/string/ministring.cpp
vpath %.c $(LIBXML_DIR)

View File

@ -1 +1 @@
cc82990bfeded59df2befde90f20004f2a5a331d
fd1a0bb3692bfb4448f3b3f8978fc1c5d037e2c4

View File

@ -1,52 +1,96 @@
LICENSE := GPLv2
VERSION := 4.2.24
VERSION := 4.3.16
DOWNLOADS := virtualbox.archive
VIRTUALBOX_TBZ2 := VirtualBox-$(VERSION).tar.bz2
URL(virtualbox) := http://download.virtualbox.org/virtualbox/$(VERSION)/$(VIRTUALBOX_TBZ2)
DIR(virtualbox) := src/app/virtualbox
SHA(virtualbox) := 4685a898fb426ae59081a3b3adf3f5b8c5cfd34e
SHA(virtualbox) := e4c23b713e8715b8e0172fa066f2197756e901fe
PATCHES := src/virtualbox/*.patch
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 := $(addsuffix .patch, $(PATCHES_LIST))
PATCHES := $(addprefix src/virtualbox/patches/, $(PATCHES))
$(call check_tool,xsltproc)
VBOX_MAIN_GLUE := AutoLock EventQueue string xpcom/helpers
VBOX_MAIN_ALL := DisplayResampleImage DisplayUtils EventImpl Global HashedPw
VBOX_MAIN_ALL += PCIDeviceAttachmentImpl ProgressImpl SharedFolderImpl
VBOX_MAIN_ALL += VirtualBoxBase
VBOX_MAIN_CLI := AdditionsFacilityImpl ConsoleImpl2 DisplayImpl HGCM HGCMThread
VBOX_MAIN_CLI += HGCMObjects
VBOX_MAIN_CLI += KeyboardImpl SessionImpl VMMDevInterface BusAssignmentManager
VBOX_MAIN_CLI += ConsoleImpl GuestImpl MouseImpl VBoxDriversRegister
VBOX_MAIN_SRV := AudioAdapterImpl DHCPServerImpl MediumAttachmentImpl
VBOX_MAIN_SRV += NATEngineImpl SerialPortImpl USBControllerImpl
VBOX_MAIN_SRV += BandwidthControlImpl GuestOSTypeImpl MediumFormatImpl
VBOX_MAIN_SRV += NetworkAdapterImpl SnapshotImpl USBDeviceFiltersImpl
VBOX_MAIN_SRV += BandwidthGroupImpl MachineImplCloneVM MediumImpl
VBOX_MAIN_SRV += NetworkServiceRunner StorageControllerImpl VirtualBoxImpl
VBOX_MAIN_SRV += BIOSSettingsImpl MachineImpl MediumLock ParallelPortImpl
VBOX_MAIN_SRV += SystemPropertiesImpl VRDEServerImpl TokenImpl
VBOX_MAIN_INC := AdditionsFacilityImpl AudioAdapterImpl AudioSnifferInterface
VBOX_MAIN_INC += AutoCaller AutostartDb AutoStateDep BandwidthControlImpl
VBOX_MAIN_INC += BandwidthGroupImpl BIOSSettingsImpl BusAssignmentManager Nvram
VBOX_MAIN_INC += ConsoleEvents ConsoleImpl DHCPServerImpl DisplayImpl HostImpl
VBOX_MAIN_INC += DisplayUtils EventImpl FramebufferImpl Global
VBOX_MAIN_INC += GuestCtrlImplPrivate GuestDirectoryImpl GuestDnDImpl Logging
VBOX_MAIN_INC += GuestFileImpl GuestFsObjInfoImpl GuestImpl GuestOSTypeImpl
VBOX_MAIN_INC += GuestSessionImpl HashedPw KeyboardImpl MachineImplCloneVM
VBOX_MAIN_INC += HGCM HGCMThread HGCMObjects
VBOX_MAIN_INC += MachineImpl MediumAttachmentImpl MediumFormatImpl MediumImpl
VBOX_MAIN_INC += MediumLock MouseImpl NATEngineImpl NATNetworkImpl objectslist
VBOX_MAIN_INC += NetworkAdapterImpl NetworkServiceRunner ParallelPortImpl
VBOX_MAIN_INC += PCIDeviceAttachmentImpl Performance ProgressImpl SnapshotImpl
VBOX_MAIN_INC += ProgressProxyImpl SerialPortImpl SessionImpl SharedFolderImpl
VBOX_MAIN_INC += StorageControllerImpl SystemPropertiesImpl TokenImpl VMMDev
VBOX_MAIN_INC += USBControllerImpl USBDeviceFilterImpl USBDeviceFiltersImpl
VBOX_MAIN_INC += VirtualBoxImpl VRDEServerImpl GuestProcessImpl
VBOX_SRC_VBOX := VMM Devices Runtime GuestHost/HGSMI Storage Disassembler
VBOX_SRC_VBOX += HostServices/SharedFolders Main/xml/Settings.cpp
VBOX_SRC_VBOX += Main/xml/VirtualBox-settings.xsd Main/xml/SchemaDefs.xsl
VBOX_SRC_VBOX += $(addsuffix .h, $(addprefix Main/include/, $(VBOX_MAIN_INC)))
VBOX_SRC_VBOX += $(addsuffix .cpp, $(addprefix Main/src-client/, $(VBOX_MAIN_CLI)))
VBOX_SRC_VBOX += $(addsuffix .cpp, $(addprefix Main/src-server/, $(VBOX_MAIN_SRV)))
VBOX_SRC_VBOX += $(addsuffix .cpp, $(addprefix Main/src-all/, $(VBOX_MAIN_ALL)))
VBOX_SRC_VBOX += $(addsuffix .cpp, $(addprefix Main/glue/, $(VBOX_MAIN_GLUE)))
VBOX_INC += types.h cdefs.h hgcmsvc.h err.h dis.h disopcode.h log.h sup.h pci.h
VBOX_INC += param.h ostypes.h VMMDev.h VMMDev2.h vusb.h dbg.h version.h HGSMI
VBOX_INC += VBoxVideo.h Hardware bioslogo.h scsi.h shflsvc.h VBoxGuest2.h vd.h
VBOX_INC += vd-plugin.h vd-ifs.h vd-ifs-internal.h vd-image-backend.h
VBOX_INC += vd-cache-backend.h vd-filter-backend.h msi.h asmdefs.mac err.mac
VBOX_INC += VBoxVideoHost3D.h VBoxVideo3D.h settings.h VBoxAuth.h
VBOX_INC_COM := array.h assert.h AutoLock.h ErrorInfo.h EventQueue.h Guid.h
VBOX_INC_COM += list.h MultiResult.h string.h
VBOX_CONTENT += $(addprefix src/VBox/, $(VBOX_SRC_VBOX))
VBOX_CONTENT += $(addprefix include/VBox/, $(VBOX_INC))
VBOX_CONTENT += $(addprefix include/VBox/com/, $(VBOX_INC_COM))
VBOX_CONTENT += src/libs/zlib-1.2.6 src/libs/liblzf-3.4 src/libs/libxml2-2.6.31
VBOX_CONTENT += src/recompiler include/VBox/vmm include/iprt Config.kmk
VIRTUALBOX_CONTENT = src/VBox/VMM \
src/VBox/Devices \
src/VBox/Runtime \
src/VBox/GuestHost/HGSMI \
src/VBox/Frontends/VBoxBFE \
src/VBox/Storage \
src/VBox/Disassembler \
src/VBox/HostServices/SharedFolders \
src/recompiler \
src/VBox/Main/include/MouseImpl.h \
src/VBox/Main/include/ConsoleEvents.h \
src/VBox/Main/src-client/MouseImpl.cpp \
src/libs/zlib-1.2.6 \
src/libs/liblzf-3.4 \
include/VBox/vmm \
include/iprt \
$(addprefix include/VBox/,types.h cdefs.h hgcmsvc.h \
err.h dis.h disopcode.h \
log.h sup.h pci.h param.h \
ostypes.h VMMDev.h VMMDev2.h \
vusb.h dbg.h version.h \
VBoxVideo.h Hardware bioslogo.h \
scsi.h shflsvc.h VBoxGuest2.h \
HGSMI) \
include/VBox/msi.h \
include/VBox/DevPCNet.h \
include/VBox/asmdefs.mac \
include/VBox/err.mac \
include/VBox/vd.h \
include/VBox/vd-ifs.h \
include/VBox/vd-plugin.h \
include/VBox/vd-ifs-internal.h \
include/VBox/vd-cache-plugin.h \
Config.kmk \
include/VBox/VBoxVideo3D.h
TAR_OPT(virtualbox) := \
--strip-components 1 \
$(addprefix $(VIRTUALBOX_TBZ2:.tar.bz2=)/,$(VIRTUALBOX_CONTENT)) \
--exclude SDLConsole.h --exclude SDLFramebuffer.h
$(addprefix $(VIRTUALBOX_TBZ2:.tar.bz2=)/,$(VBOX_CONTENT))
default : additional_steps
additional_steps : $(DOWNLOADS)
xsltproc --stringparam mode declare \
-o src/app/virtualbox/src/VBox/Main/xml/SchemaDefs.h \
src/app/virtualbox/src/VBox/Main/xml/SchemaDefs.xsl \
src/app/virtualbox/src/VBox/Main/xml/VirtualBox-settings.xsd

161
repos/ports/run/test.vbox Normal file
View File

@ -0,0 +1,161 @@
<?xml version="1.0"?>
<!--
** DO NOT EDIT THIS FILE.
** If you make changes to this file while any VirtualBox related application
** is running, your changes will be overwritten later, without taking effect.
** Use VBoxManage or the VirtualBox Manager GUI to make changes.
-->
<VirtualBox xmlns="http://www.innotek.de/VirtualBox-settings" version="1.14-linux">
<Machine uuid="{410f6221-6237-4833-b02c-a54000b7b190}" name="Tinycore" OSType="Linux26" snapshotFolder="Snapshots" lastStateChange="2014-10-30T13:26:17Z">
<MediaRegistry>
<HardDisks/>
<DVDImages>
<Image uuid="{81763434-9a51-49e8-9444-528a5a28c4bc}" location="test.iso"/>
</DVDImages>
<FloppyImages/>
</MediaRegistry>
<ExtraData>
<ExtraDataItem name="GUI/LastGuestSizeHint" value="720,400"/>
<ExtraDataItem name="GUI/LastNormalWindowPosition" value="513,100,720,422"/>
</ExtraData>
<Hardware version="2">
<CPU count="1" hotplug="false">
<HardwareVirtEx enabled="true"/>
<HardwareVirtExNestedPaging enabled="true"/>
<HardwareVirtExVPID enabled="true"/>
<HardwareVirtExUX enabled="true"/>
<PAE enabled="false"/>
<LongMode enabled="false"/>
<HardwareVirtExLargePages enabled="false"/>
<HardwareVirtForce enabled="false"/>
</CPU>
<Memory RAMSize="256" PageFusion="false"/>
<HID Pointing="PS2Mouse" Keyboard="PS2Keyboard"/>
<HPET enabled="false"/>
<Chipset type="PIIX3"/>
<Boot>
<Order position="1" device="Floppy"/>
<Order position="2" device="DVD"/>
<Order position="3" device="HardDisk"/>
<Order position="4" device="None"/>
</Boot>
<Display VRAMSize="12" monitorCount="1" accelerate3D="false" accelerate2DVideo="false"/>
<VideoCapture enabled="false" screens="18446744073709551615" horzRes="1024" vertRes="768" rate="512" fps="25"/>
<RemoteDisplay enabled="false" authType="Null" authTimeout="5000"/>
<BIOS>
<ACPI enabled="true"/>
<IOAPIC enabled="false"/>
<Logo fadeIn="true" fadeOut="true" displayTime="0"/>
<BootMenu mode="MessageAndMenu"/>
<TimeOffset value="0"/>
<PXEDebug enabled="false"/>
</BIOS>
<USB>
<Controllers/>
<DeviceFilters/>
</USB>
<Network>
<Adapter slot="0" enabled="false" MACAddress="08002785385E" cable="true" speed="0" type="82540EM">
<DisabledModes>
<InternalNetwork name="intnet"/>
<NATNetwork name="NatNetwork"/>
</DisabledModes>
<NAT>
<DNS pass-domain="true" use-proxy="false" use-host-resolver="false"/>
<Alias logging="false" proxy-only="false" use-same-ports="false"/>
</NAT>
</Adapter>
<Adapter slot="1" enabled="false" MACAddress="0800273AD0BB" cable="true" speed="0" type="82540EM">
<DisabledModes>
<NAT>
<DNS pass-domain="true" use-proxy="false" use-host-resolver="false"/>
<Alias logging="false" proxy-only="false" use-same-ports="false"/>
</NAT>
</DisabledModes>
</Adapter>
<Adapter slot="2" enabled="false" MACAddress="0800270786C1" cable="true" speed="0" type="82540EM">
<DisabledModes>
<NAT>
<DNS pass-domain="true" use-proxy="false" use-host-resolver="false"/>
<Alias logging="false" proxy-only="false" use-same-ports="false"/>
</NAT>
</DisabledModes>
</Adapter>
<Adapter slot="3" enabled="false" MACAddress="0800279B9C1E" cable="true" speed="0" type="82540EM">
<DisabledModes>
<NAT>
<DNS pass-domain="true" use-proxy="false" use-host-resolver="false"/>
<Alias logging="false" proxy-only="false" use-same-ports="false"/>
</NAT>
</DisabledModes>
</Adapter>
<Adapter slot="4" enabled="false" MACAddress="080027B94C18" cable="true" speed="0" type="82540EM">
<DisabledModes>
<NAT>
<DNS pass-domain="true" use-proxy="false" use-host-resolver="false"/>
<Alias logging="false" proxy-only="false" use-same-ports="false"/>
</NAT>
</DisabledModes>
</Adapter>
<Adapter slot="5" enabled="false" MACAddress="080027E38E65" cable="true" speed="0" type="82540EM">
<DisabledModes>
<NAT>
<DNS pass-domain="true" use-proxy="false" use-host-resolver="false"/>
<Alias logging="false" proxy-only="false" use-same-ports="false"/>
</NAT>
</DisabledModes>
</Adapter>
<Adapter slot="6" enabled="false" MACAddress="0800275A8627" cable="true" speed="0" type="82540EM">
<DisabledModes>
<NAT>
<DNS pass-domain="true" use-proxy="false" use-host-resolver="false"/>
<Alias logging="false" proxy-only="false" use-same-ports="false"/>
</NAT>
</DisabledModes>
</Adapter>
<Adapter slot="7" enabled="false" MACAddress="0800271CE60A" cable="true" speed="0" type="82540EM">
<DisabledModes>
<NAT>
<DNS pass-domain="true" use-proxy="false" use-host-resolver="false"/>
<Alias logging="false" proxy-only="false" use-same-ports="false"/>
</NAT>
</DisabledModes>
</Adapter>
</Network>
<UART>
<Port slot="0" enabled="false" IOBase="0x3f8" IRQ="4" hostMode="Disconnected"/>
<Port slot="1" enabled="false" IOBase="0x2f8" IRQ="3" hostMode="Disconnected"/>
</UART>
<LPT>
<Port slot="0" enabled="false" IOBase="0x378" IRQ="7"/>
<Port slot="1" enabled="false" IOBase="0x378" IRQ="7"/>
</LPT>
<AudioAdapter controller="AC97" driver="Pulse" enabled="false"/>
<RTC localOrUTC="UTC"/>
<SharedFolders/>
<Clipboard mode="Disabled"/>
<DragAndDrop mode="Disabled"/>
<IO>
<IoCache enabled="true" size="5"/>
<BandwidthGroups/>
</IO>
<HostPci>
<Devices/>
</HostPci>
<EmulatedUSB>
<CardReader enabled="false"/>
</EmulatedUSB>
<Guest memoryBalloonSize="0"/>
<GuestProperties>
<GuestProperty name="/VirtualBox/HostInfo/GUI/LanguageID" value="en_US" timestamp="1414675524029545000" flags=""/>
</GuestProperties>
</Hardware>
<StorageControllers>
<StorageController name="IDE" type="PIIX4" PortCount="2" useHostIOCache="true" Bootable="true">
<AttachedDevice passthrough="false" tempeject="true" type="DVD" port="1" device="0">
<Image uuid="{81763434-9a51-49e8-9444-528a5a28c4bc}"/>
</AttachedDevice>
</StorageController>
</StorageControllers>
</Machine>
</VirtualBox>

View File

@ -98,20 +98,17 @@ append_if [expr $use_net] config {
append config {
<start name="virtualbox" priority="-2">
<resource name="RAM" quantum="1G"/>
<config>
<image type="iso" file="test.iso" />
<!-- <ioapic/> -->
<!-- <noacpi/> -->}
append_if [expr $use_net] config {
<net model="e1000"/>}
append config {
<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>
<rom name="test.iso" />
<rom name="test.vbox" />
<dir name="VirtualBox VMs">
<dir name="TestVM">
<rom name="test.iso" />
</dir>
</dir>
</vfs>
</libc>
</config>
@ -121,7 +118,9 @@ append config {
install_config $config
set boot_modules { core init timer virtualbox test.iso }
exec cp ${genode_dir}/repos/ports/run/test.vbox bin/.
set boot_modules { core init timer virtualbox test.iso test.vbox }
# platform-specific modules
lappend_if [have_spec ps2] boot_modules ps2_drv
@ -132,9 +131,10 @@ lappend_if [have_spec linux] boot_modules fb_sdl
lappend_if [have_spec nova] boot_modules pci_device_pd
lappend_if [have_spec x86] boot_modules rtc_drv
append boot_modules { ld.lib.so libc.lib.so libm.lib.so pthread.lib.so
libc_lock_pipe.lib.so libc_terminal.lib.so
libiconv.lib.so }
append boot_modules {
ld.lib.so libc.lib.so libm.lib.so pthread.lib.so libc_lock_pipe.lib.so
libc_terminal.lib.so libiconv.lib.so stdcxx.lib.so
}
append_if [expr $use_net] boot_modules { nic_drv }

View File

@ -15,9 +15,10 @@ append 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 [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_ram_fs] build_components server/ram_fs
build $build_components
@ -73,6 +74,21 @@ set config {
</route>
</start>}
append_if [expr $use_ram_fs] config {
<start name="ram_fs" priority="-1">
<resource name="RAM" quantum="512M" />
<provides><service name="File_system"/></provides>
<config>
<content>
<dir name="ram">
<rom name="overlay.vdi"/>
</dir>
</content>
<!-- constrain sessions according to their labels -->
<policy label="vbox -> from_ram_fs" root="/ram" writeable="yes" />
</config>
</start>}
append_if [have_spec acpi] config {
<start name="acpi" priority="-1">
<resource name="RAM" quantum="10M"/>
@ -127,9 +143,9 @@ append boot_modules {
part_blk ahci
ld.lib.so libc.lib.so libm.lib.so pthread.lib.so
libc_lock_pipe.lib.so libc_terminal.lib.so
libiconv.lib.so
libiconv.lib.so stdcxx.lib.so
rump.lib.so rump_fs.lib.so rump_fs
virtualbox vbox-auto-test-helper
virtualbox
}
#
@ -162,6 +178,9 @@ append boot_modules {
# }
#}
lappend_if [expr $use_ram_fs] boot_modules ram_fs
lappend_if [expr $use_ram_fs] boot_modules overlay.vdi
# platform-specific modules
lappend_if [have_spec ps2] boot_modules ps2_drv
lappend_if [have_spec acpi] boot_modules acpi_drv
@ -169,5 +188,3 @@ lappend_if [have_spec pci] boot_modules pci_drv
lappend_if [have_spec framebuffer] boot_modules fb_drv
lappend_if [have_spec nova] boot_modules pci_device_pd
lappend_if [have_spec x86] boot_modules rtc_drv
build_boot_image $boot_modules

View File

@ -1,62 +1,45 @@
# Tested for nova.
assert_spec nova
set use_vdi 1
set use_iso 0
set vdi_image "win7.vdi"
set config_of_app {
<start name="vbox-auto-test-helper" priority="-1">
<resource name="RAM" quantum="10M"/>
<route>
<service name="File_system"> <child name="rump_fs"/> </service>
<any-service> <parent/> <any-child /> </any-service>
</route>
<config>
<libc stdout="/dev/log" stderr="/dev/log">
<vfs>
<fs />
<dir name="dev"> <log/> </dir>
</vfs>
</libc>
</config>
</start>
if {[is_qemu_available]} {
puts "\nRun script does not support Qemu.\n"
exit
}
source ${genode_dir}/repos/ports/run/virtualbox_auto.inc
set vdi_image "win7.vdi"
# Write overlay back to harddisk if set to 0
set use_ram_fs 0
run_genode_until "vbox_auto_test_helper is done." 20
exec kill [exp_pid i $spawn_id]
# reset values used before
set build_components { }
set boot_modules { }
set boot_modules { vm_auto_disk.vbox }
set config_of_app {
<start name="vbox" priority="-2">
<binary name="virtualbox" />
<resource name="RAM" quantum="2G"/>
<config>}
<resource name="RAM" quantum="1280M"/>
<config vbox_file="vm_auto_disk.vbox" vm_name="AutoDisk">
<libc stdout="/dev/log" stderr="/dev/log">
<vfs>}
if {$use_iso} {
append config_of_app "
<image type=\"iso\" file=\"/$iso_image\"/>"
}
if {$use_vdi} {
append config_of_app "
<image type=\"vdi\" file=\"/$vdi_image\" overlay=\"yes\"/>"
}
append_if [expr $use_ram_fs] config_of_app {
<dir name="ram"> <fs label="from_ram_fs"/> </dir>}
append config_of_app {
<libc stdout="/dev/log" stderr="/dev/log">
<vfs>
<fs />
<dir name="dev"> <log/> </dir>
<rom name="vm_auto_disk.vbox" />
<fs />
</vfs>
</libc>
</config>
<route>
<route>}
append_if [expr $use_ram_fs] config_of_app {
<service name="File_system">
<if-arg key="label" value="from_ram_fs" />
<child name="ram_fs"/>
</service>}
append config_of_app {
<service name="File_system"> <child name="rump_fs"/> </service>
<any-service> <parent/> <any-child /> </any-service>
</route>
@ -65,10 +48,18 @@ append config_of_app {
source ${genode_dir}/repos/ports/run/virtualbox_auto.inc
# copy vbox configuration to bin directory
exec cp ${genode_dir}/repos/ports/run/vm_auto_disk.vbox bin/.
run_genode_until "ignore resize request to 720x400" 20
run_genode_until "ignore resize request to 640x480" 25 $spawn_id
run_genode_until "ignore resize request to 800x600" 35 $spawn_id
run_genode_until {\[init -\> vbox\].*Guest Additions capability report:.*seamless: yes, hostWindowMapping: no, graphics: yes} 60 $spawn_id
build_boot_image $boot_modules
run_genode_until "fb resize : 1024x768@16 -> 720x400@0" 40
run_genode_until "fb resize : 720x400@16 -> 640x480@0" 25 $spawn_id
run_genode_until "fb resize : 640x480@16 -> 800x600@16" 45 $spawn_id
run_genode_until {\[init -\> vbox\].*Guest Additions capability report:.*seamless: yes, hostWindowMapping: no, graphics: yes} 180 $spawn_id
# cleanup bin directory - remove vbox file
exec rm bin/vm_auto_disk.vbox
puts "\nTest succeeded"

View File

@ -57,7 +57,6 @@
# beforehand. test.bat contains the actual instructions to be performed by
# the VM - for this script to copy the test.bin file from D: to E:.
if {[is_qemu_available]} {
puts "\nRun script does not support Qemu.\n"
exit
@ -66,11 +65,8 @@ if {[is_qemu_available]} {
# Tested for nova.
assert_spec nova
#
# Build Noux packages only once
#
foreach pkg {bash coreutils} {
lappend_if [expr ![file exists bin/$pkg]] build_components noux-pkg/$pkg }
# Write overlay back to harddisk if set to 0
set use_ram_fs 0
#
# Create .bat file to be executed by Win VM
@ -96,52 +92,28 @@ catch { exec unix2dos bin/template.bat }
#
catch { exec dd if=/dev/urandom of=bin/test.bin bs=4096 count=8160 }
#
# Step 0: prepare overlay.vdi for a clean run of the VM
#
set config_of_app {
<start name="vbox-auto-test-helper" priority="-1">
<resource name="RAM" quantum="10M"/>
<route>
<service name="File_system"> <child name="rump_fs"/> </service>
<any-service> <parent/> <any-child /> </any-service>
</route>
<config>
<libc stdout="/dev/log" stderr="/dev/log">
<vfs>
<fs />
<dir name="dev"> <log/> </dir>
</vfs>
</libc>
</config>
</start>
}
source ${genode_dir}/repos/ports/run/virtualbox_auto.inc
run_genode_until "vbox_auto_test_helper is done." 20
exec kill [exp_pid i $spawn_id]
#
# Step 1: prepare and start the actual VM
#
exec tar cfv bin/bash.tar -h -C bin/bash .
exec tar cfv bin/coreutils.tar -h -C bin/coreutils .
set build_components {
server/ram_fs
server/tcp_terminal drivers/nic
noux/minimal
server/ram_fs
server/tcp_terminal drivers/nic
lib/libc_noux
noux/minimal
}
#
# Build Noux packages only once
#
foreach pkg {bash coreutils} {
lappend_if [expr ![file exists bin/$pkg]] build_components noux-pkg/$pkg }
set boot_modules {
ram_fs
noux libc_noux.lib.so bash.tar coreutils.tar
tcp_terminal lwip.lib.so nic_drv
test.bin template.bat
vm_auto_share.vbox
}
set config_of_app {
@ -213,21 +185,32 @@ set config_of_app {
<start name="vbox" priority="-2">
<binary name="virtualbox" />
<resource name="RAM" quantum="1536M"/>
<config>
<share host="/from" guest="from" />
<share host="/to" guest="to" />
<image type="vdi" file="win7.vdi" overlay="yes"/>
<resource name="RAM" quantum="1280M"/>
<config vbox_file="vm_auto_share.vbox" vm_name="AutoDisk">
<libc stdout="/dev/log" stderr="/dev/log">
<vfs>
<dir name="dev"> <log/> </dir>
<rom name="vm_auto_share.vbox" />}
append_if [expr $use_ram_fs] config_of_app {
<dir name="ram"> <fs label="from_ram_fs"/> </dir>}
append config_of_app {
<dir name="from"> <fs label="share_ram_fs_from"/> </dir>
<dir name="to"> <fs label="share_ram_fs_to"/> </dir>
<fs />
</vfs>
</libc>
</config>
<route>
<route>}
append_if [expr $use_ram_fs] config_of_app {
<service name="File_system">
<if-arg key="label" value="from_ram_fs" />
<child name="ram_fs"/>
</service>}
append config_of_app {
<service name="File_system">
<if-arg key="label" value="share_ram_fs_from" />
<child name="ram_fs_from"/>
@ -244,6 +227,12 @@ set config_of_app {
source ${genode_dir}/repos/ports/run/virtualbox_auto.inc
exec tar cfv bin/bash.tar -h -C bin/bash .
exec tar cfv bin/coreutils.tar -h -C bin/coreutils .
exec cp ${genode_dir}/repos/ports/run/vm_auto_share.vbox bin/.
build_boot_image $boot_modules
#
# Step 2: Read out TCP/IP address of tcp_terminal running on Genode target
#
@ -256,6 +245,8 @@ regexp {[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+} $serial_ip_addr serial_ip_addr
#
# Step 3: Wait until Windows is up for sure
#
run_genode_until {\[init -\> vbox\].*Guest Additions capability report:.*seamless: yes, hostWindowMapping: no, graphics: yes} 300 $serial_id
@ -292,7 +283,7 @@ puts $noux_id "sleep 5"
puts $noux_id "done"
# Wait until VM signaled shutdown state
run_genode_until {\[init -\> vbox\].*Changing the VM state from 'POWERING_OFF' to 'OFF'} 120 $serial_id
run_genode_until {\[init -\> vbox\] EMT PDMR3PowerOff: .* ns run time} 120 $serial_id
# SHA1 of copied file
puts $noux_id "sha1sum to/test.bin"
@ -305,6 +296,7 @@ run_genode_until {[[:xdigit:]]+ to/test\.bin} 50 $noux_id
foreach pkg {bash coreutils} { exec rm -f bin/$pkg.tar }
exec rm -f bin/test.bin
exec rm -f bin/template.bat
exec rm -f bin/vm_auto_share.vbox
#

View File

@ -0,0 +1,185 @@
<?xml version="1.0"?>
<!--
** DO NOT EDIT THIS FILE.
** If you make changes to this file while any VirtualBox related application
** is running, your changes will be overwritten later, without taking effect.
** Use VBoxManage or the VirtualBox Manager GUI to make changes.
-->
<VirtualBox xmlns="http://www.innotek.de/VirtualBox-settings" version="1.14-linux">
<Machine uuid="{37ab43a5-38d8-4491-93f5-5b0b077f5c32}" name="Windows XP" OSType="WindowsXP" snapshotFolder="Snapshots" lastStateChange="2014-11-14T11:58:35Z">
<MediaRegistry>
<HardDisks>
<HardDisk uuid="{8e55fcfc-4c09-4173-9066-341968be4864}" location="/win7.vdi" format="VDI" type="Immutable">
<HardDisk uuid="{4c5ed34f-f6cf-48e8-808d-2c06f0d11464}" location="/ram/overlay.vdi" format="VDI" autoReset="true"/>
</HardDisk>
</HardDisks>
<DVDImages/>
<FloppyImages/>
</MediaRegistry>
<ExtraData>
<ExtraDataItem name="GUI/LastGuestSizeHint" value="1024,768"/>
<ExtraDataItem name="GUI/LastNormalWindowPosition" value="513,100,1024,790"/>
</ExtraData>
<Hardware version="2">
<CPU count="1" hotplug="false">
<HardwareVirtEx enabled="true"/>
<HardwareVirtExNestedPaging enabled="true"/>
<HardwareVirtExVPID enabled="true"/>
<HardwareVirtExUX enabled="true"/>
<PAE enabled="true"/>
<LongMode enabled="false"/>
<HardwareVirtExLargePages enabled="false"/>
<HardwareVirtForce enabled="false"/>
</CPU>
<Memory RAMSize="1024" PageFusion="false"/>
<HID Pointing="PS2Mouse" Keyboard="PS2Keyboard"/>
<HPET enabled="false"/>
<Chipset type="PIIX3"/>
<Boot>
<Order position="1" device="Floppy"/>
<Order position="2" device="DVD"/>
<Order position="3" device="HardDisk"/>
<Order position="4" device="None"/>
</Boot>
<Display VRAMSize="20" monitorCount="1" accelerate3D="false" accelerate2DVideo="false"/>
<VideoCapture enabled="false" screens="18446744073709551615" horzRes="1024" vertRes="768" rate="512" fps="25"/>
<RemoteDisplay enabled="false" authType="Null"/>
<BIOS>
<ACPI enabled="true"/>
<IOAPIC enabled="false"/>
<Logo fadeIn="true" fadeOut="true" displayTime="0"/>
<BootMenu mode="MessageAndMenu"/>
<TimeOffset value="0"/>
<PXEDebug enabled="false"/>
</BIOS>
<USB>
<Controllers/>
<DeviceFilters/>
</USB>
<Network>
<Adapter slot="0" enabled="false" MACAddress="0800271D7901" cable="true" speed="0" type="82540EM">
<HostInterface/>
<DisabledModes/>
</Adapter>
<Adapter slot="1" enabled="false" MACAddress="08002790A84B" cable="true" speed="0" type="Am79C973">
<DisabledModes>
<NAT>
<DNS pass-domain="true" use-proxy="false" use-host-resolver="false"/>
<Alias logging="false" proxy-only="false" use-same-ports="false"/>
</NAT>
</DisabledModes>
</Adapter>
<Adapter slot="2" enabled="false" MACAddress="080027EEE873" cable="true" speed="0" type="Am79C973">
<DisabledModes>
<NAT>
<DNS pass-domain="true" use-proxy="false" use-host-resolver="false"/>
<Alias logging="false" proxy-only="false" use-same-ports="false"/>
</NAT>
</DisabledModes>
</Adapter>
<Adapter slot="3" enabled="false" MACAddress="080027D37A39" cable="true" speed="0" type="Am79C973">
<DisabledModes>
<NAT>
<DNS pass-domain="true" use-proxy="false" use-host-resolver="false"/>
<Alias logging="false" proxy-only="false" use-same-ports="false"/>
</NAT>
</DisabledModes>
</Adapter>
<Adapter slot="4" enabled="false" MACAddress="080027F9D5DA" cable="true" speed="0" type="Am79C973">
<DisabledModes>
<NAT>
<DNS pass-domain="true" use-proxy="false" use-host-resolver="false"/>
<Alias logging="false" proxy-only="false" use-same-ports="false"/>
</NAT>
</DisabledModes>
</Adapter>
<Adapter slot="5" enabled="false" MACAddress="080027EEC7EA" cable="true" speed="0" type="Am79C973">
<DisabledModes>
<NAT>
<DNS pass-domain="true" use-proxy="false" use-host-resolver="false"/>
<Alias logging="false" proxy-only="false" use-same-ports="false"/>
</NAT>
</DisabledModes>
</Adapter>
<Adapter slot="6" enabled="false" MACAddress="0800279C5C02" cable="true" speed="0" type="Am79C973">
<DisabledModes>
<NAT>
<DNS pass-domain="true" use-proxy="false" use-host-resolver="false"/>
<Alias logging="false" proxy-only="false" use-same-ports="false"/>
</NAT>
</DisabledModes>
</Adapter>
<Adapter slot="7" enabled="false" MACAddress="080027E8E350" cable="true" speed="0" type="Am79C973">
<DisabledModes>
<NAT>
<DNS pass-domain="true" use-proxy="false" use-host-resolver="false"/>
<Alias logging="false" proxy-only="false" use-same-ports="false"/>
</NAT>
</DisabledModes>
</Adapter>
</Network>
<UART>
<Port slot="0" enabled="false" IOBase="0x3f8" IRQ="4" hostMode="Disconnected"/>
<Port slot="1" enabled="false" IOBase="0x2f8" IRQ="3" hostMode="Disconnected"/>
</UART>
<LPT>
<Port slot="0" enabled="false" IOBase="0x378" IRQ="7"/>
<Port slot="1" enabled="false" IOBase="0x378" IRQ="7"/>
</LPT>
<AudioAdapter controller="AC97" driver="Pulse" enabled="false"/>
<RTC localOrUTC="UTC"/>
<SharedFolders/>
<Clipboard mode="Disabled"/>
<DragAndDrop mode="Disabled"/>
<IO>
<IoCache enabled="true" size="5"/>
<BandwidthGroups/>
</IO>
<HostPci>
<Devices/>
</HostPci>
<EmulatedUSB>
<CardReader enabled="false"/>
</EmulatedUSB>
<Guest memoryBalloonSize="0"/>
<GuestProperties>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxControl.exe" value="4.2.24r92790" timestamp="1415966288630337000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxCredProv.dll" value="-" timestamp="1415966288637768000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxDisp.dll" value="4.2.24r92790" timestamp="1415966288632592000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxGINA.dll" value="-" timestamp="1415966288637454000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxGuest.sys" value="4.2.24r92790" timestamp="1415966288652892000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxHook.dll" value="4.2.24r92790" timestamp="1415966288632047000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxMRXNP.dll" value="4.2.24r92790" timestamp="1415966288634519000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxMouse.sys" value="4.2.24r92790" timestamp="1415966288653459000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxOGL.dll" value="4.2.24r92790" timestamp="1415966288651797000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxOGLarrayspu.dll" value="4.2.24r92790" timestamp="1415966288638972000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxOGLcrutil.dll" value="4.2.24r92790" timestamp="1415966288640771000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxOGLerrorspu.dll" value="4.2.24r92790" timestamp="1415966288642065000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxOGLfeedbackspu.dll" value="4.2.24r92790" timestamp="1415966288648832000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxOGLpackspu.dll" value="4.2.24r92790" timestamp="1415966288644753000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxOGLpassthroughspu.dll" value="4.2.24r92790" timestamp="1415966288645967000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxSF.sys" value="4.2.24r92790" timestamp="1415966288654030000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxService.exe" value="4.2.24r92790" timestamp="1415966288634937000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxTray.exe" value="4.2.24r92790" timestamp="1415966288637109000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxVideo.sys" value="4.2.24r92790" timestamp="1415966288655613000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/HostVerLastChecked" value="4.3.10" timestamp="1415966303913847000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/InstallDir" value="C:/Program Files/Oracle/VirtualBox Guest Additions" timestamp="1415966288627098000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Revision" value="92790" timestamp="1415966288620317000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Version" value="4.2.24" timestamp="1415966288619548000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/VersionExt" value="4.2.24" timestamp="1415966288619930000" flags=""/>
<GuestProperty name="/VirtualBox/GuestInfo/OS/Product" value="Windows 7" timestamp="1415966288617739000" flags=""/>
<GuestProperty name="/VirtualBox/GuestInfo/OS/Release" value="6.1.7601" timestamp="1415966288618219000" flags=""/>
<GuestProperty name="/VirtualBox/GuestInfo/OS/ServicePack" value="1" timestamp="1415966288619118000" flags=""/>
<GuestProperty name="/VirtualBox/HostInfo/GUI/LanguageID" value="en_US" timestamp="1415966277397115000" flags=""/>
</GuestProperties>
</Hardware>
<StorageControllers>
<StorageController name="IDE" type="PIIX4" PortCount="2" useHostIOCache="true" Bootable="true">
<AttachedDevice type="HardDisk" port="0" device="0">
<Image uuid="{4c5ed34f-f6cf-48e8-808d-2c06f0d11464}"/>
</AttachedDevice>
<AttachedDevice passthrough="false" type="DVD" port="1" device="0"/>
</StorageController>
</StorageControllers>
</Machine>
</VirtualBox>

View File

@ -0,0 +1,188 @@
<?xml version="1.0"?>
<!--
** DO NOT EDIT THIS FILE.
** If you make changes to this file while any VirtualBox related application
** is running, your changes will be overwritten later, without taking effect.
** Use VBoxManage or the VirtualBox Manager GUI to make changes.
-->
<VirtualBox xmlns="http://www.innotek.de/VirtualBox-settings" version="1.14-linux">
<Machine uuid="{37ab43a5-38d8-4491-93f5-5b0b077f5c32}" name="Windows XP" OSType="WindowsXP" snapshotFolder="Snapshots" lastStateChange="2014-11-14T11:58:35Z">
<MediaRegistry>
<HardDisks>
<HardDisk uuid="{8e55fcfc-4c09-4173-9066-341968be4864}" location="/win7.vdi" format="VDI" type="Immutable">
<HardDisk uuid="{4c5ed34f-f6cf-48e8-808d-2c06f0d11464}" location="/ram/overlay.vdi" format="VDI" autoReset="true"/>
</HardDisk>
</HardDisks>
<DVDImages/>
<FloppyImages/>
</MediaRegistry>
<ExtraData>
<ExtraDataItem name="GUI/LastGuestSizeHint" value="1024,768"/>
<ExtraDataItem name="GUI/LastNormalWindowPosition" value="513,100,1024,790"/>
</ExtraData>
<Hardware version="2">
<CPU count="1" hotplug="false">
<HardwareVirtEx enabled="true"/>
<HardwareVirtExNestedPaging enabled="true"/>
<HardwareVirtExVPID enabled="true"/>
<HardwareVirtExUX enabled="true"/>
<PAE enabled="true"/>
<LongMode enabled="false"/>
<HardwareVirtExLargePages enabled="false"/>
<HardwareVirtForce enabled="false"/>
</CPU>
<Memory RAMSize="1024" PageFusion="false"/>
<HID Pointing="PS2Mouse" Keyboard="PS2Keyboard"/>
<HPET enabled="false"/>
<Chipset type="PIIX3"/>
<Boot>
<Order position="1" device="Floppy"/>
<Order position="2" device="DVD"/>
<Order position="3" device="HardDisk"/>
<Order position="4" device="None"/>
</Boot>
<Display VRAMSize="20" monitorCount="1" accelerate3D="false" accelerate2DVideo="false"/>
<VideoCapture enabled="false" screens="18446744073709551615" horzRes="1024" vertRes="768" rate="512" fps="25"/>
<RemoteDisplay enabled="false" authType="Null"/>
<BIOS>
<ACPI enabled="true"/>
<IOAPIC enabled="false"/>
<Logo fadeIn="true" fadeOut="true" displayTime="0"/>
<BootMenu mode="MessageAndMenu"/>
<TimeOffset value="0"/>
<PXEDebug enabled="false"/>
</BIOS>
<USB>
<Controllers/>
<DeviceFilters/>
</USB>
<SharedFolders>
<SharedFolder name="from" hostPath="/from" writable="false" autoMount="true"/>
<SharedFolder name="to" hostPath="/to" writable="true" autoMount="true"/>
</SharedFolders>
<Network>
<Adapter slot="0" enabled="false" MACAddress="0800271D7901" cable="true" speed="0" type="82540EM">
<HostInterface/>
<DisabledModes/>
</Adapter>
<Adapter slot="1" enabled="false" MACAddress="08002790A84B" cable="true" speed="0" type="Am79C973">
<DisabledModes>
<NAT>
<DNS pass-domain="true" use-proxy="false" use-host-resolver="false"/>
<Alias logging="false" proxy-only="false" use-same-ports="false"/>
</NAT>
</DisabledModes>
</Adapter>
<Adapter slot="2" enabled="false" MACAddress="080027EEE873" cable="true" speed="0" type="Am79C973">
<DisabledModes>
<NAT>
<DNS pass-domain="true" use-proxy="false" use-host-resolver="false"/>
<Alias logging="false" proxy-only="false" use-same-ports="false"/>
</NAT>
</DisabledModes>
</Adapter>
<Adapter slot="3" enabled="false" MACAddress="080027D37A39" cable="true" speed="0" type="Am79C973">
<DisabledModes>
<NAT>
<DNS pass-domain="true" use-proxy="false" use-host-resolver="false"/>
<Alias logging="false" proxy-only="false" use-same-ports="false"/>
</NAT>
</DisabledModes>
</Adapter>
<Adapter slot="4" enabled="false" MACAddress="080027F9D5DA" cable="true" speed="0" type="Am79C973">
<DisabledModes>
<NAT>
<DNS pass-domain="true" use-proxy="false" use-host-resolver="false"/>
<Alias logging="false" proxy-only="false" use-same-ports="false"/>
</NAT>
</DisabledModes>
</Adapter>
<Adapter slot="5" enabled="false" MACAddress="080027EEC7EA" cable="true" speed="0" type="Am79C973">
<DisabledModes>
<NAT>
<DNS pass-domain="true" use-proxy="false" use-host-resolver="false"/>
<Alias logging="false" proxy-only="false" use-same-ports="false"/>
</NAT>
</DisabledModes>
</Adapter>
<Adapter slot="6" enabled="false" MACAddress="0800279C5C02" cable="true" speed="0" type="Am79C973">
<DisabledModes>
<NAT>
<DNS pass-domain="true" use-proxy="false" use-host-resolver="false"/>
<Alias logging="false" proxy-only="false" use-same-ports="false"/>
</NAT>
</DisabledModes>
</Adapter>
<Adapter slot="7" enabled="false" MACAddress="080027E8E350" cable="true" speed="0" type="Am79C973">
<DisabledModes>
<NAT>
<DNS pass-domain="true" use-proxy="false" use-host-resolver="false"/>
<Alias logging="false" proxy-only="false" use-same-ports="false"/>
</NAT>
</DisabledModes>
</Adapter>
</Network>
<UART>
<Port slot="0" enabled="false" IOBase="0x3f8" IRQ="4" hostMode="Disconnected"/>
<Port slot="1" enabled="false" IOBase="0x2f8" IRQ="3" hostMode="Disconnected"/>
</UART>
<LPT>
<Port slot="0" enabled="false" IOBase="0x378" IRQ="7"/>
<Port slot="1" enabled="false" IOBase="0x378" IRQ="7"/>
</LPT>
<AudioAdapter controller="AC97" driver="Pulse" enabled="false"/>
<RTC localOrUTC="UTC"/>
<SharedFolders/>
<Clipboard mode="Disabled"/>
<DragAndDrop mode="Disabled"/>
<IO>
<IoCache enabled="true" size="5"/>
<BandwidthGroups/>
</IO>
<HostPci>
<Devices/>
</HostPci>
<EmulatedUSB>
<CardReader enabled="false"/>
</EmulatedUSB>
<Guest memoryBalloonSize="0"/>
<GuestProperties>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxControl.exe" value="4.2.24r92790" timestamp="1415966288630337000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxCredProv.dll" value="-" timestamp="1415966288637768000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxDisp.dll" value="4.2.24r92790" timestamp="1415966288632592000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxGINA.dll" value="-" timestamp="1415966288637454000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxGuest.sys" value="4.2.24r92790" timestamp="1415966288652892000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxHook.dll" value="4.2.24r92790" timestamp="1415966288632047000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxMRXNP.dll" value="4.2.24r92790" timestamp="1415966288634519000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxMouse.sys" value="4.2.24r92790" timestamp="1415966288653459000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxOGL.dll" value="4.2.24r92790" timestamp="1415966288651797000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxOGLarrayspu.dll" value="4.2.24r92790" timestamp="1415966288638972000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxOGLcrutil.dll" value="4.2.24r92790" timestamp="1415966288640771000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxOGLerrorspu.dll" value="4.2.24r92790" timestamp="1415966288642065000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxOGLfeedbackspu.dll" value="4.2.24r92790" timestamp="1415966288648832000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxOGLpackspu.dll" value="4.2.24r92790" timestamp="1415966288644753000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxOGLpassthroughspu.dll" value="4.2.24r92790" timestamp="1415966288645967000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxSF.sys" value="4.2.24r92790" timestamp="1415966288654030000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxService.exe" value="4.2.24r92790" timestamp="1415966288634937000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxTray.exe" value="4.2.24r92790" timestamp="1415966288637109000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Components/VBoxVideo.sys" value="4.2.24r92790" timestamp="1415966288655613000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/HostVerLastChecked" value="4.3.10" timestamp="1415966303913847000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/InstallDir" value="C:/Program Files/Oracle/VirtualBox Guest Additions" timestamp="1415966288627098000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Revision" value="92790" timestamp="1415966288620317000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/Version" value="4.2.24" timestamp="1415966288619548000" flags=""/>
<GuestProperty name="/VirtualBox/GuestAdd/VersionExt" value="4.2.24" timestamp="1415966288619930000" flags=""/>
<GuestProperty name="/VirtualBox/GuestInfo/OS/Product" value="Windows 7" timestamp="1415966288617739000" flags=""/>
<GuestProperty name="/VirtualBox/GuestInfo/OS/Release" value="6.1.7601" timestamp="1415966288618219000" flags=""/>
<GuestProperty name="/VirtualBox/GuestInfo/OS/ServicePack" value="1" timestamp="1415966288619118000" flags=""/>
<GuestProperty name="/VirtualBox/HostInfo/GUI/LanguageID" value="en_US" timestamp="1415966277397115000" flags=""/>
</GuestProperties>
</Hardware>
<StorageControllers>
<StorageController name="IDE" type="PIIX4" PortCount="2" useHostIOCache="true" Bootable="true">
<AttachedDevice type="HardDisk" port="0" device="0">
<Image uuid="{4c5ed34f-f6cf-48e8-808d-2c06f0d11464}"/>
</AttachedDevice>
</StorageController>
</StorageControllers>
</Machine>
</VirtualBox>

View File

@ -1,45 +0,0 @@
#include <base/printf.h>
#include <base/thread.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
static char buf[128 * 1024];
int main(int argc, char **argv)
{
using Genode::printf;
int res = unlink("/ram/overlay.vdi");
printf("unlink result %d\n", res);
int fd_src = open("/ram/overlay-original.vdi", O_RDONLY);
int fd_dst = creat("/ram/overlay.vdi", O_CREAT);
size_t len, sum = 0;
printf("fd_src %d fd_dst %d\n", fd_src, fd_dst);
if (fd_src < 0 || fd_dst < 0)
return 1;
while ((len = read(fd_src, buf, sizeof(buf))) > 0) {
while (len) {
ssize_t written = write(fd_dst, buf, len);
len -= written;
sum += written;
if (written > 0 && len >= 0)
continue;
PERR("could not write whole file - %zu %zu %d\n",
sum, written, errno);
return -1;
}
}
close(fd_src);
close(fd_dst);
printf("wrote %zu bytes to overlay.vdi - res=%zu\n", sum, len);
printf("vbox_auto_test_helper is done.\n");
return 0;
}

View File

@ -1,3 +0,0 @@
TARGET = vbox-auto-test-helper
SRC_CC = main.cc
LIBS = libc

View File

@ -1,45 +0,0 @@
/*
* \brief Dummy implementations of symbols needed by VirtualBox
* \author Norman Feske
* \date 2013-08-22
*/
/*
* Copyright (C) 2013 Genode Labs GmbH
*
* This file is distributed under the terms of the GNU General Public License
* version 2.
*/
/* Genode includes */
#include <base/printf.h>
/* VirtualBox includes */
#include <VBox/vmm/vmapi.h>
#define CXX_DUMMY(retval, signature) \
int signature { \
PDBG( #signature " called, not implemented"); \
for (;;); \
return retval; \
}
#define CHECKED_CXX_DUMMY(retval, signature) \
int signature { \
PINF( #signature " called, not implemented"); \
return retval; \
}
CXX_DUMMY(-1, VMMR3InitCompleted(VM*, VMINITCOMPLETED))
CXX_DUMMY(-1, VMMR3InitR0(VM*))
CXX_DUMMY(-1, VMMR3InitRC(VM*))
CXX_DUMMY(-1, VMMR3Init(VM*))
CXX_DUMMY(-1, VMMR3Relocate(VM*, long long))
CXX_DUMMY(-1, VMMR3Term(VM*))
CXX_DUMMY(-1, PGMR3InitCompleted(VM*, VMINITCOMPLETED))
CXX_DUMMY(-1, PGMNotifyNxeChanged(VMCPU*, bool))
CXX_DUMMY(-1, VMMR3SendSipi(VM*, unsigned int, unsigned int))
CXX_DUMMY(-1, VMMR3SendInitIpi(VM*, unsigned int))
CXX_DUMMY(-1, VMMR3EmtRendezvousFF(VM*, VMCPU*))
CXX_DUMMY(-1, VMMR3YieldStop(VM*))
CXX_DUMMY(-1, VMMR3EmtRendezvousSetDisabled(VMCPU*, bool))

View File

@ -21,8 +21,6 @@
extern "C" int VBoxDevicesRegister(PPDMDEVREGCB pCallbacks, uint32_t u32Version)
{
PDBG("VBoxDevicesRegister called");
int rc = 0;
/* pcarch */

View File

@ -20,8 +20,6 @@
extern "C" int VBoxDriversRegister(PCPDMDRVREGCB pCallbacks, uint32_t u32Version)
{
PDBG("VBoxDriversRegister called");
PDMDRVREG const *drvs[] = {
&g_DrvKeyboardQueue,
&g_DrvMouseQueue,

View File

@ -5,295 +5,188 @@
*/
/*
* Copyright (C) 2013 Genode Labs GmbH
* Copyright (C) 2013-2014 Genode Labs GmbH
*
* This file is distributed under the terms of the GNU General Public License
* version 2.
*/
#include <base/printf.h>
#include <base/thread.h>
#include <iprt/types.h>
#include <string.h> /* libc memcpy */
#include <stddef.h>
#include <time.h>
#include "VMMInternal.h"
#include "EMInternal.h"
#include "PDMInternal.h"
extern "C" {
#include <iprt/err.h>
#include <iprt/mem.h>
#include <VBox/vmm/cpum.h>
#include <VBox/vmm/mm.h>
#include <VBox/vmm/dbgf.h>
#include <VBox/vmm/ftm.h>
#include <VBox/vmm/iem.h>
#include <VBox/vmm/selm.h>
#include <VBox/vmm/hm.h>
#include <VBox/vmm/iom.h>
#define DUMMY(retval, name) \
int name(void) { \
PDBG( #name " called, not implemented, eip=%p", __builtin_return_address(0)); \
for (;;); \
return retval; \
#include "util.h"
static const bool trace = false;
#define TRACE(retval) \
{ \
if (trace) \
PDBG("called, return dummy, eip=%p", \
__builtin_return_address(0)); \
return retval; \
}
RT_C_DECLS_BEGIN
RTDECL(int) RTMemProtect(void *pv, size_t cb, unsigned fProtect) RT_NO_THROW
{
if (!trace)
return VINF_SUCCESS;
char type[4];
if (fProtect & RTMEM_PROT_READ)
type[0] = 'r';
else
type[0] = '-';
if (fProtect & RTMEM_PROT_WRITE)
type[1] = 'w';
else
type[1] = '-';
if (fProtect & RTMEM_PROT_EXEC)
type[2] = 'x';
else
type[2] = '-';
type[3] = 0;
PDBG("called - not implemented - 0x%p+%0zx protect %x - '%s'",
pv, cb, fProtect, type);
return VINF_SUCCESS;
}
#define CHECKED_DUMMY(TYPE, retval, name) \
TYPE name(void) { \
PINF( #name " called, not implemented, eip=%p", __builtin_return_address(0)); \
return retval; \
static_assert(sizeof(RTR0PTR) == sizeof(RTR3PTR), "pointer transformation bug");
static_assert(sizeof(RTR0PTR) == sizeof(void *) , "pointer transformation bug");
static_assert(sizeof(RTR3PTR) == sizeof(RTR0PTR), "pointer transformation bug");
RTR0PTR MMHyperR3ToR0(PVM pVM, RTR3PTR R3Ptr) { return (RTR0PTR)R3Ptr; }
RTRCPTR MMHyperR3ToRC(PVM pVM, RTR3PTR R3Ptr) { return to_rtrcptr(R3Ptr); }
RTR0PTR MMHyperCCToR0(PVM pVM, void *pv) { return (RTR0PTR)pv; }
RTRCPTR MMHyperCCToRC(PVM pVM, void *pv) { return to_rtrcptr(pv); }
RTR3PTR MMHyperR0ToR3(PVM pVM, RTR0PTR R0Ptr) { return (RTR3PTR*)(R0Ptr | 0UL); }
RTR3PTR MMHyperRCToR3(PVM pVM, RTRCPTR RCPtr)
{
static_assert(sizeof(RCPtr) <= sizeof(RTR3PTR), "ptr transformation bug");
return reinterpret_cast<RTR3PTR>(0UL | RCPtr);
}
CHECKED_DUMMY(int, 0, cpumR3DbgInit)
CHECKED_DUMMY(int, 0, DBGFR3Init) /* debugger */
DUMMY(-1, DBGFR3CoreWrite)
CHECKED_DUMMY(int, 0, FTMR3Init) /* fault tolerance manager */
CHECKED_DUMMY(int, 0, pdmR3LdrInitU) /* module loader of pluggable device manager */
CHECKED_DUMMY(int, 0, PDMR3LdrLoadVMMR0U) /* pretend to have successfully loaded the r0 module */
CHECKED_DUMMY(int, 0, pdmR3LoadR3U)
CHECKED_DUMMY(int, 0, pthread_atfork)
CHECKED_DUMMY(int, 0, pthread_attr_setdetachstate)
CHECKED_DUMMY(int, 0, pthread_attr_setstacksize)
CHECKED_DUMMY(int, 0, RTMemProtect)
CHECKED_DUMMY(int, 0, SELMR3Init) /* selector manager - GDT handling */
CHECKED_DUMMY(int, 0, sigfillset)
CHECKED_DUMMY(int, 0, vmmR3SwitcherInit) /* world switcher */
CHECKED_DUMMY(int, -1, atexit)
CHECKED_DUMMY(pid_t, -1, getpid)
CHECKED_DUMMY(char *, (char *)-1, pdmR3FileR3)
CHECKED_DUMMY(char *, nullptr, setlocale)
CHECKED_DUMMY(int, -1, sigaddset)
CHECKED_DUMMY(int, -1, sigemptyset)
CHECKED_DUMMY(int, -1, siginterrupt)
CHECKED_DUMMY(int, -1, sysctl)
DUMMY( 0, RTErrCOMGet)
void CPUMPushHyper() { } /* called by 'VMMR3InitRC', but we don't use GC */
DUMMY(-1, DBGCRegisterCommands)
DUMMY(-1, DBGFR3Event)
DUMMY(-1, DBGFR3EventAssertion)
DUMMY(-1, DBGFR3EventBreakpoint)
DUMMY(-1, DBGFR3EventSrc)
CHECKED_DUMMY(int, 0, DBGFR3EventSrcV)
void DBGFR3Relocate() { }
DUMMY(-1, DBGFR3Term)
DUMMY(-1, DBGFR3VMMForcedAction)
CHECKED_DUMMY(int, -4, DBGFR3AsSymbolByAddr) /* -4 == VERR_INVALID_HANDLE */
DUMMY(-1, _flockfile)
int FTMR3SetCheckpoint() { return -1; }
DUMMY(-1, FTMR3Term)
int FTMSetCheckpoint() { return 0; }
DUMMY(-1, _funlockfile)
DUMMY(-1, _fwalk)
DUMMY(-1, HWACCMInvalidatePage)
DUMMY(-1, HWACCMFlushTLB)
DUMMY(-1, HWACCMR3EmulateIoBlock)
DUMMY(-1, HWACCMR3PatchTprInstr)
DUMMY(-1, HWACCMR3CheckError)
DUMMY(-1, HWACCMR3RestartPendingIOInstr)
void HWACCMR3Relocate() { }
void HWACCMR3Reset() { }
DUMMY(-1, HWACCMR3Term)
DUMMY(-1, HWACMMR3EnablePatching)
DUMMY(-1, HWACMMR3DisablePatching)
CHECKED_DUMMY(int, 0, IEMR3Init) /* interpreted execution manager (seems to be just a skeleton) */
void IEMR3Relocate() { }
DUMMY(-1, IEMR3Term)
DUMMY(-1, MMHyperR0ToCC)
DUMMY(-1, MMHyperR0ToR3)
DUMMY(-1, MMHyperRCToCC)
DUMMY(-1, MMHyperRCToR3)
CHECKED_DUMMY(RTGCPTR, 0, MMHyperGetArea)
DUMMY(-1, MMR3HeapAPrintfV)
CHECKED_DUMMY(int, 0, MMR3HyperInitFinalize)
CHECKED_DUMMY(int, 0, MMR3HyperSetGuard)
DUMMY(-1, MMR3LockCall)
DUMMY(-1, MMR3Term)
DUMMY(-1, MMR3TermUVM)
DUMMY(-1, PDMR3AsyncCompletionTemplateCreateDriver)
DUMMY(-1, PDMR3LdrGetInterfaceSymbols)
void PDMR3LdrRelocateU() { }
DUMMY(-1, pdmR3LdrTermU)
DUMMY(-1, PGMNotifyNxeChanged)
DUMMY(-1, PGMPhysGCPtr2GCPhys)
DUMMY(-1, PGMPhysSimpleReadGCPhys)
DUMMY(-1, PGMPhysSimpleReadGCPtr)
DUMMY(-1, PGMPhysSimpleWriteGCPtr)
DUMMY(-1, PGMSyncCR3)
CHECKED_DUMMY(int, 0, PGMR3CheckIntegrity)
CHECKED_DUMMY(int, 0, PGMR3FinalizeMappings)
CHECKED_DUMMY(int, 0, PGMR3InitCompleted)
CHECKED_DUMMY(int, 0, PGMR3InitDynMap) /* reserve space for "dynamic mappings" */
CHECKED_DUMMY(int, 0, PGMR3InitFinalize)
DUMMY(-1, PGMR3SharedModuleCheckAll)
DUMMY(-1, PGMR3SharedModuleUnregister)
DUMMY(-1, PGMR3SharedModuleRegister)
DUMMY(-1, PGMR3MappingsUnfix)
DUMMY(-1, PGMR3PhysChangeMemBalloon)
DUMMY(-1, PGMR3MappingsFix)
DUMMY(-1, PGMR3MappingsDisable)
DUMMY(-1, PGMR3LockCall)
DUMMY(-1, PGMR3PhysAllocateHandyPages)
DUMMY(-1, PGMR3PhysAllocateLargeHandyPage)
DUMMY(-1, PGMR3PhysChunkMap)
DUMMY(-1, PGMR3PhysGCPhys2CCPtrExternal)
DUMMY(-1, PGMR3PhysGCPhys2CCPtrReadOnlyExternal)
DUMMY(-1, PGMR3PhysMMIO2Deregister)
DUMMY(-1, PGMR3PhysMMIO2MapKernel)
DUMMY(-1, PGMR3PhysReadU16)
DUMMY(-1, PGMR3PhysReadU64)
DUMMY(-1, PGMR3PhysRomProtect)
DUMMY(-1, PGMR3PoolGrow)
void PGMR3Relocate() {}
DUMMY(-1, PGMR3ResetCpu)
DUMMY(-1, PGMR3Term)
DUMMY(-1, PGMPrefetchPage)
DUMMY(-1, PGMGstGetPage)
DUMMY(-1, PGMGstIsPagePresent)
DUMMY(-1, PGMShwMakePageReadonly)
DUMMY(-1, PGMShwMakePageNotPresent)
DUMMY(-1, PGMPhysIsGCPhysNormal)
DUMMY(-1, PGMHandlerVirtualChangeInvalidateCallback)
DUMMY(-1, PGMSetLargePageUsage)
DUMMY(-1, PGMPhysSimpleDirtyWriteGCPtr)
DUMMY(-1, PGMGetShadowMode)
DUMMY(-1, PGMGetHostMode)
CHECKED_DUMMY(int, 0, PGMGetGuestMode) /* PGMMODE_INVALID == 0 */
int PGMChangeMode() { return 0; }
CHECKED_DUMMY(int, 0, poll) /* needed by 'DrvHostSerial.cpp' */
DUMMY(-1, pthread_key_delete)
DUMMY(-1, RTMemExecFree)
DUMMY(-1, RTMemPageFree)
DUMMY(-1, RTPathAppend)
DUMMY(-1, RTSemEventWaitEx)
CHECKED_DUMMY(int, 0, SELMR3InitFinalize)
void SELMR3Relocate() { }
void SELMR3DisableMonitoring () { }
void SELMR3Reset() { }
DUMMY(-1, SELMR3Term)
DUMMY(-1, SELMR3GetSelectorInfo)
DUMMY(-1, libc_select_notify) /* needed for libc_terminal plugin */
DUMMY(-1, DISInstrToStrEx)
DUMMY(-1, strcat)
DUMMY(-1, strerror)
DUMMY(-1, strpbrk)
CHECKED_DUMMY(int, 0, SUPR3SetVMForFastIOCtl)
DUMMY(-1, SUPR3HardenedLdrLoadPlugIn)
DUMMY(-1, SUPR3Term)
uint32_t SUPSemEventMultiGetResolution()
{ return 100000*10; /* called by 'vmR3HaltGlobal1Init' */ }
DUMMY(-1, VMMR3FatalDump)
void vmmR3SwitcherRelocate() { }
DUMMY(-1, VMMR3GetHostToGuestSwitcher)
DUMMY(-1, pthread_kill)
DUMMY(-1, sscanf)
DUMMY(-1, RTHeapSimpleRelocate)
DUMMY(-1, RTHeapSimpleAlloc)
DUMMY(-1, RTHeapSimpleInit)
DUMMY(-1, RTHeapSimpleFree)
DUMMY(-1, RTAvloU32Get)
DUMMY(-1, RTAvloU32Remove)
DUMMY(-1, RTAvloU32GetBestFit)
CHECKED_DUMMY(void *, nullptr, RTAvloU32RemoveBestFit)
DUMMY(-1, RTAvlU32Destroy)
DUMMY(-1, RTAvlU32GetBestFit)
DUMMY(-1, RTAvloU32DoWithAll)
DUMMY(-1, RTAvloU32Insert)
DUMMY(-1, RTAvlU32Get)
DUMMY(-1, RTAvlU32DoWithAll)
DUMMY(-1, RTAvlU32Insert)
CHECKED_DUMMY(int, 0, IOMR3Init)
int IOMR3IOPortRegisterR0() { return 0; }
int IOMR3IOPortRegisterRC() { return 0; }
CHECKED_DUMMY(int, 0, IOMR3MmioRegisterR0)
CHECKED_DUMMY(int, 0, IOMR3MmioRegisterRC)
void IOMR3Relocate() { }
void IOMR3Reset() { }
DUMMY(-1, IOMR3Term)
DUMMY(-1, IOMInterpretOUT)
DUMMY(-1, IOMInterpretOUTS)
DUMMY(-1, IOMInterpretIN)
DUMMY(-1, IOMInterpretINS)
/* debugger */
int DBGFR3Init(PVM) TRACE(VINF_SUCCESS)
int DBGFR3EventSrcV(PVM, DBGFEVENTTYPE, const char *, unsigned, const char *,
const char *, va_list) TRACE(VINF_SUCCESS)
void DBGFR3Relocate(PVM, RTGCINTPTR) TRACE()
int DBGFR3RegRegisterDevice(PVM, PCDBGFREGDESC, PPDMDEVINS, const char*,
uint32_t) TRACE(VINF_SUCCESS)
int DBGFR3AsSymbolByAddr(PUVM, RTDBGAS, PCDBGFADDRESS, uint32_t, PRTGCINTPTR,
PRTDBGSYMBOL, PRTDBGMOD) TRACE(VERR_INVALID_HANDLE)
int DBGFR3Term(PVM) TRACE(VINF_SUCCESS)
DUMMY(-1, DISInstrToStrWithReader)
/* called by 'VMMR3InitRC', but we don't use GC */
int cpumR3DbgInit(PVM) TRACE(VINF_SUCCESS)
void CPUMPushHyper(PVMCPU, uint32_t) TRACE()
DUMMY(-1, RTFileQueryFsSizes)
int PGMFlushTLB(PVMCPU, uint64_t, bool) TRACE(VINF_SUCCESS)
int PGMInvalidatePage(PVMCPU, RTGCPTR) TRACE(VINF_SUCCESS)
int PGMHandlerPhysicalPageTempOff(PVM, RTGCPHYS, RTGCPHYS) TRACE(VINF_SUCCESS)
void PGMPhysReleasePageMappingLock(PVM, PPGMPAGEMAPLOCK) TRACE()
int PGMR3CheckIntegrity(PVM) TRACE(VINF_SUCCESS)
int PGMR3FinalizeMappings(PVM) TRACE(VINF_SUCCESS)
int PGMR3InitCompleted(PVM, VMINITCOMPLETED) TRACE(VINF_SUCCESS)
int PGMR3InitDynMap(PVM) TRACE(VINF_SUCCESS)
int PGMR3InitFinalize(PVM) TRACE(VINF_SUCCESS)
int PGMR3HandlerVirtualRegister(PVM, PGMVIRTHANDLERTYPE, RTGCPTR, RTGCPTR,
PFNPGMR3VIRTINVALIDATE, PFNPGMR3VIRTHANDLER,
const char*, const char*, const char*) TRACE(VINF_SUCCESS)
int PGMHandlerVirtualDeregister(PVM, RTGCPTR) TRACE(VINF_SUCCESS)
void PGMR3Relocate(PVM, RTGCINTPTR) TRACE()
int PGMChangeMode(PVMCPU, uint64_t, uint64_t, uint64_t) TRACE(VINF_SUCCESS)
int PGMR3ChangeMode(PVM, PVMCPU, PGMMODE) TRACE(VINF_SUCCESS)
/* required for Netware */
void PGMCr0WpEnabled(PVMCPU pVCpu) TRACE()
DUMMY(-1, pthread_mutex_timedlock)
/* debugger */
void DBGFR3PowerOff(PVM pVM) TRACE()
int DBGFR3DisasInstrCurrent(PVMCPU, char *, uint32_t) TRACE(VINF_SUCCESS)
CHECKED_DUMMY(int, 0, PGMHandlerVirtualDeregister) /* XXX */
CHECKED_DUMMY(int, 0, PGMR3HandlerVirtualRegister) /* XXX */
int vmmR3SwitcherInit(PVM pVM) TRACE(VINF_SUCCESS)
void vmmR3SwitcherRelocate(PVM, RTGCINTPTR) TRACE()
int VMMR3DisableSwitcher(PVM) TRACE(VINF_SUCCESS)
/*
* Dummies added for storage
*/
DUMMY(-1, RTAvlrFileOffsetDestroy)
DUMMY(-1, RTAvlrFileOffsetGet)
DUMMY(-1, RTAvlrFileOffsetGetBestFit)
DUMMY(-1, RTAvlrFileOffsetInsert)
DUMMY(-1, RTAvlrFileOffsetRemove)
DUMMY(-1, RTAvlrU64Destroy)
DUMMY(-1, RTAvlrU64DoWithAll)
DUMMY(-1, RTAvlrU64GetBestFit)
DUMMY(-1, RTAvlrU64Insert)
DUMMY(-1, RTAvlrU64RangeGet)
DUMMY(-1, RTAvlrU64RangeRemove)
DUMMY(-1, RTAvlrU64Remove)
DUMMY(-1, RTLdrClose)
DUMMY(-1, RTMemDupExTag)
DUMMY(-1, rtPathRootSpecLen)
DUMMY(-1, RTPathStartsWithRoot)
DUMMY(-1, RTSocketToNative)
DUMMY(-1, RTStrCatP)
DUMMY(-1, RTTcpClientCloseEx)
DUMMY(-1, RTTcpClientConnect)
DUMMY(-1, RTTcpFlush)
DUMMY(-1, RTTcpGetLocalAddress)
DUMMY(-1, RTTcpGetPeerAddress)
DUMMY(-1, RTTcpRead)
DUMMY(-1, RTTcpReadNB)
DUMMY(-1, RTTcpSelectOne)
DUMMY(-1, RTTcpSelectOneEx)
DUMMY(-1, RTTcpSetSendCoalescing)
DUMMY(-1, RTTcpSgWrite)
DUMMY(-1, RTTcpSgWriteNB)
DUMMY(-1, RTTcpWrite)
DUMMY(-1, RTTcpWriteNB)
DUMMY(-1, RTTimeLocalExplode)
int emR3InitDbg(PVM pVM) TRACE(VINF_SUCCESS)
DUMMY(-1, RTSymlinkCreate)
DUMMY(-1, RTSymlinkRead)
DUMMY(-1, RTSymlinkDelete)
int FTMR3Init(PVM) TRACE(VINF_SUCCESS)
int FTMR3SetCheckpoint(PVM, FTMCHECKPOINTTYPE) TRACE(-1)
int FTMSetCheckpoint(PVM, FTMCHECKPOINTTYPE) TRACE(VINF_SUCCESS)
int FTMR3Term(PVM) TRACE(VINF_SUCCESS)
DUMMY(-1, RTNetIPv6PseudoChecksumEx)
int IEMR3Init(PVM) TRACE(VINF_SUCCESS)
int IEMR3Term(PVM) TRACE(VINF_SUCCESS)
void IEMR3Relocate(PVM) TRACE()
CHECKED_DUMMY(int, 0, futimes)
CHECKED_DUMMY(int, 0, lutimes)
void HMR3Relocate(PVM) TRACE()
void HMR3Reset(PVM pVM) TRACE()
int __isthreaded;
int SELMR3Init(PVM) TRACE(VINF_SUCCESS)
int SELMR3Term(PVM) TRACE(VINF_SUCCESS)
int SELMR3InitFinalize(PVM) TRACE(VINF_SUCCESS)
void SELMR3Relocate(PVM) TRACE()
void SELMR3Reset(PVM) TRACE()
void SELMR3DisableMonitoring(PVM) TRACE()
int sigprocmask() { return 0; }
int _sigprocmask() { return 0; }
int IOMR3IOPortRegisterRC(PVM, PPDMDEVINS, RTIOPORT, RTUINT, RTRCPTR, RTRCPTR,
RTRCPTR, RTRCPTR, RTRCPTR, const char*) TRACE(VINF_SUCCESS)
int IOMR3IOPortRegisterR0(PVM, PPDMDEVINS, RTIOPORT, RTUINT, RTR0PTR,
RTHCUINTPTR, RTHCUINTPTR, RTHCUINTPTR, RTHCUINTPTR,
const char*) TRACE(VINF_SUCCESS)
int IOMR3MmioRegisterR0(PVM, PPDMDEVINS, RTGCPHYS, uint32_t, RTR0PTR,
RTHCUINTPTR, RTHCUINTPTR, RTHCUINTPTR) TRACE(VINF_SUCCESS)
int IOMR3MmioRegisterRC(PVM, PPDMDEVINS, RTGCPHYS, uint32_t, RTGCPTR, RTRCPTR,
RTRCPTR, RTRCPTR) TRACE(VINF_SUCCESS)
void IOMR3Relocate(PVM, RTGCINTPTR) TRACE()
void IOMR3Reset(PVM) TRACE()
int PGMFlushTLB() { return 0; }
int PGMInvalidatePage() { return 0; } /* seems to be needed on raw mode only */
int PGMHandlerPhysicalPageTempOff() { return 0; }
int SUPR3SetVMForFastIOCtl(PVMR0) TRACE(VINF_SUCCESS)
bool PGMIsLockOwner() { return false; } /* assertion in EMRemLock */
bool IOMIsLockOwner() { return false; } /* XXX */
_AVLOU32NodeCore* RTAvloU32RemoveBestFit(PAVLOU32TREE, AVLOU32KEY, bool) TRACE(VINF_SUCCESS)
int RTAvlrFileOffsetDestroy(PAVLRFOFFTREE, PAVLRFOFFCALLBACK, void*) TRACE(VINF_SUCCESS)
int MMHyperIsInsideArea() { return 0; } /* used by dbgfR3DisasInstrRead */
void PGMPhysReleasePageMappingLock() { }
} /* extern "C" */
/* module loader of pluggable device manager */
int pdmR3LdrInitU(PUVM) TRACE(VINF_SUCCESS)
int PDMR3LdrLoadVMMR0U(PUVM) TRACE(VINF_SUCCESS)
void PDMR3LdrRelocateU(PUVM, RTGCINTPTR) TRACE()
int pdmR3LoadR3U(PUVM, const char *, const char *) TRACE(VINF_SUCCESS)
void pdmR3LdrTermU(PUVM) TRACE()
char *pdmR3FileR3(const char * file, bool)
{
char * pv = reinterpret_cast<char *>(RTMemTmpAllocZ(1));
if (trace)
PDBG("file %s %s %p", file, pv, __builtin_return_address(0));
TRACE(pv)
}
RT_C_DECLS_END

View File

@ -29,7 +29,7 @@ static struct shared {
const char * name;
const char * symbol;
void * func;
} shared[] = { "/VBoxSharedFolders", VBOX_HGCM_SVCLOAD_NAME, (void *)VBoxHGCMSvcLoad };
} shared[] = {{ "VBoxSharedFolders", VBOX_HGCM_SVCLOAD_NAME, (void *)VBoxHGCMSvcLoad }};
int RTLdrLoad(const char *pszFilename, PRTLDRMOD phLdrMod)
@ -73,4 +73,9 @@ int RTLdrGetSymbol(RTLDRMOD hLdrMod, const char *pszSymbol, void **ppvValue)
return VINF_SUCCESS;
}
int RTLdrClose(RTLDRMOD hLdrMod)
{
return VINF_SUCCESS;
}
}

View File

@ -1,10 +0,0 @@
+++ src/app/virtualbox/src/VBox/Devices/Graphics/DevVGA.cpp 2013-12-09 10:33:02.168894689 +0100
@@ -5885,7 +5889,7 @@
vgaR3Reset(pDevIns);
/* The PCI devices configuration. */
- PCIDevSetVendorId( &pThis->Dev, 0x80ee); /* PCI vendor, just a free bogus value */
+ PCIDevSetVendorId( &pThis->Dev, 0x80ef); /* PCI vendor, just a free bogus value */
PCIDevSetDeviceId( &pThis->Dev, 0xbeef);
PCIDevSetClassSub( &pThis->Dev, 0x00); /* VGA controller */
PCIDevSetClassBase( &pThis->Dev, 0x03);

View File

@ -0,0 +1,19 @@
#ifndef ____H_CLIENTTOKEN
#define ____H_CLIENTTOKEN
#include <VBox/com/ptr.h>
#include <VBox/com/AutoLock.h>
#include "MachineImpl.h"
class Machine::ClientToken
{
public:
ClientToken(const ComObjPtr<Machine> &pMachine, SessionMachine *pSessionMachine);
bool isReady();
bool release();
void getId(Utf8Str &strId);
};
#endif /* !____H_CLIENTTOKEN */

View File

@ -0,0 +1,14 @@
#ifndef ____H_CLIENTWATCHER
#define ____H_CLIENTWATCHER
class VirtualBox::ClientWatcher
{
public:
ClientWatcher(VirtualBox* const) { }
bool isReady() { return true; }
void update() { }
void addProcess(RTPROCESS pid);
};
#endif /* !____H_CLIENTWATCHER */

View File

@ -0,0 +1,285 @@
#ifndef ____H_GENODEIMPL
#define ____H_GENODEIMPL
#include <VBox/vmm/vmapi.h>
#include <VBox/com/com.h>
#include <VBox/com/string.h>
#include <VBox/com/Guid.h>
#include <VBox/com/defs.h>
#include <VBox/com/AutoLock.h>
#include <VBox/com/EventQueue.h>
class Progress;
typedef Progress IProgress;
class VirtualBoxErrorInfo;
typedef VirtualBoxErrorInfo IVirtualBoxErrorInfo;
class IUnknown;
#include <VBox/com/ErrorInfo.h>
#include <VBox/vmm/pdmifs.h>
#include <VBox/settings.h>
#include <iprt/uuid.h>
#include <iprt/fs.h>
#include <iprt/file.h>
#include <iprt/semaphore.h>
class Console;
#include "AutoCaller.h"
#include "VMMDev.h"
#include <map>
#include <list>
#include <vector>
#define TRUNKTYPE_WHATEVER "whatever"
#define TRUNKTYPE_NETFLT "netflt"
#define INTNET_MAX_NETWORK_NAME 128
#define VBOX_SHARED_CLIPBOARD_HOST_FN_SET_HEADLESS 2
enum INTNETTRUNKTYPE
{
kIntNetTrunkType_WhateverNone,
kIntNetTrunkType_NetFlt,
};
class IHostNetworkInterface;
class IFramebufferOverlay;
class IInternalSessionControl;
class IHostUSBDevice;
class IHostUSBDeviceFilter;
class IHostVideoInputDevice;
class IVetoEvent;
class AdditionsFacility;
class AudioAdapter;
class BandwidthControl;
class BandwidthGroup;
class BIOSSettings;
class ConsoleMouseInterface;
class Display;
class DHCPServer;
class EmulatedUSB;
class EventSource;
class Framebuffer;
class Guest;
class GuestDirectory;
class GuestFile;
class GuestFsObjInfo;
class GuestOSType;
class GuestProcess;
class GuestSession;
class Host;
class Keyboard;
class Machine;
class MachineDebugger;
class Medium;
class MediumAttachment;
class MediumFormat;
class MediumLockList;
class Mouse;
class NATEngine;
class NATNetwork;
class NetworkAdapter;
class ParallelPort;
class PCIDeviceAttachment;
class SerialPort;
class Session;
class SessionMachine;
class SharedFolder;
class Snapshot;
class StorageController;
class SystemProperties;
class Token;
class USBController;
class USBDeviceFilter;
class USBDeviceFilters;
class VBoxEvent;
class VBoxEventDesc;
class VBoxVetoEvent;
class VirtualBox;
class VRDEServer;
class VRDEServerInfo;
class VirtualBoxErrorInfo {
public:
HRESULT init(HRESULT aResultCode, const GUID &aIID,
const char *pcszComponent, const com::Utf8Str &strText,
IVirtualBoxErrorInfo *aNext = NULL);
HRESULT FinalConstruct() { return S_OK; }
};
class IStateChangedEvent
{
public:
void get_State(MachineState_T*);
};
typedef AdditionsFacility IAdditionsFacility;
class IAppliance;
typedef AudioAdapter IAudioAdapter;
typedef Console IConsole;
typedef BandwidthControl IBandwidthControl;
typedef BandwidthGroup IBandwidthGroup;
typedef BIOSSettings IBIOSSettings;
typedef Display IDisplay;
typedef DHCPServer IDHCPServer;
typedef EmulatedUSB IEmulatedUSB;
typedef VBoxEvent IEvent;
typedef VBoxVetoEvent IExtraDataCanChangeEvent;
typedef EventSource IEventSource;
typedef Framebuffer IFramebuffer;
class IExtPackManager;
typedef Guest IGuest;
typedef GuestDirectory IGuestDirectory;
typedef GuestFile IGuestFile;
typedef GuestFsObjInfo IGuestFsObjInfo;
typedef GuestProcess IGuestProcess;
typedef GuestSession IGuestSession;
typedef GuestOSType IGuestOSType;
typedef Host IHost;
typedef Keyboard IKeyboard;
typedef Machine IMachine;
typedef MachineDebugger IMachineDebugger;
typedef Medium IMedium;
typedef MediumAttachment IMediumAttachment;
typedef Mouse IMouse;
typedef NetworkAdapter INetworkAdapter;
typedef NATEngine INATEngine;
typedef NATNetwork INATNetwork;
typedef ParallelPort IParallelPort;
class IPerformanceCollector;
typedef SerialPort ISerialPort;
typedef Session ISession;
typedef SharedFolder ISharedFolder;
typedef Snapshot ISnapshot;
typedef StorageController IStorageController;
typedef SystemProperties ISystemProperties;
typedef Token IToken;
typedef USBController IUSBController;
class IUSBDevice;
typedef USBDeviceFilter IUSBDeviceFilter;
typedef USBDeviceFilters IUSBDeviceFilters;
typedef VirtualBox IVirtualBox;
typedef VRDEServer IVRDEServer;
typedef VRDEServerInfo IVRDEServerInfo;
typedef PCIDeviceAttachment IPCIDeviceAttachment;
typedef SessionMachine IInternalMachineControl;
class IVirtualSystemDescription;
class IEventListener {
public:
HRESULT HandleEvent(IEvent * aEvent);
/*
{
VBoxEventType_T aType = VBoxEventType_Invalid;
aEvent->COMGETTER(Type)(&aType);
return mListener->HandleEvent(aType, aEvent);
}
*/
};
template <typename X>
class DummyClass {
public:
void AddRef() { }
void Release() { }
void fireNATRedirectEvent(const ComObjPtr<EventSource>&, BSTR, ULONG&, bool&, short unsigned int*&, NATProtocol_T&, short unsigned int*&, uint16_t&, short unsigned int*&, uint16_t&);
void fireNATNetworkChangedEvent(const ComObjPtr<EventSource>&, short unsigned int*&);
void fireNATNetworkStartStopEvent(const ComObjPtr<EventSource>&, short unsigned int*&, BOOL&);
void fireNATNetworkSettingEvent(const ComObjPtr<EventSource>&, short unsigned int*&, BOOL&, short unsigned int*&, short unsigned int*&, BOOL&, BOOL&);
void fireNATNetworkPortForwardEvent(const ComObjPtr<EventSource>&, short unsigned int*&, BOOL&, BOOL&, short unsigned int*&, NATProtocol_T&, short unsigned int*&, LONG&, short unsigned int*&, LONG&);
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*&);
};
#define ATL_NO_VTABLE
#define DECLARE_CLASSFACTORY()
#define VBOX_SCRIPTABLE_IMPL(X) public DummyClass<X>
#define DECLARE_NOT_AGGREGATABLE(X)
#define DECLARE_REGISTRY_RESOURCEID(X)
#define DECLARE_PROTECT_FINAL_CONSTRUCT(Y)
#define DECLARE_CLASSFACTORY_SINGLETON(X)
#define BEGIN_COM_MAP(X)
#define VBOX_DEFAULT_INTERFACE_ENTRIES(X)
#define COM_INTERFACE_ENTRY(X)
#define COM_INTERFACE_ENTRY2(X,Y)
#define END_COM_MAP()
#define DECLARE_EMPTY_CTOR_DTOR(X) public: X(); ~X();
#define DEFINE_EMPTY_CTOR_DTOR(X) X::X() {} X::~X() {}
#define STDMETHODIMP HRESULT
#define STDMETHOD(X) virtual HRESULT X
#define Q_OBJECT
#include "BusAssignmentManager.h"
#include "MediumFormatImpl.h"
typedef MediumFormat IMediumFormat;
typedef struct sdfkkd { } VRDEUSBDEVICEDESC;
typedef struct sdfsdf3 { } VBOXGUESTCTRLHOSTCBCTX, *PVBOXGUESTCTRLHOSTCBCTX;
typedef struct sdffsd2 { } VBOXGUESTCTRLHOSTCALLBACK, *PVBOXGUESTCTRLHOSTCALLBACK;
typedef struct IFsObjInfo { } IFsObjInfo;
#include "AdditionsFacilityImpl.h"
#include "BIOSSettingsImpl.h"
#include "EventImpl.h"
#include "FramebufferImpl.h"
#include "PCIDeviceAttachmentImpl.h"
#include "GuestImpl.h"
#include "GuestDirectoryImpl.h"
#include "GuestFsObjInfoImpl.h"
#include "GuestProcessImpl.h"
#include "GuestSessionImpl.h"
#include "NetworkServiceRunner.h"
#include "SnapshotImpl.h"
#include "ParallelPortImpl.h"
#include "MediumAttachmentImpl.h"
#include "StorageControllerImpl.h"
#include "USBControllerImpl.h"
#include "SerialPortImpl.h"
#include "NATEngineImpl.h"
#include "NetworkAdapterImpl.h"
#include "ProgressImpl.h"
#include "VRDEServerImpl.h"
#include "GuestOSTypeImpl.h"
#include "DHCPServerImpl.h"
#include "SystemPropertiesImpl.h"
#include "KeyboardImpl.h"
#include "DisplayImpl.h"
#include "NATNetworkImpl.h"
#include "VRDEServerImpl.h"
#include "MediumImpl.h"
#include "SessionImpl.h"
#include "HostImpl.h"
class VRDEServerInfo { };
class EmulatedUSB { };
class ConsoleVRDPServer
{
public:
void SendResize (void) {}
void SendUpdate (unsigned uScreenId, void *pvUpdate, uint32_t cbUpdate) const;
void SendUpdateBitmap (unsigned uScreenId, uint32_t x, uint32_t y, uint32_t w, uint32_t h) const;
void Stop();
};
#endif // !____H_GENODEIMPL

View File

@ -0,0 +1,10 @@
#include "VirtualBoxBase.h"
class MediumFormatWrap : public VirtualBoxBase, public DummyClass<MediumFormatWrap> {
public:
virtual const char* getComponentName() const
{
return "MediumFormatWrap";
}
};

View File

@ -0,0 +1,22 @@
#include "VirtualBoxBase.h"
class Token : public VirtualBoxBase
{
public:
virtual HRESULT abandon(AutoCaller &aAutoCaller) = 0;
HRESULT Abandon() {
AutoCaller autoCaller(this);
abandon(autoCaller);
return S_OK;
}
virtual const char* getComponentName() const
{
return "Token";
}
};
class TokenWrap : public Token
{
};

View File

@ -0,0 +1,448 @@
#ifndef ____H_VIRTUALBOXBASEIMPL
#define ____H_VIRTUALBOXBASEIMPL
#include <base/printf.h>
#include <iprt/asm.h>
#include <iprt/thread.h>
#include <list>
#include <map>
#include "VBox/com/defs.h"
#include "VBox/com/ptr.h"
#include "VBox/com/string.h"
#include "VBox/com/AutoLock.h"
namespace com
{
class ErrorInfo;
}
using namespace com;
using namespace util;
class Medium;
typedef std::list<ComObjPtr<Medium> > MediaList;
typedef std::list<Utf8Str> StringsList;
class VirtualBoxBase : public util::Lockable {
public:
enum State { NotReady, Ready, InInit, InUninit, InitFailed, Limited };
virtual void uninit() { }
private:
RWLockHandle *_lock;
void setState(State aState)
{
Assert(mState != aState);
mState = aState;
mStateChangeThread = RTThreadSelf();
}
/** Primary state of this object */
State mState;
/** Thread that caused the last state change */
RTTHREAD mStateChangeThread;
/** Total number of active calls to this object */
unsigned mCallers;
/** Posted when the number of callers drops to zero */
RTSEMEVENT mZeroCallersSem;
/** Posted when the object goes from InInit/InUninit to some other state */
RTSEMEVENTMULTI mInitUninitSem;
/** Number of threads waiting for mInitUninitDoneSem */
unsigned mInitUninitWaiters;
/** Protects access to state related data members */
WriteLockHandle mStateLock;
/** User-level object lock for subclasses */
mutable RWLockHandle *mObjectLock;
friend class AutoInitSpan;
friend class AutoReinitSpan;
friend class AutoUninitSpan;
protected:
HRESULT BaseFinalConstruct() { return S_OK; }
void BaseFinalRelease() { }
public:
VirtualBoxBase(); // : _lock(nullptr) { }
~VirtualBoxBase();
virtual HRESULT addCaller(State *aState = NULL, bool aLimited = false);
virtual void releaseCaller();
virtual const char* getComponentName() const = 0;
/* should be used for translations */
inline static const char *tr(const char *pcszSourceText,
const char *aComment = NULL)
{
return pcszSourceText;
}
static HRESULT handleUnexpectedExceptions(VirtualBoxBase *const aThis, RT_SRC_POS_DECL);
static HRESULT initializeComForThread(void);
static void clearError(void);
HRESULT setError(HRESULT aResultCode);
HRESULT setError(HRESULT aResultCode, const char *pcsz, ...);
HRESULT setError(const com::ErrorInfo &ei);
static HRESULT setErrorInternal(HRESULT aResultCode,
const GUID &aIID,
const char *aComponent,
Utf8Str aText,
bool aWarning,
bool aLogIt);
virtual VBoxLockingClass getLockingClass() const
{
return LOCKCLASS_OTHEROBJECT;
}
RWLockHandle * lockHandle() const;
};
template <typename T>
class Shareable {
private:
bool _verbose;
T * _obj;
public:
Shareable<T> () : _verbose(false), _obj(nullptr) { }
/* operators */
T * operator->() const { if (_verbose) PDBG("called"); return _obj; }
bool isNull() const { return _obj == nullptr; }
bool operator!() const { return isNull(); }
void allocate() { if (_verbose) PDBG("called %p %u", __builtin_return_address(0), sizeof(*_obj)); _obj = new T; }
void attach(T * t) { if (_verbose) PDBG("called"); }
void attach(Shareable &s) { if (_verbose) PDBG("called"); }
void share(const Shareable &s) { if (_verbose) PDBG("called"); _obj = s._obj; }
void share(T * obj) { if (_verbose) PDBG("called"); _obj = obj; }
void free() { if (_verbose) PDBG("called"); }
void attachCopy(const T *) { if(_verbose) PDBG("called"); }
void attachCopy(const Shareable &) { if (_verbose)PDBG("called"); }
T *data() const { if (_verbose) PDBG("called"); return _obj; }
bool isShared() const { if (_verbose) PDBG("called"); return false; }
};
template <typename T>
class Backupable : public Shareable<T> {
public:
Backupable() : Shareable<T>() { }
void backup() { }
void rollback() { }
void commit() { }
void commitCopy() { }
void assignCopy(const T *) { }
void assignCopy(const Backupable &) { }
HRESULT backupEx() { return S_OK; }
T *backedUpData() const { PDBG("called"); return nullptr; }
bool isBackedUp() const { return false; }
};
/**
* Special version of the Assert macro to be used within VirtualBoxBase
* subclasses.
*
* In the debug build, this macro is equivalent to Assert.
* In the release build, this macro uses |setError(E_FAIL, ...)| to set the
* error info from the asserted expression.
*
* @see VirtualBoxBase::setError
*
* @param expr Expression which should be true.
*/
#if defined(DEBUG)
#define ComAssert(expr) Assert(expr)
#else
#define ComAssert(expr) \
do { \
if (RT_UNLIKELY(!(expr))) \
setError(E_FAIL, \
"Assertion failed: [%s] at '%s' (%d) in %s.\nPlease contact the product vendor!", \
#expr, __FILE__, __LINE__, __PRETTY_FUNCTION__); \
} while (0)
#endif
/**
* Special version of the AssertFailed macro to be used within VirtualBoxBase
* subclasses.
*
* In the debug build, this macro is equivalent to AssertFailed.
* In the release build, this macro uses |setError(E_FAIL, ...)| to set the
* error info from the asserted expression.
*
* @see VirtualBoxBase::setError
*
*/
#if defined(DEBUG)
#define ComAssertFailed() AssertFailed()
#else
#define ComAssertFailed() \
do { \
setError(E_FAIL, \
"Assertion failed: at '%s' (%d) in %s.\nPlease contact the product vendor!", \
__FILE__, __LINE__, __PRETTY_FUNCTION__); \
} while (0)
#endif
/**
* Special version of the AssertMsg macro to be used within VirtualBoxBase
* subclasses.
*
* See ComAssert for more info.
*
* @param expr Expression which should be true.
* @param a printf argument list (in parenthesis).
*/
#if defined(DEBUG)
#define ComAssertMsg(expr, a) AssertMsg(expr, a)
#else
#define ComAssertMsg(expr, a) \
do { \
if (RT_UNLIKELY(!(expr))) \
setError(E_FAIL, \
"Assertion failed: [%s] at '%s' (%d) in %s.\n%s.\nPlease contact the product vendor!", \
#expr, __FILE__, __LINE__, __PRETTY_FUNCTION__, Utf8StrFmt a .c_str()); \
} while (0)
#endif
/**
* Special version of the AssertComRC macro to be used within VirtualBoxBase
* subclasses.
*
* See ComAssert for more info.
*
* @param rc COM result code
*/
#if defined(DEBUG)
#define ComAssertComRC(rc) AssertComRC(rc)
#else
#define ComAssertComRC(rc) ComAssertMsg(SUCCEEDED(rc), ("COM RC = %Rhrc (0x%08X)", (rc), (rc)))
#endif
/**
* Special version of the AssertMsgRC macro to be used within VirtualBoxBase
* subclasses.
*
* See ComAssert for more info.
*
* @param vrc VBox status code.
* @param msg printf argument list (in parenthesis).
*/
#if defined(DEBUG)
#define ComAssertMsgRC(vrc, msg) AssertMsgRC(vrc, msg)
#else
#define ComAssertMsgRC(vrc, msg) ComAssertMsg(RT_SUCCESS(vrc), msg)
#endif
/**
* Special version of the AssertRC macro to be used within VirtualBoxBase
* subclasses.
*
* See ComAssert for more info.
*
* @param vrc VBox status code.
*/
#if defined(DEBUG)
#define ComAssertRC(vrc) AssertRC(vrc)
#else
#define ComAssertRC(vrc) ComAssertMsgRC(vrc, ("%Rra", vrc))
#endif
/** Special version of ComAssert that returns ret if expr fails */
#define ComAssertRet(expr, ret) \
do { ComAssert(expr); if (!(expr)) return (ret); } while (0)
/** Special version of ComAssertMsg that returns ret if expr fails */
#define ComAssertMsgRet(expr, a, ret) \
do { ComAssertMsg(expr, a); if (!(expr)) return (ret); } while (0)
/** Special version of ComAssertComRC that returns ret if rc does not succeed */
#define ComAssertComRCRet(rc, ret) \
do { ComAssertComRC(rc); if (!SUCCEEDED(rc)) return (ret); } while (0)
/** Special version of ComAssertMsg that evaluates eval and breaks if expr fails */
#define ComAssertMsgBreak(expr, a, eval) \
if (1) { ComAssertMsg(expr, a); if (!(expr)) { eval; break; } } else do {} while (0)
/** Special version of ComAssert that evaluates eval and throws it if expr fails */
#define ComAssertThrow(expr, eval) \
do { ComAssert(expr); if (!(expr)) { throw (eval); } } while (0)
/** Special version of ComAssertRC that evaluates eval and throws it if vrc does not succeed */
#define ComAssertRCThrow(vrc, eval) \
do { ComAssertRC(vrc); if (!RT_SUCCESS(vrc)) { throw (eval); } } while (0)
/** Special version of ComAssertFailed that returns ret */
#define ComAssertFailedRet(ret) \
do { ComAssertFailed(); return (ret); } while (0)
/** Special version of ComAssertFailed that returns ret */
#define ComAssertFailedRet(ret) \
do { ComAssertFailed(); return (ret); } while (0)
/** Special version of ComAssertRC that returns ret if vrc does not succeed */
#define ComAssertRCRet(vrc, ret) \
do { ComAssertRC(vrc); if (!RT_SUCCESS(vrc)) return (ret); } while (0)
/** Special version of ComAssertComRC that just throws rc if rc does not succeed */
#define ComAssertComRCThrowRC(rc) \
do { ComAssertComRC(rc); if (!SUCCEEDED(rc)) { throw rc; } } while (0)
/** Special version of ComAssertComRC that returns rc if rc does not succeed */
#define ComAssertComRCRetRC(rc) \
do { ComAssertComRC(rc); if (!SUCCEEDED(rc)) return (rc); } while (0)
/**
* Checks that the pointer argument is not NULL and returns E_INVALIDARG +
* extended error info on failure.
* @param arg Input pointer-type argument (strings, interface pointers...)
*/
#define CheckComArgNotNull(arg) \
do { \
if (RT_UNLIKELY((arg) == NULL)) \
return setError(E_INVALIDARG, tr("Argument %s is NULL"), #arg); \
} while (0)
/**
* Checks that the given expression (that must involve the argument) is true and
* returns E_INVALIDARG + extended error info on failure.
* @param arg Argument.
* @param expr Expression to evaluate.
*/
#define CheckComArgExpr(arg, expr) \
do { \
if (RT_UNLIKELY(!(expr))) \
return setError(E_INVALIDARG, \
tr("Argument %s is invalid (must be %s)"), #arg, #expr); \
} while (0)
/**
* Checks that the given pointer to an output argument is valid and returns
* E_POINTER + extended error info otherwise.
* @param arg Pointer argument.
*/
#define CheckComArgOutPointerValid(arg) \
do { \
if (RT_UNLIKELY(!VALID_PTR(arg))) \
return setError(E_POINTER, \
tr("Output argument %s points to invalid memory location (%p)"), \
#arg, (void *)(arg)); \
} while (0)
/**
* Checks that a string input argument is valid (not NULL or obviously invalid
* pointer), returning E_INVALIDARG + extended error info if invalid.
* @param a_bstrIn Input string argument (IN_BSTR).
*/
#define CheckComArgStr(a_bstrIn) \
do { \
IN_BSTR const bstrInCheck = (a_bstrIn); /* type check */ \
if (RT_UNLIKELY(!RT_VALID_PTR(bstrInCheck))) \
return setError(E_INVALIDARG, tr("Argument %s is an invalid pointer"), #a_bstrIn); \
} while (0)
/**
* Checks that the string argument is not a NULL, a invalid pointer or an empty
* string, returning E_INVALIDARG + extended error info on failure.
* @param a_bstrIn Input string argument (BSTR etc.).
*/
#define CheckComArgStrNotEmptyOrNull(a_bstrIn) \
do { \
IN_BSTR const bstrInCheck = (a_bstrIn); /* type check */ \
if (RT_UNLIKELY(!RT_VALID_PTR(bstrInCheck) || *(bstrInCheck) == '\0')) \
return setError(E_INVALIDARG, tr("Argument %s is empty or an invalid pointer"), #a_bstrIn); \
} while (0)
/**
* Checks that the given pointer to an output safe array argument is valid and
* returns E_POINTER + extended error info otherwise.
* @param arg Safe array argument.
*/
#define CheckComArgOutSafeArrayPointerValid(arg) \
do { \
if (RT_UNLIKELY(ComSafeArrayOutIsNull(arg))) \
return setError(E_POINTER, \
tr("Output argument %s points to invalid memory location (%p)"), \
#arg, (void*)(arg)); \
} while (0)
/**
* Checks that safe array argument is not NULL and returns E_INVALIDARG +
* extended error info on failure.
* @param arg Input safe array argument (strings, interface pointers...)
*/
#define CheckComArgSafeArrayNotNull(arg) \
do { \
if (RT_UNLIKELY(ComSafeArrayInIsNull(arg))) \
return setError(E_INVALIDARG, tr("Argument %s is NULL"), #arg); \
} while (0)
/**
* Sets the extended error info and returns E_NOTIMPL.
*/
#define ReturnComNotImplemented() \
do { \
return setError(E_NOTIMPL, tr("Method %s is not implemented"), __FUNCTION__); \
} while (0)
#define VIRTUALBOXBASE_ADD_VIRTUAL_COMPONENT_METHODS(cls, iface) \
virtual const GUID& getClassIID() const \
{ \
return cls::getStaticClassIID(); \
} \
static const GUID& getStaticClassIID() \
{ \
return COM_IIDOF(iface); \
} \
virtual const char* getComponentName() const \
{ \
return cls::getStaticComponentName(); \
} \
static const char* getStaticComponentName() \
{ \
return #cls; \
}
/**
* VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT:
* This macro must be used once in the declaration of any class derived
* from VirtualBoxBase. It implements the pure virtual getClassIID() and
* getComponentName() methods. If this macro is not present, instances
* of a class derived from VirtualBoxBase cannot be instantiated.
*
* @param X The class name, e.g. "Class".
* @param IX The interface name which this class implements, e.g. "IClass".
*/
#define VIRTUALBOXBASE_ADD_ERRORINFO_SUPPORT(cls, iface) \
VIRTUALBOXBASE_ADD_VIRTUAL_COMPONENT_METHODS(cls, iface)
#include "GenodeImpl.h"
#endif // !____H_VIRTUALBOXBASEIMPL

View File

@ -0,0 +1,118 @@
#include <base/printf.h>
#include <VBox/settings.h>
#include "ConsoleImpl.h"
#include "MachineImpl.h"
static const bool debug = false;
#define DUMMY(X) \
{ \
PERR("%s called (%s), not implemented, eip=%p", __func__, __FILE__, \
__builtin_return_address(0)); \
while (1) \
asm volatile ("ud2a"); \
\
return X; \
}
#define TRACE(X) \
{ \
if (debug) \
PDBG(" called (%s) - eip=%p", __FILE__, \
__builtin_return_address(0)); \
return X; \
}
void Console::uninit() DUMMY()
HRESULT Console::resume(Reason_T aReason) DUMMY(E_FAIL)
HRESULT Console::pause(Reason_T aReason) DUMMY(E_FAIL)
void Console::enableVMMStatistics(BOOL aEnable) DUMMY()
void Console::changeClipboardMode(ClipboardMode_T aClipboardMode) DUMMY()
HRESULT Console::updateMachineState(MachineState_T aMachineState) DUMMY(E_FAIL)
HRESULT Console::attachToTapInterface(INetworkAdapter *networkAdapter)
{
HRESULT rc = S_OK;
ULONG slot = 0;
rc = networkAdapter->COMGETTER(Slot)(&slot);
AssertComRC(rc);
maTapFD[slot] = (RTFILE)1;
TRACE(S_OK)
}
HRESULT Console::teleporterTrg(UVM*, Machine*, com::Utf8Str*, bool, Progress*,
bool*) DUMMY(E_FAIL)
HRESULT Console::detachFromTapInterface(INetworkAdapter *networkAdapter) DUMMY(E_FAIL)
HRESULT Console::saveState(Reason_T aReason, IProgress **aProgress) DUMMY(E_FAIL)
HRESULT Console::get_Debugger(MachineDebugger**) DUMMY(E_FAIL)
HRESULT Console::get_USBDevices(unsigned int*, IUSBDevice***) DUMMY(E_FAIL)
HRESULT Console::get_RemoteUSBDevices(unsigned int*, IHostUSBDevice***) DUMMY(E_FAIL)
HRESULT Console::get_VRDEServerInfo(VRDEServerInfo**) DUMMY(E_FAIL)
HRESULT Console::get_SharedFolders(unsigned int*, SharedFolder***) DUMMY(E_FAIL)
HRESULT Console::get_AttachedPCIDevices(unsigned int*, PCIDeviceAttachment***) DUMMY(E_FAIL)
HRESULT Console::get_UseHostClipboard(bool*) DUMMY(E_FAIL)
HRESULT Console::set_UseHostClipboard(bool) DUMMY(E_FAIL)
HRESULT Console::get_EmulatedUSB(EmulatedUSB**) DUMMY(E_FAIL)
HRESULT Console::Reset() DUMMY(E_FAIL)
HRESULT Console::Pause() DUMMY(E_FAIL)
HRESULT Console::Resume() DUMMY(E_FAIL)
HRESULT Console::PowerButton() DUMMY(E_FAIL)
HRESULT Console::SleepButton() DUMMY(E_FAIL)
HRESULT Console::GetPowerButtonHandled(bool*) DUMMY(E_FAIL)
HRESULT Console::GetGuestEnteredACPIMode(bool*) DUMMY(E_FAIL)
HRESULT Console::SaveState(Progress**) DUMMY(E_FAIL)
HRESULT Console::AdoptSavedState(unsigned short*) DUMMY(E_FAIL)
HRESULT Console::DiscardSavedState(bool) DUMMY(E_FAIL)
HRESULT Console::GetDeviceActivity(DeviceType_T, DeviceActivity_T*) DUMMY(E_FAIL)
HRESULT Console::AttachUSBDevice(unsigned short*) DUMMY(E_FAIL)
HRESULT Console::DetachUSBDevice(unsigned short*, IUSBDevice**) DUMMY(E_FAIL)
HRESULT Console::FindUSBDeviceByAddress(unsigned short*, IUSBDevice**) DUMMY(E_FAIL)
HRESULT Console::FindUSBDeviceById(unsigned short*, IUSBDevice**) DUMMY(E_FAIL)
HRESULT Console::CreateSharedFolder(unsigned short*, unsigned short*, bool,
bool) DUMMY(E_FAIL)
HRESULT Console::RemoveSharedFolder(unsigned short*) DUMMY(E_FAIL)
HRESULT Console::TakeSnapshot(unsigned short*, unsigned short*, Progress**) DUMMY(E_FAIL)
HRESULT Console::DeleteSnapshot(unsigned short*, Progress**) DUMMY(E_FAIL)
HRESULT Console::DeleteSnapshotAndAllChildren(unsigned short*, Progress**) DUMMY(E_FAIL)
HRESULT Console::DeleteSnapshotRange(unsigned short*, unsigned short*,
Progress**) DUMMY(E_FAIL)
HRESULT Console::RestoreSnapshot(Snapshot*, Progress**) DUMMY(E_FAIL)
HRESULT Console::Teleport(unsigned short*, unsigned int, unsigned short*,
unsigned int, Progress**) DUMMY(E_FAIL)
HRESULT Console::setDiskEncryptionKeys(const Utf8Str &strCfg) DUMMY(E_FAIL)
DisplayMouseInterface *Console::getDisplayMouseInterface() DUMMY(nullptr)
void Console::onMouseCapabilityChange(BOOL, BOOL, BOOL, BOOL) TRACE()
void Console::onAdditionsStateChange() TRACE()
void Console::onAdditionsOutdated() DUMMY()
void Console::onMousePointerShapeChange(bool, bool, uint32_t, uint32_t,
uint32_t, uint32_t,
ComSafeArrayIn(uint8_t, aShape)) DUMMY()
void Console::onKeyboardLedsChange(bool, bool, bool) TRACE()
HRESULT Console::onVideoCaptureChange() DUMMY(E_FAIL)
HRESULT Console::onSharedFolderChange(BOOL aGlobal) DUMMY(E_FAIL)
HRESULT Console::onUSBControllerChange() DUMMY(E_FAIL)
HRESULT Console::onCPUChange(ULONG aCPU, BOOL aRemove) DUMMY(E_FAIL)
HRESULT Console::onClipboardModeChange(ClipboardMode_T aClipboardMode) DUMMY(E_FAIL)
HRESULT Console::onDragAndDropModeChange(DragAndDropMode_T aDragAndDropMode) DUMMY(E_FAIL)
HRESULT Console::onCPUExecutionCapChange(ULONG aExecutionCap) DUMMY(E_FAIL)
HRESULT Console::onStorageControllerChange() DUMMY(E_FAIL)
HRESULT Console::onMediumChange(IMediumAttachment *aMediumAttachment, BOOL) DUMMY(E_FAIL)
HRESULT Console::onVRDEServerChange(BOOL aRestart) DUMMY(E_FAIL)
HRESULT Console::onUSBDeviceAttach(IUSBDevice *, IVirtualBoxErrorInfo *, ULONG) DUMMY(E_FAIL)
HRESULT Console::onUSBDeviceDetach(IN_BSTR aId, IVirtualBoxErrorInfo *aError) DUMMY(E_FAIL)
HRESULT Console::onShowWindow(BOOL aCheck, BOOL *aCanShow, LONG64 *aWinId) DUMMY(E_FAIL)
HRESULT Console::onNetworkAdapterChange(INetworkAdapter *, BOOL changeAdapter) DUMMY(E_FAIL)
HRESULT Console::onStorageDeviceChange(IMediumAttachment *, BOOL, BOOL) DUMMY(E_FAIL)
HRESULT Console::onBandwidthGroupChange(IBandwidthGroup *aBandwidthGroup) DUMMY(E_FAIL)
HRESULT Console::onSerialPortChange(ISerialPort *aSerialPort) DUMMY(E_FAIL)
HRESULT Console::onParallelPortChange(IParallelPort *aParallelPort) DUMMY(E_FAIL)
HRESULT Console::onlineMergeMedium(IMediumAttachment *aMediumAttachment,
ULONG aSourceIdx, ULONG aTargetIdx,
IProgress *aProgress) DUMMY(E_FAIL)

View File

@ -1,11 +1,12 @@
/*
* \brief Console implementation of VirtualBox for Genode
* \author Alexander Boettcher
* \author Norman Feske
* \date 2013-10-16
*/
/*
* Copyright (C) 2013 Genode Labs GmbH
* Copyright (C) 2013-2014 Genode Labs GmbH
*
* This file is distributed under the terms of the GNU General Public License
* version 2.
@ -21,7 +22,7 @@
#include <scan_code_set_1.h>
/* VirtualBox includes */
#include <ConsoleImpl.h>
#include "ConsoleImpl.h"
#include <base/printf.h>
/* XXX */
@ -102,14 +103,15 @@ class Scan_code
};
class SDLConsole : public Console {
class GenodeConsole : public Console {
private:
Timer::Connection timer;
Input::Connection input;
Input::Event *_ev_buf;
unsigned _ax, _ay;
Input::Connection _input;
Genode::Signal_receiver _receiver;
Genode::Signal_context _context;
Input::Event *_ev_buf;
unsigned _ax, _ay;
bool _key_status[Input::KEY_MAX + 1];
@ -122,64 +124,29 @@ class SDLConsole : public Console {
public:
SDLConsole()
GenodeConsole()
:
Console(),
_ev_buf(static_cast<Input::Event *>(Genode::env()->rm_session()->attach(input.dataspace()))),
_ev_buf(static_cast<Input::Event *>(Genode::env()->rm_session()->attach(_input.dataspace()))),
_ax(0), _ay(0)
{
for (unsigned i = 0; i <= Input::KEY_MAX; i++)
_key_status[i] = 0;
_input.sigh(_receiver.manage(&_context));
/*
if (FAILED(gMouse->init(this))) {
PERR("mouse init failed");
return;
}
mfInitialized = true;
*/
}
void updateTitlebar()
void eventWait(IKeyboard * gKeyboard, IMouse * gMouse)
{
PERR("%s:%s called", __FILE__, __FUNCTION__);
}
_receiver.wait_for_signal();
void updateTitlebarProgress(const char *, int)
{
PERR("%s:%s called", __FILE__, __FUNCTION__);
}
void inputGrabStart()
{
PERR("%s:%s called", __FILE__, __FUNCTION__);
}
void inputGrabEnd()
{
PERR("%s:%s called", __FILE__, __FUNCTION__);
}
void mouseSendEvent(int)
{
PERR("%s:%s called", __FILE__, __FUNCTION__);
}
void onMousePointerShapeChange(bool, bool, uint32_t, uint32_t,
uint32_t, uint32_t, void *)
{
PERR("%s:%s called", __FILE__, __FUNCTION__);
}
void progressInfo(PVM, unsigned, void *)
{
PERR("%s:%s called", __FILE__, __FUNCTION__);
}
CONEVENT eventWait()
{
while (!input.is_pending()) { timer.msleep(50); }
for (int i = 0, num_ev = input.flush(); i < num_ev; ++i) {
for (int i = 0, num_ev = _input.flush(); i < num_ev; ++i) {
Input::Event &ev = _ev_buf[i];
bool const is_press = ev.type() == Input::Event::PRESS;
@ -218,10 +185,9 @@ class SDLConsole : public Console {
bool const is_mouse_event = is_mouse_button_event || is_motion;
if (is_mouse_event) {
unsigned const buttons = (_key_status[Input::BTN_LEFT] ? 0x1 : 0)
| (_key_status[Input::BTN_RIGHT] ? 0x2 : 0)
| (_key_status[Input::BTN_MIDDLE] ? 0x4 : 0);
unsigned const buttons = (_key_status[Input::BTN_LEFT] ? MouseButtonState_LeftButton : 0)
| (_key_status[Input::BTN_RIGHT] ? MouseButtonState_RightButton : 0)
| (_key_status[Input::BTN_MIDDLE] ? MouseButtonState_MiddleButton : 0);
if (ev.is_absolute_motion()) {
int const rx = ev.ax() - _ax; _ax = ev.ax();
int const ry = ev.ay() - _ay; _ay = ev.ay();
@ -235,12 +201,5 @@ class SDLConsole : public Console {
gMouse->PutMouseEvent(0, 0, 0, 0, buttons);
}
}
return CONEVENT_NONE;
}
void eventQuit() { PERR("%s:%s called", __FILE__, __FUNCTION__); }
void resetKeys(void) { PERR("%s:%s called", __FILE__, __FUNCTION__); }
VMMDev *getVMMDev() { return gVMMDev; }
Display *getDisplay() { return gDisplay; }
};

View File

@ -0,0 +1,33 @@
#include <base/printf.h>
#include "VirtualBoxBase.h"
#include "AutostartDb.h"
static bool debug = false;
#define TRACE(X) \
{ \
if (debug) \
PDBG(" called (%s) - eip=%p", __FILE__, \
__builtin_return_address(0)); \
return X; \
}
#define DUMMY(X) \
{ \
PERR("%s called (%s), not implemented, eip=%p", __func__, __FILE__, \
__builtin_return_address(0)); \
while (1) \
asm volatile ("ud2a"); \
\
return X; \
}
int AutostartDb::addAutostartVM(const char *pszVMId) DUMMY(-1)
int AutostartDb::addAutostopVM(char const*) DUMMY(-1)
int AutostartDb::removeAutostopVM(char const*) DUMMY(-1)
int AutostartDb::removeAutostartVM(char const*) DUMMY(-1)
AutostartDb::AutostartDb() TRACE()
AutostartDb::~AutostartDb() DUMMY()
int AutostartDb::setAutostartDbPath(char const*path) TRACE(VINF_SUCCESS)

View File

@ -0,0 +1,31 @@
#include <base/printf.h>
#include "VirtualBoxBase.h"
#include <VBox/com/ErrorInfo.h>
static bool debug = false;
#define TRACE(X) \
{ \
if (debug) \
PDBG(" called (%s) - eip=%p", __FILE__, \
__builtin_return_address(0)); \
return X; \
}
#define DUMMY(X) \
{ \
PERR("%s called (%s), not implemented, eip=%p", __func__, __FILE__, \
__builtin_return_address(0)); \
while (1) \
asm volatile ("ud2a"); \
\
return X; \
}
void ErrorInfo::init(bool aKeepObj) TRACE()
void ErrorInfo::cleanup() TRACE()
HRESULT ErrorInfoKeeper::restore() TRACE(S_OK)
void ErrorInfo::copyFrom(const ErrorInfo &x) DUMMY()

View File

@ -0,0 +1,143 @@
#include <base/printf.h>
#include "VirtualBoxBase.h"
static bool debug = false;
#define TRACE(X) \
{ \
if (debug) \
PDBG(" called (%s) - eip=%p", __FILE__, \
__builtin_return_address(0)); \
return X; \
}
#define DUMMY(X) \
{ \
PERR("%s called (%s:%u), not implemented, eip=%p", __func__, \
__FILE__, __LINE__, \
__builtin_return_address(0)); \
while (1) \
asm volatile ("ud2a"); \
\
return X; \
}
STDMETHODIMP Host::COMGETTER(DVDDrives)(ComSafeArrayOut(IMedium *, drives)) DUMMY(E_FAIL)
STDMETHODIMP Host::COMGETTER(FloppyDrives)(ComSafeArrayOut(IMedium *, drives)) DUMMY(E_FAIL)
STDMETHODIMP Host::COMGETTER(USBDevices)(ComSafeArrayOut(IHostUSBDevice *, aUSBDevices)) DUMMY(E_FAIL)
STDMETHODIMP Host::COMGETTER(USBDeviceFilters)(ComSafeArrayOut(IHostUSBDeviceFilter *, aUSBDeviceFilters)) DUMMY(E_FAIL)
STDMETHODIMP Host::COMGETTER(NetworkInterfaces)(ComSafeArrayOut(IHostNetworkInterface *, aNetworkInterfaces)) DUMMY(E_FAIL)
STDMETHODIMP Host::COMGETTER(NameServers)(ComSafeArrayOut(BSTR, aNameServers)) DUMMY(E_FAIL)
STDMETHODIMP Host::COMGETTER(DomainName)(BSTR *aDomainName) DUMMY(E_FAIL)
STDMETHODIMP Host::COMGETTER(SearchStrings)(ComSafeArrayOut(BSTR, aSearchStrings)) DUMMY(E_FAIL)
STDMETHODIMP Host::COMGETTER(ProcessorCount)(ULONG *count) DUMMY(E_FAIL)
STDMETHODIMP Host::COMGETTER(ProcessorOnlineCount)(ULONG *count) DUMMY(E_FAIL)
STDMETHODIMP Host::COMGETTER(ProcessorCoreCount)(ULONG *count) DUMMY(E_FAIL)
STDMETHODIMP Host::COMGETTER(ProcessorOnlineCoreCount)(ULONG *count) DUMMY(E_FAIL)
STDMETHODIMP Host::GetProcessorSpeed(ULONG cpuId, ULONG *speed) DUMMY(E_FAIL)
STDMETHODIMP Host::GetProcessorDescription(ULONG cpuId, BSTR *description) DUMMY(E_FAIL)
STDMETHODIMP Host::GetProcessorCPUIDLeaf(ULONG aCpuId, ULONG aLeaf, ULONG aSubLeaf, ULONG *aValEAX, ULONG *aValEBX, ULONG *aValECX, ULONG *aValEDX) DUMMY(E_FAIL)
STDMETHODIMP Host::COMGETTER(MemorySize)(ULONG *size) DUMMY(E_FAIL)
STDMETHODIMP Host::COMGETTER(MemoryAvailable)(ULONG *available) DUMMY(E_FAIL)
STDMETHODIMP Host::COMGETTER(OperatingSystem)(BSTR *os) DUMMY(E_FAIL)
STDMETHODIMP Host::COMGETTER(OSVersion)(BSTR *version) DUMMY(E_FAIL)
STDMETHODIMP Host::COMGETTER(UTCTime)(LONG64 *aUTCTime) DUMMY(E_FAIL)
STDMETHODIMP Host::COMGETTER(Acceleration3DAvailable)(BOOL *aSupported) DUMMY(E_FAIL)
STDMETHODIMP Host::COMGETTER(VideoInputDevices)(ComSafeArrayOut(IHostVideoInputDevice*, aVideoInputDevices)) DUMMY(E_FAIL)
// IHost methods
STDMETHODIMP Host::CreateHostOnlyNetworkInterface(IHostNetworkInterface **aHostNetworkInterface,
IProgress **aProgress) DUMMY(E_FAIL)
STDMETHODIMP Host::RemoveHostOnlyNetworkInterface(IN_BSTR aId, IProgress **aProgress) DUMMY(E_FAIL)
STDMETHODIMP Host::CreateUSBDeviceFilter(IN_BSTR aName, IHostUSBDeviceFilter **aFilter) DUMMY(E_FAIL)
STDMETHODIMP Host::InsertUSBDeviceFilter(ULONG aPosition, IHostUSBDeviceFilter *aFilter) DUMMY(E_FAIL)
STDMETHODIMP Host::RemoveUSBDeviceFilter(ULONG aPosition) DUMMY(E_FAIL)
STDMETHODIMP Host::FindHostDVDDrive(IN_BSTR aName, IMedium **aDrive) DUMMY(E_FAIL)
STDMETHODIMP Host::FindHostFloppyDrive(IN_BSTR aName, IMedium **aDrive) DUMMY(E_FAIL)
STDMETHODIMP Host::FindHostNetworkInterfaceByName(IN_BSTR aName, IHostNetworkInterface **networkInterface) DUMMY(E_FAIL)
STDMETHODIMP Host::FindHostNetworkInterfaceById(IN_BSTR id, IHostNetworkInterface **networkInterface) DUMMY(E_FAIL)
STDMETHODIMP Host::FindHostNetworkInterfacesOfType(HostNetworkInterfaceType_T type, ComSafeArrayOut(IHostNetworkInterface *, aNetworkInterfaces)) DUMMY(E_FAIL)
STDMETHODIMP Host::FindUSBDeviceByAddress(IN_BSTR aAddress, IHostUSBDevice **aDevice) DUMMY(E_FAIL)
STDMETHODIMP Host::FindUSBDeviceById(IN_BSTR aId, IHostUSBDevice **aDevice) DUMMY(E_FAIL)
STDMETHODIMP Host::GenerateMACAddress(BSTR *aAddress) DUMMY(E_FAIL)
HRESULT Host::findHostDriveByName(DeviceType_T mediumType,
const Utf8Str &strLocationFull,
bool fRefresh,
ComObjPtr<Medium> &pMedium) DUMMY(E_FAIL)
HRESULT Host::findHostDriveById(DeviceType_T, com::Guid const&, bool,
ComObjPtr<Medium>&) TRACE(VBOX_E_OBJECT_NOT_FOUND)
HRESULT Host::saveSettings(settings::Host&) TRACE(S_OK)
HRESULT Host::init(VirtualBox *aParent) TRACE(S_OK)
HRESULT Host::loadSettings(const settings::Host &) TRACE(S_OK)
HRESULT Host::FinalConstruct() TRACE(S_OK)
void Host::FinalRelease() DUMMY()
void Host::uninit() DUMMY()
void Host::generateMACAddress(Utf8Str &mac)
{
static unsigned counter = 1;
mac = Utf8StrFmt("080027%06X", counter++);
TRACE();
}
HRESULT Host::GetProcessorFeature(ProcessorFeature_T feature, BOOL *supported)
{
CheckComArgOutPointerValid(supported);
switch (feature)
{
case ProcessorFeature_HWVirtEx:
*supported = true;
break;
case ProcessorFeature_PAE:
*supported = true;
break;
case ProcessorFeature_LongMode:
*supported = false;
break;
case ProcessorFeature_NestedPaging:
*supported = true;
break;
default:
return setError(E_INVALIDARG, tr("The feature value is out of range."));
}
return S_OK;
}
HRESULT Host::getDrives(DeviceType_T, bool, MediaList*&, util::AutoWriteLock&) DUMMY(E_FAIL)
HRESULT Host::findHostDriveByNameOrId(DeviceType_T, const com::Utf8Str&,
ComObjPtr<Medium>&) DUMMY(E_FAIL)
HRESULT Host::buildDVDDrivesList(MediaList &list) DUMMY(E_FAIL)
HRESULT Host::buildFloppyDrivesList(MediaList &list) DUMMY(E_FAIL)
#ifdef VBOX_WITH_USB
USBProxyService* Host::usbProxyService() DUMMY(nullptr)
HRESULT Host::addChild(HostUSBDeviceFilter *pChild) DUMMY(E_FAIL)
HRESULT Host::removeChild(HostUSBDeviceFilter *pChild) DUMMY(E_FAIL)
VirtualBox* Host::parent() DUMMY(nullptr)
HRESULT Host::onUSBDeviceFilterChange(HostUSBDeviceFilter *aFilter) DUMMY(E_FAIL)
void Host::getUSBFilters(Host::USBDeviceFilterList *aGlobalFilters) DUMMY()
#endif
/*
void Host::getDVDInfoFromDevTree(std::list<ComObjPtr<Medium> > &list) DUMMY()
bool Host::getDVDInfoFromHal(std::list<ComObjPtr<Medium> > &list) DUMMY(false)
bool Host::getFloppyInfoFromHal(std::list< ComObjPtr<Medium> > &list) DUMMY(false)
void Host::parseMountTable(char *mountTable, std::list< ComObjPtr<Medium> > &list) DUMMY()
bool Host::validateDevice(const char *deviceNode, bool isCDROM) DUMMY(false)
HRESULT Host::checkUSBProxyService() DUMMY(E_FAIL)
HRESULT Host::updateNetIfList() DUMMY(E_FAIL)
void Host::registerDiskMetrics(PerformanceCollector *aCollector) DUMMY()
void Host::registerMetrics(PerformanceCollector *aCollector) DUMMY()
void Host::unregisterMetrics (PerformanceCollector *aCollector) DUMMY()
*/

View File

@ -0,0 +1,201 @@
#include <base/printf.h>
#include "VirtualBoxBase.h"
#include "ClientToken.h"
#include "TokenImpl.h"
#include "ProgressProxyImpl.h"
#include "SharedFolderImpl.h"
static bool debug = false;
#define TRACE(X) \
{ \
if (debug) \
PDBG(" called (%s) - eip=%p", __FILE__, \
__builtin_return_address(0)); \
return X; \
}
#define DUMMY(X) \
{ \
PERR("%s called (%s:%u), not implemented, eip=%p", __func__, \
__FILE__, __LINE__, \
__builtin_return_address(0)); \
while (1) \
asm volatile ("ud2a"); \
\
return X; \
}
#define DUMMY_STATIC(X) \
{ \
static X dummy; \
PERR("%s called (%s), not implemented, eip=%p", __func__, __FILE__, \
__builtin_return_address(0)); \
while (1) \
asm volatile ("ud2a"); \
\
return dummy; \
}
/* static */
const Guid Guid::Empty;
HRESULT IMediumFormat::get_Capabilities(unsigned int*,
MediumFormatCapabilities_T**) DUMMY(E_FAIL)
HRESULT Machine::ExportTo(IAppliance *aAppliance, IN_BSTR location,
IVirtualSystemDescription **aDescription) DUMMY(E_FAIL)
int DisplayMakePNG(uint8_t *, uint32_t, uint32_t, uint8_t **, uint32_t *,
uint32_t *, uint32_t *, uint8_t) DUMMY(-1)
ProgressErrorInfo::ProgressErrorInfo(Progress*) DUMMY()
HRESULT ProgressProxy::init(VirtualBox*, IUnknown*, unsigned short const*,
bool) DUMMY(E_FAIL)
HRESULT ProgressProxy::init(VirtualBox*, void*, unsigned short const*, bool,
unsigned int, unsigned short const*, unsigned int,
unsigned int) DUMMY(E_FAIL)
HRESULT ProgressProxy::notifyComplete(HRESULT) DUMMY(E_FAIL)
HRESULT ProgressProxy::notifyComplete(HRESULT, GUID const&, char const*,
char const*, ...) DUMMY(E_FAIL)
bool ProgressProxy::setOtherProgressObject(Progress*) DUMMY(false)
HRESULT ProgressProxy::FinalConstruct() DUMMY(E_FAIL)
STDMETHODIMP ProgressProxy::COMGETTER(Cancelable)(BOOL *) DUMMY(E_FAIL)
STDMETHODIMP ProgressProxy::COMGETTER(Percent)(ULONG *) DUMMY(E_FAIL)
STDMETHODIMP ProgressProxy::COMGETTER(TimeRemaining)(LONG *) DUMMY(E_FAIL)
STDMETHODIMP ProgressProxy::COMGETTER(Completed)(BOOL *) DUMMY(E_FAIL)
STDMETHODIMP ProgressProxy::COMGETTER(Canceled)(BOOL *) DUMMY(E_FAIL)
STDMETHODIMP ProgressProxy::COMGETTER(ResultCode)(LONG *) DUMMY(E_FAIL)
STDMETHODIMP ProgressProxy::COMGETTER(ErrorInfo)(IVirtualBoxErrorInfo **) DUMMY(E_FAIL)
STDMETHODIMP ProgressProxy::COMGETTER(Operation)(ULONG *) DUMMY(E_FAIL)
STDMETHODIMP ProgressProxy::COMGETTER(OperationDescription)(BSTR *) DUMMY(E_FAIL)
STDMETHODIMP ProgressProxy::COMGETTER(OperationPercent)(ULONG *) DUMMY(E_FAIL)
STDMETHODIMP ProgressProxy::COMSETTER(Timeout)(ULONG) DUMMY(E_FAIL)
STDMETHODIMP ProgressProxy::COMGETTER(Timeout)(ULONG *) DUMMY(E_FAIL)
STDMETHODIMP ProgressProxy::WaitForCompletion(LONG aTimeout) DUMMY(E_FAIL)
STDMETHODIMP ProgressProxy::WaitForOperationCompletion(ULONG, LONG) DUMMY(E_FAIL)
STDMETHODIMP ProgressProxy::Cancel() DUMMY(E_FAIL)
STDMETHODIMP ProgressProxy::SetCurrentOperationProgress(ULONG aPercent) DUMMY(E_FAIL)
STDMETHODIMP ProgressProxy::SetNextOperation(IN_BSTR, ULONG) DUMMY(E_FAIL)
void ProgressProxy::clearOtherProgressObjectInternal(bool fEarly) DUMMY()
void ProgressProxy::copyProgressInfo(IProgress *pOtherProgress, bool fEarly) DUMMY()
void ProgressProxy::uninit() DUMMY()
void ProgressProxy::FinalRelease() DUMMY()
template<>
void DummyClass<VirtualBox>::fireNATRedirectEvent(ComObjPtr<EventSource> const&,
unsigned short*,
unsigned int&, bool&,
unsigned short*&,
NATProtocol_T&,
unsigned short*&,
unsigned short&,
unsigned short*&,
unsigned short&) DUMMY()
template<>
void DummyClass<Console>::fireStateChangedEvent(ComObjPtr<EventSource> const&,
MachineState_T) TRACE()
template<>
void DummyClass<Console>::fireRuntimeErrorEvent(ComObjPtr<EventSource> const&,
bool&, unsigned short*&,
unsigned short*&) DUMMY()
template<>
void DummyClass<Machine>::fireHostPCIDevicePlugEvent(ComPtr<EventSource>&,
unsigned short*, bool,
bool, ComObjPtr<PCIDeviceAttachment>&,
void*) DUMMY()
NATNetwork::NATNetwork() : mVirtualBox(nullptr) DUMMY()
void NATNetwork::uninit() DUMMY()
HRESULT NATNetwork::init(VirtualBox *aVirtualBox, IN_BSTR aName) DUMMY(E_FAIL)
HRESULT NATNetwork::init(VirtualBox *aVirtualBox, const settings::NATNetwork &) DUMMY(E_FAIL)
HRESULT NATNetwork::FinalConstruct() DUMMY(E_FAIL)
HRESULT NATNetwork::saveSettings(settings::NATNetwork &data) DUMMY(E_FAIL)
STDMETHODIMP NATNetwork::COMGETTER(EventSource)(IEventSource **IEventSource) DUMMY(E_FAIL)
STDMETHODIMP NATNetwork::COMGETTER(Enabled)(BOOL *aEnabled) DUMMY(E_FAIL)
STDMETHODIMP NATNetwork::COMSETTER(Enabled)(BOOL aEnabled) DUMMY(E_FAIL)
STDMETHODIMP NATNetwork::COMGETTER(NetworkName)(BSTR *aName) DUMMY(E_FAIL)
STDMETHODIMP NATNetwork::COMSETTER(NetworkName)(IN_BSTR aName) DUMMY(E_FAIL)
STDMETHODIMP NATNetwork::COMGETTER(Gateway)(BSTR *aIPGateway) DUMMY(E_FAIL)
STDMETHODIMP NATNetwork::COMGETTER(Network)(BSTR *aIPNetwork) DUMMY(E_FAIL)
STDMETHODIMP NATNetwork::COMSETTER(Network)(IN_BSTR aIPNetwork) DUMMY(E_FAIL)
STDMETHODIMP NATNetwork::COMGETTER(IPv6Enabled)(BOOL *aEnabled) DUMMY(E_FAIL)
STDMETHODIMP NATNetwork::COMSETTER(IPv6Enabled)(BOOL aEnabled) DUMMY(E_FAIL)
STDMETHODIMP NATNetwork::COMGETTER(IPv6Prefix)(BSTR *aName) DUMMY(E_FAIL)
STDMETHODIMP NATNetwork::COMSETTER(IPv6Prefix)(IN_BSTR aName) DUMMY(E_FAIL)
STDMETHODIMP NATNetwork::COMGETTER(AdvertiseDefaultIPv6RouteEnabled)(BOOL *aEnabled) DUMMY(E_FAIL)
STDMETHODIMP NATNetwork::COMSETTER(AdvertiseDefaultIPv6RouteEnabled)(BOOL aEnabled) DUMMY(E_FAIL)
STDMETHODIMP NATNetwork::COMGETTER(NeedDhcpServer)(BOOL *aEnabled) DUMMY(E_FAIL)
STDMETHODIMP NATNetwork::COMSETTER(NeedDhcpServer)(BOOL aEnabled) DUMMY(E_FAIL)
STDMETHODIMP NATNetwork::COMGETTER(LocalMappings)(ComSafeArrayOut(BSTR, aLocalMappings)) DUMMY(E_FAIL)
STDMETHODIMP NATNetwork::AddLocalMapping(IN_BSTR aHostId, LONG aOffset) DUMMY(E_FAIL)
STDMETHODIMP NATNetwork::COMGETTER(LoopbackIp6)(LONG *aLoopbackIp6) DUMMY(E_FAIL)
STDMETHODIMP NATNetwork::COMSETTER(LoopbackIp6)(LONG aLoopbackIp6) DUMMY(E_FAIL)
STDMETHODIMP NATNetwork::COMGETTER(PortForwardRules4)(ComSafeArrayOut(BSTR, aPortForwardRules4)) DUMMY(E_FAIL)
STDMETHODIMP NATNetwork::COMGETTER(PortForwardRules6)(ComSafeArrayOut(BSTR, aPortForwardRules6)) DUMMY(E_FAIL)
STDMETHODIMP NATNetwork::AddPortForwardRule(BOOL aIsIpv6,
IN_BSTR aPortForwardRuleName,
NATProtocol_T aProto,
IN_BSTR aHostIp,
USHORT aHostPort,
IN_BSTR aGuestIp,
USHORT aGuestPort) DUMMY(E_FAIL)
STDMETHODIMP NATNetwork::RemovePortForwardRule(BOOL aIsIpv6, IN_BSTR aPortForwardRuleName) DUMMY(E_FAIL)
STDMETHODIMP NATNetwork::Start(IN_BSTR aTrunkType) DUMMY(E_FAIL)
STDMETHODIMP NATNetwork::Stop() DUMMY(E_FAIL)
HRESULT com::Shutdown() DUMMY(E_FAIL)
void Display::fireGuestMonitorChangedEvent(EventSource*, GuestMonitorChangedEventType, int, int, int, int, int) DUMMY()
STDMETHODIMP Guest::UpdateGuestAdditions(IN_BSTR,
ComSafeArrayIn(IN_BSTR, aArguments),
ComSafeArrayIn(AdditionsUpdateFlag_T, aFlags),
IProgress **aProgress) DUMMY(E_FAIL)
STDMETHODIMP Guest::FindSession(IN_BSTR,
ComSafeArrayOut(IGuestSession *, aSessions)) DUMMY(E_FAIL)
STDMETHODIMP Guest::CreateSession(IN_BSTR, IN_BSTR, IN_BSTR, IN_BSTR,
IGuestSession **) DUMMY(E_FAIL)
void ConsoleVRDPServer::SendUpdate(unsigned int, void*, unsigned int) const DUMMY()
void ConsoleVRDPServer::SendUpdateBitmap(unsigned int, unsigned int,
unsigned int, unsigned int,
unsigned int) const DUMMY()
void ConsoleVRDPServer::Stop() DUMMY()
void IStateChangedEvent::get_State(MachineState_T*) DUMMY()
HRESULT IEventListener::HandleEvent(IEvent*) DUMMY(E_FAIL)
HRESULT SharedFolder::init(Console*, com::Utf8Str const&, com::Utf8Str const&,
bool, bool, bool) DUMMY(E_FAIL)
Machine::ClientToken::ClientToken(const ComObjPtr<Machine> &, SessionMachine *) TRACE()
bool Machine::ClientToken::isReady() TRACE(true)
void Machine::ClientToken::getId(Utf8Str &strId)
{
strId = "ClientTokenID DUMMY";
TRACE()
}
HRESULT com::Initialize(bool fGui) TRACE(S_OK)

View File

@ -0,0 +1,58 @@
#include <base/printf.h>
#include "VirtualBoxImpl.h"
#include "VBox/com/MultiResult.h"
static bool debug = false;
#define TRACE(X) \
{ \
if (debug) \
PDBG(" called (%s) - eip=%p", __FILE__, \
__builtin_return_address(0)); \
return X; \
}
#define DUMMY(X) \
{ \
PERR("%s called (%s:%u), not implemented, eip=%p", __func__, __FILE__, __LINE__, \
__builtin_return_address(0)); \
while (1) \
asm volatile ("ud2a"); \
\
return X; \
}
HRESULT VirtualBoxBase::setError(HRESULT aResultCode, const char *pcsz, ...)
{
Genode::printf(ESC_ERR);
va_list list;
va_start(list, pcsz);
Genode::printf("%s : %s", this->getComponentName(),
Utf8Str(pcsz, list).c_str());
va_end(list);
Genode::printf(ESC_END "\n");
TRACE(aResultCode);
}
HRESULT VirtualBox::CreateAppliance(IAppliance**) DUMMY(E_FAIL)
void VirtualBoxBase::clearError() TRACE()
HRESULT VirtualBoxBase::setError(HRESULT aResultCode) DUMMY(E_FAIL)
HRESULT VirtualBoxBase::setError(const com::ErrorInfo &ei) DUMMY(E_FAIL)
HRESULT VirtualBoxBase::handleUnexpectedExceptions(VirtualBoxBase *const,
RT_SRC_POS_DECL) TRACE(E_FAIL)
HRESULT VirtualBoxBase::setErrorInternal(HRESULT, GUID const&, char const*,
com::Utf8Str, bool, bool) DUMMY(E_FAIL)
HRESULT VirtualBoxBase::initializeComForThread(void) TRACE(S_OK)
HRESULT VirtualBoxErrorInfo::init(HRESULT, const GUID &, const char *,
const Utf8Str &, IVirtualBoxErrorInfo *) DUMMY(E_FAIL)
HRESULT VBoxEventDesc::init(IEventSource* aSource, VBoxEventType_T aType, ...) TRACE(S_OK)
HRESULT VBoxEventDesc::reinit(VBoxEventType_T aType, ...) TRACE(S_OK)

View File

@ -0,0 +1,190 @@
/*
* \brief Virtualbox framebuffer implementation for Genode
* \author Alexander Boettcher
* \date 2013-10-16
*/
/*
* Copyright (C) 2013-2014 Genode Labs GmbH
*
* This file is distributed under the terms of the GNU General Public License
* version 2.
*/
/* Genode includes */
#define Framebuffer Fb_Genode
#include <framebuffer_session/connection.h>
#undef Framebuffer
/* VirtualBox includes */
class Genodefb : public Framebuffer
{
private:
Fb_Genode::Connection _fb;
Fb_Genode::Mode const _fb_mode;
void * _fb_base;
RTCRITSECT _fb_lock;
unsigned long _width;
unsigned long _height;
public:
Genodefb ()
:
_fb_mode(_fb.mode()),
_fb_base(Genode::env()->rm_session()->attach(_fb.dataspace())),
_width(_fb_mode.width()),
_height(_fb_mode.height())
{
int rc = RTCritSectInit(&_fb_lock);
Assert(rc == VINF_SUCCESS);
}
STDMETHODIMP COMGETTER(Width)(ULONG *width)
{
if (!width)
return E_INVALIDARG;
*width = _width;
return S_OK;
}
STDMETHODIMP COMGETTER(Height)(ULONG *height)
{
if (!height)
return E_INVALIDARG;
*height = _height;
return S_OK;
}
STDMETHODIMP Lock()
{
return Global::vboxStatusCodeToCOM(RTCritSectEnter(&_fb_lock));
}
STDMETHODIMP Unlock()
{
return Global::vboxStatusCodeToCOM(RTCritSectLeave(&_fb_lock));
}
STDMETHODIMP COMGETTER(Address)(BYTE **addr)
{
*addr = reinterpret_cast<BYTE*>(_fb_base);
return S_OK;
}
STDMETHODIMP COMGETTER(BitsPerPixel)(ULONG *bits)
{
if (!bits)
return E_INVALIDARG;
*bits = _fb_mode.bytes_per_pixel() * 8;
return S_OK;
}
STDMETHODIMP COMGETTER(BytesPerLine)(ULONG *line)
{
*line = _fb_mode.width() * _fb_mode.bytes_per_pixel();
return S_OK;
}
HRESULT NotifyUpdate(ULONG x, ULONG y, ULONG w, ULONG h)
{
_fb.refresh(x, y, w, h);
return S_OK;
}
STDMETHODIMP RequestResize(ULONG aScreenId, ULONG pixelFormat,
BYTE *vram, ULONG bitsPerPixel,
ULONG bytesPerLine, ULONG w, ULONG h,
BOOL *finished)
{
/* clear screen to avoid artefacts during resize */
size_t const num_pixels = _fb_mode.width() * _fb_mode.height();
memset(_fb_base, 0, num_pixels * _fb_mode.bytes_per_pixel());
_fb.refresh(0, 0, _fb_mode.width(), _fb_mode.height());
/* bitsPerPixel == 0 is set by DevVGA when in text mode */
bool ok = ((bitsPerPixel == 16) || (bitsPerPixel == 0)) &&
(w <= (ULONG)_fb_mode.width()) &&
(h <= (ULONG)_fb_mode.height());
if (ok) {
PINF("fb resize : %lux%lu@%zu -> %ux%u@%u", _width, _height,
_fb_mode.bytes_per_pixel() * 8, w, h, bitsPerPixel);
_width = w;
_height = h;
} else
PERR("Could not resize to %ux%u - %u bpp, %u bpl, vram %p",
w, h, bitsPerPixel, bytesPerLine, vram);
*finished = ok;
return S_OK;
}
STDMETHODIMP COMGETTER(PixelFormat) (ULONG *format)
{
if (!format)
return E_POINTER;
*format = FramebufferPixelFormat_Opaque;
return S_OK;
}
STDMETHODIMP COMGETTER(UsesGuestVRAM) (BOOL *usesGuestVRAM)
{
if (!usesGuestVRAM)
return E_POINTER;
*usesGuestVRAM = FALSE;
return S_OK;
}
STDMETHODIMP COMGETTER(HeightReduction) (ULONG *reduce)
{
*reduce = 0;
return S_OK;
}
STDMETHODIMP COMGETTER(Overlay) (IFramebufferOverlay **aOverlay)
{
Assert(!"FixMe");
return S_OK;
}
STDMETHODIMP COMGETTER(WinId) (ULONG64 *winId)
{
Assert(!"FixMe");
return S_OK;
}
STDMETHODIMP VideoModeSupported(ULONG width, ULONG height, ULONG bpp, BOOL *supported)
{
Assert(!"FixMe");
return S_OK;
}
STDMETHODIMP GetVisibleRegion(BYTE *aRectangles, ULONG aCount,
ULONG *aCountCopied)
{
Assert(!"FixMe");
return S_OK;
}
STDMETHODIMP SetVisibleRegion(BYTE *aRectangles, ULONG aCount)
{
Assert(!"FixMe");
return S_OK;
}
STDMETHODIMP ProcessVHWACommand(BYTE *pCommand)
{
return E_NOTIMPL;
}
};

View File

@ -0,0 +1,244 @@
/*
* \brief Port of VirtualBox to Genode
* \author Norman Feske
* \author Alexander Boettcher
* \date 2013-08-20
*/
/*
* Copyright (C) 2013-2014 Genode Labs GmbH
*
* This file is distributed under the terms of the GNU General Public License
* version 2.
*/
/* Genode includes */
#include <base/printf.h>
#include <os/config.h>
/* Virtualbox includes */
#include <iprt/initterm.h>
#include <iprt/assert.h>
#include <iprt/err.h>
#include <VBox/vmm/vmapi.h>
/* Virtualbox includes of generic Main frontend */
#include "ConsoleImpl.h"
#include "MachineImpl.h"
#include "MouseImpl.h"
/* Genode port specific includes */
#include "console.h"
#include "fb.h"
static char c_vbox_file[128];
static char c_vbox_vmname[128];
/**
* xpcom style memory allocation
*/
void * nsMemory::Alloc(size_t size)
{
return new char[size];
}
void nsMemory::Free(void* ptr)
{
Assert(ptr);
delete [] reinterpret_cast<char *>(ptr);
}
void *nsMemory::Realloc(void* ptr, size_t size)
{
Assert(!"not implemented");
return nullptr;
}
void * nsMemory::Clone(const void*, size_t)
{
Assert(!"not implemented");
return nullptr;
}
/**
* Other stuff
*/
Framebuffer::Framebuffer() { }
Framebuffer::~Framebuffer() { }
int com::GetVBoxUserHomeDirectory(char *aDir, size_t aDirLen, bool fCreateDir)
{
AssertReturn(aDir, VERR_INVALID_POINTER);
AssertReturn(aDirLen > 1, VERR_BUFFER_OVERFLOW);
memcpy(aDir, "/", 1);
aDir[1] = 0;
return VINF_SUCCESS;
}
extern "C"
RTDECL(int) RTPathUserHome(char *pszPath, size_t cchPath)
{
return com::GetVBoxUserHomeDirectory(pszPath, cchPath);
}
HRESULT setupmachine()
{
HRESULT rc;
static com::Utf8Str vm_config(c_vbox_file);
static com::Utf8Str vm_name(c_vbox_vmname);
settings::MachineConfigFile * machine_config = new settings::MachineConfigFile(&vm_config);
/* Machine object */
ComObjPtr<Machine> machine;
rc = machine.createObject();
if (FAILED(rc))
return rc;
/* Virtualbox object */
ComObjPtr<VirtualBox> virtualbox;
rc = virtualbox.createObject();
if (FAILED(rc))
return rc;
rc = machine->init(virtualbox, vm_name, *machine_config);
if (FAILED(rc))
return rc;
rc = virtualbox->RegisterMachine(machine);
if (FAILED(rc))
return rc;
// open a session
ComObjPtr<ISession> session;
rc = session.createObject();
if (FAILED(rc))
return rc;
rc = machine->LockMachine(session, LockType_VM);
if (FAILED(rc))
return rc;
/* Console object */
GenodeConsole * gConsole = new GenodeConsole();
/* Derived from Session::AssignMachine method in Main/src-client/SessionImpl.cpp */
static IInternalMachineControl control;
rc = control.init(machine);
if (FAILED(rc))
return rc;
rc = gConsole->init(machine, &control, LockType_VM);
if (FAILED(rc))
return rc;
/* Validate configured memory of vbox file and Genode config */
ULONG memory_vbox;
rc = machine->COMGETTER(MemorySize)(&memory_vbox);
if (FAILED(rc))
return rc;
/* request max available memory */
size_t memory_genode = Genode::env()->ram_session()->avail() >> 20;
size_t memory_vmm = 28;
if (memory_vbox + memory_vmm > memory_genode) {
PERR("Configured memory %u MB (vbox file) is insufficient.",
memory_vbox);
PERR("%zu MB (1) - %zu MB (2) = %zu MB (3)",
memory_genode, memory_vmm, memory_genode - memory_vmm);
PERR("(1) available memory based defined by Genode config");
PERR("(2) minimum memory required for VBox VMM");
PERR("(3) maximal available memory to VM");
return E_FAIL;
}
/* Display object */
ComPtr<Display> display;
rc = gConsole->COMGETTER(Display)(display.asOutParam());
if (FAILED(rc))
return rc;
ULONG cMonitors = 1;
rc = machine->COMGETTER(MonitorCount)(&cMonitors);
if (FAILED(rc))
return rc;
unsigned uScreenId;
for (uScreenId = 0; uScreenId < cMonitors; uScreenId++)
{
Genodefb *fb = new Genodefb();
display->SetFramebuffer(uScreenId, fb);
}
/* Power up the VMM */
ComPtr <IProgress> progress;
rc = gConsole->PowerUp(progress.asOutParam());
if (FAILED(rc))
return rc;
/* wait until VM is up */
MachineState_T machineState = MachineState_Null;
do {
if (machineState != MachineState_Null)
RTThreadSleep(1000);
rc = machine->COMGETTER(State)(&machineState);
} while (machineState == MachineState_Starting);
if (rc != S_OK || (machineState != MachineState_Running))
return E_FAIL;
/* request mouse object */
static ComPtr<IMouse> gMouse;
rc = gConsole->COMGETTER(Mouse)(gMouse.asOutParam());
if (RT_FAILURE(rc))
return rc;
Assert (&*gMouse);
/* request keyboard object */
ComPtr<IKeyboard> gKeyboard;
rc = gConsole->COMGETTER(Keyboard)(gKeyboard.asOutParam());
if (FAILED(rc))
return rc;
Assert (&*gKeyboard);
/* handle input of Genode and forward it to VMM layer */
while (true) {
gConsole->eventWait(gKeyboard, gMouse);
}
Assert(!"return not expected");
return E_FAIL;
}
int main(int argc, char **argv)
{
try {
using namespace Genode;
Xml_node node = config()->xml_node();
Xml_node::Attribute vbox_file = node.attribute("vbox_file");
vbox_file.value(c_vbox_file, sizeof(c_vbox_file));
Xml_node::Attribute vm_name = node.attribute("vm_name");
vm_name.value(c_vbox_vmname, sizeof(c_vbox_vmname));
} catch (...) {
PERR("Missing attributes in configuration, minimum requirements: ");
PERR(" <config vbox_file=\"...\" vm_name=\"...\">" );
throw;
}
int rc = RTR3InitExe(argc, &argv, 0);
if (RT_FAILURE(rc))
return -1;
HRESULT hrc = setupmachine();
if (FAILED(hrc)) {
PERR("Start-up of VMM failed - reason %d - exiting ...", hrc);
return -2;
}
PERR("VMM exiting ...");
return 0;
}

View File

@ -0,0 +1,17 @@
#ifndef nsMemory_h__
#define nsMemory_h__
#define nsID GUID
#include <stddef.h>
class nsMemory
{
public:
static void * Alloc(size_t size);
static void * Realloc(void* ptr, size_t size);
static void Free(void* ptr);
static void * Clone(const void* ptr, size_t size);
};
#endif /* nsMemory_h__ */

View File

@ -133,21 +133,49 @@ class Guest_memory
int mmio_write(RTGCPHYS GCPhys, void const *pv, unsigned cb)
{
if (!_pfnWriteCallback)
return VERR_IOM_MMIO_RANGE_NOT_FOUND;
return VINF_SUCCESS;
// PDBG("mmio_write(GCPhys=0x%lx, cb=%u)", GCPhys, cb);
int rc = PDMCritSectEnter(_pDevIns->CTX_SUFF(pCritSectRo),
VINF_IOM_R3_MMIO_READ);
if (rc != VINF_SUCCESS)
return rc;
return _pfnWriteCallback(_pDevIns, _pvUser, GCPhys, pv, cb);
rc = _pfnWriteCallback(_pDevIns, _pvUser, GCPhys, pv, cb);
PDMCritSectLeave(_pDevIns->CTX_SUFF(pCritSectRo));
return rc;
}
int mmio_read(RTGCPHYS GCPhys, void *pv, unsigned cb)
{
if (!_pfnReadCallback)
return VERR_IOM_MMIO_RANGE_NOT_FOUND;
return VINF_IOM_MMIO_UNUSED_FF;
// PDBG("mmio_read(GCPhys=0x%lx, cb=%u)", GCPhys, cb);
int rc = PDMCritSectEnter(_pDevIns->CTX_SUFF(pCritSectRo),
VINF_IOM_R3_MMIO_WRITE);
return _pfnReadCallback(_pDevIns, _pvUser, GCPhys, pv, cb);
rc = _pfnReadCallback(_pDevIns, _pvUser, GCPhys, pv, cb);
PDMCritSectLeave(_pDevIns->CTX_SUFF(pCritSectRo));
return rc;
}
bool simple_mmio_write(RTGCPHYS vm_phys, unsigned cb)
{
/* adhere to original IOMMIOWrite check */
return (cb == 4 && !(vm_phys & 3)) ||
((_fFlags & IOMMMIO_FLAGS_WRITE_MODE) == IOMMMIO_FLAGS_WRITE_PASSTHRU) ||
(cb == 8 && !(vm_phys & 7) && IOMMMIO_DOES_WRITE_MODE_ALLOW_QWORD(_fFlags));
}
bool simple_mmio_read(RTGCPHYS vm_phys, unsigned cb)
{
/* adhere to original IOMMIORead check */
return (cb == 4 && !(vm_phys & 3)) ||
((_fFlags & IOMMMIO_FLAGS_READ_MODE) == IOMMMIO_FLAGS_READ_PASSTHRU) ||
(cb == 8 && !(vm_phys & 7) && (_fFlags & IOMMMIO_FLAGS_READ_MODE) == IOMMMIO_FLAGS_READ_DWORD_QWORD);
}
};
@ -328,35 +356,49 @@ class Guest_memory
/**
* \return VirtualBox return code
*/
int mmio_write(PVM pVM, RTGCPHYS GCPhys, uint32_t u32Value, size_t cbValue)
int mmio_write(RTGCPHYS vm_phys, uint32_t u32Value, size_t size)
{
Region *r = _lookup(GCPhys, cbValue);
Region *r = _lookup(vm_phys, size);
if (!r) {
PERR("Guest_memory::mmio_write: lookup failed");
PERR("GCPhys=0x%x, u32Value=0x%x, cbValue=%zd",
GCPhys, u32Value, cbValue);
PERR("Guest_memory::mmio_write: lookup failed - "
"GCPhys=0x%llx, u32Value=0x%x, size=%zd",
(Genode::uint64_t)vm_phys, u32Value, size);
return VERR_IOM_MMIO_RANGE_NOT_FOUND;
}
return r->mmio_write(GCPhys, &u32Value, cbValue);
/* use VERR_IOM_NOT_MMIO_RANGE_OWNER to request complicated write */
if (!r->simple_mmio_write(vm_phys, size))
return VERR_IOM_NOT_MMIO_RANGE_OWNER;
int rc = r->mmio_write(vm_phys, &u32Value, size);
/* check that VERR_IOM_NOT_MMIO_RANGE_OWNER is unused, see above */
Assert(rc != VERR_IOM_NOT_MMIO_RANGE_OWNER);
return rc;
}
/**
* \return VirtualBox return code
*/
int mmio_read(PVM pVM, RTGCPHYS GCPhys, uint32_t *u32Value, size_t cbValue)
int mmio_read(RTGCPHYS vm_phys, uint32_t *u32Value, size_t size)
{
Region *r = _lookup(GCPhys, cbValue);
Region *r = _lookup(vm_phys, size);
if (!r) {
PERR("Guest_memory::mmio_read: lookup failed");
PERR("GCPhys=0x%x, u32Value=0x%x, cbValue=%zd",
GCPhys, u32Value, cbValue);
PERR("Guest_memory::mmio_read: lookup faile - "
"GCPhys=0x%llx, u32Value=0x%p, size=%zd",
(Genode::uint64_t)vm_phys, u32Value, size);
return VERR_IOM_MMIO_RANGE_NOT_FOUND;
}
return r->mmio_read(GCPhys, u32Value, cbValue);
/* use VERR_IOM_NOT_MMIO_RANGE_OWNER to request complicated read */
if (!r->simple_mmio_read(vm_phys, size))
return VERR_IOM_NOT_MMIO_RANGE_OWNER;
int rc = r->mmio_read(vm_phys, u32Value, size);
/* check that VERR_IOM_NOT_MMIO_RANGE_OWNER is unused, see above */
Assert(rc != VERR_IOM_NOT_MMIO_RANGE_OWNER);
return rc;
}
};

View File

@ -1,53 +0,0 @@
+++ src/app/virtualbox/src/VBox/Frontends/VBoxBFE/VBoxBFE.cpp
@@ -158,6 +160,7 @@
static bool g_fReleaseLog = true; /**< Set if we should open the release. */
const char *g_pszProgressString;
unsigned g_uProgressPercent = ~0U;
+static bool g_fOverlay= false;
/**
@@ -715,6 +718,8 @@
g_fCSAM = false;
#endif /* VBOXSDL_ADVANCED_OPTIONS */
/* just show the help screen */
+ else if (strcmp(pszArg, "-overlay") == 0)
+ g_fOverlay = true;
else
{
SyntaxError("unrecognized argument '%s'\n", pszArg);
@@ -1532,7 +1550,7 @@
rc = CFGMR3InsertNode(pLunL0, "AttachedDriver", &pDrv); UPDATE_RC();
rc = CFGMR3InsertString(pDrv, "Driver", "VD"); UPDATE_RC();
rc = CFGMR3InsertNode(pDrv, "Config", &pCfg); UPDATE_RC();
- rc = CFGMR3InsertString(pCfg, "Path", g_pszHdaFile); UPDATE_RC();
+ rc = CFGMR3InsertString(pCfg, "Type", "HardDisk"); UPDATE_RC();
if (g_fHdaSpf)
{
@@ -1541,13 +1559,23 @@
else
{
char *pcExt = RTPathExt(g_pszHdaFile);
- if ((pcExt) && (!strcmp(pcExt, ".vdi")))
+ if ((pcExt) && (!strcmp(pcExt, ".vdi") && !g_fOverlay))
{
rc = CFGMR3InsertString(pCfg, "Format", "VDI"); UPDATE_RC();
+ rc = CFGMR3InsertString(pCfg, "Path", g_pszHdaFile); UPDATE_RC();
}
else
{
- rc = CFGMR3InsertString(pCfg, "Format", "VMDK"); UPDATE_RC();
+ /*
+ * Use the overlay.vdi file to store differential changes.
+ * Leave the VMDK file passed as argument unchanged.
+ */
+ PCFGMNODE pParent = 0;
+ rc = CFGMR3InsertString(pCfg, "Format", "VDI"); UPDATE_RC();
+ rc = CFGMR3InsertString(pCfg, "Path", "/ram/overlay.vdi"); UPDATE_RC();
+ rc = CFGMR3InsertNode(pCfg, "Parent", &pParent); UPDATE_RC();
+ rc = CFGMR3InsertString(pParent, "Format", "VDI"); UPDATE_RC();
+ rc = CFGMR3InsertString(pParent, "Path", g_pszHdaFile); UPDATE_RC();
}
}
}

View File

@ -0,0 +1,145 @@
/*
* \brief VirtualBox hardware-acceleration manager
* \author Norman Feske
* \date 2013-08-20
*/
/*
* Copyright (C) 2013 Genode Labs GmbH
*
* This file is distributed under the terms of the GNU General Public License
* version 2.
*/
/* Genode includes */
#include <base/printf.h>
/* VirtualBox includes */
#include "HMInternal.h" /* enable access to hm.s.* */
#include <VBox/vmm/hm.h>
#include <VBox/vmm/vm.h>
/* Genode's VirtualBox includes */
#include "sup.h"
static bool enabled = true;
VMMR3DECL(int) HMR3Init(PVM pVM)
{
/*
* We always set the fHMEnabled flag. Otherwise, the EM won't
* consult us for taking scheduling decisions. The actual switch to
* HW accelerated mode is still dependent on the result of the
* HMR3CanExecuteGuest function.
*/
pVM->fHMEnabled = true;
for (VMCPUID i = 0; i < pVM->cCpus; i++)
pVM->aCpus[i].hm.s.fActive = false;
pVM->fHMEnabledFixed = true;
return VINF_SUCCESS;
}
VMMR3_INT_DECL(int) HMR3Term(PVM pVM)
{
return VINF_SUCCESS;
}
VMMR3_INT_DECL(int) HMR3InitCompleted(PVM pVM, VMINITCOMPLETED enmWhat)
{
enabled = pVM->hm.s.svm.fSupported || pVM->hm.s.vmx.fSupported;
if (!enabled || enmWhat != VMINITCOMPLETED_RING0)
return VINF_SUCCESS;
int rc = SUPR3CallVMMR0Ex(pVM->pVMR0, 0 /*idCpu*/, VMMR0_DO_HM_SETUP_VM, 0, NULL);
if (rc == VINF_SUCCESS) {
CPUMSetGuestCpuIdFeature(pVM, CPUMCPUIDFEATURE_SEP);
}
return rc;
}
VMMDECL(bool) HMIsEnabledNotMacro(PVM pVM)
{
Assert(pVM->fHMEnabledFixed);
return pVM->fHMEnabled;
}
VMMR3DECL(bool) HMR3IsVmxPreemptionTimerUsed(PVM pVM)
{
// PLOG("HMR3IsVmxPreemptionTimerUsed");
return false;
}
VMMR3DECL(bool) HMR3IsActive(PVMCPU pVCpu)
{
return pVCpu->hm.s.fActive;
}
VMM_INT_DECL(bool) HMIsLongModeAllowed(PVM pVM)
{
return HMIsEnabled(pVM) && pVM->hm.s.fAllow64BitGuests;
}
VMMR3DECL(bool) HMR3IsRescheduleRequired(PVM pVM, PCPUMCTX pCtx)
{
/* no re-schedule on AMD-V required - just works */
/*
if (pVM->hm.s.svm.fSupported)
return false;
*/
bool reschedule = !CPUMIsGuestInPagedProtectedModeEx(pCtx);
// PLOG("reschedule %u %u %lx", reschedule, HMR3CanExecuteGuest(pVM, pCtx), pCtx->cr0);
return reschedule;
}
VMMR3DECL(bool) HMR3IsEventPending(PVMCPU pVCpu)
{
// PLOG("HMR3IsEventPending false");
return false;
}
VMMR3DECL(bool) HMR3CanExecuteGuest(PVM pVM, PCPUMCTX pCtx)
{
PVMCPU pVCpu = VMMGetCpu(pVM);
/* AMD-V just works */
/*
if (pVM->hm.s.svm.fSupported) {
pVCpu->hm.s.fActive = true;
return true;
}
*/
if (!enabled)
return false;
/* enable H/W acceleration in protected mode only */
bool res = (pCtx->cr0 & 1) && (pCtx->cr0 & 0x80000000);
/*
static bool on = false;
if (res)
on = true;
if (on)
PLOG("executeguest %lx -> %x", pCtx->cr0, res);
*/
pVCpu->hm.s.fActive = res;
return res;
}

View File

@ -1,16 +0,0 @@
+++ src/app/virtualbox/src/VBox/Frontends/VBoxBFE/VBoxBFE.cpp
@@ -1273,6 +1279,14 @@
rc = CFGMR3InsertInteger(pRoot, "CSAMEnabled", 1); UPDATE_RC();
#endif
+ /* enable HW virtualization support */
+
+ PCFGMNODE pHWVirtExt = NULL;
+
+ rc = CFGMR3InsertNode(pRoot, "HWVirtExt", &pHWVirtExt); UPDATE_RC();
+ rc = CFGMR3InsertInteger(pHWVirtExt, "Enabled", 1); UPDATE_RC();
+ rc = CFGMR3InsertInteger(pHWVirtExt, "64bitEnabled", 0); UPDATE_RC();
+
/*
* PDM.
*/

View File

@ -1,134 +0,0 @@
/*
* \brief VirtualBox hardware-acceleration manager
* \author Norman Feske
* \date 2013-08-20
*/
/*
* Copyright (C) 2013 Genode Labs GmbH
*
* This file is distributed under the terms of the GNU General Public License
* version 2.
*/
/* Genode includes */
#include <base/printf.h>
/* VirtualBox includes */
#include "HWACCMInternal.h" /* enable access to hwaccm.s.* */
#include <VBox/vmm/hwaccm.h>
#include <VBox/vmm/vm.h>
/* Genode's VirtualBox includes */
#include "sup.h"
static bool enabled = true;
VMMR3DECL(int) HWACCMR3Init(PVM pVM)
{
/*
* We always set the fHWACCMEnabled flag. Otherwise, the EM won't
* consult us for taking scheduling decisions. The actual switch to
* HW accelerated mode is still dependent on the result of the
* HWACCMR3CanExecuteGuest function.
*/
pVM->fHWACCMEnabled = true;
for (VMCPUID i = 0; i < pVM->cCpus; i++)
pVM->aCpus[i].hwaccm.s.fActive = false;
return VINF_SUCCESS;
}
VMMR3_INT_DECL(int) HWACCMR3InitCompleted(PVM pVM, VMINITCOMPLETED enmWhat)
{
enabled = pVM->hwaccm.s.svm.fSupported || pVM->hwaccm.s.vmx.fSupported;
if (!enabled || enmWhat != VMINITCOMPLETED_RING0)
return VINF_SUCCESS;
int rc = SUPR3CallVMMR0Ex(pVM->pVMR0, 0 /*idCpu*/, VMMR0_DO_HWACC_SETUP_VM, 0, NULL);
if (rc == VINF_SUCCESS) {
CPUMSetGuestCpuIdFeature(pVM, CPUMCPUIDFEATURE_SEP);
}
return rc;
}
VMMR3DECL(bool) HWACCMR3IsVmxPreemptionTimerUsed(PVM pVM)
{
PLOG("HWACCMR3IsVmxPreemptionTimerUsed");
return false;
}
VMMR3DECL(bool) HWACCMR3IsActive(PVMCPU pVCpu)
{
return pVCpu->hwaccm.s.fActive;
}
VMMR3DECL(bool) HWACCMR3IsRescheduleRequired(PVM pVM, PCPUMCTX pCtx)
{
/* no re-schedule on AMD-V required - just works */
/*
if (pVM->hwaccm.s.svm.fSupported)
return false;
*/
bool reschedule = !CPUMIsGuestInPagedProtectedModeEx(pCtx);
// PLOG("reschedule %u %u %lx", reschedule, HWACCMR3CanExecuteGuest(pVM, pCtx), pCtx->cr0);
return reschedule;
}
void HWACCMR3PagingModeChanged(PVM pVM, PVMCPU pVCpu, PGMMODE enmShadowMode,
PGMMODE enmGuestMode)
{
// PLOG("HWACCMR3PagingModeChanged: enmShadowMode=%d enmGuestMode=%d",
// enmShadowMode, enmGuestMode);
}
VMMR3DECL(bool) HWACCMR3IsEventPending(PVMCPU pVCpu)
{
// PLOG("HWACCMR3IsEventPending false");
return false;
}
VMMR3DECL(bool) HWACCMR3CanExecuteGuest(PVM pVM, PCPUMCTX pCtx)
{
PVMCPU pVCpu = VMMGetCpu(pVM);
/* AMD-V just works */
/*
if (pVM->hwaccm.s.svm.fSupported) {
pVCpu->hwaccm.s.fActive = true;
return true;
}
*/
if (!enabled)
return false;
/* enable H/W acceleration in protected mode only */
bool res = (pCtx->cr0 & 1) && (pCtx->cr0 & 0x80000000);
/*
static bool on = false;
if (res)
on = true;
if (on)
PLOG("executeguest %lx -> %x", pCtx->cr0, res);
*/
pVCpu->hwaccm.s.fActive = res;
return res;
}

View File

@ -1,17 +0,0 @@
+++ src/app/virtualbox/src/VBox/Runtime/r3/posix/utf8-posix.cpp
@@ -319,11 +319,11 @@
size_t cbOutLeft = cbOutput2;
const void *pvInputLeft = pvInput;
void *pvOutputLeft = pvOutput;
-#if defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) || (defined(RT_OS_DARWIN) && defined(_DARWIN_FEATURE_UNIX_CONFORMANCE)) /* there are different opinions about the constness of the input buffer. */
+//#if defined(RT_OS_LINUX) || defined(RT_OS_SOLARIS) || (defined(RT_OS_DARWIN) && defined(_DARWIN_FEATURE_UNIX_CONFORMANCE)) /* there are different opinions about the constness of the input buffer. */
if (iconv(icHandle, (char **)&pvInputLeft, &cbInLeft, (char **)&pvOutputLeft, &cbOutLeft) != (size_t)-1)
-#else
- if (iconv(icHandle, (const char **)&pvInputLeft, &cbInLeft, (char **)&pvOutputLeft, &cbOutLeft) != (size_t)-1)
-#endif
+//#else
+// if (iconv(icHandle, (const char **)&pvInputLeft, &cbInLeft, (char **)&pvOutputLeft, &cbOutLeft) != (size_t)-1)
+//#endif
{
if (!cbInLeft)
{

View File

@ -1,110 +0,0 @@
/*
* \brief Framebuffer implementation of VirtualBox for Genode
* \author Alexander Boettcher
* \date 2013-10-16
*/
/*
* Copyright (C) 2013 Genode Labs GmbH
*
* This file is distributed under the terms of the GNU General Public License
* version 2.
*/
/* Genode includes */
#define Framebuffer FramebufferGenode
#include <framebuffer_session/connection.h>
#undef Framebuffer
/* VirtualBox includes */
#include "Framebuffer.h"
#include <base/printf.h>
class SDLFramebuffer : public Framebuffer
{
private:
FramebufferGenode::Connection _fb;
FramebufferGenode::Mode const _fb_mode;
void * _fb_base;
RTCRITSECT mUpdateLock;
public:
SDLFramebuffer ()
:
_fb_mode(_fb.mode()),
_fb_base(Genode::env()->rm_session()->attach(_fb.dataspace()))
{
int rc = RTCritSectInit(&mUpdateLock);
if (rc != VINF_SUCCESS)
PERR("Lock could not be initalized");
}
HRESULT getWidth(ULONG * width)
{
*width = _fb_mode.width();
return S_OK;
}
HRESULT getHeight(ULONG * height)
{
*height = _fb_mode.height();
return S_OK;
}
HRESULT Lock() { return RTCritSectEnter(&mUpdateLock); }
HRESULT Unlock() { return RTCritSectLeave(&mUpdateLock); }
HRESULT getAddress(uintptr_t * addr)
{
*addr = reinterpret_cast<uintptr_t>(_fb_base);
return S_OK;
}
HRESULT getBitsPerPixel(ULONG * bits)
{
*bits = _fb_mode.bytes_per_pixel() * 8;
return S_OK;
}
HRESULT getLineSize(ULONG * line)
{
*line = _fb_mode.width() * _fb_mode.bytes_per_pixel();
return S_OK;
}
HRESULT NotifyUpdate(ULONG x, ULONG y, ULONG w, ULONG h)
{
_fb.refresh(x, y, w, h);
return S_OK;
}
HRESULT RequestResize(ULONG x, ULONG y, BOOL * finished)
{
PERR("ignore resize request to %lux%lu", x, y);
Genode::size_t const num_pixels = _fb_mode.width()*_fb_mode.height();
Genode::memset(_fb_base, 0, num_pixels*_fb_mode.bytes_per_pixel());
_fb.refresh(0, 0, _fb_mode.width(), _fb_mode.height());
*finished = true;
return S_OK;
}
HRESULT GetVisibleRegion(BYTE *, ULONG, ULONG *) { PERR("%s:%s called", __FILE__, __FUNCTION__); return E_NOTIMPL; }
HRESULT SetVisibleRegion(BYTE *, ULONG) { PERR("%s:%s called", __FILE__, __FUNCTION__); return E_NOTIMPL; }
HRESULT ProcessVHWACommand(BYTE *) { PERR("%s:%s called", __FILE__, __FUNCTION__); return E_NOTIMPL; }
void repaint() { PERR("%s:%s called", __FILE__, __FUNCTION__); }
void resize() { PERR("%s:%s called", __FILE__, __FUNCTION__); }
void update(int, int, int, int) { PERR("%s:%s called", __FILE__, __FUNCTION__); }
bool getFullscreen() { PERR("%s:%s called", __FILE__, __FUNCTION__); }
void setFullscreen(bool) { PERR("%s:%s called", __FILE__, __FUNCTION__); }
int getYOffset() { PERR("%s:%s called", __FILE__, __FUNCTION__); }
int getHostXres() { PERR("%s:%s called", __FILE__, __FUNCTION__); }
int getHostYres() { PERR("%s:%s called", __FILE__, __FUNCTION__); }
int getHostBitsPerPixel() { PERR("%s:%s called", __FILE__, __FUNCTION__); }
};

View File

@ -0,0 +1,7 @@
#ifndef ___VBox_com_VirtualBox_h
#define ___VBox_com_VirtualBox_h
#include <VBox/com/defs.h>
#endif

View File

@ -0,0 +1,15 @@
#ifndef ___VBox_com_com_h
#define ___VBox_com_com_h
#define COMGETTER(n) get_##n
#define COMSETTER(n) set_##n
#include <VBox/com/defs.h>
namespace com {
int GetVBoxUserHomeDirectory(char *aDir, size_t aDirLen, bool fCreateDir = true);
HRESULT Initialize(bool fGui = false);
HRESULT Shutdown();
}
#endif /* ___VBox_com_com_h */

View File

@ -0,0 +1,631 @@
#ifndef ___VBox_com_defs_h
#define ___VBox_com_defs_h
#include <iprt/types.h>
typedef short unsigned int * BSTR;
typedef BSTR IN_BSTR;
typedef const short unsigned int * CBSTR;
typedef short unsigned int OLECHAR;
typedef unsigned int PRUint32;
typedef OLECHAR PRUnichar;
typedef bool BOOL;
typedef unsigned char BYTE;
#define FALSE false
#define TRUE true
#define SUCCEEDED(X) ((X) == VINF_SUCCESS)
#define FAILED(X) ((X) != VINF_SUCCESS)
#define ComSafeArrayInArg(aArg) aArg##Size, aArg
#define ComSafeArrayOutArg(aArg) aArg##Size, aArg
#define ComSafeArrayOut(aType, aArg) PRUint32 *aArg##Size, aType **aArg
#define ComSafeArrayIn(aType, aArg) unsigned aArg##Size, aType *aArg
#define ComSafeGUIDArrayIn(aArg) PRUint32 aArg##Size, const nsID **aArg
#define ComSafeGUIDArrayInArg(aArg) ComSafeArrayInArg(aArg)
#define ComSafeArrayOutIsNull(aArg) ((aArg) == NULL)
#define ComSafeArrayInIsNull(aArg) ((aArg) == NULL)
#define COM_STRUCT_OR_CLASS(I) class I
#define FAILED_DEAD_INTERFACE(rc) ( (rc) != VINF_SUCCESS )
enum HRESULT {
S_OK,
E_ACCESSDENIED,
E_OUTOFMEMORY,
E_INVALIDARG,
E_FAIL,
E_POINTER,
E_NOTIMPL,
E_UNEXPECTED,
E_NOINTERFACE,
E_ABORT,
VBOX_E_VM_ERROR,
VBOX_E_INVALID_VM_STATE,
VBOX_E_INVALID_OBJECT_STATE,
VBOX_E_INVALID_SESSION_STATE,
VBOX_E_OBJECT_NOT_FOUND,
VBOX_E_FILE_ERROR,
VBOX_E_OBJECT_IN_USE,
VBOX_E_NOT_SUPPORTED,
VBOX_E_IPRT_ERROR,
VBOX_E_PDM_ERROR,
VBOX_E_HOST_ERROR,
VBOX_E_XML_ERROR,
};
typedef struct { char x [sizeof(RTUUID)]; } GUID;
inline GUID& stuffstuff() {
static GUID stuff;
return stuff;
}
#define COM_IIDOF(X) stuffstuff()
#define getStaticClassIID() stuffstuff()
#define IN_GUID GUID
#define OUT_GUID GUID *
extern "C"
{
BSTR SysAllocString(const OLECHAR* sz);
BSTR SysAllocStringByteLen(char *psz, unsigned int len);
BSTR SysAllocStringLen(const OLECHAR *pch, unsigned int cch);
void SysFreeString(BSTR bstr);
unsigned int SysStringByteLen(BSTR bstr);
unsigned int SysStringLen(BSTR bstr);
}
typedef signed int LONG;
typedef unsigned int ULONG;
typedef unsigned short USHORT;
typedef short SHORT;
typedef signed long long LONG64;
typedef unsigned long long ULONG64;
/* capiidl.xsl */
typedef enum VARTYPE
{
VT_I2 = 2,
VT_I4 = 3,
VT_BSTR = 8,
VT_DISPATCH = 9,
VT_BOOL = 11,
VT_UNKNOWN = 13,
VT_I1 = 16,
VT_UI1 = 17,
VT_UI2 = 18,
VT_UI4 = 19,
VT_I8 = 20,
VT_UI8 = 21,
VT_HRESULT = 25
} VARTYPE;
typedef struct SAFEARRAY
{
void *pv;
ULONG c;
} SAFEARRAY;
enum AccessMode_T
{
AccessMode_ReadOnly,
AccessMode_ReadWrite,
};
enum AdditionsFacilityClass_T
{
AdditionsFacilityClass_None,
AdditionsFacilityClass_Driver,
AdditionsFacilityClass_Feature,
AdditionsFacilityClass_Program,
AdditionsFacilityClass_Service,
};
enum AdditionsFacilityStatus_T
{
AdditionsFacilityStatus_Unknown,
AdditionsFacilityStatus_Active,
};
enum AdditionsFacilityType_T
{
AdditionsFacilityType_None,
AdditionsFacilityType_AutoLogon,
AdditionsFacilityType_Graphics,
AdditionsFacilityType_Seamless,
AdditionsFacilityType_VBoxService,
AdditionsFacilityType_VBoxGuestDriver,
AdditionsFacilityType_VBoxTrayClient,
};
enum CopyFileFlag_T { };
enum DeviceActivity_T { };
enum FsObjType_T { };
enum FileStatus_T { };
enum FileSeekType_T { };
enum DragAndDropAction_T { };
enum GuestSessionStatus_T { };
enum GuestSessionWaitForFlag_T { };
enum GuestSessionWaitResult_T { };
enum DirectoryCreateFlag_T { };
enum DirectoryOpenFlag_T { };
enum DirectoryRemoveRecFlag_T { };
enum PathRenameFlag_T { };
enum SymlinkType_T { };
enum SymlinkReadFlag_T { };
enum AdditionsUpdateFlag_T { };
enum AdditionsRunLevelType_T
{
AdditionsRunLevelType_None,
AdditionsRunLevelType_System,
AdditionsRunLevelType_Desktop,
AdditionsRunLevelType_Userland,
};
enum GuestUserState_T {
};
enum MouseButtonState
{
MouseButtonState_LeftButton = 0x01,
MouseButtonState_RightButton = 0x02,
MouseButtonState_MiddleButton = 0x04,
MouseButtonState_WheelUp = 0x08,
MouseButtonState_WheelDown = 0x10,
MouseButtonState_XButton1 = 0x20,
MouseButtonState_XButton2 = 0x40,
MouseButtonState_MouseStateMask = 0x7F
};
enum GuestMouseEventMode_T
{
GuestMouseEventMode_Absolute,
GuestMouseEventMode_Relative,
};
enum GUEST_FILE_SEEKTYPE { };
enum ProcessPriority_T
{
ProcessPriority_Default,
};
enum FramebufferPixelFormat
{
FramebufferPixelFormat_Opaque = 0,
FramebufferPixelFormat_FOURCC_RGB = 0x32424752,
};
enum GuestMonitorChangedEventType
{
GuestMonitorChangedEventType_Enabled,
GuestMonitorChangedEventType_Disabled,
GuestMonitorChangedEventType_NewOrigin,
};
enum VBoxEventType_T
{
VBoxEventType_Invalid = 0,
VBoxEventType_Any = 1,
VBoxEventType_Vetoable = 2,
VBoxEventType_MachineEvent = 3,
VBoxEventType_SnapshotEvent = 4,
VBoxEventType_InputEvent = 5,
VBoxEventType_LastWildcard = 31,
VBoxEventType_OnMachineStateChanged = 32,
VBoxEventType_OnMachineDataChanged = 33,
VBoxEventType_OnExtraDataChanged = 34,
VBoxEventType_OnExtraDataCanChange = 35,
VBoxEventType_OnMediumRegistered = 36,
VBoxEventType_OnMachineRegistered = 37,
VBoxEventType_OnSessionStateChanged = 38,
VBoxEventType_OnSnapshotTaken = 39,
VBoxEventType_OnSnapshotDeleted = 40,
VBoxEventType_OnSnapshotChanged = 41,
VBoxEventType_OnGuestPropertyChanged = 42,
VBoxEventType_OnMousePointerShapeChanged = 43,
VBoxEventType_OnMouseCapabilityChanged = 44,
VBoxEventType_OnKeyboardLedsChanged = 45,
VBoxEventType_OnStateChanged = 46,
VBoxEventType_OnAdditionsStateChanged = 47,
VBoxEventType_OnNetworkAdapterChanged = 48,
VBoxEventType_OnSerialPortChanged = 49,
VBoxEventType_OnParallelPortChanged = 50,
VBoxEventType_OnStorageControllerChanged = 51,
VBoxEventType_OnMediumChanged = 52,
VBoxEventType_OnVRDEServerChanged = 53,
VBoxEventType_OnUSBControllerChanged = 54,
VBoxEventType_OnUSBDeviceStateChanged = 55,
VBoxEventType_OnSharedFolderChanged = 56,
VBoxEventType_OnRuntimeError = 57,
VBoxEventType_OnCanShowWindow = 58,
VBoxEventType_OnShowWindow = 59,
VBoxEventType_OnCPUChanged = 60,
VBoxEventType_OnVRDEServerInfoChanged = 61,
VBoxEventType_OnEventSourceChanged = 62,
VBoxEventType_OnCPUExecutionCapChanged = 63,
VBoxEventType_OnGuestKeyboard = 64,
VBoxEventType_OnGuestMouse = 65,
VBoxEventType_OnNATRedirect = 66,
VBoxEventType_OnHostPCIDevicePlug = 67,
VBoxEventType_OnVBoxSVCAvailabilityChanged = 68,
VBoxEventType_OnBandwidthGroupChanged = 69,
VBoxEventType_OnGuestMonitorChanged = 70,
VBoxEventType_OnStorageDeviceChanged = 71,
VBoxEventType_OnClipboardModeChanged = 72,
VBoxEventType_OnDragAndDropModeChanged = 73,
VBoxEventType_OnGuestMultiTouch = 74,
VBoxEventType_Last = 75
};
enum ProcessStatus_T { };
enum ProcessInputStatus_T { };
enum ProcessInputFlag_T { };
enum ProcessWaitResult_T { };
enum ProcessWaitForFlag_T { };
enum ProcessCreateFlag_T
{
ProcessCreateFlag_None,
};
enum SessionType_T
{
SessionType_Null,
SessionType_WriteLock,
SessionType_Remote,
SessionType_Shared,
};
enum MachineState_T {
MachineState_Null,
MachineState_Aborted,
MachineState_Running,
MachineState_Paused,
MachineState_Teleporting,
MachineState_LiveSnapshotting,
MachineState_Stuck,
MachineState_Starting,
MachineState_Stopping,
MachineState_Saving,
MachineState_Restoring,
MachineState_TeleportingPausedVM,
MachineState_TeleportingIn,
MachineState_RestoringSnapshot,
MachineState_DeletingSnapshot,
MachineState_SettingUp,
MachineState_FaultTolerantSyncing,
MachineState_PoweredOff,
MachineState_Teleported,
MachineState_Saved,
MachineState_DeletingSnapshotOnline,
MachineState_DeletingSnapshotPaused,
};
enum CleanupMode_T {
CleanupMode_UnregisterOnly,
CleanupMode_DetachAllReturnHardDisksOnly,
CleanupMode_Full,
};
enum CloneMode_T {
CloneMode_MachineState,
CloneMode_AllStates,
CloneMode_MachineAndChildStates,
};
enum CloneOptions_T {
CloneOptions_Link,
CloneOptions_KeepAllMACs,
CloneOptions_KeepNATMACs,
CloneOptions_KeepDiskNames,
};
enum LockType_T {
LockType_Shared,
LockType_Write,
LockType_VM,
};
enum SessionState_T {
SessionState_Null,
SessionState_Locked,
SessionState_Spawning,
SessionState_Unlocking,
SessionState_Unlocked,
};
enum Reason_T
{
Reason_Unspecified,
Reason_HostSuspend,
Reason_HostResume,
Reason_HostBatteryLow,
};
enum MediumFormatCapabilities_T
{
MediumFormatCapabilities_Uuid = 0x01,
MediumFormatCapabilities_CreateFixed = 0x02,
MediumFormatCapabilities_CreateDynamic = 0x04,
MediumFormatCapabilities_Differencing = 0x10,
MediumFormatCapabilities_File = 0x40
};
enum DataType_T {
DataType_Int32,
DataType_Int8,
DataType_String,
};
enum DataFlags_T {
DataFlags_Array,
};
enum MediumVariant_T {
MediumVariant_Standard,
MediumVariant_Fixed,
MediumVariant_Diff,
MediumVariant_VmdkStreamOptimized,
MediumVariant_NoCreateDir,
};
enum HostNetworkInterfaceType_T { };
enum NATAliasMode_T
{
NATAliasMode_AliasLog = 0x1,
NATAliasMode_AliasProxyOnly = 0x02,
NATAliasMode_AliasUseSamePorts = 0x04,
};
enum MediumState_T {
MediumState_NotCreated = 0,
MediumState_Created = 1,
MediumState_LockedRead = 2,
MediumState_LockedWrite = 3,
MediumState_Inaccessible = 4,
MediumState_Creating = 5,
MediumState_Deleting = 6
};
enum AuthType_T {
AuthType_Null,
AuthType_Guest,
AuthType_External,
};
enum BIOSBootMenuMode_T {
BIOSBootMenuMode_MessageAndMenu,
BIOSBootMenuMode_Disabled,
BIOSBootMenuMode_MenuOnly,
};
enum USBControllerType_T {
USBControllerType_Null,
USBControllerType_OHCI,
USBControllerType_EHCI,
USBControllerType_Last,
};
enum USBDeviceFilterAction_T {
USBDeviceFilterAction_Null,
USBDeviceFilterAction_Ignore,
USBDeviceFilterAction_Hold,
};
enum DeviceType_T {
DeviceType_Null,
DeviceType_HardDisk,
DeviceType_DVD,
DeviceType_Floppy,
DeviceType_Network,
DeviceType_USB,
DeviceType_SharedFolder,
};
enum MediumType_T {
MediumType_Normal,
MediumType_Immutable,
MediumType_Writethrough,
MediumType_Shareable,
MediumType_Readonly,
MediumType_MultiAttach,
};
enum NATProtocol_T {
NATProtocol_TCP,
NATProtocol_UDP,
};
enum NetworkAdapterType_T {
NetworkAdapterType_Am79C970A,
NetworkAdapterType_Am79C973,
NetworkAdapterType_I82540EM,
NetworkAdapterType_I82543GC,
NetworkAdapterType_I82545EM,
NetworkAdapterType_Virtio,
};
enum ProcessorFeature_T
{
ProcessorFeature_HWVirtEx,
ProcessorFeature_LongMode,
ProcessorFeature_NestedPaging,
ProcessorFeature_PAE,
};
enum CPUPropertyType_T
{
CPUPropertyType_Null,
CPUPropertyType_PAE,
CPUPropertyType_Synthetic,
CPUPropertyType_LongMode,
CPUPropertyType_TripleFaultReset,
};
/* End of enum CPUPropertyType Declaration */
enum AudioDriverType_T {
AudioDriverType_Null,
AudioDriverType_WinMM,
AudioDriverType_DirectSound,
AudioDriverType_SolAudio,
AudioDriverType_ALSA,
AudioDriverType_Pulse,
AudioDriverType_OSS,
AudioDriverType_CoreAudio,
AudioDriverType_MMPM,
};
enum PortMode_T {
PortMode_Disconnected,
PortMode_HostPipe,
PortMode_HostDevice,
PortMode_RawFile,
};
enum BandwidthGroupType_T {
BandwidthGroupType_Null,
BandwidthGroupType_Disk,
BandwidthGroupType_Network,
};
enum ClipboardMode_T {
ClipboardMode_Disabled,
ClipboardMode_HostToGuest,
ClipboardMode_GuestToHost,
ClipboardMode_Bidirectional,
};
enum FaultToleranceState_T {
FaultToleranceState_Inactive,
FaultToleranceState_Master,
FaultToleranceState_Standby,
};
enum AudioControllerType_T {
AudioControllerType_AC97,
AudioControllerType_HDA,
AudioControllerType_SB16,
};
enum NetworkAttachmentType_T {
NetworkAttachmentType_Null,
NetworkAttachmentType_NAT,
NetworkAttachmentType_Bridged,
NetworkAttachmentType_Internal,
NetworkAttachmentType_HostOnly,
NetworkAttachmentType_Generic,
NetworkAttachmentType_NATNetwork,
};
enum NetworkAdapterPromiscModePolicy_T {
NetworkAdapterPromiscModePolicy_Deny,
NetworkAdapterPromiscModePolicy_AllowNetwork,
NetworkAdapterPromiscModePolicy_AllowAll,
};
enum StorageBus_T {
StorageBus_Null,
StorageBus_IDE,
StorageBus_SATA,
StorageBus_SAS,
StorageBus_SCSI,
StorageBus_Floppy,
};
enum FirmwareType_T {
FirmwareType_BIOS,
FirmwareType_EFI,
FirmwareType_EFI32,
FirmwareType_EFI64,
FirmwareType_EFIDUAL,
};
enum GraphicsControllerType_T {
GraphicsControllerType_Null,
GraphicsControllerType_VBoxVGA,
GraphicsControllerType_VMSVGA,
};
enum AutostopType_T {
AutostopType_Disabled,
AutostopType_SaveState,
AutostopType_PowerOff,
AutostopType_AcpiShutdown,
};
enum DragAndDropMode_T {
DragAndDropMode_Disabled,
DragAndDropMode_HostToGuest,
DragAndDropMode_GuestToHost,
DragAndDropMode_Bidirectional,
};
enum StorageControllerType_T {
StorageControllerType_PIIX3,
StorageControllerType_IntelAhci,
StorageControllerType_LsiLogic,
StorageControllerType_BusLogic,
StorageControllerType_PIIX4,
StorageControllerType_ICH6,
StorageControllerType_I82078,
StorageControllerType_LsiLogicSas,
};
enum KeyboardHIDType_T {
KeyboardHIDType_None,
KeyboardHIDType_PS2Keyboard,
KeyboardHIDType_USBKeyboard,
KeyboardHIDType_ComboKeyboard,
};
enum PointingHIDType_T {
PointingHIDType_None,
PointingHIDType_PS2Mouse,
PointingHIDType_USBMouse,
PointingHIDType_USBTablet,
PointingHIDType_ComboMouse,
PointingHIDType_USBMultiTouch,
};
enum ChipsetType_T {
ChipsetType_Null,
ChipsetType_ICH9,
ChipsetType_PIIX3,
};
enum DhcpOpt_T {
DhcpOpt_SubnetMask,
DhcpOpt_Router,
};
enum SettingsVersion_T {
SettingsVersion_Null,
SettingsVersion_v1_3,
SettingsVersion_v1_4,
SettingsVersion_v1_5,
SettingsVersion_v1_6,
SettingsVersion_v1_7,
SettingsVersion_v1_8,
SettingsVersion_v1_9,
SettingsVersion_v1_10,
SettingsVersion_v1_11,
SettingsVersion_v1_12,
SettingsVersion_v1_13,
SettingsVersion_v1_14,
SettingsVersion_Future,
};
enum HWVirtExPropertyType_T
{
HWVirtExPropertyType_Enabled,
HWVirtExPropertyType_Force,
HWVirtExPropertyType_NestedPaging,
HWVirtExPropertyType_LargePages,
HWVirtExPropertyType_VPID,
HWVirtExPropertyType_UnrestrictedExecution,
};
#endif /* !___VBox_com_defs_h */

View File

@ -0,0 +1,66 @@
#ifndef ___VBox_com_ptr_h
#define ___VBox_com_ptr_h
#include <VBox/com/defs.h>
template <typename T>
class ComPtr {
protected:
T * _obj;
public:
ComPtr<T> () : _obj(nullptr) { }
/* copy constructor */
ComPtr<T> (T *obj) : _obj(obj) { }
template<typename X>
ComPtr<T> (X *obj) : _obj(nullptr) { }
template <class T2>
ComPtr(const ComPtr<T2> &that) : _obj(nullptr) { }
/* operators */
T * operator->() const { return _obj; }
operator T*() const { return _obj; }
bool isNull () const { return _obj == nullptr; }
T ** asOutParam() { return &_obj; }
template <class T2>
HRESULT queryInterfaceTo(T2 **pp) const {
if (pp == nullptr)
return E_INVALIDARG;
*pp = _obj;
return S_OK;
}
void setNull() { _obj = nullptr; }
};
template <class T>
class ComObjPtr : public ComPtr<T> {
public:
ComObjPtr<T> () : ComPtr<T>() { }
/* copy constructor */
ComObjPtr<T> (T *obj) : ComPtr<T>(obj) { }
HRESULT createObject()
{
T * obj = new T();
if (!obj)
return E_OUTOFMEMORY;
ComPtr<T>::_obj = obj;
return obj->FinalConstruct();
}
};
#endif /* ___VBox_com_ptr_h */

View File

@ -1,4 +0,0 @@
/*
* \brief Dummy stubs needed by 'src/VBox/Frontends/VBoxBFE/VirtualBoxBase.h'
* \author Alexander Boettcher
*/

View File

@ -1,4 +0,0 @@
/*
* \brief Dummy stubs needed by 'src/VBox/Frontends/VBoxBFE/VirtualBoxBase.h'
* \author Alexander Boettcher
*/

View File

@ -15,12 +15,55 @@
#include <base/printf.h>
/* VirtualBox includes */
#include "IOMInternal.h"
#include <VBox/vmm/vm.h>
#include <VBox/vmm/iom.h>
#include <VBox/vmm/rem.h>
/* local includes */
#include "guest_memory.h"
static const bool verbose = false;
VMMR3_INT_DECL(int) IOMR3Init(PVM pVM)
{
/*
* Assert alignment and sizes.
*/
AssertCompileMemberAlignment(VM, iom.s, 32);
AssertCompile(sizeof(pVM->iom.s) <= sizeof(pVM->iom.padding));
AssertCompileMemberAlignment(IOM, CritSect, sizeof(uintptr_t));
/*
* Initialize the REM critical section.
*/
#ifdef IOM_WITH_CRIT_SECT_RW
int rc = PDMR3CritSectRwInit(pVM, &pVM->iom.s.CritSect, RT_SRC_POS, "IOM Lock");
#else
int rc = PDMR3CritSectInit(pVM, &pVM->iom.s.CritSect, RT_SRC_POS, "IOM Lock");
#endif
AssertRCReturn(rc, rc);
return VINF_SUCCESS;
}
int IOMR3Term(PVM)
{
if (verbose)
PDBG("called");
return VINF_SUCCESS;
}
VMMDECL(bool) IOMIsLockWriteOwner(PVM pVM)
{
#ifdef IOM_WITH_CRIT_SECT_RW
return PDMCritSectRwIsInitialized(&pVM->iom.s.CritSect)
&& PDMCritSectRwIsWriteOwner(&pVM->iom.s.CritSect);
#else
return PDMCritSectIsOwner(&pVM->iom.s.CritSect);
#endif
}
int IOMR3MmioRegisterR3(PVM pVM, PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart,
uint32_t cbRange, RTHCPTR pvUser,
@ -29,10 +72,11 @@ int IOMR3MmioRegisterR3(PVM pVM, PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart,
R3PTRTYPE(PFNIOMMMIOFILL) pfnFillCallback,
uint32_t fFlags, const char *pszDesc)
{
PLOG("%s: GCPhys=0x%lx cb=0x%x pszDesc=%s rd=%p wr=%p fl=%p",
__PRETTY_FUNCTION__,
(long)GCPhysStart, cbRange, pszDesc,
pfnWriteCallback, pfnReadCallback, pfnFillCallback);
if (verbose)
PLOG("%s: GCPhys=0x%llx cb=0x%x pszDesc=%s rd=%p wr=%p fl=%p flags=%x",
__PRETTY_FUNCTION__,
(Genode::uint64_t)GCPhysStart, cbRange, pszDesc,
pfnWriteCallback, pfnReadCallback, pfnFillCallback, fFlags);
REMR3NotifyHandlerPhysicalRegister(pVM, PGMPHYSHANDLERTYPE_MMIO,
GCPhysStart, cbRange, true);
@ -49,7 +93,9 @@ int IOMR3MmioRegisterR3(PVM pVM, PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart,
int IOMR3MmioDeregister(PVM pVM, PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart,
uint32_t cbRange)
{
PLOG("%s: GCPhys=0x%lx cb=0x%x", __PRETTY_FUNCTION__, GCPhysStart, cbRange);
if (verbose)
PLOG("%s: GCPhys=0x%llx cb=0x%x", __PRETTY_FUNCTION__,
(Genode::uint64_t)GCPhysStart, cbRange);
bool status = guest_memory()->remove_mmio_mapping(GCPhysStart, cbRange);
if (status)
@ -60,32 +106,75 @@ int IOMR3MmioDeregister(PVM pVM, PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart,
}
VBOXSTRICTRC IOMMMIOWrite(PVM pVM, RTGCPHYS GCPhys, uint32_t u32Value, size_t cbValue)
VMMDECL(VBOXSTRICTRC) IOMMMIOWrite(PVM pVM, PVMCPU, RTGCPHYS GCPhys,
uint32_t u32Value, size_t cbValue)
{
// PDBG("GCPhys=0x%x, u32Value=0x%x, cbValue=%zd", GCPhys, u32Value, cbValue);
VBOXSTRICTRC rc = IOM_LOCK_SHARED(pVM);
Assert(rc == VINF_SUCCESS);
return guest_memory()->mmio_write(pVM, GCPhys, u32Value, cbValue);
rc = guest_memory()->mmio_write(GCPhys, u32Value, cbValue);
/*
* Check whether access is unaligned or access width is less than device
* supports. See original IOMMIOWrite & iomMMIODoComplicatedWrite of VBox.
*/
Assert(rc != VERR_IOM_NOT_MMIO_RANGE_OWNER);
IOM_UNLOCK_SHARED(pVM);
return rc;
}
VBOXSTRICTRC IOMMMIORead(PVM pVM, RTGCPHYS GCPhys, uint32_t *pu32Value,
size_t cbValue)
VMMDECL(VBOXSTRICTRC) IOMMMIORead(PVM pVM, PVMCPU, RTGCPHYS GCPhys,
uint32_t *pvalue, size_t bytes)
{
// PDBG("GCPhys=0x%x, cbValue=%zd", GCPhys, cbValue);
VBOXSTRICTRC rc = IOM_LOCK_SHARED(pVM);
Assert(rc == VINF_SUCCESS);
return guest_memory()->mmio_read(pVM, GCPhys, pu32Value, cbValue);
rc = guest_memory()->mmio_read(GCPhys, pvalue, bytes);
/*
* Check whether access is unaligned or access width is less than device
* supports. See original IOMMIORead & iomMMIODoComplicatedRead of VBox.
*/
if (rc == VERR_IOM_NOT_MMIO_RANGE_OWNER) {
/* implement what we need to - extend by need */
Assert((GCPhys & 3U) == 0);
Assert(bytes == 1 || bytes == 2);
uint32_t value;
rc = guest_memory()->mmio_read(GCPhys, &value, sizeof(value));
Assert(rc == VINF_SUCCESS);
if (rc == VINF_SUCCESS) {
switch (bytes) {
case 1:
*(uint8_t *) pvalue = (uint8_t)value;
case 2:
*(uint16_t *)pvalue = (uint16_t)value;
}
}
}
IOM_UNLOCK_SHARED(pVM);
return rc;
}
int IOMMMIOMapMMIO2Page(PVM pVM, RTGCPHYS GCPhys, RTGCPHYS GCPhysRemapped,
uint64_t fPageFlags)
{
PDBG("called - %lx %lx", GCPhys, GCPhysRemapped);
if (verbose)
PDBG("called - %llx %llx", (Genode::uint64_t)GCPhys,
(Genode::uint64_t)GCPhysRemapped);
return VINF_SUCCESS;
}
int IOMMMIOResetRegion(PVM pVM, RTGCPHYS GCPhys)
{
PDBG("called - %lx", GCPhys);
if (verbose)
PDBG("called - %llx", (Genode::uint64_t)GCPhys);
return VINF_SUCCESS;
}

View File

@ -57,10 +57,12 @@ class Guest_ioports
&& (PortStart <= _PortStart + _cPorts - 1);
}
bool partof(RTIOPORT PortStart, RTUINT cPorts) const
bool partof(RTIOPORT port, RTUINT cPorts) const
{
return (PortStart <= _PortStart)
&& (PortStart + cPorts - 1 >= _PortStart + _cPorts - 1);
RTIOPORT last_port = port + cPorts - 1;
RTIOPORT _last_port = _PortStart + _cPorts - 1;
return ((port <= _PortStart) && (_PortStart <= last_port)) ||
((port <= _last_port) && (_last_port <= last_port));
}
Range(PPDMDEVINS pDevIns,
@ -87,7 +89,6 @@ class Guest_ioports
if (!_pfnOutCallback)
return VINF_IOM_R3_IOPORT_WRITE;
// PDBG("IOPORT write Port=0x%lx", (long)port);
VBOXSTRICTRC rc = PDMCritSectEnter(_pDevIns->CTX_SUFF(pCritSectRo),
VINF_IOM_R3_IOPORT_WRITE);
if (rc != VINF_SUCCESS)
@ -111,12 +112,13 @@ class Guest_ioports
return rc;
rc = _pfnInCallback(_pDevIns, _pvUser, port, pu32Value, cb);
if (rc != VINF_SUCCESS)
PDMCritSectLeave(_pDevIns->CTX_SUFF(pCritSectRo));
if (rc != VERR_IOM_IOPORT_UNUSED && rc != VINF_SUCCESS)
PDBG("IOPORT read port=0x%x failed - callback %p eip %p",
port, _pfnInCallback, __builtin_return_address(0));
PDMCritSectLeave(_pDevIns->CTX_SUFF(pCritSectRo));
return rc;
}
};
@ -135,6 +137,14 @@ class Guest_ioports
return 0;
}
void dump()
{
for (Range *r = _ranges.first(); r; r = r->next())
PINF("0x%x+0x%x - '%s'\n",
r->_PortStart, r->_cPorts,
r->_pDevIns && r->_pDevIns->pReg ? r->_pDevIns->pReg->szName : 0);
}
/*
* The whitelist is used to suppress log messages, which the VM tries
* to access I/O ports with no device model associated. TinyCore Linux
@ -146,19 +156,22 @@ class Guest_ioports
/* LPT3 */ if (port >= 0x0278 && port <= 0x027f) return true;
/* ECP */ if (port >= 0x0778 && port <= 0x077a) return true;
/* IDE1 */ if (port >= 0x0170 && port <= 0x017f) return true;
/* COM1 */ if (port >= 0x03f8 && port <= 0x03ff) return true;
/* COM2 */ if (port >= 0x02f8 && port <= 0x02ff) return true;
/* COM3 */ if (port >= 0x03e8 && port <= 0x03ef) return true;
/* COM4 */ if (port >= 0x02e8 && port <= 0x02ef) return true;
return false;
}
public:
int add_range(PPDMDEVINS pDevIns,
RTIOPORT PortStart, RTUINT cPorts, RTHCPTR pvUser,
R3PTRTYPE(PFNIOMIOPORTOUT) pfnOutCallback,
R3PTRTYPE(PFNIOMIOPORTIN) pfnInCallback,
R3PTRTYPE(PFNIOMIOPORTOUTSTRING) pfnOutStringCallback,
R3PTRTYPE(PFNIOMIOPORTINSTRING) pfnInStringCallback)
int add_range(PPDMDEVINS pDevIns,
RTIOPORT PortStart, RTUINT cPorts, RTHCPTR pvUser,
R3PTRTYPE(PFNIOMIOPORTOUT) pfnOutCallback,
R3PTRTYPE(PFNIOMIOPORTIN) pfnInCallback,
R3PTRTYPE(PFNIOMIOPORTOUTSTRING) pfnOutStringCallback,
R3PTRTYPE(PFNIOMIOPORTINSTRING) pfnInStringCallback)
{
/*
Range *r = _lookup(PortStart, cPorts);
if (r) {
PERR("io port inseration failure 0x%x+0x%x - '%s'",
@ -168,7 +181,11 @@ class Guest_ioports
Assert(!r);
return VERR_GENERAL_FAILURE;
}
*/
if (verbose)
PLOG("insert io port range 0x%x+0x%x - '%s'", PortStart, cPorts,
pDevIns && pDevIns->pReg ? pDevIns->pReg->szName : 0);
_ranges.insert(new (Genode::env()->heap())
Range(pDevIns, PortStart, cPorts, pvUser,
pfnOutCallback, pfnInCallback,
@ -190,11 +207,17 @@ class Guest_ioports
deleted = true;
PERR("delete %x+%x", r->_PortStart, r->_cPorts);
if (verbose)
PLOG("delete io port range 0x%x+0x%x out of 0x%x+0x%x - '%s'",
r->_PortStart, r->_cPorts, PortStart, cPorts,
r->_pDevIns &&
r->_pDevIns->pReg ? r->_pDevIns->pReg->szName : 0);
Range *s = r;
r = r->next();
_ranges.remove(s);
destroy(Genode::env()->heap(), s);
}
return deleted ? VINF_SUCCESS : VERR_GENERAL_FAILURE;
@ -210,22 +233,21 @@ class Guest_ioports
return VINF_SUCCESS;
char c = u32Value & 0xff;
PWRN("attempted to write to non-existing port 0x%lx+%u %c (%02x)",
PWRN("attempted to write to non-existing port 0x%x+%zu %c (%02x)",
port, cbValue, c >= 32 && c <= 176 ? c : '.', c);
return VINF_SUCCESS;
}
VBOXSTRICTRC read(RTIOPORT port, uint32_t *pu32Value, unsigned cbValue)
VBOXSTRICTRC read(RTIOPORT port, uint32_t *pu32Value, size_t cbValue)
{
Range *r = _lookup(port, cbValue);
if (r) {
VBOXSTRICTRC err = r->read(port, pu32Value, cbValue);
if (err != VERR_IOM_IOPORT_UNUSED)
return err;
}
} else
if (!_white_listed(port))
PWRN("attempted to read from non-existing port 0x%x+%u %p",
PWRN("attempted to read from non-existing port 0x%x+%zu %p",
port, cbValue, r);
switch (cbValue)
@ -240,7 +262,8 @@ class Guest_ioports
*reinterpret_cast<uint32_t *>(pu32Value) = 0xFFFFFFFFU;
break;
default:
PERR("Invalid I/O port (%x) access of size (%x)", port, cbValue);
PERR("Invalid I/O port (%x) access of size (%zx)",
port, cbValue);
return VERR_IOM_INVALID_IOPORT_SIZE;
}
return VINF_SUCCESS;
@ -289,16 +312,15 @@ int IOMR3IOPortDeregister(PVM pVM, PPDMDEVINS pDevIns, RTIOPORT PortStart,
}
VMMDECL(VBOXSTRICTRC) IOMIOPortWrite(PVM pVM, RTIOPORT Port, uint32_t u32Value,
size_t cbValue)
VMMDECL(VBOXSTRICTRC) IOMIOPortWrite(PVM, PVMCPU, RTIOPORT Port,
uint32_t u32Value, size_t cbValue)
{
// PDBG("IOMIOPortWrite Port=0x%lx cbValue=%zd", (long)Port, cbValue);
return guest_ioports()->write(Port, u32Value, cbValue);
}
VMMDECL(VBOXSTRICTRC) IOMIOPortRead(PVM pVM, RTIOPORT Port, uint32_t *pu32Value,
size_t cbValue)
VMMDECL(VBOXSTRICTRC) IOMIOPortRead(PVM, PVMCPU, RTIOPORT Port,
uint32_t *pu32Value, size_t cbValue)
{
return guest_ioports()->read(Port, pu32Value, cbValue);
}

View File

@ -20,18 +20,24 @@
#include <stdlib.h>
#include <signal.h>
#include <sys/time.h>
#include <sys/mount.h> /* statfs */
#include <unistd.h>
#include <errno.h>
#include <fcntl.h> /* open */
/* libc memory allocator */
#include <libc_mem_alloc.h>
/* VirtualBox includes */
#include <iprt/mem.h>
#include <iprt/assert.h>
static const bool verbose = false;
using Genode::size_t;
/*
* We cannot use the libc's version of malloc because it does not satisfies
* the alignment constraints asserted by 'Runtime/r3/alloc.cpp'.
@ -108,9 +114,10 @@ extern "C" char *getenv(const char *name)
// "+dev_pcnet.e.l.f"
// "+dev_pic.e.l.f"
// "+dev_apic.e.l.f"
// "+dev_vmm.e.l.f"
"+dev_vmm.e"
// "+main.e.l.f"
// "+hgcm.e.l.f"
// "+shared_folders.e.l.f"
;
if (Genode::strcmp(name, "VBOX_LOG_FLAGS") == 0 ||
@ -154,13 +161,94 @@ extern "C" int gettimeofday(struct timeval *tv, struct timezone *tz)
}
}
/* our libc provides a _nanosleep function */
extern "C" int _nanosleep(const struct timespec *req, struct timespec *rem);
extern "C" int nanosleep(const struct timespec *req, struct timespec *rem)
{
Assert(req);
/*
if (req) { // && req->tv_sec == 0 && req->tv_nsec <= 10 *1000000) {
char _name[64];
Genode::Thread_base::myself()->name(_name, sizeof(_name));
PERR("%zd:%ld s:ns rip %p '%s'", req->tv_sec, req->tv_nsec,
__builtin_return_address(0), _name);
}
*/
return _nanosleep(req, rem);
}
/* Some dummy implementation for LibC functions */
extern "C" pid_t getpid(void)
{
if (verbose)
PINF("%s called - rip %p", __func__, __builtin_return_address(0));
return 1345;
}
extern "C" int sigprocmask(int how, const sigset_t *set, sigset_t *oldset)
{
if (verbose)
PINF("%s called - rip %p", __func__, __builtin_return_address(0));
return -1;
}
extern "C" int _sigaction(int, const struct sigaction *, struct sigaction *)
{
if (verbose)
PINF("%s called - rip %p", __func__, __builtin_return_address(0));
return -1;
}
extern "C" int futimes(int fd, const struct timeval tv[2])
{
PINF("%s called - rip %p", __func__, __builtin_return_address(0));
return 0;
}
extern "C" int lutimes(const char *filename, const struct timeval tv[2])
{
PINF("%s called - file '%s' - rip %p", __func__, filename,
__builtin_return_address(0));
return 0;
}
extern "C" int _sigprocmask()
{
if (verbose)
PINF("%s called - rip %p", __func__, __builtin_return_address(0));
return 0;
}
/**
* Used by Shared Folders
* Used by Shared Folders Guest additions
*/
extern "C" int _fstatfs(int libc_fd, struct statfs *buf);
extern "C" int statfs(const char *path, struct statfs *buf)
{
int fd = open(path, 0);
if (fd < 0)
return fd;
int res = _fstatfs(fd, buf);
close(fd);
return res;
}
extern "C" long pathconf(char const *path, int name)
{
if (name = _PC_NAME_MAX) return 255;
if (name == _PC_NAME_MAX) return 255;
PERR("pathconf does not support config option %d", name);
errno = EINVAL;

View File

@ -1,279 +0,0 @@
/*
* \brief Port of VirtualBox to Genode
* \author Norman Feske
* \date 2013-08-20
*/
/*
* Copyright (C) 2013 Genode Labs GmbH
*
* This file is distributed under the terms of the GNU General Public License
* version 2.
*/
/* Genode includes */
#include <base/env.h>
#include <base/printf.h>
#include <os/config.h>
#include <base/snprintf.h>
/* libc includes */
#include <stdio.h>
#include <string.h>
/* libc memory allocator */
#include <libc_mem_alloc.h>
/* Virtualbox includes of VBoxBFE */
#include <iprt/initterm.h>
#include <iprt/err.h>
void *operator new (Genode::size_t size)
{
static Libc::Mem_alloc_impl heap(Genode::env()->rm_session());
return heap.alloc(size, 0x10);
}
void *operator new [] (Genode::size_t size) {
return Genode::env()->heap()->alloc(size); }
void operator delete(void * p) {
if (Genode::env()->heap()->need_size_for_free()) {
PERR("leaking memory - delete operator is missing size information");
return;
}
Genode::env()->heap()->free(p, 0);
}
namespace {
template <int MAX_ARGS>
class Args
{
private:
int _argc = 0;
char *_argv[MAX_ARGS] = { };
public:
class Too_many_arguments { };
void add(char const *arg)
{
/* argv[MAX_ARGS - 1] must be unused and set to 0 */
if (_argc >= MAX_ARGS - 1)
throw Too_many_arguments();
_argv[_argc++] = strdup(arg);
}
char *** argvp() {
static char ** argv = _argv;
return &argv;
}
int argc() { return _argc; }
};
} /* unnamed namespace */
extern "C" {
/* make output of Virtualbox visible */
size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream)
{
if (!stream || !ptr ||
!(fileno(stdout) == fileno(stream) || fileno(stderr) == fileno(stream)))
return EOF;
char const * cptr = reinterpret_cast<const char *>(ptr);
for (size_t j = 0; j < nmemb; j++)
for (size_t i = 0; i < size; i++)
Genode::printf("%c", cptr[j * size + i]);
return nmemb;
}
int fprintf(FILE *stream, const char *format, ...) /* called by RTAssertMsg1 */
{
if (!stream ||
!(fileno(stdout) == fileno(stream) || fileno(stderr) == fileno(stream)))
return EOF;
va_list list;
va_start(list, format);
Genode::vprintf(format, list);
va_end(list);
return 0;
}
int fputs(const char *s, FILE *stream) /* called by RTAssertMsg2Weak */
{
if (!stream ||
!(fileno(stdout) == fileno(stream) || fileno(stderr) == fileno(stream)))
return EOF;
fwrite(s, Genode::strlen(s), 1, stream);
}
/* our libc provides a _nanosleep function */
int _nanosleep(const struct timespec *req, struct timespec *rem);
int nanosleep(const struct timespec *req, struct timespec *rem) {
return _nanosleep(req, rem); }
/*
* Genode way of using a configuration. Wrap VBox main until we throught it
* out eventually.
*/
/* main function of VBox is in Frontends/VBoxBFE/VBoxBFE.cpp */
extern "C" DECLEXPORT(int) TrustedMain (int argc, char **argv, char **envp);
int main()
{
static char c_mem[16];
static char c_vram[16];
static char c_type[4];
static char c_file[128];
static bool bOverlay = false;
static Args<64> args;
/* request max available memory */
size_t vm_size = Genode::env()->ram_session()->avail();
enum {
VMM_MEMORY = 88 * 1024 * 1024, /* let a bit memory for the VMM */
VRAM_MEMORY = 8 * 1024 * 1024, /* video memory */
};
if (vm_size < VMM_MEMORY + VRAM_MEMORY) {
PERR("not enough memory available - need %u, available only %zu "
"- exit", VMM_MEMORY + VRAM_MEMORY, vm_size);
return 1;
}
vm_size -= VMM_MEMORY + VRAM_MEMORY;
try {
using namespace Genode;
Xml_node node = config()->xml_node().sub_node("image");
Xml_node::Attribute type = node.attribute("type");
Xml_node::Attribute file = node.attribute("file");
try {
Xml_node::Attribute overlay = node.attribute("overlay");
overlay.value(c_type, sizeof(c_type));
if (!Genode::strcmp(c_type, "yes"))
bOverlay = true;
} catch (...) { }
type.value(c_type, sizeof(c_type));
file.value(c_file, sizeof(c_file));
} catch (...) {
PERR("C++ exception during xml parsing");
return 2;
}
args.add("virtualbox");
Genode::snprintf(c_mem, sizeof(c_mem), "%u", vm_size / 1024 / 1024);
args.add("-m"); args.add(c_mem);
Genode::snprintf(c_vram, sizeof(c_vram), "%u", VRAM_MEMORY / 1024 / 1024);
args.add("-vram"); args.add(c_vram);
args.add("-boot");
if (!Genode::strcmp(c_type, "iso")) {
args.add("d");
args.add("-cdrom");
} else
if (!Genode::strcmp(c_type, "vdi")) {
args.add("c");
args.add("-hda");
} else {
PERR("invalid configuration - abort");
return 3;
}
args.add(c_file);
if (bOverlay)
args.add("-overlay");
/* disable acpi support if requested */
try {
Genode::Xml_node node = Genode::config()->xml_node().sub_node("noacpi");
args.add("-noacpi");
} catch (...) { }
/* ioapic support */
try {
Genode::Xml_node node = Genode::config()->xml_node().sub_node("ioapic");
args.add("-ioapic");
} catch (...) { }
/* shared folder setup */
unsigned shares = 0;
try {
using namespace Genode;
for (Xml_node node = config()->xml_node().sub_node("share");
true; node = node.next("share")) {
Xml_node::Attribute share_dir_host = node.attribute("host");
Xml_node::Attribute share_dir_guest = node.attribute("guest");
char * dir_host = new char[share_dir_host.value_size() + 1];
char * dir_guest = new char[share_dir_guest.value_size() + 1];
share_dir_host.value(dir_host, share_dir_host.value_size() + 1);
share_dir_guest.value(dir_guest, share_dir_guest.value_size() + 1);
args.add("-share"); args.add(dir_host), args.add(dir_guest);
shares ++;
}
} catch(Genode::Xml_node::Nonexistent_sub_node) { }
/* network setup */
unsigned net = 0;
try {
using namespace Genode;
for (Xml_node node = config()->xml_node().sub_node("net");
true; node = node.next("net")) {
net ++;
char buf [10];
Genode::snprintf(buf, sizeof(buf), "-hifdev%d", net);
args.add(buf);
/* read out network model, if not set use e1000 */
try {
Xml_node::Attribute model = node.attribute("model");
char * c_model = new char[model.value_size() + 1];
model.value(c_model, model.value_size() + 1);
args.add(c_model);
} catch(Genode::Xml_node::Nonexistent_attribute) {
args.add("e1000");
}
}
} catch(Genode::Xml_node::Nonexistent_sub_node) { }
PINF("start %s image '%s' with %zu MB guest memory=%zu, %u shared folders,"
" %u network connections",
c_type, c_file, vm_size / 1024 / 1024,
Genode::env()->ram_session()->avail(), shares, net);
if (RT_FAILURE(RTR3InitExe(args.argc(), args.argvp(), 0))) {
PERR("Intialization of VBox Runtime failed.");
return 5;
}
return TrustedMain(args.argc(), *args.argvp(), NULL);
}
} /* extern "C" */

View File

@ -84,7 +84,7 @@ class Sub_rm_connection : public Genode::Rm_connection
static struct {
Sub_rm_connection * conn;
Libc::Mem_alloc_impl * heap;
} memory_regions [MM_TAG_HWACCM];
} memory_regions [MM_TAG_HM + 1];
static Libc::Mem_alloc * heap_by_mmtag(MMTAG enmTag)
@ -123,18 +123,10 @@ static Libc::Mem_alloc * heap_by_pointer(void * pv)
}
int MMR3Init(PVM pVM)
{
PDBG("MMR3Init called, not implemented");
return VINF_SUCCESS;
}
int MMR3InitUVM(PUVM pUVM)
{
PDBG("MMR3InitUVM called, not implemented");
return VINF_SUCCESS;
}
int MMR3Init(PVM) { return VINF_SUCCESS; }
int MMR3Term(PVM) { return VINF_SUCCESS; }
int MMR3InitUVM(PUVM) { return VINF_SUCCESS; }
void MMR3TermUVM(PUVM) { }
void *MMR3HeapAllocU(PUVM pUVM, MMTAG enmTag, size_t cbSize)
@ -151,7 +143,11 @@ static unsigned align_by_mmtag(MMTAG enmTag)
switch (enmTag) {
case MM_TAG_PDM_DEVICE:
case MM_TAG_PDM_DEVICE_USER:
case MM_TAG_VMM:
return 12;
case MM_TAG_CPUM_CPUID:
case MM_TAG_CPUM_MSRS:
return Genode::log2(32);
default:
return Genode::log2(RTMEM_ALIGNMENT);
}
@ -193,9 +189,24 @@ int MMR3HeapAllocZEx(PVM pVM, MMTAG enmTag, size_t cbSize, void **ppv)
}
int MMR3HyperInitFinalize(PVM)
{
return VINF_SUCCESS;
}
int MMR3HyperSetGuard(PVM, void* ptr, size_t, bool)
{
// PDBG("called %p", ptr);
return VINF_SUCCESS;
}
int MMR3HyperAllocOnceNoRel(PVM pVM, size_t cb, unsigned uAlignment,
MMTAG enmTag, void **ppv)
{
AssertRelease(align_by_mmtag(enmTag) >= (uAlignment ? Genode::log2(uAlignment) : 0));
unsigned const align_log2 = uAlignment ? Genode::log2(uAlignment)
: align_by_mmtag(enmTag);
@ -214,13 +225,15 @@ int MMR3HyperAllocOnceNoRel(PVM pVM, size_t cb, unsigned uAlignment,
int MMR3HyperAllocOnceNoRelEx(PVM pVM, size_t cb, uint32_t uAlignment,
MMTAG enmTag, uint32_t fFlags, void **ppv)
{
AssertRelease(align_by_mmtag(enmTag) >= (uAlignment ? Genode::log2(uAlignment) : 0));
return MMR3HyperAllocOnceNoRel(pVM, cb, uAlignment, enmTag, ppv);
}
int MMHyperAlloc(PVM pVM, size_t cb, unsigned uAlignment, MMTAG enmTag, void **ppv)
{
AssertRelease(align_by_mmtag(enmTag) >= uAlignment);
AssertRelease(align_by_mmtag(enmTag) >= (uAlignment ? Genode::log2(uAlignment) : 0));
*ppv = MMR3HeapAllocZ(pVM, enmTag, cb);
return VINF_SUCCESS;
@ -234,6 +247,20 @@ int MMHyperFree(PVM pVM, void *pv)
}
int MMHyperDupMem(PVM pVM, const void *pvSrc, size_t cb,
unsigned uAlignment, MMTAG enmTag, void **ppv)
{
int rc = MMHyperAlloc(pVM, cb, uAlignment, enmTag, ppv);
if (RT_SUCCESS(rc))
memcpy(*ppv, pvSrc, cb);
return rc;
}
bool MMHyperIsInsideArea(PVM, RTGCPTR ptr)
{
return false;
}
void MMR3HeapFree(void *pv)
{
Libc::Mem_alloc *heap = heap_by_pointer(pv);
@ -244,16 +271,8 @@ void MMR3HeapFree(void *pv)
}
RTR0PTR MMHyperR3ToR0(PVM pVM, RTR3PTR R3Ptr) { return (RTR0PTR)R3Ptr; }
RTRCPTR MMHyperR3ToRC(PVM pVM, RTR3PTR R3Ptr) { return to_rtrcptr(R3Ptr); }
RTR0PTR MMHyperCCToR0(PVM pVM, void *pv) { return (RTR0PTR)pv; }
RTRCPTR MMHyperCCToRC(PVM pVM, void *pv) { return to_rtrcptr(pv); }
uint64_t MMR3PhysGetRamSize(PVM pVM)
{
PDBG("MMR3PhysGetRamSize called, return 0");
/* when called from REMR3Init, it is expected to return 0 */
return 0;
}
@ -262,17 +281,15 @@ uint64_t MMR3PhysGetRamSize(PVM pVM)
int MMR3HyperMapHCPhys(PVM pVM, void *pvR3, RTR0PTR pvR0, RTHCPHYS HCPhys,
size_t cb, const char *pszDesc, PRTGCPTR pGCPtr)
{
PDBG("pszDesc=%s", pszDesc);
static_assert(sizeof(*pGCPtr) == sizeof(HCPhys) , "pointer transformation bug");
*pGCPtr = (RTGCPTR)HCPhys;
return VINF_SUCCESS;
}
int MMR3HyperReserve(PVM pVM, unsigned cb, const char *pszDesc, PRTGCPTR pGCPtr)
{
PINF("MMR3HyperReserve: cb=0x%x, pszDesc=%s", cb, pszDesc);
// PINF("MMR3HyperReserve: cb=0x%x, pszDesc=%s", cb, pszDesc);
return VINF_SUCCESS;
}
@ -282,11 +299,10 @@ int MMR3HyperMapMMIO2(PVM pVM, PPDMDEVINS pDevIns, uint32_t iRegion,
RTGCPHYS off, RTGCPHYS cb, const char *pszDesc,
PRTRCPTR pRCPtr)
{
/*
PLOG("MMR3HyperMapMMIO2: pszDesc=%s iRegion=%u off=0x%lx cb=0x%zx",
pszDesc, iRegion, (long)off, (size_t)cb);
*/
return VINF_SUCCESS;
}
@ -330,7 +346,7 @@ int MMR3InitPaging(PVM pVM)
/*
* Make the initial memory reservation with GMM.
*/
PDBG("GMMR3InitialReservation missing");
LogFlow(("GMMR3INitialReservation missing\n"));
/*
* If RamSize is 0 we're done now.

View File

@ -1,131 +0,0 @@
+++ src/app/virtualbox/src/VBox/Devices/Network/DevE1000.cpp
@@ -7536,6 +7536,39 @@
pState->INetworkConfig.pfnGetLinkState = e1kGetLinkState;
pState->INetworkConfig.pfnSetLinkState = e1kSetLinkState;
+ /* For Genode attach already here to be able to overwrite mac address */
+ rc = PDMDevHlpDriverAttach(pDevIns, 0, &pState->IBase, &pState->pDrvBase, "Network Port");
+ if (RT_SUCCESS(rc))
+ {
+ /* Genode: read out the mac address from nic_session interface */
+ PPDMINETWORKCONFIG pDrvConfig = PDMIBASE_QUERY_INTERFACE(pState->pDrvBase, PDMINETWORKCONFIG);
+ Assert(pDrvConfig && pDrvConfig->pfnGetMac);
+ pDrvConfig->pfnGetMac(pDrvConfig, &pState->macConfigured);
+
+ if (rc == VINF_NAT_DNS)
+ {
+ PDMDevHlpVMSetRuntimeError(pDevIns, 0 /*fFlags*/, "NoDNSforNAT",
+ N_("A Domain Name Server (DNS) for NAT networking could not be determined. Ensure that your host is correctly connected to an ISP. If you ignore this warning the guest will not be able to perform nameserver lookups and it will probably observe delays if trying so"));
+ }
+ pState->pDrvR3 = PDMIBASE_QUERY_INTERFACE(pState->pDrvBase, PDMINETWORKUP);
+ AssertMsgReturn(pState->pDrvR3, ("Failed to obtain the PDMINETWORKUP interface!\n"),
+ VERR_PDM_MISSING_INTERFACE_BELOW);
+
+ pState->pDrvR0 = PDMIBASER0_QUERY_INTERFACE(PDMIBASE_QUERY_INTERFACE(pState->pDrvBase, PDMIBASER0), PDMINETWORKUP);
+ pState->pDrvRC = PDMIBASERC_QUERY_INTERFACE(PDMIBASE_QUERY_INTERFACE(pState->pDrvBase, PDMIBASERC), PDMINETWORKUP);
+ }
+ else if ( rc == VERR_PDM_NO_ATTACHED_DRIVER
+ || rc == VERR_PDM_CFG_MISSING_DRIVER_NAME)
+ {
+ /* No error! */
+ E1kLog(("%s This adapter is not attached to any network!\n", INSTANCE(pState)));
+ }
+ else
+ return PDMDEV_SET_ERROR(pDevIns, rc, N_("Failed to attach the network LUN"));
+
+
+
+
/* Initialize the EEPROM */
pState->eeprom.init(pState->macConfigured);
@@ -7696,30 +7729,6 @@
return PDMDEV_SET_ERROR(pDevIns, rc, N_("Failed to attach the status LUN"));
pState->pLedsConnector = PDMIBASE_QUERY_INTERFACE(pBase, PDMILEDCONNECTORS);
- rc = PDMDevHlpDriverAttach(pDevIns, 0, &pState->IBase, &pState->pDrvBase, "Network Port");
- if (RT_SUCCESS(rc))
- {
- if (rc == VINF_NAT_DNS)
- {
- PDMDevHlpVMSetRuntimeError(pDevIns, 0 /*fFlags*/, "NoDNSforNAT",
- N_("A Domain Name Server (DNS) for NAT networking could not be determined. Ensure that your host is correctly connected to an ISP. If you ignore this warning the guest will not be able to perform nameserver lookups and it will probably observe delays if trying so"));
- }
- pState->pDrvR3 = PDMIBASE_QUERY_INTERFACE(pState->pDrvBase, PDMINETWORKUP);
- AssertMsgReturn(pState->pDrvR3, ("Failed to obtain the PDMINETWORKUP interface!\n"),
- VERR_PDM_MISSING_INTERFACE_BELOW);
-
- pState->pDrvR0 = PDMIBASER0_QUERY_INTERFACE(PDMIBASE_QUERY_INTERFACE(pState->pDrvBase, PDMIBASER0), PDMINETWORKUP);
- pState->pDrvRC = PDMIBASERC_QUERY_INTERFACE(PDMIBASE_QUERY_INTERFACE(pState->pDrvBase, PDMIBASERC), PDMINETWORKUP);
- }
- else if ( rc == VERR_PDM_NO_ATTACHED_DRIVER
- || rc == VERR_PDM_CFG_MISSING_DRIVER_NAME)
- {
- /* No error! */
- E1kLog(("%s This adapter is not attached to any network!\n", INSTANCE(pState)));
- }
- else
- return PDMDEV_SET_ERROR(pDevIns, rc, N_("Failed to attach the network LUN"));
-
rc = RTSemEventCreate(&pState->hEventMoreRxDescAvail);
if (RT_FAILURE(rc))
return rc;
+++ src/app/virtualbox/src/VBox/Devices/Network/DevPCNet.cpp
@@ -5331,6 +5331,11 @@
rc = PDMDevHlpDriverAttach(pDevIns, 0, &pThis->IBase, &pThis->pDrvBase, "Network Port");
if (RT_SUCCESS(rc))
{
+ /* Genode: read out the mac address from nic_session interface */
+ PPDMINETWORKCONFIG pDrvConfig = PDMIBASE_QUERY_INTERFACE(pThis->pDrvBase, PDMINETWORKCONFIG);
+ Assert(pDrvConfig && pDrvConfig->pfnGetMac);
+ pDrvConfig->pfnGetMac(pDrvConfig, &pThis->MacConfigured);
+
if (rc == VINF_NAT_DNS)
{
#ifdef RT_OS_LINUX
+++ src/app/virtualbox/src/VBox/Frontends/VBoxBFE/VBoxBFE.cpp
@@ -1601,11 +1630,14 @@
/*
* Network adapters
*/
- rc = CFGMR3InsertNode(pDevices, "pcnet", &pDev); UPDATE_RC();
for (ULONG ulInstance = 0; ulInstance < NetworkAdapterCount; ulInstance++)
{
if (g_aNetDevs[ulInstance].enmType != BFENETDEV::NOT_CONFIGURED)
{
+ /* On Genode we use pszName to select the device model */
+ const char * device_model = g_aNetDevs[ulInstance].pszName;
+ rc = CFGMR3InsertNode(pDevices, device_model, &pDev); UPDATE_RC();
+
char szInstance[4];
RTStrPrintf(szInstance, sizeof(szInstance), "%lu", ulInstance);
rc = CFGMR3InsertNode(pDev, szInstance, &pInst); UPDATE_RC();
@@ -1616,6 +1650,10 @@
rc = CFGMR3InsertNode(pInst, "Config", &pCfg); UPDATE_RC();
rc = CFGMR3InsertBytes(pCfg, "MAC", &g_aNetDevs[ulInstance].Mac, sizeof(RTMAC));
UPDATE_RC();
+ if (!strcmp("e1000", device_model)) {
+ rc = CFGMR3InsertInteger(pCfg, "CableConnected", 1); UPDATE_RC();
+ rc = CFGMR3InsertInteger(pCfg, "AdapterType", 0); UPDATE_RC();
+ }
/*
* Enable the packet sniffer if requested.
@@ -1747,10 +1785,15 @@
#else
- FatalError("Name based HIF devices not implemented yet for this host platform\n");
- return VERR_NOT_IMPLEMENTED;
+// FatalError("Name based HIF devices not implemented yet for this host platform\n");
+// return VERR_NOT_IMPLEMENTED;
#endif
}
+
+ rc = CFGMR3InsertNode(pInst, "LUN#999", &pLunL0); UPDATE_RC();
+ rc = CFGMR3InsertString(pLunL0, "Driver", "MainStatus"); UPDATE_RC();
+ rc = CFGMR3InsertNode(pLunL0, "Config", &pCfg); UPDATE_RC();
+ rc = CFGMR3InsertInteger(pCfg, "papLeds", (uintptr_t)&mapFDLeds[0]); UPDATE_RC();
}
else if (g_aNetDevs[ulInstance].enmType == BFENETDEV::INTNET)
{

View File

@ -27,10 +27,10 @@
#include <nova/syscalls.h>
/* VirtualBox includes */
#include "HWACCMInternal.h" /* enable access to hwaccm.s.* */
#include "HMInternal.h" /* enable access to hm.s.* */
#include "CPUMInternal.h" /* enable access to cpum.s.* */
#include <VBox/vmm/vm.h>
#include <VBox/vmm/hwacc_svm.h>
#include <VBox/vmm/hm_svm.h>
#include <VBox/err.h>
/* Genode's VirtualBox includes */
@ -58,8 +58,8 @@ void SUPR3QueryHWACCLonGenodeSupport(VM * pVM)
try {
Nova::Hip * hip = hip_rom.local_addr<Nova::Hip>();
pVM->hwaccm.s.svm.fSupported = hip->has_feature_svm();
pVM->hwaccm.s.vmx.fSupported = hip->has_feature_vmx();
pVM->hm.s.svm.fSupported = hip->has_feature_svm();
pVM->hm.s.vmx.fSupported = hip->has_feature_vmx();
PINF("support svm %u vmx %u", hip->has_feature_svm(), hip->has_feature_vmx());
} catch (...) {
@ -75,7 +75,7 @@ int SUPR3QueryVTxSupported(void) { return VINF_SUCCESS; }
int SUPR3CallVMMR0Fast(PVMR0 pVMR0, unsigned uOperation, VMCPUID idCpu)
{
switch (uOperation) {
case SUP_VMMR0_DO_HWACC_RUN:
case SUP_VMMR0_DO_HM_RUN:
return vcpu_handler->run_hw(pVMR0, idCpu);
}
return VERR_INTERNAL_ERROR;
@ -107,10 +107,12 @@ int SUPR3CallVMMR0Ex(PVMR0 pVMR0, VMCPUID idCpu, unsigned
SUPR3QueryHWACCLonGenodeSupport(reinterpret_cast<VM *>(pVMR0));
return VINF_SUCCESS;
case VMMR0_DO_HWACC_SETUP_VM:
case VMMR0_DO_GVMM_DESTROY_VM:
case VMMR0_DO_VMMR0_TERM:
case VMMR0_DO_HM_SETUP_VM:
return VINF_SUCCESS;
case VMMR0_DO_HWACC_ENABLE:
case VMMR0_DO_HM_ENABLE:
return VINF_SUCCESS;
case VMMR0_DO_GVMM_SCHED_POKE:
@ -183,7 +185,23 @@ bool Vmm_memory::revoke_from_vm(Region *r)
}
extern "C" void pthread_yield(void) { Nova::ec_ctrl(Nova::EC_YIELD); }
extern "C" void pthread_yield(void)
{
/*
char _name[64];
Genode::Thread_base::myself()->name(_name, sizeof(_name));
PERR("pthread_yield %p - '%s'", __builtin_return_address(0), _name);
Assert(!"pthread_yield called");
*/
Nova::ec_ctrl(Nova::EC_YIELD);
}
void *operator new (Genode::size_t size, int log2_align)
{
static Libc::Mem_alloc_impl heap(Genode::env()->rm_session());
return heap.alloc(size, log2_align);
}
bool create_emt_vcpu(pthread_t * pthread, size_t stack,
@ -198,12 +216,14 @@ bool create_emt_vcpu(pthread_t * pthread, size_t stack,
return false;
if (hip->has_feature_vmx())
vcpu_handler = new Vcpu_handler_vmx(stack, attr, start_routine, arg,
cpu_session, location);
vcpu_handler = new (0x10) Vcpu_handler_vmx(stack, attr, start_routine,
arg, cpu_session, location);
if (hip->has_feature_svm())
vcpu_handler = new Vcpu_handler_svm(stack, attr, start_routine, arg,
cpu_session, location);
vcpu_handler = new (0x10) Vcpu_handler_svm(stack, attr, start_routine,
arg, cpu_session, location);
Assert(!(reinterpret_cast<unsigned long>(vcpu_handler) & 0xf));
*pthread = vcpu_handler;
return true;

View File

@ -45,6 +45,10 @@
/* LibC includes */
#include <setjmp.h>
#include <VBox/vmm/rem.h>
static bool debug_map_memory = false;
/*
* VirtualBox stores segment attributes in Intel format using a 32-bit
* value. NOVA represents the attributes in packet format using a 16-bit
@ -160,14 +164,17 @@ class Vcpu_handler : public Vmm::Vcpu_dispatcher<pthread>
Nova::Utcb * utcb = reinterpret_cast<Nova::Utcb *>(Thread_base::utcb());
Assert(utcb->actv_state == ACTIVITY_STATE_ACTIVE);
if (utcb->intr_state != INTERRUPT_STATE_NONE)
Vmm::printf("intr state %x %x\n", utcb->intr_state, utcb->intr_state & 0xF);
Assert(utcb->intr_state == INTERRUPT_STATE_NONE);
if (utcb->inj_info & IRQ_INJ_VALID_MASK) {
Assert(utcb->flags & X86_EFL_IF);
/*
if (!continue_hw_accelerated(utcb))
Vmm::printf("WARNING - recall ignored during IRQ delivery\n");
*/
/* got recall during irq injection and X86_EFL_IF set for
* delivery of IRQ - just continue */
Nova::reply(_stack_reply);
@ -205,6 +212,9 @@ class Vcpu_handler : public Vmm::Vcpu_dispatcher<pthread>
Assert(utcb->actv_state == ACTIVITY_STATE_ACTIVE);
Assert(utcb->intr_state == INTERRUPT_STATE_NONE);
if (utcb->inj_info & IRQ_INJ_VALID_MASK)
Vmm::printf("inj_info %x\n", utcb->inj_info);
Assert(!(utcb->inj_info & IRQ_INJ_VALID_MASK));
if (unmap) {
@ -261,6 +271,11 @@ class Vcpu_handler : public Vmm::Vcpu_dispatcher<pthread>
Crd crd = Mem_crd(flexpage.addr >> 12, flexpage.log2_order - 12,
permission);
res = utcb->append_item(crd, flexpage.hotspot, USER_PD, GUEST_PGT);
if (debug_map_memory)
Vmm::printf("map guest mem %p+%x -> %lx - reason %lx\n",
flexpage.addr, 1UL << flexpage.log2_order,
flexpage.hotspot, reason);
} while (res);
Nova::reply(_stack_reply);
@ -335,7 +350,7 @@ class Vcpu_handler : public Vmm::Vcpu_dispatcher<pthread>
utcb->gdtr.limit = pCtx->gdtr.cbGdt;
utcb->gdtr.base = pCtx->gdtr.pGdt;
Assert(!(VMCPU_FF_ISSET(pVCpu, VMCPU_FF_INHIBIT_INTERRUPTS)));
Assert(!(VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_INHIBIT_INTERRUPTS)));
return true;
}
@ -409,8 +424,8 @@ class Vcpu_handler : public Vmm::Vcpu_dispatcher<pthread>
inline bool check_to_request_irq_window(Nova::Utcb * utcb, PVMCPU pVCpu)
{
if (!TRPMHasTrap(pVCpu) &&
!VMCPU_FF_ISPENDING(pVCpu, (VMCPU_FF_INTERRUPT_APIC |
VMCPU_FF_INTERRUPT_PIC)))
!VMCPU_FF_IS_PENDING(pVCpu, (VMCPU_FF_INTERRUPT_APIC |
VMCPU_FF_INTERRUPT_PIC)))
return false;
unsigned vector = 0;
@ -429,7 +444,7 @@ class Vcpu_handler : public Vmm::Vcpu_dispatcher<pthread>
Assert(utcb->intr_state == INTERRUPT_STATE_NONE);
Assert(utcb->flags & X86_EFL_IF);
Assert(!VMCPU_FF_ISSET(pVCpu, VMCPU_FF_INHIBIT_INTERRUPTS));
Assert(!VMCPU_FF_IS_SET(pVCpu, VMCPU_FF_INHIBIT_INTERRUPTS));
Assert(!(utcb->inj_info & IRQ_INJ_VALID_MASK));
Assert(_irq_win);
@ -437,10 +452,10 @@ class Vcpu_handler : public Vmm::Vcpu_dispatcher<pthread>
if (!TRPMHasTrap(pVCpu)) {
bool res = VMCPU_FF_TESTANDCLEAR(pVCpu, VMCPU_FF_INTERRUPT_NMI);
bool res = VMCPU_FF_TEST_AND_CLEAR(pVCpu, VMCPU_FF_INTERRUPT_NMI);
Assert(!res);
if (VMCPU_FF_ISPENDING(pVCpu, (VMCPU_FF_INTERRUPT_APIC |
if (VMCPU_FF_IS_PENDING(pVCpu, (VMCPU_FF_INTERRUPT_APIC |
VMCPU_FF_INTERRUPT_PIC))) {
uint8_t irq;
@ -458,26 +473,21 @@ class Vcpu_handler : public Vmm::Vcpu_dispatcher<pthread>
*/
Assert(TRPMHasTrap(pVCpu));
#ifdef VBOX_STRICT
if (TRPMHasTrap(pVCpu)) {
uint8_t u8Vector;
int const rc = TRPMQueryTrapAll(pVCpu, &u8Vector, 0, 0, 0);
AssertRC(rc);
}
#endif
/* interrupt can be dispatched */
uint8_t u8Vector;
TRPMEVENT enmType;
SVM_EVENT Event;
SVMEVENT Event;
RTGCUINT u32ErrorCode;
RTGCUINTPTR GCPtrFaultAddress;
uint8_t cbInstr;
Event.au64[0] = 0;
Event.u = 0;
/* If a new event is pending, then dispatch it now. */
int rc = TRPMQueryTrapAll(pVCpu, &u8Vector, &enmType, &u32ErrorCode, 0);
int rc = TRPMQueryTrapAll(pVCpu, &u8Vector, &enmType, &u32ErrorCode, 0, 0);
AssertRC(rc);
Assert(enmType == TRPM_HARDWARE_INT);
Assert(u8Vector != X86_XCPT_NMI);
/* Clear the pending trap. */
rc = TRPMResetTrap(pVCpu);
@ -489,7 +499,7 @@ class Vcpu_handler : public Vmm::Vcpu_dispatcher<pthread>
Event.n.u3Type = SVM_EVENT_EXTERNAL_IRQ;
utcb->inj_info = Event.au64[0];
utcb->inj_info = Event.u;
utcb->inj_error = Event.n.u32ErrorCode;
/*
@ -503,21 +513,21 @@ class Vcpu_handler : public Vmm::Vcpu_dispatcher<pthread>
inline bool continue_hw_accelerated(Nova::Utcb * utcb)
{
Assert(!(VMCPU_FF_ISSET(_current_vcpu, VMCPU_FF_INHIBIT_INTERRUPTS)));
Assert(!(VMCPU_FF_IS_SET(_current_vcpu, VMCPU_FF_INHIBIT_INTERRUPTS)));
uint32_t check_vm = VM_FF_HWACCM_TO_R3_MASK | VM_FF_REQUEST
uint32_t check_vm = VM_FF_HM_TO_R3_MASK | VM_FF_REQUEST
| VM_FF_PGM_POOL_FLUSH_PENDING
| VM_FF_PDM_DMA;
uint32_t check_vcpu = VMCPU_FF_HWACCM_TO_R3_MASK
uint32_t check_vcpu = VMCPU_FF_HM_TO_R3_MASK
| VMCPU_FF_PGM_SYNC_CR3
| VMCPU_FF_PGM_SYNC_CR3_NON_GLOBAL
| VMCPU_FF_REQUEST;
if (!VM_FF_ISPENDING(_current_vm, check_vm) &&
!VMCPU_FF_ISPENDING(_current_vcpu, check_vcpu))
if (!VM_FF_IS_PENDING(_current_vm, check_vm) &&
!VMCPU_FF_IS_PENDING(_current_vcpu, check_vcpu))
return true;
Assert(!(VM_FF_ISPENDING(_current_vm, VM_FF_PGM_NO_MEMORY)));
Assert(!(VM_FF_IS_PENDING(_current_vm, VM_FF_PGM_NO_MEMORY)));
return false;
}
@ -741,6 +751,11 @@ class Vcpu_handler : public Vmm::Vcpu_dispatcher<pthread>
next_utcb.mtd |= Mtd::STA;
}
#ifdef VBOX_WITH_REM
/* XXX see VMM/VMMR0/HMVMXR0.cpp - not necessary every time ! XXX */
REMFlushTBs(pVM);
#endif
return _last_exit_was_recall ? VINF_SUCCESS : VINF_EM_RAW_EMULATE_INSTR;
}
};

View File

@ -91,26 +91,28 @@ class Vcpu_handler_svm : public Vcpu_handler
{
using namespace Nova;
Genode::addr_t const exc_base = vcpu().exc_base();
typedef Vcpu_handler_svm This;
register_handler<RECALL, This,
&This::_svm_recall>(vcpu().exc_base(), Mtd(Mtd::EFL | Mtd::STA));
&This::_svm_recall> (exc_base, Mtd::ALL | Mtd::FPU);
register_handler<SVM_EXIT_IOIO, This,
&This::_svm_ioio> (vcpu().exc_base(), Mtd(Mtd::ALL | Mtd::FPU));
&This::_svm_ioio> (exc_base, Mtd(Mtd::ALL | Mtd::FPU));
register_handler<SVM_EXIT_VINTR, This,
&This::_svm_vintr> (vcpu().exc_base(), Mtd(Mtd::ALL | Mtd::FPU));
&This::_svm_vintr> (exc_base, Mtd(Mtd::ALL | Mtd::FPU));
register_handler<SVM_EXIT_RDTSC, This,
&This::_svm_default> (vcpu().exc_base(), Mtd(Mtd::ALL | Mtd::FPU));
&This::_svm_default> (exc_base, Mtd(Mtd::ALL | Mtd::FPU));
register_handler<SVM_EXIT_MSR, This,
&This::_svm_default> (vcpu().exc_base(), Mtd(Mtd::ALL | Mtd::FPU));
&This::_svm_default> (exc_base, Mtd(Mtd::ALL | Mtd::FPU));
register_handler<SVM_NPT, This,
&This::_svm_npt<SVM_NPT>>(vcpu().exc_base(), Mtd(Mtd::ALL | Mtd::FPU));
&This::_svm_npt<SVM_NPT>> (exc_base, Mtd(Mtd::ALL | Mtd::FPU));
register_handler<SVM_EXIT_HLT, This,
&This::_svm_default>(vcpu().exc_base(), Mtd(Mtd::ALL | Mtd::FPU));
&This::_svm_default> (exc_base, Mtd(Mtd::ALL | Mtd::FPU));
register_handler<SVM_EXIT_CPUID, This,
&This::_svm_default> (vcpu().exc_base(), Mtd(Mtd::ALL | Mtd::FPU));
&This::_svm_default> (exc_base, Mtd(Mtd::ALL | Mtd::FPU));
register_handler<VCPU_STARTUP, This,
&This::_svm_startup>(vcpu().exc_base(), Mtd(Mtd::ALL | Mtd::FPU));
&This::_svm_startup> (exc_base, Mtd(Mtd::ALL | Mtd::FPU));
start();
}

View File

@ -13,7 +13,7 @@
*/
/* VirtualBox includes */
#include <VBox/vmm/hwacc_vmx.h>
#include <VBox/vmm/hm_vmx.h>
#include "vmm_memory.h"
@ -51,24 +51,24 @@ class Vcpu_handler_vmx : public Vcpu_handler
/* configure VM exits to get */
next_utcb.mtd = Nova::Mtd::CTRL;
/* from src/VBox/VMM/VMMR0/HWVMXR0.cpp of virtualbox sources */
next_utcb.ctrl[0] = VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_HLT_EXIT |
VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_MOV_DR_EXIT |
VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_RDPMC_EXIT |
VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_UNCOND_IO_EXIT |
next_utcb.ctrl[0] = VMX_VMCS_CTRL_PROC_EXEC_HLT_EXIT |
VMX_VMCS_CTRL_PROC_EXEC_MOV_DR_EXIT |
VMX_VMCS_CTRL_PROC_EXEC_RDPMC_EXIT |
VMX_VMCS_CTRL_PROC_EXEC_UNCOND_IO_EXIT |
/* XXX commented out because TinyCore Linux won't run as guest otherwise
VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_MONITOR_EXIT |
VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_MWAIT_EXIT |
VMX_VMCS_CTRL_PROC_EXEC_MONITOR_EXIT |
VMX_VMCS_CTRL_PROC_EXEC_MWAIT_EXIT |
*/
VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_CR8_LOAD_EXIT |
VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_CR8_STORE_EXIT |
VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_RDPMC_EXIT |
/* VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_PAUSE_EXIT | */
VMX_VMCS_CTRL_PROC_EXEC_CR8_LOAD_EXIT |
VMX_VMCS_CTRL_PROC_EXEC_CR8_STORE_EXIT |
VMX_VMCS_CTRL_PROC_EXEC_RDPMC_EXIT |
/* VMX_VMCS_CTRL_PROC_EXEC_PAUSE_EXIT | */
/* we don't support tsc offsetting for now - so let the rdtsc exit */
VMX_VMCS_CTRL_PROC_EXEC_CONTROLS_RDTSC_EXIT;
VMX_VMCS_CTRL_PROC_EXEC_RDTSC_EXIT;
next_utcb.ctrl[1] = VMX_VMCS_CTRL_PROC_EXEC2_VIRT_APIC |
VMX_VMCS_CTRL_PROC_EXEC2_WBINVD_EXIT |
VMX_VMCS_CTRL_PROC_EXEC2_REAL_MODE |
VMX_VMCS_CTRL_PROC_EXEC2_UNRESTRICTED_GUEST |
VMX_VMCS_CTRL_PROC_EXEC2_VPID |
/* VMX_VMCS_CTRL_PROC_EXEC2_X2APIC | */
VMX_VMCS_CTRL_PROC_EXEC2_RDTSCP |
@ -133,7 +133,7 @@ class Vcpu_handler_vmx : public Vcpu_handler
&This::_vmx_triple> (exc_base, Mtd::ALL | Mtd::FPU);
register_handler<VMX_EXIT_INIT_SIGNAL, This,
&This::_vmx_default> (exc_base, Mtd::ALL | Mtd::FPU);
register_handler<VMX_EXIT_IRQ_WINDOW, This,
register_handler<VMX_EXIT_INT_WINDOW, This,
&This::_vmx_irqwin> (exc_base, Mtd::ALL | Mtd::FPU);
register_handler<VMX_EXIT_CPUID, This,
&This::_vmx_default> (exc_base, Mtd::ALL | Mtd::FPU);
@ -146,7 +146,7 @@ class Vcpu_handler_vmx : public Vcpu_handler
register_handler<VMX_EXIT_VMCALL, This,
&This::_vmx_default> (exc_base, Mtd::ALL | Mtd::FPU);
register_handler<VMX_EXIT_PORT_IO, This,
register_handler<VMX_EXIT_IO_INSTR, This,
&This::_vmx_default> (exc_base, Mtd::ALL | Mtd::FPU);
register_handler<VMX_EXIT_RDMSR, This,
&This::_vmx_default> (exc_base, Mtd::ALL | Mtd::FPU);
@ -158,7 +158,7 @@ class Vcpu_handler_vmx : public Vcpu_handler
// &This::_vmx_default> (exc_base, Mtd::ALL | Mtd::FPU);
register_handler<VMX_EXIT_WBINVD, This,
&This::_vmx_default> (exc_base, Mtd::ALL | Mtd::FPU);
register_handler<VMX_EXIT_DRX_MOVE, This,
register_handler<VMX_EXIT_MOV_DRX, This,
&This::_vmx_default> (exc_base, Mtd::ALL | Mtd::FPU);
register_handler<VMX_EXIT_EPT_VIOLATION, This,
&This::_vmx_ept<VMX_EXIT_EPT_VIOLATION>> (exc_base, Mtd::ALL | Mtd::FPU);

View File

@ -0,0 +1,76 @@
+++ src/app/virtualbox/src/VBox/VMM/VMMR3/VMM.cpp
@@ -660,11 +660,13 @@
/*
* Create the EMT yield timer.
*/
+/*
rc = TMR3TimerCreateInternal(pVM, TMCLOCK_REAL, vmmR3YieldEMT, NULL, "EMT Yielder", &pVM->vmm.s.pYieldTimer);
AssertRCReturn(rc, rc);
rc = TMTimerSetMillies(pVM->vmm.s.pYieldTimer, pVM->vmm.s.cYieldEveryMillies);
AssertRCReturn(rc, rc);
+*/
#ifdef VBOX_WITH_NMI
/*
@@ -1160,6 +1162,7 @@
*/
VMMR3_INT_DECL(void) VMMR3YieldSuspend(PVM pVM)
{
+/*
VMCPU_ASSERT_EMT(&pVM->aCpus[0]);
if (!pVM->vmm.s.cYieldResumeMillies)
{
@@ -1172,6 +1175,7 @@
TMTimerStop(pVM->vmm.s.pYieldTimer);
}
pVM->vmm.s.u64LastYield = RTTimeNanoTS();
+*/
}
@@ -1182,10 +1186,12 @@
*/
VMMR3_INT_DECL(void) VMMR3YieldStop(PVM pVM)
{
+#if 0
if (!pVM->vmm.s.cYieldResumeMillies)
TMTimerStop(pVM->vmm.s.pYieldTimer);
pVM->vmm.s.cYieldResumeMillies = pVM->vmm.s.cYieldEveryMillies;
pVM->vmm.s.u64LastYield = RTTimeNanoTS();
+#endif
}
@@ -1196,11 +1202,13 @@
*/
VMMR3_INT_DECL(void) VMMR3YieldResume(PVM pVM)
{
+#if 0
if (pVM->vmm.s.cYieldResumeMillies)
{
TMTimerSetMillies(pVM->vmm.s.pYieldTimer, pVM->vmm.s.cYieldResumeMillies);
pVM->vmm.s.cYieldResumeMillies = 0;
}
+#endif
}
+++ src/app/virtualbox/src/VBox/Devices/Storage/DevATA.cpp
@@ -4466,6 +4466,7 @@
{
#ifdef IN_RING3
cBusy = 0;
+#if 0
PDMCritSectLeave(&pCtl->lock);
#ifndef RT_OS_WINDOWS
@@ -4502,7 +4501,7 @@
PDMCritSectEnter(&pCtl->lock, VINF_SUCCESS);
STAM_PROFILE_STOP(&pCtl->StatLockWait, a);
}
+#endif
-
val = s->uATARegStatus;
#else /* !IN_RING3 */
/* Cannot yield CPU in guest context. And switching to host

View File

@ -0,0 +1,31 @@
+++ src/app/virtualbox/src/VBox/Devices/Network/DevE1000.cpp
@@ -5721,22 +5721,29 @@
rc = g_aE1kRegMap[index].pfnRead(pThis, offReg & 0xFFFFFFFC, index, &u32);
u32 &= mask;
//e1kCsLeave(pThis);
+#ifdef DEBUG
E1kLog2(("%s At %08X read %s from %s (%s)\n",
pThis->szPrf, offReg, e1kU32toHex(u32, mask, buf), g_aE1kRegMap[index].abbrev, g_aE1kRegMap[index].name));
Log6(("%s At %08X read %s from %s (%s) [UNALIGNED]\n",
pThis->szPrf, offReg, e1kU32toHex(u32, mask, buf), g_aE1kRegMap[index].abbrev, g_aE1kRegMap[index].name));
+#endif
/* Shift back the result. */
u32 >>= shift;
}
+#ifdef DEBUG
else
E1kLog(("%s At %08X read (%s) attempt from write-only register %s (%s)\n",
pThis->szPrf, offReg, e1kU32toHex(u32, mask, buf), g_aE1kRegMap[index].abbrev, g_aE1kRegMap[index].name));
+#endif
+
if (IOM_SUCCESS(rc))
STAM_COUNTER_INC(&pThis->aStatRegReads[index]);
}
+#ifdef DEBUG
else
E1kLog(("%s At %08X read (%s) attempt from non-existing register\n",
pThis->szPrf, offReg, e1kU32toHex(u32, mask, buf)));
+#endif
memcpy(pv, &u32, cb);
return rc;

View File

@ -0,0 +1,15 @@
Triggers misalignment assertion in STAM.cpp
case STAMTYPE_PROFILE_ADV:
AssertMsg(!((uintptr_t)pvSample & 7), ("%p - %s - %u\n", pvSample, pszName, enmType));
+++ src/app/virtualbox/src/VBox/VMM/include/EMInternal.h
@@ -361,6 +361,8 @@
#ifdef VBOX_WITH_RAW_MODE
/** Pointer to the PATM status structure. (R3 Ptr) */
R3PTRTYPE(PPATMGCSTATE) pPatmGCState;
+#else
+ RTR3PTR dummyDONTUSE;
#endif
/** Pointer to the guest CPUM state. (R3 Ptr) */

View File

@ -0,0 +1,10 @@
+++ src/app/virtualbox/src/VBox/Devices/Graphics/DevVGA.cpp
@@ -5946,7 +5946,7 @@
else
{
#endif /* VBOX_WITH_VMSVGA */
- PCIDevSetVendorId( &pThis->Dev, 0x80ee); /* PCI vendor, just a free bogus value */
+ PCIDevSetVendorId( &pThis->Dev, 0x80ef); /* PCI vendor, just a free bogus value */
PCIDevSetDeviceId( &pThis->Dev, 0xbeef);
#ifdef VBOX_WITH_VMSVGA
}

View File

@ -0,0 +1,13 @@
+++ src/app/virtualbox/src/VBox/Runtime/r3/posix/utf8-posix.cpp
@@ -324,11 +324,7 @@
const void *pvInputLeft = pvInput;
void *pvOutputLeft = pvOutput;
size_t cchNonRev;
-#if defined(RT_OS_LINUX) || defined(RT_OS_HAIKU) || defined(RT_OS_SOLARIS) || (defined(RT_OS_DARWIN) && defined(_DARWIN_FEATURE_UNIX_CONFORMANCE)) /* there are different opinions about the constness of the input buffer. */
cchNonRev = iconv(icHandle, (char **)&pvInputLeft, &cbInLeft, (char **)&pvOutputLeft, &cbOutLeft);
-#else
- cchNonRev = iconv(icHandle, (const char **)&pvInputLeft, &cbInLeft, (char **)&pvOutputLeft, &cbOutLeft);
-#endif
if (cchNonRev != (size_t)-1)
{
if (!cbInLeft)

View File

@ -8,9 +8,9 @@ alive but reads out the buffer with some delay.
* @interface_method_impl{PDMIMOUSEPORT,pfnPutEvent}
*/
+#include <base/printf.h>
static DECLCALLBACK(int) drvMouseQueuePutEvent(PPDMIMOUSEPORT pInterface, int32_t iDeltaX, int32_t iDeltaY, int32_t iDeltaZ, int32_t iDeltaW, uint32_t fButtonStates)
{
PDRVMOUSEQUEUE pDrv = IMOUSEPORT_2_DRVMOUSEQUEUE(pInterface);
static DECLCALLBACK(int) drvMouseQueuePutEvent(PPDMIMOUSEPORT pInterface,
int32_t dx, int32_t dy,
int32_t dz, int32_t dw,
@@ -121,7 +122,8 @@
PDMQueueInsert(pDrv->pQueue, &pItem->Core);
return VINF_SUCCESS;

View File

@ -0,0 +1,79 @@
+++ src/app/virtualbox/src/VBox/Devices/Network/DevPCNet.cpp
@@ -5331,6 +5331,11 @@
rc = PDMDevHlpDriverAttach(pDevIns, 0, &pThis->IBase, &pThis->pDrvBase, "Network Port");
if (RT_SUCCESS(rc))
{
+ /* Genode: read out the mac address from nic_session interface */
+ PPDMINETWORKCONFIG pDrvConfig = PDMIBASE_QUERY_INTERFACE(pThis->pDrvBase, PDMINETWORKCONFIG);
+ Assert(pDrvConfig && pDrvConfig->pfnGetMac);
+ pDrvConfig->pfnGetMac(pDrvConfig, &pThis->MacConfigured);
+
if (rc == VINF_NAT_DNS)
{
#ifdef RT_OS_LINUX
+++ src/app/virtualbox/src/VBox/Devices/Network/DevE1000.cpp
@@ -7512,6 +7519,35 @@
pThis->fR0Enabled ? "enabled" : "disabled",
pThis->fRCEnabled ? "enabled" : "disabled"));
+ /* For Genode attach already here to be able to overwrite mac address */
+ /* Network driver */
+ rc = PDMDevHlpDriverAttach(pDevIns, 0, &pThis->IBase, &pThis->pDrvBase, "Network Port");
+ if (RT_SUCCESS(rc))
+ {
+
+ /* Genode: read out the mac address from nic_session interface */
+ PPDMINETWORKCONFIG pDrvConfig = PDMIBASE_QUERY_INTERFACE(pThis->pDrvBase, PDMINETWORKCONFIG);
+ Assert(pDrvConfig && pDrvConfig->pfnGetMac);
+ pDrvConfig->pfnGetMac(pDrvConfig, &pThis->macConfigured);
+
+ if (rc == VINF_NAT_DNS)
+ PDMDevHlpVMSetRuntimeError(pDevIns, 0 /*fFlags*/, "NoDNSforNAT",
+ N_("A Domain Name Server (DNS) for NAT networking could not be determined. Ensure that your host is correctly connected to an ISP. If you ignore this warning the guest will not be able to perform nameserver lookups and it will probably observe delays if trying so"));
+ pThis->pDrvR3 = PDMIBASE_QUERY_INTERFACE(pThis->pDrvBase, PDMINETWORKUP);
+ AssertMsgReturn(pThis->pDrvR3, ("Failed to obtain the PDMINETWORKUP interface!\n"), VERR_PDM_MISSING_INTERFACE_BELOW);
+
+ pThis->pDrvR0 = PDMIBASER0_QUERY_INTERFACE(PDMIBASE_QUERY_INTERFACE(pThis->pDrvBase, PDMIBASER0), PDMINETWORKUP);
+ pThis->pDrvRC = PDMIBASERC_QUERY_INTERFACE(PDMIBASE_QUERY_INTERFACE(pThis->pDrvBase, PDMIBASERC), PDMINETWORKUP);
+ }
+ else if ( rc == VERR_PDM_NO_ATTACHED_DRIVER
+ || rc == VERR_PDM_CFG_MISSING_DRIVER_NAME)
+ {
+ /* No error! */
+ E1kLog(("%s This adapter is not attached to any network!\n", pThis->szPrf));
+ }
+ else
+ return PDMDEV_SET_ERROR(pDevIns, rc, N_("Failed to attach the network LUN"));
+
/* Initialize the EEPROM. */
pThis->eeprom.init(pThis->macConfigured);
@@ -7670,28 +7706,6 @@
return PDMDEV_SET_ERROR(pDevIns, rc, N_("Failed to attach the status LUN"));
pThis->pLedsConnector = PDMIBASE_QUERY_INTERFACE(pBase, PDMILEDCONNECTORS);
- /* Network driver */
- rc = PDMDevHlpDriverAttach(pDevIns, 0, &pThis->IBase, &pThis->pDrvBase, "Network Port");
- if (RT_SUCCESS(rc))
- {
- if (rc == VINF_NAT_DNS)
- PDMDevHlpVMSetRuntimeError(pDevIns, 0 /*fFlags*/, "NoDNSforNAT",
- N_("A Domain Name Server (DNS) for NAT networking could not be determined. Ensure that your host is correctly connected to an ISP. If you ignore this warning the guest will not be able to perform nameserver lookups and it will probably observe delays if trying so"));
- pThis->pDrvR3 = PDMIBASE_QUERY_INTERFACE(pThis->pDrvBase, PDMINETWORKUP);
- AssertMsgReturn(pThis->pDrvR3, ("Failed to obtain the PDMINETWORKUP interface!\n"), VERR_PDM_MISSING_INTERFACE_BELOW);
-
- pThis->pDrvR0 = PDMIBASER0_QUERY_INTERFACE(PDMIBASE_QUERY_INTERFACE(pThis->pDrvBase, PDMIBASER0), PDMINETWORKUP);
- pThis->pDrvRC = PDMIBASERC_QUERY_INTERFACE(PDMIBASE_QUERY_INTERFACE(pThis->pDrvBase, PDMIBASERC), PDMINETWORKUP);
- }
- else if ( rc == VERR_PDM_NO_ATTACHED_DRIVER
- || rc == VERR_PDM_CFG_MISSING_DRIVER_NAME)
- {
- /* No error! */
- E1kLog(("%s This adapter is not attached to any network!\n", pThis->szPrf));
- }
- else
- return PDMDEV_SET_ERROR(pDevIns, rc, N_("Failed to attach the network LUN"));
-
rc = RTSemEventCreate(&pThis->hEventMoreRxDescAvail);
if (RT_FAILURE(rc))
return rc;

View File

@ -0,0 +1,13 @@
+++ src/app/virtualbox/src/VBox/VMM/VMMR3/PDMDriver.cpp
@@ -1550,7 +1550,11 @@
LogFlow(("pdmR3DrvHlp_AsyncCompletionTemplateCreate: caller='%s'/%d: ppTemplate=%p pfnCompleted=%p pszDesc=%p:{%s}\n",
pDrvIns->pReg->szName, pDrvIns->iInstance, ppTemplate, pfnCompleted, pszDesc, pszDesc));
+#ifdef VBOX_WITH_PDM_ASYNC_COMPLETION
int rc = pdmR3AsyncCompletionTemplateCreateDriver(pDrvIns->Internal.s.pVMR3, pDrvIns, ppTemplate, pfnCompleted, pvTemplateUser, pszDesc);
+#else
+ int rc = VERR_NOT_IMPLEMENTED;
+#endif
LogFlow(("pdmR3DrvHlp_AsyncCompletionTemplateCreate: caller='%s'/%d: returns %Rrc *ppThread=%p\n", pDrvIns->pReg->szName,
pDrvIns->iInstance, rc, *ppTemplate));

View File

@ -0,0 +1,128 @@
+++ src/app/virtualbox/include/VBox/com/array.h
@@ -219,10 +219,10 @@
protected:
/** Initializes memory for aElem. */
- static void Init(T &aElem) { aElem = 0; }
+ static void Init(T &aElem) { /*aElem = 0; */ }
/** Initializes memory occupied by aElem. */
- static void Uninit(T &aElem) { aElem = 0; }
+ static void Uninit(T &aElem) { /* aElem = 0; */ }
/** Creates a deep copy of aFrom and stores it in aTo. */
static void Copy(const T &aFrom, T &aTo) { aTo = aFrom; }
+++ src/app/virtualbox/include/VBox/com/ErrorInfo.h
@@ -31,8 +31,8 @@
#include "VBox/com/Guid.h"
#include "VBox/com/assert.h"
-struct IProgress;
-struct IVirtualBoxErrorInfo;
+//struct IProgress;
+//struct IVirtualBoxErrorInfo;
namespace com
{
+++ src/app/virtualbox/include/VBox/com/string.h
@@ -109,11 +109,13 @@
}
#if defined(VBOX_WITH_XPCOM)
+/*
Bstr(const wchar_t *that)
{
AssertCompile(sizeof(wchar_t) == sizeof(OLECHAR));
copyFrom((const OLECHAR *)that);
}
+*/
#endif
Bstr(const RTCString &that)
@@ -151,12 +153,14 @@
}
#if defined(VBOX_WITH_XPCOM)
+/*
Bstr& operator=(const wchar_t *that)
{
cleanup();
copyFrom((const OLECHAR *)that);
return *this;
}
+*/
#endif
Bstr& setNull()
@@ -247,7 +251,7 @@
* returns a pointer to a global variable containing an empty BSTR with a proper zero
* length prefix so that Windows is happy.
*/
- CBSTR raw() const
+ BSTR raw() const
{
if (m_bstr)
return m_bstr;
+++ src/app/virtualbox/include/VBox/vmm/hm_vmx.h
@@ -1859,10 +1859,10 @@
".byte 0xF3, 0x0F, 0xC7, 0x34, 0x24 # VMXON [esp] \n\t"
"ja 2f \n\t"
"je 1f \n\t"
- "movl $"RT_XSTR(VERR_VMX_INVALID_VMXON_PTR)", %0 \n\t"
+ "movl $" RT_XSTR(VERR_VMX_INVALID_VMXON_PTR)", %0 \n\t"
"jmp 2f \n\t"
"1: \n\t"
- "movl $"RT_XSTR(VERR_VMX_VMXON_FAILED)", %0 \n\t"
+ "movl $" RT_XSTR(VERR_VMX_VMXON_FAILED)", %0 \n\t"
"2: \n\t"
"add $8, %%esp \n\t"
:"=rm"(rc)
@@ -1952,7 +1952,7 @@
"push %2 \n\t"
".byte 0x66, 0x0F, 0xC7, 0x34, 0x24 # VMCLEAR [esp] \n\t"
"jnc 1f \n\t"
- "movl $"RT_XSTR(VERR_VMX_INVALID_VMCS_PTR)", %0 \n\t"
+ "movl $" RT_XSTR(VERR_VMX_INVALID_VMCS_PTR)", %0 \n\t"
"1: \n\t"
"add $8, %%esp \n\t"
:"=rm"(rc)
@@ -2009,7 +2009,7 @@
"push %2 \n\t"
".byte 0x0F, 0xC7, 0x34, 0x24 # VMPTRLD [esp] \n\t"
"jnc 1f \n\t"
- "movl $"RT_XSTR(VERR_VMX_INVALID_VMCS_PTR)", %0 \n\t"
+ "movl $" RT_XSTR(VERR_VMX_INVALID_VMCS_PTR)", %0 \n\t"
"1: \n\t"
"add $8, %%esp \n\t"
:"=rm"(rc)
@@ -2079,10 +2079,10 @@
".byte 0x0F, 0x79, 0xC2 # VMWRITE eax, edx \n\t"
"ja 2f \n\t"
"je 1f \n\t"
- "movl $"RT_XSTR(VERR_VMX_INVALID_VMCS_PTR)", %0 \n\t"
+ "movl $" RT_XSTR(VERR_VMX_INVALID_VMCS_PTR)", %0 \n\t"
"jmp 2f \n\t"
"1: \n\t"
- "movl $"RT_XSTR(VERR_VMX_INVALID_VMCS_FIELD)", %0 \n\t"
+ "movl $" RT_XSTR(VERR_VMX_INVALID_VMCS_FIELD)", %0 \n\t"
"2: \n\t"
:"=rm"(rc)
:"0"(VINF_SUCCESS),
@@ -2207,14 +2207,14 @@
# if RT_INLINE_ASM_GNU_STYLE
int rc = VINF_SUCCESS;
__asm__ __volatile__ (
- "movl $"RT_XSTR(VINF_SUCCESS)", %0 \n\t"
+ "movl $" RT_XSTR(VINF_SUCCESS)", %0 \n\t"
".byte 0x0F, 0x78, 0xc2 # VMREAD eax, edx \n\t"
"ja 2f \n\t"
"je 1f \n\t"
- "movl $"RT_XSTR(VERR_VMX_INVALID_VMCS_PTR)", %0 \n\t"
+ "movl $" RT_XSTR(VERR_VMX_INVALID_VMCS_PTR)", %0 \n\t"
"jmp 2f \n\t"
"1: \n\t"
- "movl $"RT_XSTR(VERR_VMX_INVALID_VMCS_FIELD)", %0 \n\t"
+ "movl $" RT_XSTR(VERR_VMX_INVALID_VMCS_FIELD)", %0 \n\t"
"2: \n\t"
:"=&r"(rc),
"=d"(*pData)

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,49 @@
+++ src/app/virtualbox/src/VBox/Devices/VMMDev/VMMDev.cpp
@@ -2179,6 +2179,10 @@
("%u\n", pReq->header.size), VERR_INVALID_PARAMETER);
pReq->fEnabled = false;
+
+ if (!pThis || !pThis->pDrv || !pThis->pDrv->pfnIsPageFusionEnabled)
+ return VINF_SUCCESS;
+
int rc = pThis->pDrv->pfnIsPageFusionEnabled(pThis->pDrv, &pReq->fEnabled);
if (RT_FAILURE(rc))
pReq->fEnabled = false;
@@ -2404,7 +2408,6 @@
pReqHdr->rc = vmmdevReqHandler_HGCMCall(pThis, pReqHdr, GCPhysReqHdr);
*pfDelayedUnlock = true;
break;
-#endif /* VBOX_WITH_HGCM */
case VMMDevReq_HGCMCancel:
pReqHdr->rc = vmmdevReqHandler_HGCMCancel(pThis, pReqHdr, GCPhysReqHdr);
@@ -2414,6 +2417,7 @@
case VMMDevReq_HGCMCancel2:
pReqHdr->rc = vmmdevReqHandler_HGCMCancel2(pThis, pReqHdr);
break;
+#endif /* VBOX_WITH_HGCM */
case VMMDevReq_VideoAccelEnable:
pReqHdr->rc = vmmdevReqHandler_VideoAccelEnable(pThis, pReqHdr);
@@ -3595,8 +3599,10 @@
/* disabled statistics updating */
pThis->u32LastStatIntervalSize = 0;
+#ifdef VBOX_WITH_HGCM
/* Clear the "HGCM event enabled" flag so the event can be automatically reenabled. */
pThis->u32HGCMEnabled = 0;
+#endif
/*
* Clear the event variables.
+++ src/app/virtualbox/src/VBox/Devices/VMMDev/VMMDevHGCM.cpp
@@ -19,7 +19,7 @@
/*******************************************************************************
* Header Files *
*******************************************************************************/
-#define LOG_GROUP LOG_GROUP_DEV_VMM
+#define LOG_GROUP LOG_GROUP_HGCM
#include <iprt/alloc.h>
#include <iprt/asm.h>
#include <iprt/assert.h>

View File

@ -49,8 +49,7 @@ int PDMR3LdrGetSymbolRCLazy(PVM pVM, const char *pszModule,
static void R0SymbolDummy()
{
PDBG("unexpected call of R0 symbol");
for (;;);
Assert(!"unexpected call of R0 symbol");
}
@ -73,6 +72,7 @@ int PDMR3LdrGetSymbolR0Lazy(PVM pVM, const char *pszModule,
extern "C" int VBoxDriversRegister(PCPDMDRVREGCB, uint32_t);
extern "C" int VBoxDevicesRegister(PPDMDEVREGCB, uint32_t);
extern "C" int VBoxDriversRegister_Main(PCPDMDRVREGCB, uint32_t);
static int dummy_VBoxDriversRegister(PCPDMDRVREGCB, uint32_t) { return VINF_SUCCESS; }
@ -95,13 +95,11 @@ int PDMR3LdrGetSymbolR3(PVM pVM, const char *pszModule, const char *pszSymbol,
if (Genode::strcmp(pszSymbol, "VBoxDriversRegister") == 0) {
*ppvValue = (void *)VBoxDriversRegister;
PDBG("return VBoxDriversRegister pointer");
return VINF_SUCCESS;
}
if (Genode::strcmp(pszSymbol, "VBoxDevicesRegister") == 0) {
*ppvValue = (void *)VBoxDevicesRegister;
PDBG("return VBoxDevicesRegister pointer");
return VINF_SUCCESS;
}
}
@ -119,7 +117,14 @@ int PDMR3LdrGetSymbolR3(PVM pVM, const char *pszModule, const char *pszSymbol,
}
}
PDBG("pszModule=%s pszSymbol=%s", pszModule, pszSymbol);
if (Genode::strcmp(pszModule, "VBoxC") == 0) {
if (Genode::strcmp(pszSymbol, "VBoxDriversRegister") == 0) {
*ppvValue = (void *)VBoxDriversRegister_Main;
return VINF_SUCCESS;
}
}
PERR("pszModule=%s pszSymbol=%s", pszModule, pszSymbol);
return VERR_SYMBOL_NOT_FOUND;
}

View File

@ -19,6 +19,8 @@
/* VirtualBox includes */
#include "PGMInternal.h" /* enable access to pgm.s.* */
#include "EMInternal.h"
#include <VBox/vmm/mm.h>
#include <VBox/vmm/vm.h>
#include <VBox/vmm/pgm.h>
@ -33,7 +35,7 @@
using Genode::Ram_session;
using Genode::Rm_session;
static bool debug = false;
static bool verbose = false;
static bool verbose_debug = false;
Vmm_memory *vmm_memory()
@ -56,18 +58,17 @@ static DECLCALLBACK(int) romwritehandler(PVM pVM, RTGCPHYS GCPhys,
PGMACCESSTYPE enmAccessType,
void *pvUser)
{
while (1) {
Assert(!"Somebody tries to write to ROM");
}
return 0;
Assert(!"Somebody tries to write to ROM");
return -1;
}
int PGMR3PhysRomRegister(PVM pVM, PPDMDEVINS pDevIns, RTGCPHYS GCPhys,
RTGCPHYS cb, const void *pvBinary, uint32_t cbBinary,
uint32_t fFlags, const char *pszDesc)
{
PLOG("PGMR3PhysRomRegister: GCPhys=0x%llx cb=0x%llx pvBinary=0x%p - '%s'",
GCPhys, cb, pvBinary, pszDesc);
if (verbose)
PLOG("%s: GCPhys=0x%llx cb=0x%llx pvBinary=0x%p - '%s'", __func__,
(Genode::uint64_t)GCPhys, (Genode::uint64_t)cb, pvBinary, pszDesc);
try {
RTGCPHYS GCPhysLast = GCPhys + (cb - 1);
@ -109,11 +110,29 @@ int PGMR3PhysRomRegister(PVM pVM, PPDMDEVINS pDevIns, RTGCPHYS GCPhys,
}
static int pgmR3PhysWriteExternalEMT(PVM pVM, PRTGCPHYS pGCPhys,
const void *pvBuf, size_t cbWrite)
{
VM_ASSERT_EMT(pVM);
return PGMPhysWrite(pVM, *pGCPhys, pvBuf, cbWrite);
}
int PGMPhysWrite(PVM pVM, RTGCPHYS GCPhys, const void *pvBuf, size_t cbWrite)
{
VM_ASSERT_EMT(pVM);
void *pv = guest_memory()->lookup(GCPhys, cbWrite);
if (verbose_debug)
PDBG("%s: GCPhys=0x%llx pvBuf=0x%p cb=0x%zx pv=%p", __func__,
(Genode::uint64_t)GCPhys, pvBuf, cbWrite, pv);
if (pv) {
void * pvx = vmm_memory()->lookup(GCPhys, cbWrite);
Assert(!pvx);
memcpy(pv, pvBuf, cbWrite);
return VINF_SUCCESS;
}
@ -124,8 +143,8 @@ int PGMPhysWrite(PVM pVM, RTGCPHYS GCPhys, const void *pvBuf, size_t cbWrite)
pv = vmm_memory()->lookup(GCPhys, cbWrite, &pfnHandlerR3, &pvUserR3);
if (!pv || !pfnHandlerR3 || !pvUserR3) {
PERR("PGMPhysWrite skipped: GCPhys=0x%lx pvBuf=0x%p cbWrite=0x%zx",
GCPhys, pvBuf, cbWrite);
PERR("%s skipped: GCPhys=0x%llx pvBuf=0x%p cbWrite=0x%zx", __func__,
(Genode::uint64_t)GCPhys, pvBuf, cbWrite);
return VERR_GENERAL_FAILURE;
}
@ -145,21 +164,27 @@ int PGMPhysWrite(PVM pVM, RTGCPHYS GCPhys, const void *pvBuf, size_t cbWrite)
int PGMR3PhysWriteExternal(PVM pVM, RTGCPHYS GCPhys, const void *pvBuf,
size_t cbWrite, const char *pszWho)
{
// PDBG("GCPhys=0x%llx pvBuf=0x%p cbWrite=0x%zx - '%s'",
// GCPhys, pvBuf, cbWrite, pszWho);
VM_ASSERT_OTHER_THREAD(pVM);
return PGMPhysWrite(pVM, GCPhys, pvBuf, cbWrite);
return VMR3ReqPriorityCallWait(pVM, VMCPUID_ANY,
(PFNRT)pgmR3PhysWriteExternalEMT, 4,
pVM, &GCPhys, pvBuf, cbWrite);
}
int PGMPhysRead(PVM pVM, RTGCPHYS GCPhys, void *pvBuf, size_t cbRead)
{
VM_ASSERT_EMT(pVM);
void *pv = guest_memory()->lookup(GCPhys, cbRead);
// PLOG("PGMPhysRead: GCPhys=0x%x pvBuf=0x%p cbRead=0x%zx pv=%p",
// GCPhys, pvBuf, cbRead, pv);
if (verbose_debug)
PDBG("%s: GCPhys=0x%llx pvBuf=0x%p cbRead=0x%zx pv=%p", __func__,
(Genode::uint64_t)GCPhys, pvBuf, cbRead, pv);
if (pv) {
void * pvx = vmm_memory()->lookup(GCPhys, cbRead);
Assert(!pvx);
memcpy(pvBuf, pv, cbRead);
return VINF_SUCCESS;
}
@ -169,8 +194,8 @@ int PGMPhysRead(PVM pVM, RTGCPHYS GCPhys, void *pvBuf, size_t cbRead)
pv = vmm_memory()->lookup(GCPhys, cbRead, &pfnHandlerR3, &pvUserR3);
if (!pv || !pfnHandlerR3 || !pvUserR3) {
PERR("PGMPhysRead skipped: GCPhys=0x%lx pvBuf=0x%p cbRead=0x%zx",
GCPhys, pvBuf, cbRead);
PERR("PGMPhysRead skipped: GCPhys=0x%llx pvBuf=0x%p cbRead=0x%zx",
(Genode::uint64_t)GCPhys, pvBuf, cbRead);
return VERR_GENERAL_FAILURE;
}
@ -179,14 +204,23 @@ int PGMPhysRead(PVM pVM, RTGCPHYS GCPhys, void *pvBuf, size_t cbRead)
}
static int pgmR3PhysReadExternalEMT(PVM pVM, PRTGCPHYS pGCPhys, void *pvBuf,
size_t cbRead)
{
VM_ASSERT_EMT(pVM);
PGMPhysRead(pVM, *pGCPhys, pvBuf, cbRead);
return VINF_SUCCESS;
}
int PGMR3PhysReadExternal(PVM pVM, RTGCPHYS GCPhys, void *pvBuf, size_t cbRead)
{
void *pv = guest_memory()->lookup(GCPhys, cbRead);
VM_ASSERT_OTHER_THREAD(pVM);
// PLOG("PGMPhysReadExternal: GCPhys=0x%x pvBuf=0x%p cbRead=0x%zx pv=%p",
// GCPhys, pvBuf, cbRead, pv);
return PGMPhysRead(pVM, GCPhys, pvBuf, cbRead);
return VMR3ReqPriorityCallWait(pVM, VMCPUID_ANY,
(PFNRT)pgmR3PhysReadExternalEMT, 4,
pVM, &GCPhys, pvBuf, cbRead);
}
@ -196,25 +230,34 @@ int PGMR3PhysMMIO2Register(PVM pVM, PPDMDEVINS pDevIns, uint32_t iRegion,
{
*ppv = vmm_memory()->alloc((size_t)cb, pDevIns, iRegion);
PLOG("PGMR3PhysMMIO2Register: pszDesc=%s iRegion=%u cb=0x%zx -> 0x%p",
pszDesc, iRegion, (size_t)cb, *ppv);
if (verbose)
PLOG("PGMR3PhysMMIO2Register: pszDesc=%s iRegion=%u cb=0x%zx -> 0x%p",
pszDesc, iRegion, (size_t)cb, *ppv);
return VINF_SUCCESS;
}
int PGMR3PhysMMIO2Deregister(PVM pVM, PPDMDEVINS pDevIns, uint32_t iRegion)
{
PERR("%s: pDevIns %p iRegion=%x", __func__, pDevIns, iRegion);
return VINF_SUCCESS;
}
int PGMR3PhysMMIO2Map(PVM pVM, PPDMDEVINS pDevIns, uint32_t iRegion,
RTGCPHYS GCPhys)
{
size_t cb = vmm_memory()->map_to_vm(pDevIns, GCPhys, iRegion);
if (cb == 0) {
PERR("PGMR3PhysMMIO2Map: lookup for pDevIns=%p iRegion=%u failed\n",
PERR("%s: lookup for pDevIns=%p iRegion=%u failed\n", __func__,
pDevIns, iRegion);
for (;;);
Assert(cb);
}
PLOG("PGMR3PhysMMIO2Map: pDevIns=%p iRegion=%u cb=0x%zx GCPhys=0x%lx\n",
pDevIns, iRegion, cb, (long)GCPhys);
if (verbose)
PLOG("%s: pDevIns=%p iRegion=%u cb=0x%zx GCPhys=0x%llx\n", __func__,
pDevIns, iRegion, cb, (Genode::uint64_t)GCPhys);
#ifdef VBOX_WITH_REM
REMR3NotifyPhysRamRegister(pVM, GCPhys, cb, REM_NOTIFY_PHYS_RAM_FLAGS_MMIO2);
@ -227,19 +270,22 @@ int PGMR3PhysMMIO2Map(PVM pVM, PPDMDEVINS pDevIns, uint32_t iRegion,
int PGMR3PhysMMIO2Unmap(PVM pVM, PPDMDEVINS pDevIns, uint32_t iRegion,
RTGCPHYS GCPhys)
{
if (debug)
PDBG("called phys=%llx iRegion=0x%x", GCPhys, iRegion);
if (verbose_debug)
PDBG("called phys=%llx iRegion=0x%x", (Genode::uint64_t)GCPhys,
iRegion);
RTGCPHYS GCPhysStart = GCPhys;
size_t size = 1;
bool io = vmm_memory()->lookup_range(GCPhysStart, size);
Assert(io);
Assert(GCPhysStart == GCPhys);
bool INVALIDATE = true;
bool ok = vmm_memory()->unmap_from_vm(GCPhys, size, INVALIDATE);
Assert(ok);
#ifdef VBOX_WITH_REM
#if 0 /* XXX */
if (fInformREM)
REMR3NotifyPhysRamDeregister(pVM, GCPhysRangeREM, cbRangeREM);
#endif
REMR3NotifyPhysRamDeregister(pVM, GCPhysStart, size);
#endif
return VINF_SUCCESS;
}
@ -248,8 +294,8 @@ int PGMR3PhysMMIO2Unmap(PVM pVM, PPDMDEVINS pDevIns, uint32_t iRegion,
bool PGMR3PhysMMIO2IsBase(PVM pVM, PPDMDEVINS pDevIns, RTGCPHYS GCPhys)
{
bool res = vmm_memory()->lookup(GCPhys, 1);
if (debug)
PDBG("called phys=%llx res=%u", GCPhys, res);
if (verbose_debug)
PDBG("called phys=%llx res=%u", (Genode::uint64_t)GCPhys, res);
return res;
}
@ -263,9 +309,10 @@ int PGMR3HandlerPhysicalRegister(PVM pVM, PGMPHYSHANDLERTYPE enmType,
const char *pszHandlerRC,
RTRCPTR pvUserRC, const char *pszDesc)
{
PLOG("PGMR3HandlerPhysicalRegister: GCPhys=0x%llx-%llx r3=0x%p "
"enmType=%x - '%s'\n",
GCPhys, GCPhysLast, pfnHandlerR3, enmType, pszDesc);
if (verbose)
PLOG("%s: GCPhys=0x%llx-%llx r3=0x%p enmType=%x - '%s'\n", __func__,
(Genode::uint64_t)GCPhys, (Genode::uint64_t)GCPhysLast,
pfnHandlerR3, enmType, pszDesc);
bool ok = vmm_memory()->add_handler(GCPhys, GCPhysLast - GCPhys + 1,
pfnHandlerR3, pvUserR3, enmType);
@ -286,13 +333,13 @@ int PGMHandlerPhysicalDeregister(PVM pVM, RTGCPHYS GCPhys)
#ifdef VBOX_WITH_REM
PFNPGMR3PHYSHANDLER pfnHandlerR3 = 0;
PGMPHYSHANDLERTYPE enmType;
PGMPHYSHANDLERTYPE enmType = PGMPHYSHANDLERTYPE_MMIO;
void * pv = vmm_memory()->lookup(GCPhys, size, &pfnHandlerR3, 0, &enmType);
Assert(pv);
if (debug)
PDBG("called phys=%llx enmType=%x", GCPhys, enmType);
if (verbose_debug)
PDBG("called phys=%llx enmType=%x", (Genode::uint64_t)GCPhys, enmType);
#endif
@ -318,8 +365,9 @@ int PGMHandlerPhysicalDeregister(PVM pVM, RTGCPHYS GCPhys)
int PGMR3PhysRegisterRam(PVM pVM, RTGCPHYS GCPhys, RTGCPHYS cb,
const char *pszDesc)
{
PLOG("PGMR3PhysRegisterRam: GCPhys=0x%lx, cb=0x%zx, pszDesc=%s",
(long)GCPhys, (size_t)cb, pszDesc);
if (verbose)
PLOG("PGMR3PhysRegisterRam: GCPhys=0x%llx, cb=0x%llx, pszDesc=%s",
(Genode::uint64_t)GCPhys, (Genode::uint64_t)cb, pszDesc);
try {
@ -334,7 +382,9 @@ int PGMR3PhysRegisterRam(PVM pVM, RTGCPHYS GCPhys, RTGCPHYS cb,
guest_memory()->add_ram_mapping(GCPhys, cb, pv);
#ifdef VBOX_WITH_REM
REMR3NotifyPhysRamRegister(pVM, GCPhys, cb, REM_NOTIFY_PHYS_RAM_FLAGS_RAM);
#endif
}
catch (Guest_memory::Region_conflict) {
return VERR_PGM_MAPPING_CONFLICT; }
@ -349,8 +399,10 @@ int PGMR3PhysRegisterRam(PVM pVM, RTGCPHYS GCPhys, RTGCPHYS cb,
int PGMMapSetPage(PVM pVM, RTGCPTR GCPtr, uint64_t cb, uint64_t fFlags)
{
PLOG("PGMMapSetPage: GCPtr=0x%llx cb=0x%llx, flags=0x%llx",
GCPtr, cb, fFlags);
if (verbose)
PLOG("%s: GCPtr=0x%llx cb=0x%llx, flags=0x%llx", __func__,
(Genode::uint64_t)GCPtr, (Genode::uint64_t)cb,
(Genode::uint64_t)fFlags);
return VINF_SUCCESS;
}
@ -378,6 +430,18 @@ int PGMR3Init(PVM pVM)
pVCpu->pgm.s.GCPhysA20Mask = ~((RTGCPHYS)!pVCpu->pgm.s.fA20Enabled << 20);
}
int rc = PDMR3CritSectInit(pVM, &pVM->pgm.s.CritSectX, RT_SRC_POS, "PGM");
AssertRCReturn(rc, rc);
return VINF_SUCCESS;
}
int PGMR3Term(PVM pVM)
{
if (verbose)
PDBG("called");
return VINF_SUCCESS;
}
@ -388,7 +452,7 @@ int PGMPhysGCPtr2CCPtrReadOnly(PVMCPU pVCpu, RTGCPTR GCPtr, void const **ppv,
PERR("%s not implemented - caller 0x%p",
__func__, __builtin_return_address(0));
while (1) { asm volatile ("ud2a"); }
Assert(!"not implemented");
return VERR_GENERAL_FAILURE;
}
@ -407,22 +471,22 @@ int PGMR3PhysTlbGCPhys2Ptr(PVM pVM, RTGCPHYS GCPhys, bool fWritable, void **ppv)
pv = guest_memory()->lookup(GCPhys, size);
if (!pv) {
PERR("%s: lookup for GCPhys=0x%llx failed", __func__, GCPhys);
PERR("%s: lookup for GCPhys=0x%llx failed", __func__,
(Genode::uint64_t)GCPhys);
return VERR_PGM_PHYS_TLB_UNASSIGNED;
}
*ppv = pv;
if (verbose_debug)
PDBG("%llx %u -> 0x%p", GCPhys, fWritable, pv);
PDBG("%s: %llx %u -> 0x%p", __func__,
(Genode::uint64_t)GCPhys, fWritable, pv);
return VINF_SUCCESS;
}
/* pv valid - check handlers next */
if (!pfnHandlerR3 && !pvUserR3) {
PERR("%s: %llx %u -> 0x%p no handlers", __func__, GCPhys, fWritable, pv);
*ppv = pv;
return VINF_SUCCESS;
}
@ -431,7 +495,8 @@ int PGMR3PhysTlbGCPhys2Ptr(PVM pVM, RTGCPHYS GCPhys, bool fWritable, void **ppv)
*ppv = pv;
return VINF_PGM_PHYS_TLB_CATCH_WRITE;
}
PERR("%s: denied access - handlers set - GCPhys=0x%llx %p %p %x", __func__, GCPhys, pfnHandlerR3, pvUserR3, enmType);
PERR("%s: denied access - handlers set - GCPhys=0x%llx %p %p %x", __func__,
(Genode::uint64_t)GCPhys, pfnHandlerR3, pvUserR3, enmType);
return VERR_PGM_PHYS_TLB_CATCH_ALL;
}
@ -458,12 +523,21 @@ bool PGMPhysIsA20Enabled(PVMCPU pVCpu)
void PGMR3PhysWriteU8(PVM pVM, RTGCPHYS GCPhys, uint8_t value)
{
VM_ASSERT_EMT(pVM);
void *pv = guest_memory()->lookup(GCPhys, sizeof(value));
if (verbose_debug)
PDBG("%s: GCPhys=0x%llx cb=0x%zx pv=%p", __func__,
(Genode::uint64_t)GCPhys, sizeof(value), pv);
if (!pv) {
PERR("%s: invalid write attempt phy=%llx", __func__, GCPhys);
PERR("%s: invalid write attempt phy=%llx", __func__,
(Genode::uint64_t)GCPhys);
return;
}
void * pvx = vmm_memory()->lookup(GCPhys, sizeof(value));
Assert(!pvx);
*reinterpret_cast<uint8_t *>(pv) = value;
}
@ -471,12 +545,21 @@ void PGMR3PhysWriteU8(PVM pVM, RTGCPHYS GCPhys, uint8_t value)
void PGMR3PhysWriteU16(PVM pVM, RTGCPHYS GCPhys, uint16_t value)
{
VM_ASSERT_EMT(pVM);
void *pv = guest_memory()->lookup(GCPhys, sizeof(value));
if (verbose_debug)
PDBG("%s: GCPhys=0x%llx cb=0x%zx pv=%p",
__func__, (Genode::uint64_t)GCPhys, sizeof(value), pv);
if (!pv) {
PERR("%s: invalid write attempt phy=%llx", __func__, GCPhys);
PERR("%s: invalid write attempt phy=%llx", __func__,
(Genode::uint64_t)GCPhys);
return;
}
void * pvx = vmm_memory()->lookup(GCPhys, sizeof(value));
Assert(!pvx);
*reinterpret_cast<uint16_t *>(pv) = value;
}
@ -486,10 +569,17 @@ void PGMR3PhysWriteU32(PVM pVM, RTGCPHYS GCPhys, uint32_t value)
{
void *pv = guest_memory()->lookup(GCPhys, sizeof(value));
if (verbose_debug)
PDBG("%s: GCPhys=0x%llx cb=0x%zx pv=%p",
__func__, (Genode::uint64_t)GCPhys, sizeof(value), pv);
if (!pv) {
PERR("%s: invalid write attempt phy=%llx", __func__, GCPhys);
PERR("%s: invalid write attempt phy=%llx", __func__,
(Genode::uint64_t)GCPhys);
return;
}
void * pvx = vmm_memory()->lookup(GCPhys, sizeof(value));
Assert(!pvx);
*reinterpret_cast<uint32_t *>(pv) = value;
}
@ -499,11 +589,19 @@ uint32_t PGMR3PhysReadU32(PVM pVM, RTGCPHYS GCPhys)
{
void *pv = guest_memory()->lookup(GCPhys, 4);
if (verbose_debug)
PDBG("%s: GCPhys=0x%llx cb=0x%x pv=%p",
__func__, (Genode::uint64_t)GCPhys, 4, pv);
if (!pv) {
PERR("%s: invalid read attempt phys=%llx", __func__, GCPhys);
PERR("%s: invalid read attempt phys=%llx", __func__,
(Genode::uint64_t)GCPhys);
return 0;
}
void * pvx = vmm_memory()->lookup(GCPhys, 4);
Assert(!pvx);
return *reinterpret_cast<uint32_t *>(pv);
}
@ -513,8 +611,13 @@ int PGMPhysGCPhys2CCPtrReadOnly(PVM pVM, RTGCPHYS GCPhys, void const **ppv,
{
void *pv = guest_memory()->lookup(GCPhys, 0x1000);
if (verbose_debug)
PDBG("%s: GCPhys=0x%llx cb=0x%d pv=%p",
__func__, (Genode::uint64_t)GCPhys, 0x1000, pv);
if (!pv) {
PERR("unknown address pv=%p ppv=%p GCPhys=%llx", pv, ppv, GCPhys);
PERR("unknown address pv=%p ppv=%p GCPhys=%llx", pv, ppv,
(Genode::uint64_t)GCPhys);
guest_memory()->dump();
@ -523,8 +626,6 @@ int PGMPhysGCPhys2CCPtrReadOnly(PVM pVM, RTGCPHYS GCPhys, void const **ppv,
*ppv = pv;
PVMCPU pVCpu = VMMGetCpu(pVM);
return VINF_SUCCESS;
}
@ -533,7 +634,8 @@ int PGMHandlerPhysicalReset(PVM, RTGCPHYS GCPhys)
{
size_t size = 1;
if (!vmm_memory()->unmap_from_vm(GCPhys, size))
PWRN("%s: unbacked region - GCPhys %llx", __func__, GCPhys);
PWRN("%s: unbacked region - GCPhys %llx", __func__,
(Genode::uint64_t)GCPhys);
return VINF_SUCCESS;
}
@ -560,6 +662,8 @@ extern "C" int MMIO2_MAPPED_SYNC(PVM pVM, RTGCPHYS GCPhys, size_t cbWrite,
if (!pfnHandlerR3 && !pvUserR3) {
*ppv = pv;
// Vmm::printf("------------------ %s: GCPhys=0x%llx vmm local %p io mem map - no handlers\n", __func__, GCPhys, pv);
// return VERR_PGM_PHYS_TLB_UNASSIGNED;
/* you may map it */
return VINF_SUCCESS;
}
@ -574,8 +678,8 @@ extern "C" int MMIO2_MAPPED_SYNC(PVM pVM, RTGCPHYS GCPhys, size_t cbWrite,
return VINF_SUCCESS;
}
Vmm::printf("%s: GCPhys=0x%lx failed - unexpected rc=%d\n",
__func__, GCPhys, rc);
Vmm::printf("%s: GCPhys=0x%llx failed - unexpected rc=%d\n",
__func__, (Genode::uint64_t)GCPhys, rc);
return rc;
}
@ -589,9 +693,10 @@ extern "C" int MMIO2_MAPPED_SYNC(PVM pVM, RTGCPHYS GCPhys, size_t cbWrite,
Assert(pv);
fli = Flexpage_iterator((addr_t)pv, map_size, map_start, map_size, map_start);
if (debug)
Vmm::printf("%s: GCPhys=0x%llx - %llx+%zx\n",
__func__, GCPhys, map_start, map_size);
if (verbose_debug)
Vmm::printf("%s: GCPhys=0x%llx - %llx+%zx\n", __func__,
(Genode::uint64_t)GCPhys, (Genode::uint64_t)map_start,
map_size);
*ppv = pv;
@ -627,7 +732,7 @@ void PGMR3Reset(PVM pVM)
#ifdef PGM_WITH_A20
pVCpu->pgm.s.fSyncFlags |= PGM_SYNC_UPDATE_PAGE_BIT_VIRTUAL;
VMCPU_FF_SET(pVCpu, VMCPU_FF_PGM_SYNC_CR3);
HWACCMFlushTLB(pVCpu);
HMFlushTLB(pVCpu);
#endif
}
}
@ -638,9 +743,24 @@ void PGMR3Reset(PVM pVM)
int PGMR3MappingsSize(PVM pVM, uint32_t *pcb)
{
PINF("%s - not implemented - %p", __func__, __builtin_return_address(0));
if (verbose)
PINF("%s - not implemented - %p", __func__,
__builtin_return_address(0));
*pcb = 0;
return 0;
}
void PGMR3MemSetup(PVM pVM, bool fAtReset)
{
if (verbose)
PDBG(" called");
}
VMMDECL(bool) PGMIsLockOwner(PVM pVM)
{
return PDMCritSectIsOwner(&pVM->pgm.s.CritSectX);
}

View File

@ -19,36 +19,49 @@
#include <iprt/initterm.h>
#include <iprt/mem.h>
#include <iprt/err.h>
#include <iprt/assert.h>
#include <iprt/semaphore.h>
#include <iprt/time.h>
#include <internal/iprt.h>
static void *alloc_mem(size_t cb, const char *pszTag, bool executable = false)
{
void * local_addr = nullptr;
using namespace Genode;
try {
Ram_dataspace_capability ds = env()->ram_session()->alloc(cb);
Assert(ds.valid());
size_t const whole_size = 0;
Genode::off_t const offset = 0;
bool const any_addr = false;
void * any_local_addr = nullptr;
local_addr = env()->rm_session()->attach(ds, whole_size, offset,
any_addr, any_local_addr,
executable);
if (!local_addr)
PERR("size=0x%zx, tag=%s -> %p", cb, pszTag, local_addr);
Assert(local_addr);
} catch (...) {
Assert(!"Could not allocate RTMem* memory ");
}
return local_addr;
}
/*
* Called by the recompiler to allocate executable RAM
*/
void *RTMemExecAllocTag(size_t cb, const char *pszTag) RT_NO_THROW
{
PDBG("size=0x%zx, tag=%s", cb, pszTag);
/*
* XXX error handling is missing
*/
using namespace Genode;
Ram_dataspace_capability ds = env()->ram_session()->alloc(cb);
size_t const whole_size = 0;
Genode::off_t const offset = 0;
bool const executable = true;
bool const any_addr = false;
void *local_addr =
env()->rm_session()->attach(ds, whole_size, offset,
any_addr, (void *)0, executable);
return local_addr;
return alloc_mem(cb, pszTag, true);
}
@ -58,17 +71,21 @@ void *RTMemPageAllocZTag(size_t cb, const char *pszTag) RT_NO_THROW
* The RAM dataspace freshly allocated by 'RTMemExecAllocTag' is zeroed
* already.
*/
return RTMemExecAllocTag(cb, pszTag);
return alloc_mem(cb, pszTag);
}
void *RTMemPageAllocTag(size_t cb, const char *pszTag) RT_NO_THROW
{
return RTMemPageAllocZTag(cb, pszTag);
return alloc_mem(cb, pszTag);
}
void RTMemPageFree(void *pv, size_t cb) RT_NO_THROW
{
PERR("%s %p+%zx", __func__, pv, cb);
}
#include <iprt/buildconfig.h>
uint32_t RTBldCfgVersionMajor(void) { return VBOX_VERSION_MAJOR; }

View File

@ -1,9 +0,0 @@
+++ src/app/virtualbox/src/VBox/Frontends/VBoxBFE/VBoxBFE.cpp
@@ -1470,6 +1481,7 @@
rc = CFGMR3InsertNode(pDevices, "mc146818", &pDev); UPDATE_RC();
rc = CFGMR3InsertNode(pDev, "0", &pInst); UPDATE_RC();
rc = CFGMR3InsertNode(pInst, "Config", &pCfg); UPDATE_RC();
+ rc = CFGMR3InsertInteger(pCfg, "UseUTC", 1); /* boolean */ UPDATE_RC();
/*
* Serial ports

View File

@ -1,13 +0,0 @@
+++ src/app/virtualbox/src/VBox/Frontends/VBoxBFE/VBoxBFE.cpp
@@ -1481,6 +1489,11 @@
rc = CFGMR3InsertInteger(pCfg, "IRQ", 4); UPDATE_RC();
rc = CFGMR3InsertInteger(pCfg, "IOBase", 0x3f8); UPDATE_RC();
+/* rc = CFGMR3InsertNode(pInst, "LUN#0", &pLunL0); UPDATE_RC();
+ rc = CFGMR3InsertString(pLunL0, "Driver", "Host Serial"); UPDATE_RC();
+ rc = CFGMR3InsertNode(pLunL0, "Config", &pLunL1); UPDATE_RC();
+ rc = CFGMR3InsertString(pLunL1, "DevicePath", "/dev/terminal"); UPDATE_RC();
+*/
rc = CFGMR3InsertNode(pDev, "1", &pInst); UPDATE_RC();
rc = CFGMR3InsertNode(pInst, "Config", &pCfg); UPDATE_RC();
rc = CFGMR3InsertInteger(pCfg, "IRQ", 3); UPDATE_RC();

View File

@ -1,12 +0,0 @@
+++ src/app/virtualbox/src/VBox/Frontends/VBoxBFE/VBoxBFE.cpp 2014-05-14
@@ -1132,7 +1135,9 @@
parms[1].u.pointer.size = sizeof (SHFLSTRING) + cbString;
parms[2].type = VBOX_HGCM_SVC_PARM_32BIT;
- parms[2].u.uint32 = !g_fShareReadOnly[i];
+ parms[2].u.uint32 = g_fShareReadOnly[i] ? 0 : SHFL_ADD_MAPPING_F_WRITABLE;
+
+ parms[2].u.uint32 |= SHFL_ADD_MAPPING_F_AUTOMOUNT;
rc2 = gVMMDev->hgcmHostCall ("VBoxSharedFolders",
SHFL_FN_ADD_MAPPING, SHFL_CPARMS_ADD_MAPPING, &parms[0]);

View File

@ -20,6 +20,8 @@
#include "sup.h"
/* VirtualBox includes */
#include <iprt/semaphore.h>
#include <iprt/ldr.h>
#include <VBox/err.h>
@ -169,6 +171,9 @@ int SUPR3Init(PSUPDRVSESSION *ppSession)
}
int SUPR3Term(bool) { return VINF_SUCCESS; }
int SUPR3GipGetPhys(PRTHCPHYS pHCPhys)
{
/*
@ -181,6 +186,18 @@ int SUPR3GipGetPhys(PRTHCPHYS pHCPhys)
}
int SUPR3HardenedLdrLoadAppPriv(const char *pszFilename, PRTLDRMOD phLdrMod,
uint32_t fFlags, PRTERRINFO pErrInfo)
{
return RTLdrLoad(pszFilename, phLdrMod);
}
uint32_t SUPSemEventMultiGetResolution(PSUPDRVSESSION)
{
return 100000*10; /* called by 'vmR3HaltGlobal1Init' */
}
int SUPSemEventCreate(PSUPDRVSESSION pSession, PSUPSEMEVENT phEvent)
{
*phEvent = (SUPSEMEVENT)new Genode::Semaphore();
@ -201,7 +218,7 @@ int SUPSemEventSignal(PSUPDRVSESSION pSession, SUPSEMEVENT hEvent)
if (hEvent)
reinterpret_cast<Genode::Semaphore *>(hEvent)->up();
else
PERR("%s called %lx", __FUNCTION__, hEvent);
PERR("%s called - not implemented", __FUNCTION__);
return VINF_SUCCESS;
}
@ -213,7 +230,7 @@ int SUPSemEventWaitNoResume(PSUPDRVSESSION pSession, SUPSEMEVENT hEvent,
if (hEvent && cMillies == RT_INDEFINITE_WAIT)
reinterpret_cast<Genode::Semaphore *>(hEvent)->down();
else {
PERR("%s called %lx millis=%u - not implemented", __FUNCTION__, hEvent, cMillies);
PERR("%s called millis=%u - not implemented", __FUNCTION__, cMillies);
reinterpret_cast<Genode::Semaphore *>(hEvent)->down();
}
@ -221,16 +238,52 @@ int SUPSemEventWaitNoResume(PSUPDRVSESSION pSession, SUPSEMEVENT hEvent,
}
SUPDECL(int) SUPSemEventMultiCreate(PSUPDRVSESSION,
PSUPSEMEVENTMULTI phEventMulti)
{
RTSEMEVENTMULTI sem;
/*
* Input validation.
*/
AssertPtrReturn(phEventMulti, VERR_INVALID_POINTER);
/*
* Create the event semaphore object.
*/
int rc = RTSemEventMultiCreate(&sem);
static_assert(sizeof(sem) == sizeof(*phEventMulti), "oi");
*phEventMulti = reinterpret_cast<SUPSEMEVENTMULTI>(sem);
return rc;
}
SUPDECL(int) SUPSemEventMultiClose(PSUPDRVSESSION, SUPSEMEVENTMULTI hEvMulti)
{
return RTSemEventMultiDestroy(reinterpret_cast<RTSEMEVENTMULTI>(hEvMulti));
}
int SUPR3CallVMMR0(PVMR0 pVMR0, VMCPUID idCpu, unsigned uOperation,
void *pvArg)
{
PDBG("SUPR3CallVMMR0 called uOperation=%d", uOperation);
if (uOperation == VMMR0_DO_CALL_HYPERVISOR) {
PDBG("VMMR0_DO_CALL_HYPERVISOR - doing nothing");
return VINF_SUCCESS;
}
if (uOperation == VMMR0_DO_VMMR0_TERM) {
PDBG("VMMR0_DO_VMMR0_TERM - doing nothing");
return VINF_SUCCESS;
}
if (uOperation == VMMR0_DO_GVMM_DESTROY_VM) {
PDBG("VMMR0_DO_GVMM_DESTROY_VM - doing nothing");
return VINF_SUCCESS;
}
PDBG("SUPR3CallVMMR0Ex: unhandled uOperation %d", uOperation);
for (;;);
AssertMsg(uOperation != VMMR0_DO_VMMR0_TERM &&
uOperation != VMMR0_DO_CALL_HYPERVISOR &&
uOperation != VMMR0_DO_GVMM_DESTROY_VM,
("SUPR3CallVMMR0Ex: unhandled uOperation %d", uOperation));
return VERR_GENERAL_FAILURE;
}

View File

@ -2,18 +2,22 @@ VBOX_CC_OPT += -DVBOX_WITH_HARDENING
include $(REP_DIR)/lib/mk/virtualbox-common.inc
CC_WARN += -Wall
TARGET = virtualbox
SRC_CC = main.cc cxx_dummies.cc devices.cc drivers.cc dummies.cc libc.cc \
SRC_CC = frontend/main.cc frontend/console.cc \
devices.cc drivers.cc dummies.cc libc.cc \
logger.cc mm.cc pdm.cc pgm.cc rt.cc sup.cc iommio.cc ioport.cc \
hwaccm.cc thread.cc dynlib.cc
hm.cc thread.cc dynlib.cc unimpl.cc
LIBS += base
LIBS += config_args
LIBS += stdcxx
LIBS += virtualbox-bios virtualbox-recompiler virtualbox-runtime \
virtualbox-vmm virtualbox-devices virtualbox-drivers \
virtualbox-storage virtualbox-zlib virtualbox-liblzf \
virtualbox-hwaccl virtualbox-dis
virtualbox-hwaccl virtualbox-xml virtualbox-main
LIBS += pthread libc_terminal libc_lock_pipe libiconv
@ -21,26 +25,21 @@ INC_DIR += $(call select_from_repositories,src/lib/libc)
INC_DIR += $(call select_from_repositories,src/lib/pthread)
INC_DIR += $(VBOX_DIR)/Runtime/include
INC_DIR += $(VBOX_DIR)/Frontends/VBoxBFE
# basic frontend
SRC_CC += Frontends/VBoxBFE/DisplayImpl.cpp
SRC_CC += Frontends/VBoxBFE/HGCM.cpp
SRC_CC += Frontends/VBoxBFE/HGCMObjects.cpp
SRC_CC += Frontends/VBoxBFE/HGCMThread.cpp
SRC_CC += Frontends/VBoxBFE/KeyboardImpl.cpp
SRC_CC += Frontends/VBoxBFE/MachineDebuggerImpl.cpp
SRC_CC += Frontends/VBoxBFE/StatusImpl.cpp
SRC_CC += Frontends/VBoxBFE/VBoxBFE.cpp
SRC_CC += Frontends/VBoxBFE/VMMDevInterface.cpp
SRC_CC += HostServices/SharedFolders/service.cpp
SRC_CC += HostServices/SharedFolders/mappings.cpp
SRC_CC += HostServices/SharedFolders/vbsf.cpp
SRC_CC += HostServices/SharedFolders/shflhandle.cpp
SRC_CC += frontend/dummy/errorinfo.cc frontend/dummy/virtualboxbase.cc
SRC_CC += frontend/dummy/autostart.cc frontend/dummy/rest.cc
SRC_CC += frontend/dummy/host.cc
INC_DIR += $(VBOX_DIR)/Main/include
INC_DIR += $(VBOX_DIR)/VMM/include
INC_DIR += $(REP_DIR)/src/virtualbox/frontend
INC_DIR += $(VBOX_DIR)/Main/xml
# search path to 'scan_code_set_2.h'
INC_DIR += $(call select_from_repositories,src/drivers/input/ps2)

View File

@ -45,62 +45,80 @@ static Genode::Cpu_session * get_cpu_session(RTTHREADTYPE type) {
long const prio = (RTTHREADTYPE_END - type) *
(Cpu_session::PRIORITY_LIMIT / RTTHREADTYPE_END);
char * data = new (env()->heap()) char[32];
char * data = new (env()->heap()) char[16];
snprintf(data, 32, "vbox %u", type);
snprintf(data, 16, "vbox %u", type);
con[type - 1] = new (env()->heap()) Cpu_connection(data, prio);
/* upgrade memory of cpu session for frequent used thread type */
if (type == RTTHREADTYPE_IO)
Genode::env()->parent()->upgrade(con[type - 1]->cap(), "ram_quota=4096");
return con[type - 1];
}
extern "C" {
extern "C" int pthread_create(pthread_t *thread, const pthread_attr_t *attr,
void *(*start_routine) (void *), void *arg)
{
PRTTHREADINT rtthread = reinterpret_cast<PRTTHREADINT>(arg);
int pthread_create(pthread_t *thread, const pthread_attr_t *attr,
void *(*start_routine) (void *), void *arg)
{
PRTTHREADINT rtthread = reinterpret_cast<PRTTHREADINT>(arg);
Assert(rtthread);
Assert(rtthread);
size_t stack_size = Genode::Native_config::context_virtual_size() -
sizeof(Genode::Native_utcb) - 2 * (1UL << 12);
size_t stack_size = Genode::Native_config::context_virtual_size() -
sizeof(Genode::Native_utcb) - 2 * (1UL << 12);
if (rtthread->cbStack < stack_size)
stack_size = rtthread->cbStack;
else
PWRN("requested stack for thread '%s' of %zu Bytes is too large, "
"limit to %zu Bytes", rtthread->szName, rtthread->cbStack,
stack_size);
if (rtthread->cbStack < stack_size)
stack_size = rtthread->cbStack;
else
PWRN("requested stack for thread '%s' of %zu Bytes is too large, "
"limit to %zu Bytes", rtthread->szName, rtthread->cbStack,
stack_size);
/* sanity check - emt and vcpu thread have to have same prio class */
if (!Genode::strcmp(rtthread->szName, "EMT"))
Assert(rtthread->enmType == RTTHREADTYPE_EMULATION);
/* sanity check - emt and vcpu thread have to have same prio class */
if (!Genode::strcmp(rtthread->szName, "EMT"))
Assert(rtthread->enmType == RTTHREADTYPE_EMULATION);
if (rtthread->enmType == RTTHREADTYPE_EMULATION) {
Genode::Cpu_session * cpu_session = get_cpu_session(RTTHREADTYPE_EMULATION);
Genode::Affinity::Space cpu_space = cpu_session->affinity_space();
/* Genode::Affinity::Location location = cpu_space.location_of_index(i); */
Genode::Affinity::Location location;
if (create_emt_vcpu(thread, stack_size, attr, start_routine, arg,
cpu_session, location))
return 0;
/* no haredware support, create normal pthread thread */
}
pthread_t thread_obj = new (Genode::env()->heap())
pthread(attr ? *attr : 0, start_routine,
arg, stack_size, rtthread->szName,
get_cpu_session(rtthread->enmType));
if (!thread_obj)
return EAGAIN;
*thread = thread_obj;
thread_obj->start();
return 0;
if (rtthread->enmType == RTTHREADTYPE_EMULATION) {
Genode::Cpu_session * cpu_session = get_cpu_session(RTTHREADTYPE_EMULATION);
/*
Genode::Affinity::Space cpu_space = cpu_session->affinity_space();
Genode::Affinity::Location location = cpu_space.location_of_index(i);
*/
Genode::Affinity::Location location;
if (create_emt_vcpu(thread, stack_size, attr, start_routine, arg,
cpu_session, location))
return 0;
/* no haredware support, create normal pthread thread */
}
pthread_t thread_obj = new (Genode::env()->heap())
pthread(attr ? *attr : 0, start_routine,
arg, stack_size, rtthread->szName,
get_cpu_session(rtthread->enmType));
if (!thread_obj)
return EAGAIN;
*thread = thread_obj;
thread_obj->start();
return 0;
}
extern "C" int pthread_attr_setdetachstate(pthread_attr_t *, int)
{
return 0;
}
extern "C" int pthread_attr_setstacksize(pthread_attr_t *, size_t)
{
return 0;
}
extern "C" int pthread_atfork(void (*)(void), void (*)(void), void (*)(void))
{
return 0;
}

View File

@ -0,0 +1,213 @@
/*
* \brief Dummy implementations of symbols needed by VirtualBox
* \author Norman Feske
* \date 2013-08-22
*/
/*
* Copyright (C) 2013 Genode Labs GmbH
*
* This file is distributed under the terms of the GNU General Public License
* version 2.
*/
#include <base/printf.h>
#include <iprt/assert.h>
extern "C" {
#define DUMMY(name) \
void name(void) { \
PDBG( #name " called, not implemented, eip=%p", \
__builtin_return_address(0)); \
while (1) { Assert(!"not implemented"); } \
}
DUMMY(RTErrCOMGet)
DUMMY(DBGFR3CoreWrite)
DUMMY(DBGCRegisterCommands)
DUMMY(DBGFR3Event)
DUMMY(DBGFR3EventAssertion)
DUMMY(DBGFR3EventBreakpoint)
DUMMY(DBGFR3EventSrc)
DUMMY(DBGFR3VMMForcedAction)
DUMMY(DBGFR3DisasInstrEx)
DUMMY(DBGFR3DisasInstrCurrentLogInternal)
DUMMY(HMInvalidatePage)
DUMMY(HMFlushTLB)
DUMMY(HMR3EmulateIoBlock)
DUMMY(HMR3PatchTprInstr)
DUMMY(HMR3CheckError)
DUMMY(HMR3RestartPendingIOInstr)
DUMMY(HMR3EnablePatching)
DUMMY(HMR3DisablePatching)
DUMMY(HMGetPaePdpes)
DUMMY(HMR3ResetCpu)
DUMMY(HMSetSingleInstruction)
DUMMY(IEMExecOne)
DUMMY(IEMExecLots)
DUMMY(MMHyperR0ToCC)
DUMMY(MMHyperRCToCC)
DUMMY(MMR3HeapAPrintfV)
DUMMY(MMR3LockCall)
DUMMY(PDMR3AsyncCompletionTemplateCreateDriver)
DUMMY(PDMR3LdrGetInterfaceSymbols)
DUMMY(PDMCritSectBothFF)
DUMMY(PGMNotifyNxeChanged)
DUMMY(PGMPhysGCPtr2GCPhys)
DUMMY(PGMPhysSimpleReadGCPhys)
DUMMY(PGMPhysSimpleReadGCPtr)
DUMMY(PGMPhysSimpleWriteGCPtr)
DUMMY(PGMSyncCR3)
DUMMY(PGMR3SharedModuleCheckAll)
DUMMY(PGMR3SharedModuleUnregister)
DUMMY(PGMR3SharedModuleRegister)
DUMMY(PGMR3MappingsUnfix)
DUMMY(PGMR3MappingsFix)
DUMMY(PGMR3MappingsDisable)
DUMMY(PGMR3LockCall)
DUMMY(PGMR3PoolGrow)
DUMMY(PGMR3QueryGlobalMemoryStats)
DUMMY(PGMR3QueryMemoryStats)
DUMMY(PGMR3ResetCpu)
DUMMY(PGMR3PhysAllocateHandyPages)
DUMMY(PGMR3PhysAllocateLargeHandyPage)
DUMMY(PGMR3PhysChangeMemBalloon)
DUMMY(PGMR3PhysChunkMap)
DUMMY(PGMR3PhysGCPhys2CCPtrExternal)
DUMMY(PGMR3PhysGCPhys2CCPtrReadOnlyExternal)
DUMMY(PGMR3PhysMMIO2MapKernel)
DUMMY(PGMR3PhysReadU16)
DUMMY(PGMR3PhysReadU64)
DUMMY(PGMR3PhysRomProtect)
DUMMY(PGMPrefetchPage)
DUMMY(PGMGstGetPage)
DUMMY(PGMGstIsPagePresent)
DUMMY(PGMGstUpdatePaePdpes)
DUMMY(PGMShwMakePageReadonly)
DUMMY(PGMShwMakePageNotPresent)
DUMMY(PGMPhysIsGCPhysNormal)
DUMMY(PGMHandlerVirtualChangeInvalidateCallback)
DUMMY(PGMSetLargePageUsage)
DUMMY(PGMPhysSimpleDirtyWriteGCPtr)
DUMMY(PGMGetShadowMode)
DUMMY(PGMGetHostMode)
DUMMY(PGMUpdateCR3)
DUMMY(PGMGetGuestMode)
DUMMY(RTPoll)
DUMMY(RTPollSetAdd)
DUMMY(RTPollSetCreate)
DUMMY(RTPollSetEventsChange)
DUMMY(RTPollSetRemove)
DUMMY(RTPollSetDestroy)
DUMMY(RTProcCreate)
DUMMY(RTProcTerminate)
DUMMY(RTProcWait)
DUMMY(RTLdrGetSuff)
DUMMY(RTPathAppend)
DUMMY(RTPathChangeToDosSlashes)
DUMMY(RTSemEventWaitEx)
DUMMY(RTMemDupExTag)
DUMMY(RTMemDupTag)
DUMMY(RTMemExecFree)
DUMMY(SELMR3GetSelectorInfo)
DUMMY(SELMR3GetShadowSelectorInfo)
DUMMY(SUPR3HardenedLdrLoadPlugIn)
DUMMY(SUPSemEventMultiWaitNoResume)
DUMMY(SUPSemEventMultiReset)
DUMMY(VMMR3FatalDump)
DUMMY(VMMR3GetHostToGuestSwitcher)
DUMMY(RTHeapSimpleRelocate)
DUMMY(RTHeapSimpleAlloc)
DUMMY(RTHeapSimpleInit)
DUMMY(RTHeapSimpleFree)
DUMMY(RTAvloU32Remove)
DUMMY(RTAvloU32Get)
DUMMY(RTAvloU32GetBestFit)
DUMMY(RTAvlU32Destroy)
DUMMY(RTAvlU32GetBestFit)
DUMMY(RTAvloU32DoWithAll)
DUMMY(RTAvloU32Insert)
DUMMY(RTAvlU32Get)
DUMMY(RTAvlU32DoWithAll)
DUMMY(RTAvlU32Insert)
DUMMY(IOMInterpretOUT)
DUMMY(IOMInterpretOUTS)
DUMMY(IOMInterpretIN)
DUMMY(IOMInterpretINS)
DUMMY(DISInstrToStrWithReader)
DUMMY(DISInstrToStrEx)
DUMMY(DISFetchRegSegEx)
DUMMY(RTFileQueryFsSizes)
DUMMY(RTAvlrFileOffsetGet)
DUMMY(RTAvlrFileOffsetGetBestFit)
DUMMY(RTAvlrFileOffsetInsert)
DUMMY(RTAvlrFileOffsetRemove)
DUMMY(RTAvlrU64Destroy)
DUMMY(RTAvlrU64DoWithAll)
DUMMY(RTAvlrU64GetBestFit)
DUMMY(RTAvlrU64Insert)
DUMMY(RTAvlrU64RangeGet)
DUMMY(RTAvlrU64RangeRemove)
DUMMY(RTAvlrU64Remove)
DUMMY(RTSocketToNative)
DUMMY(RTStrCat)
DUMMY(RTStrCatP)
DUMMY(RTStrStr)
DUMMY(RTTcpClientCloseEx)
DUMMY(RTTcpClientConnect)
DUMMY(RTTcpFlush)
DUMMY(RTTcpGetLocalAddress)
DUMMY(RTTcpGetPeerAddress)
DUMMY(RTTcpRead)
DUMMY(RTTcpReadNB)
DUMMY(RTTcpSelectOne)
DUMMY(RTTcpSelectOneEx)
DUMMY(RTTcpSetSendCoalescing)
DUMMY(RTTcpSgWrite)
DUMMY(RTTcpSgWriteNB)
DUMMY(RTTcpWrite)
DUMMY(RTTcpWriteNB)
DUMMY(RTTimeLocalExplode)
DUMMY(RTSymlinkCreate)
DUMMY(RTSymlinkRead)
DUMMY(RTSymlinkDelete)
DUMMY(RTNetIPv6PseudoChecksumEx)
DUMMY(pthread_mutex_timedlock)
DUMMY(pthread_kill)
DUMMY(RTZipXarFsStreamFromIoStream)
DUMMY(FTMR3CancelStandby)
DUMMY(FTMR3PowerOn)
} /* extern "C" */

View File

@ -5,7 +5,7 @@
*/
/*
* Copyright (C) 2013 Genode Labs GmbH
* Copyright (C) 2013-2014 Genode Labs GmbH
*
* This file is distributed under the terms of the GNU General Public License
* version 2.
@ -24,16 +24,13 @@
template <typename T>
RTRCPTR to_rtrcptr(T* ptr)
{
return (RTRCPTR)((long)ptr & 0xffffffff);
}
unsigned long long u64 = reinterpret_cast<unsigned long long>(ptr);
RTRCPTR rtrcptr = u64 & 0xFFFFFFFFULL;
/**
* 64bit-aware cast of RTRCPTR (uint32_t) to pointer
*/
template <typename T>
T* from_rtrcptr(RTRCPTR rcptr)
{
return (T*)(rcptr | 0L);
AssertMsg((u64 == rtrcptr) || (u64 >> 32) == 0xFFFFFFFFULL,
("pointer transformation - %llx != %x", u64, rtrcptr));
return rtrcptr;
}
#endif /* _UTIL_H_ */

Some files were not shown because too many files have changed in this diff Show More