diff --git a/packages/genodelabs/targets.nix b/packages/genodelabs/targets.nix index e485604..33c5027 100644 --- a/packages/genodelabs/targets.nix +++ b/packages/genodelabs/targets.nix @@ -12,11 +12,15 @@ with ports; { portInputs = [ dde_linux ]; }; + ipxe_nic_drv.portInputs = [ dde_ipxe ]; + libc = { portInputs = [ libc ]; patches = [ ./libc.patch ]; }; + libiconv.portInputs = [ libc libiconv ]; + lighttpd.portInputs = [ libc lighttpd openssl zlib ]; noux.portInputs = [ libc ]; @@ -28,6 +32,8 @@ with ports; { buildInputs = with buildPackages; [ zlib ]; }; + stdcxx.portInputs = [ libc stdcxx ]; + # The following are tests that never exit # and have no conventions on log output. @@ -41,7 +47,13 @@ with ports; { vbox5 = { nativeBuildInputs = with buildPackages; [ iasl yasm ]; - patches = [ ./vbox5-iasl.patch ]; + patches = [ ./vbox5-iasl.patch ./vbox-framebuffer-fail-on-fail.patch ]; + portInputs = [ libc libiconv qemu-usb stdcxx virtualbox5 ]; + }; + + vbox5-nova = { + nativeBuildInputs = with buildPackages; [ iasl yasm ]; + patches = [ ./vbox5-iasl.patch ./vbox-framebuffer-fail-on-fail.patch ]; portInputs = [ libc libiconv qemu-usb stdcxx virtualbox5 ]; }; diff --git a/packages/genodelabs/vbox-framebuffer-fail-on-fail.patch b/packages/genodelabs/vbox-framebuffer-fail-on-fail.patch new file mode 100644 index 0000000..7fafca0 --- /dev/null +++ b/packages/genodelabs/vbox-framebuffer-fail-on-fail.patch @@ -0,0 +1,126 @@ +commit d2a28a33f6a2bda7000ce201d52ff99714895640 +Author: Emery Hemingway +Date: Fri May 15 11:28:10 2020 +0530 + + vbox: use Nitpicker mode for initial resolution + +diff --git a/repos/ports/src/virtualbox5/frontend/fb.h b/repos/ports/src/virtualbox5/frontend/fb.h +index 95a7db8602..bf2d65d7c1 100644 +--- a/repos/ports/src/virtualbox5/frontend/fb.h ++++ b/repos/ports/src/virtualbox5/frontend/fb.h +@@ -40,7 +40,7 @@ class Genodefb : + Nitpicker::Connection &_nitpicker; + Fb_Genode::Session &_fb { *_nitpicker.framebuffer() }; + View_handle _view; +- Fb_Genode::Mode _fb_mode { 1024, 768, Fb_Genode::Mode::RGB565 }; ++ Fb_Genode::Mode _fb_mode { _nitpicker.mode() }; + + /* + * The mode currently used by the VM. Can be smaller than the + +commit b6bf91067a4c1c6d5b3508aedd949c8e1a7fe4b3 +Author: Emery Hemingway +Date: Fri May 15 11:20:47 2020 +0530 + + vbox: fail on invalid framebuffer dataspace + + VirtualBox can hang during initialization if Nitpicker returns an + invalid dataspace due to insufficient server-side resources. Make + an invalid dataspace a critical rather than silent error. + +diff --git a/repos/ports/src/virtualbox5/frontend/fb.h b/repos/ports/src/virtualbox5/frontend/fb.h +index dce00fe4eb..95a7db8602 100644 +--- a/repos/ports/src/virtualbox5/frontend/fb.h ++++ b/repos/ports/src/virtualbox5/frontend/fb.h +@@ -21,6 +21,9 @@ + #include + #include + ++#include ++#include ++ + /* VirtualBox includes */ + + #include "Global.h" +@@ -35,7 +38,7 @@ class Genodefb : + + Genode::Env &_env; + Nitpicker::Connection &_nitpicker; +- Fb_Genode::Session &_fb; ++ Fb_Genode::Session &_fb { *_nitpicker.framebuffer() }; + View_handle _view; + Fb_Genode::Mode _fb_mode { 1024, 768, Fb_Genode::Mode::RGB565 }; + +@@ -43,18 +46,18 @@ class Genodefb : + * The mode currently used by the VM. Can be smaller than the + * framebuffer mode. + */ +- Fb_Genode::Mode _virtual_fb_mode; ++ Fb_Genode::Mode _virtual_fb_mode { _initial_setup() }; ++ ++ Genode::Reconstructible ++ _fb_dataspace { _env.rm(), _fb.dataspace() }; + +- void *_fb_base; + RTCRITSECT _fb_lock; + + void _clear_screen() + { +- if (!_fb_base) return; +- + size_t const max_h = Genode::min(_fb_mode.height(), _virtual_fb_mode.height()); + size_t const num_pixels = _fb_mode.width() * max_h; +- memset(_fb_base, 0, num_pixels * _fb_mode.bytes_per_pixel()); ++ memset(_fb_dataspace->local_addr(), 0, num_pixels * _fb_mode.bytes_per_pixel()); + _fb.refresh(0, 0, _virtual_fb_mode.width(), _virtual_fb_mode.height()); + } + +@@ -91,10 +94,7 @@ class Genodefb : + Genodefb (Genode::Env &env, Nitpicker::Connection &nitpicker) + : + _env(env), +- _nitpicker(nitpicker), +- _fb(*nitpicker.framebuffer()), +- _virtual_fb_mode(_initial_setup()), +- _fb_base(env.rm().attach(_fb.dataspace())) ++ _nitpicker(nitpicker) + { + int rc = RTCritSectInit(&_fb_lock); + Assert(rc == VINF_SUCCESS); +@@ -109,16 +109,11 @@ class Genodefb : + + _fb_mode = mode; + +- if (_fb_base) +- _env.rm().detach(_fb_base); ++ _fb_dataspace.destruct(); + + _adjust_buffer(); + +- try { +- _fb_base = _env.rm().attach(_fb.dataspace()); +- } catch (...) { +- _fb_base = nullptr; +- } ++ _fb_dataspace.construct(_env.rm(), _fb.dataspace()); + + Unlock(); + } +@@ -201,8 +196,6 @@ class Genodefb : + PRUint32 imageSize, + PRUint8 *image) override + { +- if (!_fb_base) return S_OK; +- + Lock(); + + Nitpicker::Area const area_fb = Nitpicker::Area(_fb_mode.width(), +@@ -215,7 +208,7 @@ class Genodefb : + typedef Pixel_rgb565 Pixel_dst; + + Texture texture((Pixel_src *)image, nullptr, area_vm); +- Surface surface((Pixel_dst *)_fb_base, area_fb); ++ Surface surface(_fb_dataspace->local_addr(), area_fb); + + Dither_painter::paint(surface, texture, Surface_base::Point(o_x, o_y)); +