Re: Networking Support in VirtualBox

2017-07-27 Thread Christian Helmuth
Chris,

some annotations of your log below that may help.

On Wed, Jul 26, 2017 at 09:58:11AM -0400, Chris Rothrock wrote:
> NOVA Microhypervisor v7-2006635 (x86_64): Jul 25 2017 11:23:13 [gcc 6.3.0]
> [MBI]
> 
> [ 0] TSC:340 kHz BUS:0 kHz DL
> [ 0] CORE:0:0:0 6:9e:9:1 [48] Intel(R) Core(TM) i5-7500 CPU @ 3.40GHz
> [ 3] CORE:0:3:0 6:9e:9:1 [48] Intel(R) Core(TM) i5-7500 CPU @ 3.40GHz
> [ 2] CORE:0:2:0 6:9e:9:1 [48] Intel(R) Core(TM) i5-7500 CPU @ 3.40GHz
> [ 1] CORE:0:1:0 6:9e:9:1 [48] Intel(R) Core(TM) i5-7500 CPU @ 3.40GHz
> [ 0] disabling super pages for DMAR
> Hypervisor features VMX
> Hypervisor reports 4x1 CPUs
> CPU ID (genode->kernel:package:core:thread) remapping
>  remap (0->0:0:0:0) boot cpu
>  remap (1->1:0:1:0)
>  remap (2->2:0:2:0)
>  remap (3->3:0:3:0)
> Hypervisor info page contains 26 memory descriptors:
> core image  [0010,02682000)
> binaries region [00226000,02682000) free for reuse
> detected physical memory: 0x - size: 0x0008ec00
> use  physical memory: 0x - size: 0x0008e000
> detected physical memory: 0x0010 - size: 0xb2bfb000
> use  physical memory: 0x0010 - size: 0xb2bfb000
> detected physical memory: 0xb3aff000 - size: 0x1000
> use  physical memory: 0xb3aff000 - size: 0x1000
> detected physical memory: 0x0001 - size: 0x00013f80
> use  physical memory: 0x0001 - size: 0x00013f80
> :virt_alloc: Allocator 0x1e76f0 dump:
>  Block: [2000,3000) size=4K avail=0 max_avail=0
>  Block: [3000,4000) size=4K avail=0 max_avail=0
>  Block: [4000,5000) size=4K avail=0 max_avail=0
>  Block: [5000,6000) size=4K avail=0 max_avail=0
>  Block: [6000,7000) size=4K avail=0 max_avail=0
>  Block: [7000,8000) size=4K avail=0 max_avail=0
>  Block: [8000,9000) size=4K avail=0 max_avail=0
>  Block: [9000,a000) size=4K avail=0 max_avail=0
>  Block: [a000,b000) size=4K avail=0 max_avail=0
>  Block: [b000,c000) size=4K avail=0 max_avail=0
>  Block: [c000,d000) size=4K avail=0 max_avail=0
>  Block: [d000,e000) size=4K avail=0 max_avail=0
>  Block: [e000,f000) size=4K avail=0 max_avail=0
>  Block: [f000,0001) size=4K avail=0 max_avail=0
>  Block: [0001,00011000) size=4K avail=0 max_avail=0
>  Block: [00011000,00012000) size=4K avail=0 max_avail=0
>  Block: [00012000,00013000) size=4K avail=0 max_avail=0
>  Block: [00013000,00014000) size=4K avail=0
> max_avail=137434760164K
>  Block: [00014000,00015000) size=4K avail=0 max_avail=0
>  Block: [00015000,00016000) size=4K avail=0 max_avail=0
>  Block: [00016000,00017000) size=4K avail=0 max_avail=0
>  Block: [00017000,00018000) size=4K avail=0 max_avail=0
>  Block: [00018000,00019000) size=4K avail=0 max_avail=0
>  Block: [00019000,0001a000) size=4K avail=0 max_avail=908K
>  Block: [0001a000,0001b000) size=4K avail=0 max_avail=0
>  Block: [0001b000,0001c000) size=4K avail=0 max_avail=908K
>  Block: [0001c000,0001d000) size=4K avail=0 max_avail=0
>  Block: [0001d000,0010) size=908K avail=908K
> max_avail=908K
>  Block: [00226000,00227000) size=4K avail=0 max_avail=0
>  Block: [00227000,00228000) size=4K avail=0
> max_avail=137434760164K
>  Block: [00228000,00229000) size=4K avail=0 max_avail=0
>  Block: [00229000,a000) size=2619228K avail=2619228K
> max_avail=2619228K
>  Block: [b000,bfeff000) size=261116K avail=261116K
> max_avail=137434760164K
>  Block: [bff04000,7fffbfffd000) size=137434760164K
> avail=137434760164K max_avail=137434760164K
>  => mem_size=140736144932864 (134216446 MB) / mem_avail=140736144809984
> (134216446 MB)
> 
> :phys_alloc: Allocator 0x1e6620 dump:
>  Block: [1000,2000) size=4K avail=0 max_avail=0
>  Block: [2000,3000) size=4K avail=0 max_avail=0
>  Block: [3000,4000) size=4K avail=0 max_avail=0
>  Block: [4000,5000) size=4K avail=0 max_avail=0
>  Block: [5000,6000) size=4K avail=0 max_avail=0
>  Block: [6000,7000) size=4K avail=0 max_avail=0
>  Block: [7000,8000) size=4K avail=0 max_avail=0
>  Block: [8000,9000) size=4K avail=0 max_avail=0
>  Block: 

