mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-20 17:52:52 +00:00
parent
ca4f956f21
commit
4f23e78f10
@ -44,6 +44,8 @@ VBOX_CC_OPT += -DVBOX_WITH_USB -DVBOX_WITH_VUSB
|
||||
# Enable Intel Network model E1000
|
||||
VBOX_CC_OPT += -DVBOX_WITH_E1000
|
||||
|
||||
VBOX_CC_OPT += -DVBOX_WITH_AHCI
|
||||
|
||||
VIRTUALBOX_VERSION_MAJOR := $(shell cat $(VIRTUALBOX_DIR)/Config.kmk | grep "VBOX_VERSION_MAJOR = " | grep -v "'VBOX_VERSION_MAJOR" | sed "s/^.*= //")
|
||||
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/^.*= //")
|
||||
|
@ -21,6 +21,7 @@ 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/DevAHCI.cpp
|
||||
SRC_CC += Devices/Storage/DevATA.cpp
|
||||
SRC_CC += Devices/Storage/Debug.cpp
|
||||
SRC_CC += Devices/Storage/DevFdc.c
|
||||
|
@ -1 +1 @@
|
||||
d7b1f7d895c0a28fe1ba95796adc23a09b4113b5
|
||||
434544e3fb1278c4984c9b21e1b9b517ba7c3ab2
|
||||
|
@ -50,6 +50,7 @@ extern "C" int VBoxDevicesRegister(PPDMDEVREGCB pCallbacks, uint32_t u32Version)
|
||||
REGISTER(DeviceFloppyController);
|
||||
REGISTER(DeviceSerialPort);
|
||||
REGISTER(DevicePIIX3IDE);
|
||||
REGISTER(DeviceAHCI);
|
||||
REGISTER(DevicePCNet);
|
||||
REGISTER(DeviceE1000);
|
||||
REGISTER(DeviceVMMDev);
|
||||
|
12
repos/ports/src/virtualbox/patches/ide.patch
Normal file
12
repos/ports/src/virtualbox/patches/ide.patch
Normal file
@ -0,0 +1,12 @@
|
||||
--- a/src/app/virtualbox/src/VBox/Devices/Storage/ide.h
|
||||
+++ b/src/app/virtualbox/src/VBox/Devices/Storage/ide.h
|
||||
@@ -202,8 +202,7 @@
|
||||
#define ATAPI_INQUIRY_PRODUCT_ID_LENGTH 16
|
||||
#define ATAPI_INQUIRY_REVISION_LENGTH 4
|
||||
|
||||
-
|
||||
-#if defined(DEBUG) && defined(IN_RING3)
|
||||
+#if defined(LOG_ENABLED) && defined(IN_RING3)
|
||||
const char * ATACmdText(uint8_t uCmd);
|
||||
#endif
|
||||
|
@ -24,3 +24,4 @@ tm_smp.patch
|
||||
posix.patch
|
||||
hostservice.patch
|
||||
vbox_dd.patch
|
||||
ide.patch
|
||||
|
@ -14,6 +14,7 @@
|
||||
/* Genode includes */
|
||||
#include <base/printf.h>
|
||||
#include <base/env.h>
|
||||
#include <base/allocator_avl.h>
|
||||
|
||||
/* VirtualBox includes */
|
||||
#include <iprt/initterm.h>
|
||||
@ -24,11 +25,38 @@
|
||||
#include <iprt/time.h>
|
||||
#include <internal/iprt.h>
|
||||
|
||||
class Avl_ds : public Genode::Avl_node<Avl_ds>
|
||||
{
|
||||
private:
|
||||
|
||||
Genode::Ram_dataspace_capability _ds;
|
||||
Genode::addr_t _virt;
|
||||
|
||||
public:
|
||||
|
||||
Avl_ds(Genode::Ram_dataspace_capability ds, void * virt)
|
||||
: _ds(ds), _virt(reinterpret_cast<Genode::addr_t>(virt))
|
||||
{ }
|
||||
|
||||
~Avl_ds() {
|
||||
Genode::env()->ram_session()->free(_ds);
|
||||
}
|
||||
|
||||
bool higher(Avl_ds *e) { return e->_virt > _virt; }
|
||||
|
||||
Avl_ds *find(Genode::addr_t virt)
|
||||
{
|
||||
if (virt == _virt) return this;
|
||||
Avl_ds *obj = this->child(virt > _virt);
|
||||
return obj ? obj->find(virt) : 0;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
static Genode::Avl_tree<Avl_ds> runtime_ds;
|
||||
|
||||
static void *alloc_mem(size_t cb, const char *pszTag, bool executable = false)
|
||||
{
|
||||
void * local_addr = nullptr;
|
||||
|
||||
using namespace Genode;
|
||||
|
||||
try {
|
||||
@ -40,19 +68,21 @@ static void *alloc_mem(size_t cb, const char *pszTag, bool executable = false)
|
||||
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);
|
||||
void * 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);
|
||||
PERR("%s size=0x%zx, tag=%s -> %p", __func__, cb, pszTag, local_addr);
|
||||
Assert(local_addr);
|
||||
|
||||
runtime_ds.insert(new (env()->heap()) Avl_ds(ds, local_addr));
|
||||
|
||||
return local_addr;
|
||||
} catch (...) {
|
||||
Assert(!"Could not allocate RTMem* memory ");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return local_addr;
|
||||
}
|
||||
|
||||
|
||||
@ -83,7 +113,17 @@ void *RTMemPageAllocTag(size_t cb, const char *pszTag) RT_NO_THROW
|
||||
|
||||
void RTMemPageFree(void *pv, size_t cb) RT_NO_THROW
|
||||
{
|
||||
PERR("%s %p+%zx", __func__, pv, cb);
|
||||
Avl_ds * ds_obj = runtime_ds.first();
|
||||
if (ds_obj)
|
||||
ds_obj = ds_obj->find(reinterpret_cast<Genode::addr_t>(pv));
|
||||
|
||||
if (ds_obj) {
|
||||
runtime_ds.remove(ds_obj);
|
||||
destroy(Genode::env()->heap(), ds_obj);
|
||||
}
|
||||
else
|
||||
PERR("%s unknown memory region %p+%zx", __func__, pv, cb);
|
||||
|
||||
}
|
||||
|
||||
#include <iprt/buildconfig.h>
|
||||
|
Loading…
x
Reference in New Issue
Block a user