Re: Blocking wait for interrupt

2017-07-27 Thread Sebastian Sumpf
Hi Johannes,

On 07/27/2017 01:42 PM, Johannes Kliemann wrote:
> Hi Sebastian,
> 
> yes, that is the function I call from Genode.
> 
> And thanks in advance for helping me out.
> 

Good. I will try to explain how the Lx::Task approach is supposed to
work in this case:

Your task calls 'i2c_dw_xfer' which sends a request, creates a Linux
completion, and calls 'wait_for_completion_timeout'. This leads to a
blocking of the task and a call to the task scheduler. Since there
should be nothing to schedule at this point, the entrypoint will
eventually return to its "wait for RPC" code. When the waited for IRQ
occurs, the entrypoint receives a signal RPC and wakes up yet another
task, the IRQ task
(dde_linux/src/lx_kit/irq.cc:Lx_kit::Irq::Context::unblock). This task
calls all registered interrupt handlers ('handle_irq' same file). One of
those handlers should, behind your back, call 'complete' (I haven't
found the relevant source code for your case, but it is there) for the
completion your task is waiting for, which in turn should unblock your
task. This way a synchronous execution is accomplished. That is the theory.

Details:

'wait_for_completion_timeout'
(dde_linux/src/include/lx_emul/impl/completion.h) will call
'__wait_completion' which must be implemented by your driver. Please
refer to '__wait_completion' (dde_linux/src/lib/usb/lx_emul.cc) as a
guidance. The important part is to call 'block_and_schedule' for the
current task. Also notice, the 'complete' function in completion.h that
calls 'unblock' for the task within a completion. This should somehow be
called by your interrupt handler and lead to the re-scheduling of your
task when the IRQ tasks blocks again after interrupt handling.

By the way, these Lx::Taks are also called routine or coroutine in
literature and nothing more than a stack and a 'setjmp/longjmp' construct.

I hope this helps,

Sebastian


-- 
Sebastian Sumpf
Genode Labs

http://www.genode-labs.com · http://genode.org

Genode Labs GmbH · Amtsgericht Dresden · HRB 28424 · Sitz Dresden
Geschäftsführer: Dr.-Ing. Norman Feske, Christian Helmuth




--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
genode-main mailing list
genode-main@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/genode-main


Re: Blocking wait for interrupt

2017-07-27 Thread Johannes Kliemann
Hi Sebastian,

yes, that is the function I call from Genode.

And thanks in advance for helping me out.

Regards,

Johannes

Am 27.07.2017 um 10:58 schrieb Sebastian Sumpf:
> Hi Johannes,
> 
> I looked into the i2c driver. Are we talking about the 'i2c_dw_xfer'
> function?
> 
> Regards,
> 
> Sebastian
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> ___
> genode-main mailing list
> genode-main@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/genode-main
> 

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
genode-main mailing list
genode-main@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/genode-main


Re: Qt Virtualkeyboard example

2017-07-27 Thread Christian Prochaska
Hi Johannes,

On 27.07.2017 13:50, Johannes Kliemann wrote:
> How can I add QtQuick dependencies on Genode, is there already some code
> example?

there are two QtQuick examples in the libports repository:
qt5_quicktest.run and qt5_samegame.run.

Regards,
Christian


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
genode-main mailing list
genode-main@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/genode-main


Re: Qt Virtualkeyboard example

2017-07-27 Thread Johannes Kliemann
Hi Christian,

thanks for your help, I was able to build the virtualkeyboard example
for Genode [1].

Currently it fails run due to missing QtQuick dependencies. Beside that
some called functions are not yet implemented but I think the missing
dependencies make it fail in the first place.

> [init -> basic] Warning: geteuid: geteuid not implemented
> [init -> basic] Warning: getuid: getuid not implemented
> [init -> basic] read_rtc: rtc not configured, returning 0
> [init -> basic] Warning: getpid: getpid not implemented
> [init -> basic] read_rtc: rtc not configured, returning 0
> [init -> basic] JIT is disabled for QML. Property bindings and animations 
> will be very slow. Visit https://wiki.qt.io/V4 to learn about possible 
> solutions for your platform.
> [init -> basic] Error: no plugin found for mmap(-1)
> [init -> basic] Warning: mmap not supported for file descriptor -1
> [init -> basic] Error: no plugin found for mmap(-1)
> [init -> basic] Warning: mmap not supported for file descriptor -1
> [init -> basic] Warning: issetugid called, not yet implemented, returning 1
> [init -> basic] Warning: issetugid called, not yet implemented, returning 1
> [init -> basic] Warning: issetugid called, not yet implemented, returning 1
> [init -> basic] Warning: issetugid called, not yet implemented, returning 1
> [init -> basic] qrc:/Basic.qml:30:1: module "QtQuick" is not installed
> [init -> basic] qrc:/Basic.qml:31:1: module "QtQuick.VirtualKeyboard" is not 
> installed
> [init -> basic] qrc:/Basic.qml:30:1: module "QtQuick" is not installed
> [init -> basic] qrc:/Basic.qml:31:1: module "QtQuick.VirtualKeyboard" is not 
> installed
> [init -> basic] QThread: Destroyed while thread is still running
> [init -> basic] Warning: getpid: getpid not implemented
> [init -> basic] Warning: kill: kill not implemented
> [init -> basic] Warning: _sigaction: _sigaction not implemented
> [init -> basic] Warning: getpid: getpid not implemented
> [init -> basic] Warning: kill: kill not implemented
> [init -> basic] Warning: 4 dangling allocations at allocator destruction time
> [init -> basic] Warning: 10 dangling allocations at allocator destruction time
> [init] child "basic" exited with exit value 1

How can I add QtQuick dependencies on Genode, is there already some code
example?

Thanks and regards,

Johannes

[1]: https://github.com/jklmnn/genode/tree/qt_virtualkeyboard


Am 27.07.2017 um 00:18 schrieb Christian Prochaska:
> Hi Johannes,
> 
> On 26.07.2017 14:42, Johannes Kliemann wrote:
>> Hi,
>>
>> I tried to build the Qt Virtualkeyboard example.
>> I adapted the target.mk of the calculatorform example to point to the
>> correct project file.
>> Make fails at the project file at line 6 with missing separator. This
>> part contains the following:
>>
>> static {
>> QT += svg
>> QTPLUGIN += qtvirtualkeyboardplugin
>> }
>>
>>
>> Is there an additional flag required? Manually running qmake && make
>> works fine.
> 
> the Genode build system does not run qmake, but includes the qmake project 
> file as if it were a Makefile. This works well for simple
> project files, but if the project file uses qmake-specific syntax and these 
> parts are relevant, they must be replaced with something
> that GNU make understands. In your case it would probably suffice to just 
> delete the 'static {' line and the '}' line.
> 
> The 'QT' variable gets evaluated in [1] and there's no svg support right now. 
> A port of the Qt5Svg library would include the
> following new files:
> 
> - repos/libports/lib/import/import-qt5_svg.mk
> - repos/libports/lib/mk/qt5_svg.mk
> - repos/libports/lib/mk/qt5_svg_generated.inc
> 
> The 'QTPLUGIN' variable does not get evaluated in the 'target_final.inc' file 
> right now. To do that, I think you would need to add
> each part of the variable content to the LIBS variable (prefixed with 
> 'qt5_'), resulting in 'LIBS += qt5_qtvirtualkeyboardplugin' in
> your case, and then build the plugin as a shared library, similar to the 
> 'qt5_qjpeg' library.
> 
> I've attached the generated include files and a patch with the script used to 
> generate the files, in case you need to change the
> configuration and regenerate them.
> 
> Regards,
> Christian
> 
> [1] 
> https://github.com/genodelabs/genode/blob/master/repos/libports/src/app/qt5/tmpl/target_final.inc
> 
> 
> 
> --
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> 
> 
> 
> ___
> genode-main mailing list
> genode-main@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/genode-main
> 

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___

Re: Blocking wait for interrupt

2017-07-27 Thread Sebastian Sumpf
Hi Johannes,

I looked into the i2c driver. Are we talking about the 'i2c_dw_xfer'
function?

Regards,

Sebastian

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
genode-main mailing list
genode-main@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/genode-main