Re: Defence of "Microkernelization of Linux"

2018-05-13 Thread Johannes Kliemann
Hi Martin,

thanks for your feedback. I didn't expect such a widespread interest and
unfortunately I won't be able to set up a stream in the short term. But
I will take it into consideration next time ;)

Regards,
Johannes

Am 10.05.2018 um 20:31 schrieb Martin Iturbide:
> Hi 
> 
> I'm very far away but I wish you good luck with it. If I were there I
> would live stream it :)
> 
> Regards.
> 
> El mié., 9 de may. de 2018 04:27, Johannes Kliemann
> <kliem...@componolit.com <mailto:kliem...@componolit.com>> escribió:
> 
> Hi Genode folks,
> 
> since the Information in my last email was a bit scarce here is a short
> follow up to my defence.
> 
> My thesis is based on the Microkernelizing Linux challenge of Genodes
> challenges [1].
> 
> > Thanks to Genode's generic interfaces for I/O access as provided
> by core, all Genode device drivers including drivers ported from
> Linux and gPXE can be executed as user-level components on all
> supported microkernels. However, so far, we have not enabled the use
> of these device drivers on Linux as base platform. The goal of this
> project is the systematic replacement of in-kernel Linux device
> drivers by Genode processes running in user space, effectively
> reducing the Linux kernel to a runtime for Genode's core process.
> But moving drivers to Genode processes is just the beginning. By
> employing further Genode functionality such as its native GUI, lwIP,
> and Noux, many protocol stacks can effectively be removed from the
> Linux kernel.
> >
> > The goal of this project is to evaluate how small the Linux kernel
> can get when used as a microkernel.
> 
> I will present the the implemented concepts for native Genode drivers on
> Linux and a demo running on base-linux with a stripped down Linux kernel
> using the native fb_boot_drv and ps2_drv.
> 
> Location: Andreas-Pfitzmann-Bau, Nöthnitzer Str. 46
> 01187 Dresden, Germany; Room 3105
> 
> Time: Monday, May 14, 2018 at 11:00 a.m
> 
> Regards,
> Johannes Kliemann
> 
> [1]: https://genode.org/about/challenges
> 
> Am 25.04.2018 um 10:18 schrieb Johannes Kliemann:
> >
> >> Hello Genode folks,
> >>
> >> I want to invite you to the defence of my student thesis
> >> "Microkernelization of Linux" (and enabling native Genode driver
> support
> >> on base-linux).
> >> It will take place in the Andreas-Pfitzmann-Bau room 3105 at 11:00.
> > At the 14th May 2018.
> >
> >> Regards,
> >> Johannes Kliemann
> >
> >
> >
> 
> --
> > 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
> <mailto: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
> <mailto: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
> 

--
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: Defence of "Microkernelization of Linux"

2018-05-09 Thread Johannes Kliemann
Hi Genode folks,

since the Information in my last email was a bit scarce here is a short
follow up to my defence.

My thesis is based on the Microkernelizing Linux challenge of Genodes
challenges [1].

> Thanks to Genode's generic interfaces for I/O access as provided by core, all 
> Genode device drivers including drivers ported from Linux and gPXE can be 
> executed as user-level components on all supported microkernels. However, so 
> far, we have not enabled the use of these device drivers on Linux as base 
> platform. The goal of this project is the systematic replacement of in-kernel 
> Linux device drivers by Genode processes running in user space, effectively 
> reducing the Linux kernel to a runtime for Genode's core process. But moving 
> drivers to Genode processes is just the beginning. By employing further 
> Genode functionality such as its native GUI, lwIP, and Noux, many protocol 
> stacks can effectively be removed from the Linux kernel.
> 
> The goal of this project is to evaluate how small the Linux kernel can get 
> when used as a microkernel.

I will present the the implemented concepts for native Genode drivers on
Linux and a demo running on base-linux with a stripped down Linux kernel
using the native fb_boot_drv and ps2_drv.

Location: Andreas-Pfitzmann-Bau, Nöthnitzer Str. 46
01187 Dresden, Germany; Room 3105

Time: Monday, May 14, 2018 at 11:00 a.m

Regards,
Johannes Kliemann

[1]: https://genode.org/about/challenges

Am 25.04.2018 um 10:18 schrieb Johannes Kliemann:
> 
>> Hello Genode folks,
>>
>> I want to invite you to the defence of my student thesis
>> "Microkernelization of Linux" (and enabling native Genode driver support
>> on base-linux).
>> It will take place in the Andreas-Pfitzmann-Bau room 3105 at 11:00.
> At the 14th May 2018.
> 
>> Regards,
>> Johannes Kliemann
> 
> 
> --
> 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: Defence of "Microkernelization of Linux"

2018-04-25 Thread Johannes Kliemann

> Hello Genode folks,
> 
> I want to invite you to the defence of my student thesis
> "Microkernelization of Linux" (and enabling native Genode driver support
> on base-linux).
> It will take place in the Andreas-Pfitzmann-Bau room 3105 at 11:00.
At the 14th May 2018.

> Regards,
> Johannes Kliemann


--
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


Defence of "Microkernelization of Linux"

2018-04-25 Thread Johannes Kliemann
Hello Genode folks,

I want to invite you to the defence of my student thesis
"Microkernelization of Linux" (and enabling native Genode driver support
on base-linux).
It will take place in the Andreas-Pfitzmann-Bau room 3105 at 11:00.

Regards,
Johannes Kliemann

--
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


base-hw kernel binaries

2018-04-11 Thread Johannes Kliemann
Hi all,

I'm currently measuring the code base sizes of Genode with different
kernels. I have split this into the kernel itself and kernel-dependent
code of Genode (core and ld.lib.so).
This worked well for all kernels except hw where I couldn't really make
a distinction between the kernel and core. The only additional binary is
is called *.bootstrap and resides inside var/. Unfortunately it doesn't
contain any references to its source code and I couldn't find any debug
binary that does so (I need this since I measure the code size by source
references in elf binaries via objdump).

Is there a way to build this binary with more debug information. And
more generally how are the kernel part and core separated in hw (which
isn't as easy as with other kernels that use a port)?

Regards,
Johannes

--
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: base-linux ram dataspace file descriptor usage

2018-03-28 Thread Johannes Kliemann
Hi Norman,

> have you tried to add this test directly in '_export_ram_ds' inside
> core. That is, 'mmap'ing it locally, writing 'ds->size' number of bytes,
> reading them again, followed by clearing them. Just to be sure.

Yes I did. I also added such a test in _map_local and in both cases I
could read and write the whole memory.

> RAM dataspaces are used as backing store for any dynamically allocated
> memory. So it is not surprising to see this fault in the heap. The
> segmentation fault in the lock implementation is certainly caused by a
> lock that resides within a dynamically allocated object.

Could this have to do with using a vfork like mechanism instead of fork?
So that the Capability is passed but the mapping doesn't exist any more
for the child?
I could verify that the segmentation fault only appears after clone in
the child.

I was able to create an environment to use gdb. The segfault happens
always in repos/base/src/lib/base/heap.cc:217 which is the begin of bool
Heap::alloc(size_t size, void **out_addr). out_addr had the value of
0x7fffe7ffe018 and when I tried to get a backtrace gdb said that it
cannot access 0x7fffe7ffe008.
Both ranges seem to reside in 0x7fffe7ffe000 which is the return value
of the first lx_mmap after clone (unfortunately I cannot tell if this
happens in the parent or in the child).

> Thread 2.1 "ld.lib.so" received signal SIGSEGV, Segmentation fault.
> 0x7fffdff47732 in Genode::Heap::alloc (
> this=0x7fffe00945e0  Genode::Pd_session*, Genode::Region_map*, Genode::Heap::{unnamed type#1}, 
> char (&) [8192], unsigned long>(Genode::Pd_session*&&, Genode::Region_map*&&, 
> Genode::Heap::{unnamed type#1}&&, char (&) [8192], unsigned 
> long&&)::object_space>, size=140, out_addr=0x7fffe7ffe018)
> at /media/sf_kernel/genode/repos/base/src/lib/base/heap.cc:217
> 217 {
> (gdb) bt
> #0  0x7fffdff47732 in Genode::Heap::alloc (
> this=0x7fffe00945e0  Genode::Pd_session*, Genode::Region_map*, Genode::Heap::{unnamed type#1}, 
> char (&) [8192], unsigned long>(Genode::Pd_session*&&, Genode::Region_map*&&, 
> Genode::Heap::{unnamed type#1}&&, char (&) [8192], unsigned 
> long&&)::object_space>, size=140, out_addr=0x7fffe7ffe018)
> at /media/sf_kernel/genode/repos/base/src/lib/base/heap.cc:217
> Backtrace stopped: Cannot access memory at address 0x7fffe7ffe008

I still cannot tell what happens there but this doesn't seem to be
component specific. I created a config with only a single component that
only prints a single log message and the problem occurs.

I hope this information helps you, and thank you for your help,
Johannes

--
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


base-linux ram dataspace file descriptor usage

2018-03-23 Thread Johannes Kliemann
Hi all,

I'm struggling with modifying the Ram_dataspace in base-linux.
I have replaced the file descriptor opened in
> void Ram_dataspace_factory::_export_ram_ds(Dataspace_component *ds)
in base-linux/src/core/ram_daraspace_support.cc by opening a special
device file that provides mappable ram.

I have attached the exact diff that causes the segfault. The kernel
module that provides the device file and the ioctl is available at [1].
I have tested it on a Linux system and mapping memory and
reading/writing it worked flawlessly.

With this change each component creates a segmentation fault. I was not
able to trace it, I couldn't even find out in which file it occurs.
The instruction pointer randomly appeared in
repos/base/src/lib/base/lock.cc or in repos/base/src/lib/base/heap.cc. I
have touched neither of these files.

Is there any information about where this is used exactly? I was unable
to trace the usage of the mapped memory beyond Region_map_mmap::attach.
I have also traced the calls inside the kernel module and it looks as it
only uses open, mmap and close so there shouldn't a problem.
I'd like to give you further information about this but I have
absolutely no idea by myself.

Regards,
Johannes

[1]:
https://github.com/jklmnn/hwiodev/blob/0f5d367162812ee015434e5b97fdf208ef362215/hwio.c
diff --git a/repos/base-linux/src/core/include/core_linux_syscalls.h b/repos/base-linux/src/core/include/core_linux_syscalls.h
index fb176e0db..42a7bfd37 100644
--- a/repos/base-linux/src/core/include/core_linux_syscalls.h
+++ b/repos/base-linux/src/core/include/core_linux_syscalls.h
@@ -106,6 +106,11 @@ inline int lx_ioctl_irq(int fd, int irq)
 return lx_syscall(SYS_ioctl, fd, _IOW('g', 2, int*), );
 }
 
+inline int lx_ioctl_dma(int fd, Genode::size_t size)
+{
+return lx_syscall(SYS_ioctl, fd, _IOW('g', 3, Genode::size_t*), );
+}
+
 /**
  ** Process creation and destruction **
  **/
diff --git a/repos/base-linux/src/core/ram_dataspace_support.cc b/repos/base-linux/src/core/ram_dataspace_support.cc
index 116210643..006ec3b44 100644
--- a/repos/base-linux/src/core/ram_dataspace_support.cc
+++ b/repos/base-linux/src/core/ram_dataspace_support.cc
@@ -38,10 +38,9 @@ void Ram_dataspace_factory::_export_ram_ds(Dataspace_component *ds)
 	char fname[Linux_dataspace::FNAME_LEN];
 
 	/* create file using a unique file name in the resource path */
-	snprintf(fname, sizeof(fname), "%s/ds-%d", resource_path(), ram_ds_cnt++);
-	lx_unlink(fname);
-	int const fd = lx_open(fname, O_CREAT|O_RDWR|O_TRUNC|LX_O_CLOEXEC, S_IRWXU);
-	lx_ftruncate(fd, ds->size());
+
+int const fd = lx_open("/dev/hwio", O_RDWR|O_SYNC|LX_O_CLOEXEC);
+lx_ioctl_dma(fd, ds->size());
 
 	/* remember file descriptor in dataspace component object */
 	ds->fd(fd);
@@ -52,7 +51,6 @@ void Ram_dataspace_factory::_export_ram_ds(Dataspace_component *ds)
 	 * gone (i.e., an open file descriptor referring to the file). A process
 	 * w/o the right file descriptor won't be able to open and access the file.
 	 */
-	lx_unlink(fname);
 }
 
 
--
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


Genode::Pd_connection::address_space returns invalid capability

2018-03-21 Thread Johannes Kliemann
Hi all,

on base-linux when Genode::Pd_connection::address_space is called it
returns an invalid capability. In the platform_drv [1] this causes the
Region_map to fail to attach the DMA memory.

On NOVA for example this capability is valid. I went through the code
but I still have no idea what causes this capability to be invalid.

Regards,
Johannes

[1]:
https://github.com/genodelabs/genode/blob/1f7b5e75bfeb9ec35b975b4db66fc9b9bd08fbbe/repos/os/src/drivers/platform/spec/x86/device_pd.h#L54

--
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: base-linux IRQ session

2018-03-14 Thread Johannes Kliemann
Hello Christian,

thanks for that hint, it was the missing piece. I can now happily
announce that Interrupts are working on Genode with base-linux!

Regards,
Johannes

Am 13.03.2018 um 16:25 schrieb Christian Helmuth:
> Hello Johannes,
> 
> On Tue, Mar 13, 2018 at 01:36:09PM +0100, Johannes Kliemann wrote:
>> I'm currently implementing the IRQ session on base-linux.
>> If I understood the Foundations book correctly interrupts are waiting in
>> a separate thread that locks when it is waiting and continues (and calls
>> the handler) once an interrupt is triggered.
> 
> The core-internal implementation depends on the base platform. On NOVA
> and FOC, the Irq_object (which is a thread) is never started, ie.,
> does not execute an entry function. Other platforms (e.g., OKL4) use
> the Irq_object thread to implement a interrupt-wait-and-signal loop.
> 
>> According to this I have implemented a kernel module [1] that triggers
>> interrupts via reads on a device file. The interrupt can be registered
>> via ioctl on the file descriptor and the a blocking read is called that
>> returns once the registered interrupts has been triggered.
>>
>> I have looked into the implementations of base-nova and base-hw but
>> didn't completely understand it. As far as I understood the session
>> component implements the session and only requires the interrupt number
>> and a signal handler.
>> The Irq_object implements the waiting thread but I didn't see where it
>> is waiting for the interrupt.
>> Also as far as I could see it the actual interrupt capability stays
>> inside the session in core and only the signal handler capability is
>> passed to the component.
> 
> I suggest you refer to OKL4
> 
>   base-okl4/src/core/irq_session_component.cc
> 
> and implement an Irq_object working similarly with a entry() function
> that uses Irq_object::_wait_for_irq() (which blocks in read(dev_fd))
> and signals IRQ occurence by Genode::Signal_transmitter(_sig_cap).submit(1)
> 
>> Is my understanding of this correct? And is there any further
>> documentation on this?
> 
> Unfortunately, there's only few documentation of the core internals.
> To get up-to-date information I suggest looking at the code and asking
> here or even on Freenode
> 
>   http://webchat.freenode.net/?randomnick=1=%23genode=d4
> 
> Regards
> 

--
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


base-linux IRQ session

2018-03-13 Thread Johannes Kliemann
Hi all,

I'm currently implementing the IRQ session on base-linux.
If I understood the Foundations book correctly interrupts are waiting in
a separate thread that locks when it is waiting and continues (and calls
the handler) once an interrupt is triggered.

According to this I have implemented a kernel module [1] that triggers
interrupts via reads on a device file. The interrupt can be registered
via ioctl on the file descriptor and the a blocking read is called that
returns once the registered interrupts has been triggered.

I have looked into the implementations of base-nova and base-hw but
didn't completely understand it. As far as I understood the session
component implements the session and only requires the interrupt number
and a signal handler.
The Irq_object implements the waiting thread but I didn't see where it
is waiting for the interrupt.
Also as far as I could see it the actual interrupt capability stays
inside the session in core and only the signal handler capability is
passed to the component.

Is my understanding of this correct? And is there any further
documentation on this?

Regards,
Johannes

[1]:
https://github.com/jklmnn/hwiodev/blob/c445eb58daa6d29e9f779bf6ad4b00818fba6659/hwio.c

--
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: 32 bit overflow in timer

2018-02-27 Thread Johannes Kliemann
Hi Bob,

The long is not necessarily defined as 4 bytes. I have checked the GNU
reference manual [1] and it states

> The 32-bit unsigned long int data type can hold integer values in the range 
> of at least 0 to 4,294,967,295. (Depending on your system, this data type 
> might be 64-bit, in which case its range is identical to that of the unsigned 
> long long int data type.) You may also refer to this data type as unsigned 
> long. 

So it can be 64bit long. I have tested this on x86_64 Linux and x86_64
Genode on NOVA and in both cases the sizeof(unsigned long) returned 8.
So it is a 64 bit integer type. I also tested this by assigning 2^32
which should yield 0 on a 32 bit type but it didn't.

Regarding this the overflow is most probably happening at some lower
level (I have not checked the exact implementation of the timer).

Regards,
Johannes

[1]:
https://www.gnu.org/software/gnu-c-manual/gnu-c-manual.html#Integer-Types

Am 18.02.2018 um 20:59 schrieb Bob Stewart:
> Johannes,
> 
> Unsigned longs are 4 bytes. Unsigned long longs are 8 bytes. One byte
> equals 8 bits.
> 
> Bob Stewart
> 
> 
> Get Outlook for Android <https://aka.ms/ghei36>
> 
> ----
> *From:* Johannes Kliemann <kliem...@componolit.com>
> *Sent:* Sunday, February 18, 2018 6:01:36 AM
> *To:* Genode OS Framework Mailing List
> *Subject:* 32 bit overflow in timer
>  
> Hi all,
> 
> I noticed a 32 bit overflow in the Timer::Connection sleep functions and
> triggers.
> Calling usleep or trigger_once with an hour (3 600 000 000 us) works but
> calling it with two hours (7 200 000 000 us) causes something to
> overflow and stop the timer after 2 905 032 704 us which equals 7 200
> 000 000 & (2^32 - 1).
> 
> As far as I have checked this these functions use the unsigned long
> which is indeed 64 bit but I think at some point only 32 bit are used.
> 
> Is this intended behaviour?
> If so I think it would make sense to give out a warning at least.
> 
> Regards,
> Johannes
> 
> --
> 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
> 

--
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


32 bit overflow in timer

2018-02-18 Thread Johannes Kliemann
Hi all,

I noticed a 32 bit overflow in the Timer::Connection sleep functions and
triggers.
Calling usleep or trigger_once with an hour (3 600 000 000 us) works but
calling it with two hours (7 200 000 000 us) causes something to
overflow and stop the timer after 2 905 032 704 us which equals 7 200
000 000 & (2^32 - 1).

As far as I have checked this these functions use the unsigned long
which is indeed 64 bit but I think at some point only 32 bit are used.

Is this intended behaviour?
If so I think it would make sense to give out a warning at least.

Regards,
Johannes

--
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


Segmentation fault in free_io_mem

2018-02-08 Thread Johannes Kliemann
Hi all,

while testing the IO_MEM session on Linux with ACPI I noticed that the
acpi_drv segfaults when freeing its io memory on
repos/os/src/drivers/acpi/acpi.cc:1304 [1]. The crash happens then in
repos/base/include/base/allocator.h:319 at

> operator delete (obj, dealloc);

I noticed that this is called many times without problems but not from
free_io_mem. Unfortunately I have to admit that my C++ knowledge is
insufficient to really grasp what happens in this expression.
Is there any difference in how io memory is freed or should there be any
(at least on Linux)?

Regards,
Johannes

[1]:
https://github.com/jklmnn/genode/blob/c2e9d35010a8a3c4f79d51d022cb3e5beb6f0453/repos/os/src/drivers/acpi/acpi.cc#L1304
[2]:
https://github.com/jklmnn/genode/blob/c2e9d35010a8a3c4f79d51d022cb3e5beb6f0453/repos/base/include/base/allocator.h#L319

--
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: getaddrinfo - Error: libc suspend() called from non-user context (0x117549a) - aborting

2018-02-07 Thread Johannes Kliemann
Hi Emery,

thanks for your help. That was indeed what I was missing!

Regards,
Johannes

Am 07.02.2018 um 11:58 schrieb Emery Hemingway:
> Hello Johannes,
> 
> The message "libc suspend() called from non-user context" indicates
> that you are using POSIX I/O from the initial Libc::Component 'kernel'
> context, and not the 'user' context. To switch to a user context,
> supply user level code as a lambda to the 'Libc::with_libc(...)'
> function. Looking at your code I see that this would likly just be a
> lamba to wrap the construction of Sntp::Main and a lambda of the body
> of the Rtc::current_time() RPC method. One example of with_libc in
> user can be found in genode/repos/gems/src/server/tcp_terminal/main.cc.
> 
> Cheers,
> Emery
> 
> 
> On Tue, 6 Feb 2018 23:19:16 +0100
> Johannes Kliemann <kliem...@componolit.com> wrote:
> 
>> Hi all,
>>
>> when I use the lwip networking I sometimes get the following error:
>>
>>> Error: libc suspend() called from non-user context (0x117549a) -
>>> aborting  
>>
>> I have tracked it down to a call of getaddrinfo yet I could not  find
>> out when exactly and why this happens. It occurs at ca. 50% of the
>> tries. Does anyone have an idea how to fix that?
>>
>> Also is there a way to check if an IP is available? Sleeping a few
>> seconds and hoping that DHCP assigned an address does not seem a
>> reliable solution to me.
>>
>> The full code is available at [1], [2] and [3] while the error happens
>> in [3] at line 24.
>> To test it yourself, check out [4] and run `make run/sntp`.
>>
>> Regards,
>> Johannes
>>
>> [1]:
>> https://github.com/jklmnn/genode-world/blob/sntp/src/server/sntp/main.cc
>> [2]:
>> https://github.com/jklmnn/genode-world/blob/sntp/src/server/sntp/client.h
>> [3]:
>> https://github.com/jklmnn/genode-world/blob/sntp/src/server/sntp/client.cc
>> [4]: https://github.com/jklmnn/genode-world/tree/sntp/src/server/sntp
>>
>> --
>> 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
> 

--
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


getaddrinfo - Error: libc suspend() called from non-user context (0x117549a) - aborting

2018-02-06 Thread Johannes Kliemann
Hi all,

when I use the lwip networking I sometimes get the following error:

> Error: libc suspend() called from non-user context (0x117549a) - aborting

I have tracked it down to a call of getaddrinfo yet I could not  find
out when exactly and why this happens. It occurs at ca. 50% of the
tries. Does anyone have an idea how to fix that?

Also is there a way to check if an IP is available? Sleeping a few
seconds and hoping that DHCP assigned an address does not seem a
reliable solution to me.

The full code is available at [1], [2] and [3] while the error happens
in [3] at line 24.
To test it yourself, check out [4] and run `make run/sntp`.

Regards,
Johannes

[1]:
https://github.com/jklmnn/genode-world/blob/sntp/src/server/sntp/main.cc
[2]:
https://github.com/jklmnn/genode-world/blob/sntp/src/server/sntp/client.h
[3]:
https://github.com/jklmnn/genode-world/blob/sntp/src/server/sntp/client.cc
[4]: https://github.com/jklmnn/genode-world/tree/sntp/src/server/sntp

--
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: Linux IO_MEM session

2018-01-25 Thread Johannes Kliemann
Hi Norman,


> just a shot in the dark: Have you called 'Rpc_entrypoint::manage(ds)'
> for your dataspace object? Or to put the question differently: Is the
> dataspace capability that you return in
> 'Io_mem_session_component::dataspace()' valid inside core? If not, you
> have most likely missed to associate your 'Dataspace_component' object
> with core's entrypoint.

I had this issue already in the first email where I tried to do exaclty
this. I read through it again and my explanation wasn't clear.
When I add

> _ds_cap = _ds_ep->manage(&_ds);

It fails to build with

> In file included from 
> /.../genode/repos/base/include/dataspace/capability.h:17:0,
>  from /.../genode/repos/base/include/dataspace/client.h:17,
>  from 
> /.../genode/repos/base-linux/src/include/linux_dataspace/client.h:17,
>  from 
> /.../genode/repos/base-linux/src/core/io_mem_session_component.cc:15:
> /.../genode/repos/base/include/base/capability.h: In instantiation of 
> ‘Genode::Untyped_capability Genode::Capability<  
> >::_check_compatibility(const Genode::Capability&) const 
> [with FROM_RPC_INTERFACE = Genode::Linux_dataspace; RPC_INTERFACE = 
> Genode::Io_mem_dataspace; Genode::Untyped_capability = 
> Genode::Native_capability]’:
> /.../genode/repos/base/include/base/capability.h:153:49:   required from 
> ‘Genode::Capability<  >::Capability(const 
> Genode::Capability&) [with FROM_RPC_INTERFACE = 
> Genode::Linux_dataspace; RPC_INTERFACE = Genode::Io_mem_dataspace]’
> /.../genode/repos/base-linux/src/core/io_mem_session_component.cc:72:34:   
> required from here
> /.../genode/repos/base/include/base/capability.h:134:24: error: cannot 
> convert ‘Genode::Linux_dataspace*’ to ‘Genode::Io_mem_dataspace*’ in 
> initialization
> RPC_INTERFACE *to = from;

I tried to circumvent this by trying different casts but I could not
find an appropriate solution (fooling the compiler with typedefs is not
one).
When you said that opening the file and adding the file descriptor was
enough I misinterpret that I don't need to call manage.

> Could you point me to a branch where I can have look at the code and
> reproduce the problem?

I have a state on [1] that contains a test `run/io_mem` which tests that
behaviour. I also have added a check to [2] so `attach` does not
segfault but throws an `Invalid_dataspace` exception.
In io_mem_session_component.cc I have already added (but commented out)
the line to call manage which does not build yet.

Thanks for your help and regards,
Johannes

[1]:
https://github.com/jklmnn/genode/tree/ac59709d4af406125454180e5453f30184505a8d
[2]:
https://github.com/jklmnn/genode/blob/ac59709d4af406125454180e5453f30184505a8d/repos/base-linux/src/lib/base/region_map_mmap.cc#L190
[3]:
https://github.com/jklmnn/genode/blob/ac59709d4af406125454180e5453f30184505a8d/repos/base-linux/src/core/io_mem_session_component.cc#L72

--
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: Linux IO_MEM session

2018-01-24 Thread Johannes Kliemann
Hi Norman,

I have tracked down the issue to the Io_mem_dataspace_capability being
invalid.
The segfault is caused by _dataspace_size() being called on an invalid
capability in region_map_mmap.cc. I think a better behaviour would be to
check the validity and throw an Invalid_dataspace() exception (I would
create a PR for this change).

> are you sure that this is the backtrace of the faulting thread? It
> doesn't look like it. To double-check, have you had a close look at the
> instruction pointer within the faulting binary as reported by the
> kernel's dmesg output?

I have taken a look at the IP and this supports the assumption about the
invalid capability as the segfault happens in
`Capability_space::ipc_cap_data`, especially in the inlined `return
local_capability_space().ipc_cap_data(*cap.data());`

> Capability_space::Ipc_cap_data 
> Capability_space::ipc_cap_data(Native_capability const )
> {
>70b40:   53  push   %rbx
>70b41:   48 8d 05 f8 ff ff fflea-0x8(%rip),%rax# 70b40 
> <_ZN6Genode16Capability_space12ipc_cap_dataERKNS_17Nativ
> e_capabilityE>
> _ZNK6Genode17Native_capability4dataEv():
> /media/sf_kernel/genode/repos/base/include/base/native_capability.h:78
> Data const *data() const { return _data; }
>70b48:   48 8b 1fmov(%rdi),%rbx
>70b4b:   49 bb 50 2f 05 00 00movabs $0x52f50,%r11
>70b52:   00 00 00 
> _ZN6Genode16Capability_space12ipc_cap_dataERKNS_17Native_capabilityE():
> /media/sf_kernel/genode/repos/base/src/lib/base/capability_space.cc:81
> return local_capability_space().ipc_cap_data(*cap.data());
>70b55:   48 ba 40 cb fa ff ffmovabs $0xfffacb40,%rdx
>70b5c:   ff ff ff 
>70b5f:   4c 01 d8add%r11,%rax
>70b62:   48 01 d0add%rdx,%rax
>70b65:   ff d0   callq  *%rax
>70b67:   48 8b 53 08 mov0x8(%rbx),%rdx
>70b6b:   8b 43 10mov0x10(%rbx),%eax
> /media/sf_kernel/genode/repos/base/src/lib/base/capability_space.cc:82
> }
>70b6e:   5b  pop%rbx
>70b6f:   c3  retq

70b67 is the instruction that fails. I don't know if this helps you in
any way.

> As another question, did you first try to hand out an FD for a regular
> file as I suggested in my last email? Just to rule out potential
> problems with the FD obtained from your kernel module.

This happens no matter which file I have opened.

> The 'rm.attach' - when executed on Linux - is just a process-local
> operation. It comes down to an invocation of 'mmap' in
> 'region_map_mmap.cc'. Maybe it helps to instrument the code there? For
> instrumentation at such a low level, I recommend using the 'raw'
> function instead of 'log'. The 'raw' function directs the output
> directly to the kernel - not to core's LOG service. You won't see the
> component's name as log-message prefix, but rule out any interaction
> with core by the instrumentation.

I looked into other implementations of base-linux that use the
Dataspace_capability. They all just instanciate and return it. This is
also the case for the Io_mem_dataspace_capability yet it seems to be
invalid by default.
I tried to return a Dataspace_capability but it can't be casted.
As far as I understand it I have to either validate the
Io_mem_dataspace_capability or cast to it.

Regards,
Johannes

--
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: Linux IO_MEM session

2018-01-19 Thread Johannes Kliemann
Hi Norman

thanks for your help.

> On base-linux, there exists a custom 'Dataspace_component'
> implementation. In contrast to the regular version that maintains the
> information about the dataspace's physical address, the base-linux
> version has a file descriptor as member variable and the setter 'fd' to
> assign it. For RAM dataspaces, the file descriptor is assigned by (the
> Linux-specific implementation of)
> 'Ram_dataspace_factory::_export_ram_ds'. For ROM dataspaces, the file
> descriptor is assigned by the 'Dataspace_components(args)' constructor.
> 
> Your approach of introducing a base-linux-specific version of
> 'io_mem_session_component.h' is good. Like in the regular version, it
> hosts a 'Dataspace_component' object. But additionally, it would obtain
> the file descriptor from your kernel driver and assign it to the
> dataspace object. This could be done in the constructor (which now just
> prints the warning message). Once assigned, the rest (in particular the
> passing of the fd to the clients via RPC) should work out of the box.
> 
> For a quick test to see if the fd-passing over component boundaries
> works, you may first open just a regular file with known content and let
> an IO_MEM client (living outside of core) attach the dataspace and print
> its content.
So if I understand it correctly just opening the file and calling
_ds.fd(fd) would be enough (beside having the Dataspace_component _ds)?

I implemented this but when I try to attach the dataspace I get a
segfault. I though this might be related to a wrong physical address for
the file but the backtrace leaves me completely clueless.


> #0  pseudo_end () at 
> /media/sf_kernel/genode/repos/base-linux/src/lib/syscall/spec/x86_64/lx_syscall.S:29
> #1  0x0109d7c1 in lx_futex (val=0, op=0, uaddr=) at 
> /media/sf_kernel/genode/repos/base-linux/src/lib/syscall/linux_syscalls.h:350
> #2  thread_stop_myself () at 
> /media/sf_kernel/genode/repos/base-linux/src/include/base/internal/lock_helper.h:66
> #3  Genode::Cancelable_lock::lock (this=this@entry=0x80ffae0) at 
> /media/sf_kernel/genode/repos/base/src/lib/base/lock.cc:123
> #4  0x010b19c8 in Genode::Lock::lock (this=) at 
> /media/sf_kernel/genode/repos/base/include/base/lock.h:33
> #5  Genode::sleep_forever () at 
> /media/sf_kernel/genode/repos/base/src/lib/base/sleep.cc:21
> #6  0x01065eb8 in Genode::Signal_receiver::block_for_signal 
> (this=this@entry=0x64b4a70 )
> at /media/sf_kernel/genode/repos/base/src/core/signal_receiver.cc:49
> #7  0x01096a70 in Genode::Entrypoint::_process_incoming_signals 
> (this=this@entry=0x64b3e40 )
> at /media/sf_kernel/genode/repos/base/src/lib/base/entrypoint.cc:108
> #8  0x0109772e in Genode::Entrypoint::Entrypoint (this=0x64b3e40 
> , env=...)
> at /media/sf_kernel/genode/repos/base/src/lib/base/entrypoint.cc:329
> #9  0x010915ac in Genode::Startup::Startup (this=0x64b3ce0 
> )
> at /media/sf_kernel/genode/repos/base/src/lib/base/component.cc:244
> #10 Genode::bootstrap_component () at 
> /media/sf_kernel/genode/repos/base/src/lib/base/component.cc:259
> #11 0x010cd016 in _main () at 
> /media/sf_kernel/genode/repos/base/src/lib/startup/_main.cc:248
> #12 0x in ?? ()

Regards,
Johannes

--
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


Linux IO_MEM session

2018-01-16 Thread Johannes Kliemann
Hi all,

I'm currently implementing a IO_MEM session for base-linux. The basic
idea is as follows:

 - core opens a file in /dev/ and calls an ioctl on the file to set a
memory range.
 - it passes this file descriptor to the child process that requested
the session
 - the child process mmaps the requested memory range from the file
descriptor

The required device on Linux is already available (if you're interested,
I've written a kernel module to provide it in [1]) so that isn't the
problem.
I tried to implement the IO_MEM session on base-linux but lack the
understanding of how the Linux_dataspace and the Io_mem_dataspace are
different. On base the Io_mem_session_component gets the dataspace
capability from

> _ds_cap = static_cap_cast(_ds_ep->manage(&_ds));

This doesn't work with base-linux since I can't cast the Linux_dataspace
to Io_mem_dataspace. Yet I don't understand what I need to do this.

I also didn't find out what parts of the session are executed in which
context (speaking what runs in core and what in the component itself),
especially where I would put the actual mmap call.

My current implementation of the IO_MEM session is at [2] and [3].

Regards,
Johannes

[1]: https://github.com/jklmnn/hwiodev
[2]:
https://github.com/jklmnn/genode/blob/0cfcec98ad4d4fdfc7bf6cc6e6df3567360b4e9c/repos/base-linux/src/core/include/io_mem_session_component.h
[3]:
https://github.com/jklmnn/genode/blob/0cfcec98ad4d4fdfc7bf6cc6e6df3567360b4e9c/repos/base-linux/src/core/io_mem_session_component.cc

--
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 canceled in entrypoint constructor

2018-01-16 Thread Johannes Kliemann
Hi Christian,

thanks for these hints. I have logged the signals and SIGCHLD is
received directly before the occurrence of the warning so I suspect that
this is the problematic signal.
I also set up a signal handler to catch all other signals and it only
logged the according signal number.

Regards,
Johannes

Am 12.01.2018 um 16:32 schrieb Christian Helmuth:
> Hello Johannes,
> 
> On Fri, Jan 12, 2018 at 01:09:25PM +0100, Johannes Kliemann wrote:
>> Why does Genode handle -EINTR with an exception and not the way proposed
>> in the GNU manual?
> 
> We use the Linux signal mechanism with signal SIGUSR1 to implement our
> cancelable lock. So, if a thread is unblocked with the EINTR error it
> reflects the cancellation by throwing this exception. Core's initial
> thread is unblocked only once by this mechanism and then blocks in
> 
>   ./base/src/core/signal_receiver.cc:41:void 
> Signal_receiver::block_for_signal()
> 
> Did you find out which signal occurred in core? We setup several
> signal handlers for fatal signals (e.g., SIGSEGV) that log diagnostic
> info and also
> 
>   src/core/thread_linux.cc:45SIGUSR1
>   ./src/core/platform.cc:95  SIGINT
>   ./src/core/platform.cc:98  SIGCHLD
> 
> You could try to setup more handlers this way and log signal
> occurrence.
> 
> Cheers
> 

--
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


blocking canceled in entrypoint constructor

2018-01-12 Thread Johannes Kliemann
Hi all,

When running Genode on Linux as PID 1 I get the warning `blocking
canceled in entrypoint constructor`. This seems to happen only when
running as init process. When I run the same configuration on Linux with
the usual user land this doesn't happen. I have also applied the patch
to [1] (I have tested this on 17.11 where it is applied anyway).
Changing the underlying Linux kernel did not help.

I could trace the issue to repos/base-linux/src/lib/base/ipc.cc:421 [2]
where lx_recvmsg returns -EINTR. The proposed way to handle this error
according to the GNU reference [3] is to retry the syscall. Yet Genode
does not and throws an exception.

Is there any signal that only the init process receives that isn't
handled properly in Genode (sorry if this is slightly off-topic)?

Why does Genode handle -EINTR with an exception and not the way proposed
in the GNU manual?

Regards,
Johannes Kliemann

[1]: https://github.com/genodelabs/genode/issues/2521
[2]:
https://github.com/genodelabs/genode/blob/f44edd407bf674bfad11accad8319d5f66110b44/repos/base-linux/src/lib/base/ipc.cc#L421
[3]:
https://www.gnu.org/software/libc/manual/html_node/Interrupted-Primitives.html#Interrupted-Primitives

--
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: Constrained file descriptors

2018-01-05 Thread Johannes Kliemann
Hi Norman,

> As another principle idea - at least for handing out MMIO mappings for
> PCI resources, you may have a look at the pseudo files under
> /sys/devices. Here you can find all memory-mapped PCI resources as
> files, which could be mapped in user space via 'mmap'. E.g., the
> following command lists the available resources (with their file size
> corresponding to the information given by 'lspci -v'):
> 
>   ls -l `find /sys/devices/pci\:00 -name "resource*"`
> 
> However, this approach has some caveats:
> 
> * Core's IO_MEM service hands out resources based on their physical
>   address. You would need to search /sys/devices for the matching PCI
>   resource.
> 
> * A user-level device driver may request just a window of a PCI
>   resource. So the dataspace handed out by core would need to carry the
>   information about its offset from the beginning of the underlying
> file. We are somehow back at the start of the discussion. :-/
> 
> * It only works for the (arguably most prominent) case of PCI
>   resources but not for other mappings. I am in particular thinking
>   of the mapping of the PCI config space, which we will need to
>   run the platform driver once the issue "RFC platform_drv/x86:
>   Switch to ECAM/MMCONF" [1] is closed. I guess that we would need
>   to have a Linux-specific platform driver then.
> 
> [1] https://github.com/genodelabs/genode/pull/2547
> 
> That said, in my opinion the tinkering with the files at /sys/ is not
> very attractive. If you are prepared to develop a generic kernel module
> for solving this problem at a lower level (and allowing us to reuse our
> existing platform driver on Linux), this should be the way to go.

We also thought about these options and came to the same conclusions.
Furthermore sysfs is something we probably want to remove in the future
so we don't want to depend on it anyway. Also at the implementation of
interrupts we will need a kernel module/patch anyway since we didn't
find any way to get them into the userspace (except polling
/proc/interrupts which is a really bad hack).

About the specific PCI memory spaces, as far as I know PCI is mainly
available on X86. Since the use of the Linux kernel is intended for
exotic platforms without a supported micro kernel (on X86 we can stay
with NOVA) where PCI most probably isn't available we definitely want to
create a generic solution to access MMIO space.

Thanks for your thoughts and regards,
Johannes

--
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: Constrained file descriptors

2018-01-04 Thread Johannes Kliemann
Hi Christian,

thanks for that info. We also found memfd_create and came to the same
conclusion that it won't work for our use case.
Since there seems to be no way to constrain /dev/mem as we need we most
probably will implement this functionality by ourselves on the kernel
either through a kernel module or by adding a new custom syscall.

UIO solved this issue but also by creating a small custom kernel module
for each driver what we wanted to prevent in the first place.
Since we now need to change the kernel anyway we won't use UIO because
the kernel also should become as small as possible at some point.

Greets
Johannes

Am 03.01.2018 um 09:45 schrieb Christian Helmuth:
> Hello Johannes,
> 
> On Fri, Dec 29, 2017 at 07:37:39PM +0100, Johannes Kliemann wrote:
>> before Christmas we chatted about enabling the MMIO session on Linux.
>> You said that you know a possibility to create constrained file
>> descriptors (in such a way that accesses through this descriptor can
>> only access a part of the file). I've done a second search but I
>> couldn't find any useful information regarding this topic.
>> Do you have any further, more specific, information about how to achieve
>> this goal?
> 
> I had a chat with Norman and we're not sure if he was referring to
> memfd_create() [1] which, unfortunately, does not solve the issue as
> it only handles anonymous memory. Maybe adding "android" to the
> keywords on your internet search brings up more interesting hits?
> Also, uio has solve this issue too, right?
> 
> [1] http://man7.org/linux/man-pages/man2/memfd_create.2.html
> [2] https://www.kernel.org/doc/html/latest/driver-api/uio-howto.html
> 
> Greets
> 

--
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


Constrained file descriptors

2017-12-29 Thread Johannes Kliemann
Hi Norman,

before Christmas we chatted about enabling the MMIO session on Linux.
You said that you know a possibility to create constrained file
descriptors (in such a way that accesses through this descriptor can
only access a part of the file). I've done a second search but I
couldn't find any useful information regarding this topic.
Do you have any further, more specific, information about how to achieve
this goal?

Regards,
Johannes

--
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: wifi: assignment of PCI device failed

2017-12-21 Thread Johannes Kliemann
Hi Alex,

I have tested your fix and can confirm that it solves the issue.

Regards,
Johannes

Am 18.12.2017 um 14:28 schrieb Alexander Boettcher:
> Hi Johannes,
> 
> On 07.12.2017 10:11, Johannes Kliemann wrote:
>> Yet this doesn't explain the second error that iwl is timing out waiting
>> for the hardware.
> 
> as discussed off-line, I could reproduce it on one of our machines. May
> you please give the commits of [0] a spin, which solves the issue for
> the one machine from us.
> 
> Thanks,
> 
> Alex.
> 
> [0] https://github.com/genodelabs/genode/issues/2620
> 
>>
>> Regards,
>> Johannes
>>
>> Am 05.12.2017 um 17:06 schrieb Johannes Kliemann:
>>> Hi Alex,
>>>
>>> thanks to your hint with Issue #2207 I was able to get the value of res
>>> which is 9. What I find interesting is the fact that it now seems to be
>>> able to assign the PCI device as you can see in [1].
>>>
>>>> [platform_drv] wifi_drv -> : assignment of PCI device 4:0.0 succeeded
>>>
>>> Yet everything else seems to behave as before. The timeout errors still
>>> appear and there doesn't seem to be any actual connection attempt.
>>>
>>> I have built this from [2] which currently incorporates log_core_kernel,
>>> NOVA VGA support and benders fix free memory calculation (if this
>>> information is useful to you).
>>>
>>> Regards,
>>> Johannes
>>>
>>> [1]: https://imgur.com/a/osaVJ
>>> [2]:
>>> https://github.com/jklmnn/genode/tree/8a64415f52df2dee30e8fcd279e16d1b18eb2fb9
>>>
>>> Am 04.12.2017 um 22:14 schrieb Alexander Boettcher:
>>>> Hello,
>>>>
>>>> On 04.12.2017 10:04, Johannes Kliemann wrote:
>>>>> Hi all,
>>>>>
>>>>> I tried to use the Wifi driver for Intel wifi chips.
>>>>> When running the driver I get the following messages:
>>>>>
>>>>>> [platform_drv] Error: wifi_drv -> : assignment of PCI device 4:0.0
>>>>> failed phys=0xf840 virt=0x10
>>>>> and
>>>>>
>>>>>> [wifi_drv] [iwl_trans_pcie_grap_nic_access] *WARN* Timeout waiting for
>>>>> hardware access (CSR_GP_CNTRL 0x)
>>>>>
>>>>> The corresponding run file [1] is explicitly written without any default
>>>>> routes. I can only provide a photo of the log output [2] (at least the
>>>>> visible part) as I don't have any other debug method yet on this hardware.
>>>>>
>>>>> I thought that this was a missing route but I couldn't find a related
>>>>> message and assigning default routes didn't fix it.
>>>>> The error seems to appear in
>>>>> repos/base-nova/src/core/pd_session_support.cc:assign_pci returning
>>>>> false but I couldn't find out why this happens.
>>>>> Does anyone have an idea?
>>>>
>>>> What is or maybe are the value(s) for the variable 'res' in
>>>> repos/base-nova/src/core/pd_session_support.cc:assign_pci ?
>>>>
>>>
>>> --
>>> 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
>>
> 

--
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: wifi: assignment of PCI device failed

2017-12-19 Thread Johannes Kliemann
Hi Alex,

unfortunately I don't have the device with me currently. I will test
those commits next time I get it into my hands ;)

Johannes

Am 18.12.2017 um 14:28 schrieb Alexander Boettcher:
> Hi Johannes,
> 
> On 07.12.2017 10:11, Johannes Kliemann wrote:
>> Yet this doesn't explain the second error that iwl is timing out waiting
>> for the hardware.
> 
> as discussed off-line, I could reproduce it on one of our machines. May
> you please give the commits of [0] a spin, which solves the issue for
> the one machine from us.
> 
> Thanks,
> 
> Alex.
> 
> [0] https://github.com/genodelabs/genode/issues/2620
> 
>>
>> Regards,
>> Johannes
>>
>> Am 05.12.2017 um 17:06 schrieb Johannes Kliemann:
>>> Hi Alex,
>>>
>>> thanks to your hint with Issue #2207 I was able to get the value of res
>>> which is 9. What I find interesting is the fact that it now seems to be
>>> able to assign the PCI device as you can see in [1].
>>>
>>>> [platform_drv] wifi_drv -> : assignment of PCI device 4:0.0 succeeded
>>>
>>> Yet everything else seems to behave as before. The timeout errors still
>>> appear and there doesn't seem to be any actual connection attempt.
>>>
>>> I have built this from [2] which currently incorporates log_core_kernel,
>>> NOVA VGA support and benders fix free memory calculation (if this
>>> information is useful to you).
>>>
>>> Regards,
>>> Johannes
>>>
>>> [1]: https://imgur.com/a/osaVJ
>>> [2]:
>>> https://github.com/jklmnn/genode/tree/8a64415f52df2dee30e8fcd279e16d1b18eb2fb9
>>>
>>> Am 04.12.2017 um 22:14 schrieb Alexander Boettcher:
>>>> Hello,
>>>>
>>>> On 04.12.2017 10:04, Johannes Kliemann wrote:
>>>>> Hi all,
>>>>>
>>>>> I tried to use the Wifi driver for Intel wifi chips.
>>>>> When running the driver I get the following messages:
>>>>>
>>>>>> [platform_drv] Error: wifi_drv -> : assignment of PCI device 4:0.0
>>>>> failed phys=0xf840 virt=0x10
>>>>> and
>>>>>
>>>>>> [wifi_drv] [iwl_trans_pcie_grap_nic_access] *WARN* Timeout waiting for
>>>>> hardware access (CSR_GP_CNTRL 0x)
>>>>>
>>>>> The corresponding run file [1] is explicitly written without any default
>>>>> routes. I can only provide a photo of the log output [2] (at least the
>>>>> visible part) as I don't have any other debug method yet on this hardware.
>>>>>
>>>>> I thought that this was a missing route but I couldn't find a related
>>>>> message and assigning default routes didn't fix it.
>>>>> The error seems to appear in
>>>>> repos/base-nova/src/core/pd_session_support.cc:assign_pci returning
>>>>> false but I couldn't find out why this happens.
>>>>> Does anyone have an idea?
>>>>
>>>> What is or maybe are the value(s) for the variable 'res' in
>>>> repos/base-nova/src/core/pd_session_support.cc:assign_pci ?
>>>>
>>>
>>> --
>>> 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
>>
> 

--
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: wifi: assignment of PCI device failed

2017-12-07 Thread Johannes Kliemann
Hi Alex,

as we have discussed yesterday, I tried enabling and disabling Vt-d.
This does deterministically affect the PCI assignment so I think that
missing Vt-d was the reason for the PCI error.

Yet this doesn't explain the second error that iwl is timing out waiting
for the hardware.

Regards,
Johannes

Am 05.12.2017 um 17:06 schrieb Johannes Kliemann:
> Hi Alex,
> 
> thanks to your hint with Issue #2207 I was able to get the value of res
> which is 9. What I find interesting is the fact that it now seems to be
> able to assign the PCI device as you can see in [1].
> 
>> [platform_drv] wifi_drv -> : assignment of PCI device 4:0.0 succeeded
> 
> Yet everything else seems to behave as before. The timeout errors still
> appear and there doesn't seem to be any actual connection attempt.
> 
> I have built this from [2] which currently incorporates log_core_kernel,
> NOVA VGA support and benders fix free memory calculation (if this
> information is useful to you).
> 
> Regards,
> Johannes
> 
> [1]: https://imgur.com/a/osaVJ
> [2]:
> https://github.com/jklmnn/genode/tree/8a64415f52df2dee30e8fcd279e16d1b18eb2fb9
> 
> Am 04.12.2017 um 22:14 schrieb Alexander Boettcher:
>> Hello,
>>
>> On 04.12.2017 10:04, Johannes Kliemann wrote:
>>> Hi all,
>>>
>>> I tried to use the Wifi driver for Intel wifi chips.
>>> When running the driver I get the following messages:
>>>
>>>> [platform_drv] Error: wifi_drv -> : assignment of PCI device 4:0.0
>>> failed phys=0xf840 virt=0x10
>>> and
>>>
>>>> [wifi_drv] [iwl_trans_pcie_grap_nic_access] *WARN* Timeout waiting for
>>> hardware access (CSR_GP_CNTRL 0x)
>>>
>>> The corresponding run file [1] is explicitly written without any default
>>> routes. I can only provide a photo of the log output [2] (at least the
>>> visible part) as I don't have any other debug method yet on this hardware.
>>>
>>> I thought that this was a missing route but I couldn't find a related
>>> message and assigning default routes didn't fix it.
>>> The error seems to appear in
>>> repos/base-nova/src/core/pd_session_support.cc:assign_pci returning
>>> false but I couldn't find out why this happens.
>>> Does anyone have an idea?
>>
>> What is or maybe are the value(s) for the variable 'res' in
>> repos/base-nova/src/core/pd_session_support.cc:assign_pci ?
>>
> 
> --
> 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: wifi: assignment of PCI device failed

2017-12-05 Thread Johannes Kliemann
Hi Alex,

thanks to your hint with Issue #2207 I was able to get the value of res
which is 9. What I find interesting is the fact that it now seems to be
able to assign the PCI device as you can see in [1].

> [platform_drv] wifi_drv -> : assignment of PCI device 4:0.0 succeeded

Yet everything else seems to behave as before. The timeout errors still
appear and there doesn't seem to be any actual connection attempt.

I have built this from [2] which currently incorporates log_core_kernel,
NOVA VGA support and benders fix free memory calculation (if this
information is useful to you).

Regards,
Johannes

[1]: https://imgur.com/a/osaVJ
[2]:
https://github.com/jklmnn/genode/tree/8a64415f52df2dee30e8fcd279e16d1b18eb2fb9

Am 04.12.2017 um 22:14 schrieb Alexander Boettcher:
> Hello,
> 
> On 04.12.2017 10:04, Johannes Kliemann wrote:
>> Hi all,
>>
>> I tried to use the Wifi driver for Intel wifi chips.
>> When running the driver I get the following messages:
>>
>>> [platform_drv] Error: wifi_drv -> : assignment of PCI device 4:0.0
>> failed phys=0xf840 virt=0x10
>> and
>>
>>> [wifi_drv] [iwl_trans_pcie_grap_nic_access] *WARN* Timeout waiting for
>> hardware access (CSR_GP_CNTRL 0x)
>>
>> The corresponding run file [1] is explicitly written without any default
>> routes. I can only provide a photo of the log output [2] (at least the
>> visible part) as I don't have any other debug method yet on this hardware.
>>
>> I thought that this was a missing route but I couldn't find a related
>> message and assigning default routes didn't fix it.
>> The error seems to appear in
>> repos/base-nova/src/core/pd_session_support.cc:assign_pci returning
>> false but I couldn't find out why this happens.
>> Does anyone have an idea?
> 
> What is or maybe are the value(s) for the variable 'res' in
> repos/base-nova/src/core/pd_session_support.cc:assign_pci ?
> 

--
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: wifi: assignment of PCI device failed

2017-12-04 Thread Johannes Kliemann
Hello Christian,

thanks for your help. I have taken the platform_drv configuration from
repos/base/run/platform_drv.inc and only changed the routes to be
explicit. I rechecked and the runfile does indeed contain the line with
constrain_phys [1]. I have also tested several other drivers (ahci_drv,
audio_drv, nic_drv) with run files based on the same code and only the
wifi driver showed this behaviour.

Regards,

Johannes

[1]:
https://github.com/jklmnn/base-linux-hw/blob/5824238397139b012785f056c1267018877a7054/run/wifi_test_log.run#L209

Am 04.12.2017 um 17:35 schrieb Christian Helmuth:
> Hello Johannes,
> 
> just an idea...
> 
> On Mon, Dec 04, 2017 at 10:04:36AM +0100, Johannes Kliemann wrote:
>>> [platform_drv] Error: wifi_drv -> : assignment of PCI device 4:0.0
>> failed phys=0xf840 virt=0x10
> 
> This physical address seems fairly high. Are you sure you enabled the
> platform_drv to apply constrains to dataspace allocations? Your start
> node should contain something like
> 
>   
> 
> Greets
> 

--
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


wifi: assignment of PCI device failed

2017-12-04 Thread Johannes Kliemann
Hi all,

I tried to use the Wifi driver for Intel wifi chips.
When running the driver I get the following messages:

> [platform_drv] Error: wifi_drv -> : assignment of PCI device 4:0.0
failed phys=0xf840 virt=0x10
and

> [wifi_drv] [iwl_trans_pcie_grap_nic_access] *WARN* Timeout waiting for
hardware access (CSR_GP_CNTRL 0x)

The corresponding run file [1] is explicitly written without any default
routes. I can only provide a photo of the log output [2] (at least the
visible part) as I don't have any other debug method yet on this hardware.

I thought that this was a missing route but I couldn't find a related
message and assigning default routes didn't fix it.
The error seems to appear in
repos/base-nova/src/core/pd_session_support.cc:assign_pci returning
false but I couldn't find out why this happens.
Does anyone have an idea?

Regards,
Johannes

[1]:
https://github.com/jklmnn/base-linux-hw/blob/5824238397139b012785f056c1267018877a7054/run/wifi_test_log.run
[2]: https://imgur.com/a/DkWTq

--
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: binary naming

2017-11-02 Thread Johannes Kliemann
Thanks, that's exactly what I needed.

Am 01.11.2017 um 15:40 schrieb Christian Helmuth:
> Hello Johannes,
> 
> I don't know exactly the compilation dependencies of your init binary
> and how it should be built. But, you may have a look into
> 
>   repos/base-linux/src/test/lx_hybrid_ctors/target.mk
> 
> which generates a libtestlib.so shared object for testing on
> base-linux. The target.mk just adds a special target which the
> original TARGET depends on, but it handles the compilation and linking
> manually.
> 
> Hope this helps
> 

--
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: binary naming

2017-11-01 Thread Johannes Kliemann
Hi Norman,

just a follow up question: instead of putting a prebuilt binary of init
into the repo I want to build it from source. Yet I haven't found out
how to tell the build system to build it with completely custom options
preferably via the target.mk. I tried to set CFLAGS and LDFLAGS there
but the build system still does it's own linking which makes the binary
segfaulting if executed on the host.
Is there a way to do this or do I need to build it externally?

Regards,
Johannes

Am 26.10.2017 um 13:39 schrieb Johannes Kliemann:
> Hi Norman,
> 
> using a separate init to chdir also made the segfault disappear and I
> can now successfully run the timer test on Linux [1].
> 
> Regards,
> Johannes
> 
> [1]:
> https://github.com/jklmnn/genode/commit/5cee03703b78018ab42398a3245f8bb148ca9281
> 
> 
> On 10/25/17 11:39, Norman Feske wrote:
>> Hi Johannes,
>>
>> for bootstrapping core, I'd create a custom (statically compiled)
>> program that merely performs a 'chdir /genode' followed by 'execve
>> '/genode/core'. This keeps core clean of the bootstrapping magic. This
>> bootstrapping program can be called '/init' whereas everything
>> Genode-related resides as '/genode/'.
>>
>> I have no good idea about the segfault though. It definitely happens in
>> init, not core because the fault occurs in 'ld.lib.so', which is not
>> used by core. You may inspect the debug version of the ld.lib.so binary
>> (using 'objdump -lSd debug/ld-linux.lib.so') at the faulting ip. The
>> offset from the start of 'ld-linux.lib.so' can be calculated by
>> subtracting the load address of ld.lib.so (as reported by the kernel)
>> from the ip of the fault.
>>
>> Cheers
>> Norman
>>
> 
> --
> 
> 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: binary naming

2017-10-26 Thread Johannes Kliemann

Hi Norman,

using a separate init to chdir also made the segfault disappear and I 
can now successfully run the timer test on Linux [1].


Regards,
Johannes

[1]: 
https://github.com/jklmnn/genode/commit/5cee03703b78018ab42398a3245f8bb148ca9281


On 10/25/17 11:39, Norman Feske wrote:

Hi Johannes,

for bootstrapping core, I'd create a custom (statically compiled)
program that merely performs a 'chdir /genode' followed by 'execve
'/genode/core'. This keeps core clean of the bootstrapping magic. This
bootstrapping program can be called '/init' whereas everything
Genode-related resides as '/genode/'.

I have no good idea about the segfault though. It definitely happens in
init, not core because the fault occurs in 'ld.lib.so', which is not
used by core. You may inspect the debug version of the ld.lib.so binary
(using 'objdump -lSd debug/ld-linux.lib.so') at the faulting ip. The
offset from the start of 'ld-linux.lib.so' can be calculated by
subtracting the load address of ld.lib.so (as reported by the kernel)
from the ip of the fault.

Cheers
Norman



--
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: binary naming

2017-10-25 Thread Johannes Kliemann

Hi,

thanks for that info, but I think there's a misunderstanding.
The kernel command line "init=" is only evaluated if the kernel boots 
without initrd or initramfs. Initramfs does always need /init (such as 
an initrd always needs /linuxrc) [1]. This is only relevant to the init 
system used after the root fs is mounted. This is supported by man 7 
bootparam which says



'init=...'
  This sets the initial command to be executed by the kernel.  If 
this is not set, or cannot be found, the kernel will try /sbin/init, then 
/etc/init, then /bin/init, then /bin/sh  and  panic  if
  all of this fails.


I have also tested this behavior by running Genode on Linux with 
init=/genode/core which still resulted in the kernel loading /init from 
the initramfs.


Sorry for the slight off topic. If I have any mistakes in my thoughts 
please correct me.


Regards,
Johannes

[1]: https://wiki.debian.org/initramfs


On 10/24/17 18:59, Nobody III wrote:

Also, you could use the kernel command line, e.g. "init=/genode/core".

On Tue, Oct 24, 2017 at 10:20 AM, Johannes Kliemann 
<johannes.kliem...@tu-dresden.de 
<mailto:johannes.kliem...@tu-dresden.de>> wrote:


Hi again,

I fixed the file naming and I don't need to rename the files anymore
(I forgot to prepend the correct directory in the cpio archive).
With the cpio initramfs I chdir into /genode from the ROM session
and correctly find the libraries. Yet the segfault and warning I
described in the last mail still appear.

To reproduce the problem with the current state, check out [1]. The
build configuration is the same as in the last mail.

Regards,
Johannes

[1]:

https://github.com/jklmnn/genode/commit/2c899063f2bad1318bbde88f2472e017fc72be34

<https://github.com/jklmnn/genode/commit/2c899063f2bad1318bbde88f2472e017fc72be34>


    On 10/24/17 11:27, Johannes Kliemann wrote:

Hi,

while booting Genode directly on Linux I encountered the problem
that
Linux requires to call `/init` in the initramfs. Unfortunately
Genode
requires to call `core` which loads `init` so renaming core to init
isn't enough.


I renamed init to init2 core to init and called it with
"label=init2"
which works at first (core finds all ROM sessions) but then
segfaults
with "init2[45]: segfault at 7f11c473b128 ip 7f11c4645f40 sp
7ffc1c8c15f8 error 4 in ld.lib.so
<http://ld.lib.so>[7f11c45c5000+95000]" and the
warning "Warning: blocking canceled in entrypoint constructor".

This warning was addressed on Linux before in [0] and fixed in
ad2859b6b9dae96c48329eebc0a73527ba4deb9b. I have already
included this
patch.

To boot Genode on Linux with this behaviour, checkout [1] and change
"KERNEL_RUN_OPT(linux) := --include power_on/linux --include
log/linux"
to
"KERNEL_RUN_OPT(linux) := $(QEMU_RUN_OPT)"
in your etc/build.conf (with linux as kernel ofc).

Beside renaming I also tried to make the ROM session chdir into
a sub
directory or to prepend this directory to the binary name.
Neither of
made Genode correctly find the binaries. I have to say that
Linux is not
booting into a real fs but is using a initramfs which consists
of a cpio
archive.

What would be the way to go to either rename the binaries to a Linux
compatible scheme or to change the library search to find its
binaries
in a cpio archive (both options should be changeable at build
time to
still use the current linux)?

Regards,
Johannes

[0]: https://github.com/genodelabs/genode/issues/2521
<https://github.com/genodelabs/genode/issues/2521>
[1]:

https://github.com/jklmnn/genode/commit/ef4becffcfc4bfc4079ff411872023b0362f346c

<https://github.com/jklmnn/genode/commit/ef4becffcfc4bfc4079ff411872023b0362f346c>


--
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
<mailto:genode-main@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/genode-main
<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: binary naming

2017-10-24 Thread Johannes Kliemann

Hi again,

I fixed the file naming and I don't need to rename the files anymore (I 
forgot to prepend the correct directory in the cpio archive).
With the cpio initramfs I chdir into /genode from the ROM session and 
correctly find the libraries. Yet the segfault and warning I described 
in the last mail still appear.


To reproduce the problem with the current state, check out [1]. The 
build configuration is the same as in the last mail.


Regards,
Johannes

[1]: 
https://github.com/jklmnn/genode/commit/2c899063f2bad1318bbde88f2472e017fc72be34


On 10/24/17 11:27, Johannes Kliemann wrote:

Hi,

while booting Genode directly on Linux I encountered the problem that
Linux requires to call `/init` in the initramfs. Unfortunately Genode
requires to call `core` which loads `init` so renaming core to init
isn't enough.


I renamed init to init2 core to init and called it with "label=init2"
which works at first (core finds all ROM sessions) but then segfaults
with "init2[45]: segfault at 7f11c473b128 ip 7f11c4645f40 sp
7ffc1c8c15f8 error 4 in ld.lib.so[7f11c45c5000+95000]" and the
warning "Warning: blocking canceled in entrypoint constructor".

This warning was addressed on Linux before in [0] and fixed in
ad2859b6b9dae96c48329eebc0a73527ba4deb9b. I have already included this
patch.

To boot Genode on Linux with this behaviour, checkout [1] and change
"KERNEL_RUN_OPT(linux) := --include power_on/linux --include log/linux"
to
"KERNEL_RUN_OPT(linux) := $(QEMU_RUN_OPT)"
in your etc/build.conf (with linux as kernel ofc).

Beside renaming I also tried to make the ROM session chdir into a sub
directory or to prepend this directory to the binary name. Neither of
made Genode correctly find the binaries. I have to say that Linux is not
booting into a real fs but is using a initramfs which consists of a cpio
archive.

What would be the way to go to either rename the binaries to a Linux
compatible scheme or to change the library search to find its binaries
in a cpio archive (both options should be changeable at build time to
still use the current linux)?

Regards,
Johannes

[0]: https://github.com/genodelabs/genode/issues/2521
[1]:
https://github.com/jklmnn/genode/commit/ef4becffcfc4bfc4079ff411872023b0362f346c

--
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: Qt5: Signals and QApplications inside Threads

2017-10-24 Thread Johannes Kliemann

Hi Boris,

I have a similar problem with running a Qt application from a second 
thread. In my case it segfaulted after QApplication::app.


Christian gave me a hint I wasn't able to try yet, but maybe it could be 
helpful for you, too.



On Mon, Oct 16, 2017 at 01:42:04PM +0200, Johannes Kliemann wrote:

I tried to create a provide an input session from a libc (in this case
an Qt application). If I just run it from the Main struct it will
correctly announce the session but since Main never returns, no client
will be able to use it.
I tried to circumvent this by putting the application into a separate
thread but this led to the following error:


Error: void Libc::Kernel::run(Libc::Application_code&) called from non-kernel 
context


Running this Qt application without wrapping it into with_libc makes it
segfault on initialization.

What is the correct way to do this? My current main is at [1].


Unfortunately, there is no "correct" way of implementing tasks like
the described currently. I must admit that with_libc() is the most
confusing function in Genode currently and we therefore will remove it
from the API soon. In fact, I myself did not expect that with_libc()
is needed in your context but there may be dependencies unknown to me.

I'd suggest a careful look into libports/src/app/avplay which provides
an input session too. The approach there is to create a second Genode
entrypoint for the input service and execute Qt code in the component
thread. I strongly encourage you not just to copy the avplay code as
it uses the older, low-level Rpc_entrypoint but use
Genode::Entrypoint.


Regards,
Johannes

On 10/23/17 15:51, Boris Mulder wrote:

Dear Genode folks,

I have built an application with Qt5. I want it to also be able to read
ROM modules from a report_rom server and to be able to handle updates to
that ROM using signals.

When I run QApplication::exec() however, it does not return and the
entrypoint cannot listen to signals, causing them to be ignored.

So I created another QThread and run my QApplication in there. Now I get
the following error:

     WARNING: QApplication was not created in the main() thread.

And the application does not do anything and does not react to events.

What can I do to be able to run both the qt event loop and the genode
event loop?


regards,

Boris



--
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


binary naming

2017-10-24 Thread Johannes Kliemann
Hi,

while booting Genode directly on Linux I encountered the problem that
Linux requires to call `/init` in the initramfs. Unfortunately Genode
requires to call `core` which loads `init` so renaming core to init
isn't enough.


I renamed init to init2 core to init and called it with "label=init2"
which works at first (core finds all ROM sessions) but then segfaults
with "init2[45]: segfault at 7f11c473b128 ip 7f11c4645f40 sp
7ffc1c8c15f8 error 4 in ld.lib.so[7f11c45c5000+95000]" and the
warning "Warning: blocking canceled in entrypoint constructor".

This warning was addressed on Linux before in [0] and fixed in
ad2859b6b9dae96c48329eebc0a73527ba4deb9b. I have already included this
patch.

To boot Genode on Linux with this behaviour, checkout [1] and change
"KERNEL_RUN_OPT(linux) := --include power_on/linux --include log/linux"
to
"KERNEL_RUN_OPT(linux) := $(QEMU_RUN_OPT)"
in your etc/build.conf (with linux as kernel ofc).

Beside renaming I also tried to make the ROM session chdir into a sub
directory or to prepend this directory to the binary name. Neither of
made Genode correctly find the binaries. I have to say that Linux is not
booting into a real fs but is using a initramfs which consists of a cpio
archive.

What would be the way to go to either rename the binaries to a Linux
compatible scheme or to change the library search to find its binaries
in a cpio archive (both options should be changeable at build time to
still use the current linux)?

Regards,
Johannes

[0]: https://github.com/genodelabs/genode/issues/2521
[1]:
https://github.com/jklmnn/genode/commit/ef4becffcfc4bfc4079ff411872023b0362f346c

--
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


additional base linux core

2017-10-17 Thread Johannes Kliemann
Hi,

I want to create a base-linux core that is able to run on a bare linux
kernel to use it such as any other microkernel in Genode. Since
base-linux already implements some of the required interfaces I'd like
to reuse the already existing components as much as possible.

Yet I'm not sure what the way to go is:

 - Copying the contents of base-linux into a new repository would
probably make an easy start but lead to code duplication (and I would
probably have to port all updates of base-linux).

 - I already tried to reinclude the contents of base-linux (my
repository currently only consists of Makefile fragments). Even though
it builds it's often quite hacky to relocate some of the $(REP_DIR)
entries to base-linux without breaking $(REP_DIR) itself. Also external
libs sometimes don't seem to find the correct headers.

- Directly extending base-linux would avoid these problems but this
would require either a switch to choose between the original and the new
functionality of this core or even better a "hybrid" core that is able
to run in both environments. Also this change would probably need to get
upstream (I don't know if this kind of change would be a problem generally).

What is the recommended way to do this?

Regards,
Johannes

--
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


Provide session from libc code

2017-10-16 Thread Johannes Kliemann
Hi,

I tried to create a provide an input session from a libc (in this case
an Qt application). If I just run it from the Main struct it will
correctly announce the session but since Main never returns, no client
will be able to use it.
I tried to circumvent this by putting the application into a separate
thread but this led to the following error:

> Error: void Libc::Kernel::run(Libc::Application_code&) called from non-kernel 
> context

Running this Qt application without wrapping it into with_libc makes it
segfault on initialization.

What is the correct way to do this? My current main is at [1].

Regards,
Johannes

[1]:
https://github.com/jklmnn/componolit/blob/478490f05f23ce4c64b4a386377a1212cb9106ae/src/app/onscreenkeyboard/main.cpp

--
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: default-route config

2017-10-13 Thread Johannes Kliemann
Hello Christian,

thanks for the quick response. It answered my question.

I indeed missed the reference [1], so I'll append it here. I also
created a small example with an empty default route [2] that works for me.

Regards,
Johannes

[1]:
https://github.com/jklmnn/genode/blob/d2a86faf9035e17c64a0b52aeab648fcb913f46d/repos/os/run/drv_test.run
[2]:
https://github.com/jklmnn/genode/blob/797578e903b85e64da2925b09024b6ab5d6780cc/repos/os/run/drv_test.run

Am 13.10.2017 um 16:36 schrieb Christian Helmuth:
> Hello Johannes,
> 
> On Fri, Oct 13, 2017 at 04:04:40PM +0200, Johannes Kliemann wrote:
>> I tried to completely remove the default-route with
>> any-service/any-child from my runfile and only explicitly allow services
>> to components.
>> I have created a minimal example with only the timer driver [1] but I
>> wasn't able to explicitly grant service access to the timer driver.
>>
>> When I prepend  with an explicit
>>
>>> > 
>>> 
>>
>> the timer driver fails with a denied PD environment session.
> 
> This route looks odd as it reads: Route any requests to service "PD"
> to the child "timer".
> 
>> What is the correct approach to do this?
> 
> You email missed the reference [1] but I would adapt log.run like
> follows.
> 
> +++ b/repos/base/run/log.run
> @@ -10,12 +10,15 @@ install_config {
>   
>   
>   
> - 
> -   
> - 
>   
>   
>   
> + 
> +
> +   
> +   
> +   
> + 
>   
>   
>  }
> 
> Does this answer your question?
> 
> Greets
> 

--
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


default-route config

2017-10-13 Thread Johannes Kliemann
Hi,

I tried to completely remove the default-route with
any-service/any-child from my runfile and only explicitly allow services
to components.
I have created a minimal example with only the timer driver [1] but I
wasn't able to explicitly grant service access to the timer driver.

When I prepend  with an explicit

> > 
> 

the timer driver fails with a denied PD environment session.

What is the correct approach to do this?

Regards,
Johannes

--
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


Custom InputMethod for QtVirtualKeyboard

2017-09-18 Thread Johannes Kliemann
Hi Christian,

I tried to implement a custom InputMethod for the QtVirtualKeyboard. But
I couldn't find any useful information on how to do this.

Beside the Technical Guide [1] for the keyboard there seems to be no
documentation on how to do this.

I have implemented my custom InputMethod class in QML (based on the
example) but I failed to find any useful information on how to activate
it. The part Activating an Input Method [2] is not helpful at all since
it only links to the class references of the InputEngine (which neither
explain where or how to use the custom class).

Do you have any idea?

Regards,
Johannes

[1]: https://doc.qt.io/qt-5/technical-guide.html
[2]: https://doc.qt.io/qt-5/technical-guide.html#activating-an-input-method

--
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


Qt5 QInputMethod

2017-09-04 Thread Johannes Kliemann
Hi Christian,

while working with the QtVirtualKeyboard, I noticed that I can attach a
QInputMethod directly to the keyboard which is a much cleaner solution
than using a hidden input field.

As far as I understood it, it is required to create a custom
implementation of QInput(Method|Engine|Context) (like it is done in
qtbase/src/plugins/plastforms). What do you think is the best approach
to implement this part? I though about either doing it directly in the
keyboard application (which might be more portable) or adding it to the
nitpicker integration in /qt5/qtbase/src/plugins/platforms/nitpicker
(which would make it accessible for more applications).

Regards,
Johannes

--
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: Qt5 Threads

2017-09-01 Thread Johannes Kliemann
Hi Christian,

thanks for the hint with the qpluginwidget yesterday. I looked into the
implementation and inheriting from QThread worked for me.
Is it possible that moveToThread is not working or not implemented?

Regards,
Johannes

Am 30.08.2017 um 18:10 schrieb Christian Prochaska:
> Hi Johannes,
> 
> On 30.08.2017 16:22, Johannes Kliemann wrote:
>> is anyone using threads in Qt5 applications on Genode?
>> Is it possible to use QThreads or are Genodes own threads required? If
>> so, how would I get an instance of Genode::Env in a Qt application
>> (which I would need for the thread).
> 
> QThreads are supported.
> 
> 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
> 

--
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


Qt5 Threads

2017-08-30 Thread Johannes Kliemann
Hi,

is anyone using threads in Qt5 applications on Genode?
Is it possible to use QThreads or are Genodes own threads required? If
so, how would I get an instance of Genode::Env in a Qt application
(which I would need for the thread).

Regards,
Johannes

--
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-08-15 Thread Johannes Kliemann
Thanks, that worked.
I forgot to use the whole patch when I tried to run it out of tree on a
separate machine.

Regards,
Johannes

Am 14.08.2017 um 16:40 schrieb Christian Prochaska:
> Hi Johannes,
> 
> On 14.08.2017 16:03, Johannes Kliemann wrote:
>> I finally got the plugin to load.
>> What was missing was the correct initialization in QNitpickerIntegration.
>> I have added the missing parts to load the QPlatformInputContext [1] and
>> it now finds the qtvirtualkeyboardplugin.
> 
> good to hear that!
> 
>> It isn't completely working yet but at least the application shows up.
>> What is missing are the dependencies. They require additional shared
>> libs. I tried to create the according make fragments with your script
>> but after applying qtbase_generated.patch the configure script fails to
>> generate qmake with
>>
>>> You cannot make a shadow build from a source tree containing a previous 
>>> build.
>> on a clean (except that patch) source tree. Do you have any idea about that?
> 
> Did you apply the 'qt5_create_generated_incs_with_preparation.patch'
> from a previous mail? The patch reordered the 'series' file, so that
> only the following Qt patches would be applied before the Qt
> configuration step:
> 
> qtbase_configuration.patch
> qtdeclarative_configuration.patch
> qttools_configuration.patch
> qtwebkit_fixes.patch
> qtwebkit_configuration.patch
> 
> 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
> 

--
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-08-14 Thread Johannes Kliemann
Hi Christian,

I finally got the plugin to load.
What was missing was the correct initialization in QNitpickerIntegration.
I have added the missing parts to load the QPlatformInputContext [1] and
it now finds the qtvirtualkeyboardplugin.

It isn't completely working yet but at least the application shows up.
What is missing are the dependencies. They require additional shared
libs. I tried to create the according make fragments with your script
but after applying qtbase_generated.patch the configure script fails to
generate qmake with

> You cannot make a shadow build from a source tree containing a previous build.

on a clean (except that patch) source tree. Do you have any idea about that?

Regards,
Johannes

[1]:
https://github.com/jklmnn/genode/commit/676df58996fe0f9958da49116ee5317edb8226cd

Am 09.08.2017 um 09:58 schrieb Johannes Kliemann:
> Hi Christian,
> 
> I tried to build the plugin statically but that seems to depend on
> static builds of its dependencies (which wouldn't be a big problem) and
> the QtQuick2 plugin itself.
> 
> I recreated the directory structure from Linux
> (qml/QtQuick/VirtualKeyboard/qmldir) but it still fails to find the
> plugin. Even if dynamically loading it is a problem, shouldn't Qt find
> the plugin first and then fail to load it?
> 
> Regards,
> Johannes
> 
> Am 02.08.2017 um 19:27 schrieb Christian Prochaska:
>> Hi Johannes,
>>
>> On 31.07.2017 15:20, Johannes Kliemann wrote:
>>> after applying your commit and fixing the vpaths for the plugin
>>> directory it compiles but it still fails to find the
>>> qtvirtualkeyboardplugin.
>>
>> from looking at what gets built and installed with Qt for Linux, it
>> seems there are actually multiple plugins involved that need to be
>> ported to Genode: one Qt plugin (the one you ported) and multiple
>> QtQuick plugins (QtQuick.Layouts, QtQuick.Virtualkeyboard.Styles,
>> Qt.labs.folderlistmodel). The layout of the 'qml' directory must
>> probably match the one on Linux (/usr/local/Qt-5.8.0/qml), with a
>> 'qmldir' file in each sub directory, for the QtQuick plugins to be
>> found. The Qt plugin was installed at
>> '/usr/local/Qt-5.8.0/plugins/platforminputcontexts/libqtvirtualkeyboardplugin.so'
>> on Linux, but I'm not sure if our Qt port can load non-QtQuick plugins
>> with 'dlopen()' yet, so I would first try to use it as a static plugin,
>> like it is done with the qjpeg plugin. This usually means adding an
>> extra file to register the plugin at program start (see
>> 'repos/libports/src/lib/qt5/qtbase/src/plugins/imageformats/jpeg/import_plugin.cc').
>>
>> 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
>>
> 
> --
> 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


gdb with Qt

2017-08-11 Thread Johannes Kliemann
Hi,

I currently try to debug a Qt application with gdb.
I adapted the setup from `ports/run/gdb_monitor_interactive.run?` and
tried it with the framebuffer test and tetrix. The framebuffer test
worked fine but with tetrix it hangs after the first continue and
doesn't seem to break at `binary_ready_hook_for_gdb`.
There's also no further output in Genode so I suspect that nothing is
executed anymore.
This seems only to happen with Qt applications.

Did anyone had a similar problem?

Regards,
Johannes

--
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-08-09 Thread Johannes Kliemann
Hi Christian,

I tried to build the plugin statically but that seems to depend on
static builds of its dependencies (which wouldn't be a big problem) and
the QtQuick2 plugin itself.

I recreated the directory structure from Linux
(qml/QtQuick/VirtualKeyboard/qmldir) but it still fails to find the
plugin. Even if dynamically loading it is a problem, shouldn't Qt find
the plugin first and then fail to load it?

Regards,
Johannes

Am 02.08.2017 um 19:27 schrieb Christian Prochaska:
> Hi Johannes,
> 
> On 31.07.2017 15:20, Johannes Kliemann wrote:
>> after applying your commit and fixing the vpaths for the plugin
>> directory it compiles but it still fails to find the
>> qtvirtualkeyboardplugin.
> 
> from looking at what gets built and installed with Qt for Linux, it
> seems there are actually multiple plugins involved that need to be
> ported to Genode: one Qt plugin (the one you ported) and multiple
> QtQuick plugins (QtQuick.Layouts, QtQuick.Virtualkeyboard.Styles,
> Qt.labs.folderlistmodel). The layout of the 'qml' directory must
> probably match the one on Linux (/usr/local/Qt-5.8.0/qml), with a
> 'qmldir' file in each sub directory, for the QtQuick plugins to be
> found. The Qt plugin was installed at
> '/usr/local/Qt-5.8.0/plugins/platforminputcontexts/libqtvirtualkeyboardplugin.so'
> on Linux, but I'm not sure if our Qt port can load non-QtQuick plugins
> with 'dlopen()' yet, so I would first try to use it as a static plugin,
> like it is done with the qjpeg plugin. This usually means adding an
> extra file to register the plugin at program start (see
> 'repos/libports/src/lib/qt5/qtbase/src/plugins/imageformats/jpeg/import_plugin.cc').
> 
> 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
> 

--
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-08-08 Thread Johannes Kliemann
Hi Sebastian,

thanks for your explanation, it helped me to understand the problem.
I'm just not yet sure how exactly to call the task.

For the interrupt I have registered it via the Lx::Irq class.
But I'm not sure how to handle the transfer task. Currently I locally
create a Lx::Task that calls the xfer_master function (through a wrapper
though) and call Lx::scheduler::schedule() after its creation.
But that seems to return while the tasks are not yet completed.

Regards,
Johannes

Am 27.07.2017 um 16:20 schrieb 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
> 
> 

--
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: ACPI _PS0 failing with UNINITIALIZED_ARG

2017-08-04 Thread Johannes Kliemann
Hi,

thanks for your answer. Well the I2C controller is already enabled. I
can successfully run \_SB_.I2C4._PS(0|3). I even can measure the effect
since the magic value in the mmio is only available if _PS0 was called
on the I2C controller.

I have traced the initialization on Linux (exactly said the calls of
evaluate object) and there doesn't seem to be anything unusual.

> \_SB_.I2C4._STA
> \_SB_.I2C4.TCS2._STA
> \_SB_.I2C4.SSCN
> \_SB_.I2C4.FMCN
> \_SB_.I2C4.FPCN
> \_SB_.I2C4.HSCN
> \_SB_.I2C4._STA
> \_SB_.I2C4.TCS2._STA
> \_SB_.I2C4._PS3
> \_SB_.I2C4._STA
> \_SB_.I2C4.TCS2._STA
> \_SB_.I2C4._PS0
> \_SB_.I2C4.TCS2._PS3
> \_SB_.I2C4.TCS2._PS0

This is the sequence called by Linux (shortened, double entries are
omitted). Beside the status calls I can't see anything special.

Regards,
Johannes

Am 04.08.2017 um 11:12 schrieb Alexander Boettcher:
> Hi,
> 
> On 03.08.2017 13:29, Johannes Kliemann wrote:
>>> I have a touchscreen controller (which is an I2C slave) that I need to 
>>> enable via APCI. This should be done by calling the _PS0 ACPI method. I 
>>> call this method by using AcpiEvaluateObject with no arguments and no 
>>> return values.
> 
> just guessing. Since the touchscreen controller is a slave of the I2C
> controller, you have to have a (ACPI) driver to enable the I2C and
> potentially also the right I2C slaves.
> 
>>> what am I missing to successfully enable the touchscreen device via ACPI? 
>>> Is there something the Linux kernel is initializing implicitly (I couldn't 
>>> find something like this)?
>>
>> The current workaround for this issue is to use the GPIO pins to enable
>> the controller. But this isn't the desired way since it requires an
>> additional GPIO driver that takes ~100 LOC and also a separate ACPI
>> initialization for this driver.
> 
> again, just guessing. Your workaround sounds bit like a part of the
> initialize sequence of the I2C controller.
> 
>> Besides that other functions that are needed to get initial parameters
>> return errors. On the specific device I have the following examples:
>>
>>> \_SB_.I2C4.SSCN
>>> \_SB_.I2C4.FMCN
>>> \_SB_.I2C4.FPCN
>>> \_SB_.I2C4.HSCN
> 
> again, just guessing. Probably you need/have to find the right acpi
> method to initialize the I2C controller, so that the slaves, as your
> touchscreen, may work properly.
> 
>>> what am I missing to successfully enable the touchscreen device via
> ACPI? Is there something the Linux kernel is initializing implicitly (I
> couldn't find something like this)?
> 
> ... just guessing: the Linux kernel initialize the I2C controller for
> sure fully, thats why the I2C method in the ACPI tables of your I2C
> slave work in Linux ?
> 
> 
> If all my guessing above is wrong, another direction could be to check
> the version of the acpica library used by Genode and the ACPICA version
> you have in the Linux kernel. I know that ACPICA library code and Linux
> code does not exactly match (but they have common roots), so that one
> may possibly deduce the difference in the behavior. Maybe a update to a
> new ACPICA library version for Genode can help (since there a features
> and fixes in the upstream ACPICA library according to the changelog) ?
> 
> Good luck,
> 

--
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


ACPI _PS0 failing with UNINITIALIZED_ARG

2017-08-03 Thread Johannes Kliemann
Hi again,

first, I have posted this question already on Stackoverflow [1] and
Reddit [2] but forgot to put it on the mailing list.

> I have a touchscreen controller (which is an I2C slave) that I need to enable 
> via APCI. This should be done by calling the _PS0 ACPI method. I call this 
> method by using AcpiEvaluateObject with no arguments and no return values.
> 
> When calling this method on the parent object (I2C4), everything goes fine 
> but calling it on the touch screen controller (TCS2), it fails. What also 
> makes me wonder is that it returns AE_AML_UNINITIALIZED_ARG even though it 
> doesn't take any args (according to the DSDT).
> 
> Calling the _CRS method on the same object also works without any problems. I 
> also looked into the Linux kernel source how they change ACPI power states 
> and they use the exact same mechanism. It boils down to the use of 
> acpi_evaluate_object in acpi_dev_pm_explicit_set which also seems to work on 
> the touchscreen device.
> 
> what am I missing to successfully enable the touchscreen device via ACPI? Is 
> there something the Linux kernel is initializing implicitly (I couldn't find 
> something like this)?

The current workaround for this issue is to use the GPIO pins to enable
the controller. But this isn't the desired way since it requires an
additional GPIO driver that takes ~100 LOC and also a separate ACPI
initialization for this driver.

Besides that other functions that are needed to get initial parameters
return errors. On the specific device I have the following examples:

> \_SB_.I2C4.SSCN
> \_SB_.I2C4.FMCN
> \_SB_.I2C4.FPCN
> \_SB_.I2C4.HSCN

Similar things also happen on the GPIO device (\_SB_.GPO1).

Regards,
Johannes


[1]:
https://stackoverflow.com/questions/44382881/acpi-ps0-failing-with-uninitialized-arg
[2]:
https://www.reddit.com/r/osdev/comments/6mtlv7/acpi_psx_function_returns_ae_aml_uninitialized_arg/
DSDT:
https://gist.github.com/jklmnn/15ed561202e04390e7bc366c0f803577#file-dsdt-dsl-L10947

--
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


Nova without Bender

2017-08-03 Thread Johannes Kliemann
Hi,

I tried to use Nova without Bender with Multiboot2. Basically it works,
but when I omit Bender, there's no serial output from either Nova or
Genode. I couldn't find out what Bender does different to enable serial
on Nova.

My grub2.cfg looks as follows:

> set timeout=5
> serial --unit=0 --speed=115200
> terminal_output serial console
> terminal_input serial console
> menuentry 'Genode on NOVA' {
>  multiboot2 /hypervisor hypervisor iommu serial novpid novga
>  module2 /image.elf image.elf
> }

What is missing to enable serial on Nova alone?

Regards,
Johannes

PS: It also seems that Benders Multiboot2-header [1] is not
specification conform. The tags type and flags are defined as double
word but according to the specification [2] these are u16 so this should
be a word only.

[1]:
https://github.com/alex-ab/morbo/blob/genode_bender/standalone/start.asm#L15
[2]: http://nongnu.askapache.com/grub/phcoder/multiboot.pdf

--
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-31 Thread Johannes Kliemann
Hi Christian,

after applying your commit and fixing the vpaths for the plugin
directory it compiles but it still fails to find the
qtvirtualkeyboardplugin.

>  qrc:/Basic.qml:31:1: module "QtQuick.VirtualKeyboard" is not installed

I can't find the problem at this point. The tar archive seems to be
complete and the QtQuick2 plugin which also is in the archive is found
correctly.

> ./qt/qml/
> ./qt/qml/QtQuick.2/
> ./qt/qml/QtQuick.2/qt5_qtquick2plugin.lib.so
> ./qt/qml/QtQuick.2/qmldir
> ./qt/qml/QtQuick.VirtualKeyboard/
> ./qt/qml/QtQuick.VirtualKeyboard/qt5_qtvirtualkeyboardplugin.lib.so
> ./qt/qml/QtQuick.VirtualKeyboard/qmldir
> ./qt/qml/QtQuick.VirtualKeyboard.2/
> ./qt/qml/QtQuick.VirtualKeyboard.2/qt5_qtvirtualkeyboardplugin.lib.so
> ./qt/qml/QtQuick.VirtualKeyboard.2/qmldir

(I tried both variants of the virtual keyboard directory but none of the
worked.)
My current state is under [1].

Thanks and regards,
Johannes

[1]:
https://github.com/jklmnn/genode/commit/ae3425c0ff2bbab0502f4216af8f89b172285139

Am 28.07.2017 um 13:26 schrieb Christian Prochaska:
> Hi Johannes,
> 
> On 27.07.2017 16:52, Johannes Kliemann wrote:
>> Thanks!
>>
>> I added the QtQuick dependencies and created build files for the QtQuick
>> VirtualKeyboard. Currently it fails to build with
>>
>>> In file included from 
>>> ../../../../../contrib/qt5-bd7410b31ae57d778d9da6599c0a4e887fa44fa8/src/lib/qt5/qt-everywhere-opensource-src-5.8.0/qtvirtualkeyboard/src/virtualkeyboard/plugin.h:33:0,
>>>  from moc_plugin.cpp:9:
>>> /media/jkliemann/40f41e9a-0a52-48f2-8434-36a2711b6c79/componolit/genode/contrib/qt5-bd7410b31ae57d778d9da6599c0a4e887fa44fa8/src/lib/qt5/qt-everywhere-opensource-src-5.8.0/qtdeclarative/include/QtQml/QtQml:3:30:
>>>  fatal error: QtQml/QtQmlDepends: Datei oder Verzeichnis nicht gefunden
>>>  #include 
>> This file seems to be autogenerated by the MOC but I cannot see what
>> causes it to fail.
> 
> These dependency header files are generated together with the
> 'qt5_*_generated.inc' files and need to be patched into the source tree
> when preparing the port. For some reason they are currently missing in
> the patch for the 'qtdeclarative' module. I've added them in [1],
> together with the QtSvgDepends header file.
> 
> [1]
> https://github.com/cproc/genode/commit/12d865a742fbd4b55879a48dcefcacdc59ade6d7
> 
> 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
> 

--
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 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
>

Qt Virtualkeyboard example

2017-07-26 Thread Johannes Kliemann
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.

Regards,
JK

--
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-26 Thread Johannes Kliemann
Hi Sebastian,

thanks for your answer.

I tried to implement the relevant parts with Lx::Tasks. It seems to me
that those Tasks are designed to run some kind of endless control flow.
Beside this, I wasn't able to get an interrupt while blocking inside the
task.Yet I'm not sure if I used the tasks correctly.

Maybe I should try to explain how the driver is intended to work.
It consists of two parts, a touch driver that is written natively for
Genode and uses I2C to communicate with its controller. And a I2C driver
for the controller that I try to port from Linux
(drivers/i2c/busses/i2c-designware-core.(c|h)).
The send method of the Linux driver is implemented as I described it in
my first mail.
This behaviour is only triggered if the send method is called and
returns after the message is sent or the controller timed out. The
return causes an unexpected return error in the task.
Beside that the interrupt never occurs while the task is inside the
Linux code.

I'm not sure what I miss or how the Lx::Task should be used exactly in
this case.

Regards,
JK

Am 25.07.2017 um 12:52 schrieb Sebastian Sumpf:
> Hi Johannes,
> 
> On 07/25/2017 08:54 AM, Johannes Kliemann wrote:
>> Hi,
>>
>> I'm currently writing a dde_linux driver that requires to wait for an
>> interrupt to be handled.
>> It basically initializes the hardware and then waits for an event to
>> occur. This event is usually triggered by the interrupt (respectively
>> its handler) which occurs after hardware initialization.
>> My problem is that this interrupt doesn't appear while the function
>> triggering it didn't return. So when this function blocks to wait for
>> the interrupt, a deadlock is created. Besides using the timer I tried to
>> block the execution with a semaphore creating the same problem.
>> Creating an async version is no option due to the architecture of the
>> Linux driver.
>>
>> How are interrupts handled in this case? What causes them to block and
>> how can I work around this?
>>
> 
> If I gather your description correctly, you are executing Linux code
> from the entrypoint context. If this code somehow blocks, lets say by
> calling 'wait_event_interruptible' or something else, the EP cannot
> receive signals, and therefore no interrupts. The solution to this
> problem are 'Lx::Task'(s). All Linux code should be executed by these
> tasks, which are able to block and can be unblocked by the EP upon
> signal reception. A small example can be found under
> 'dde_linux/src/drivers/framebuffer/intel/main.cc', there the Linux code
> is executed by a task in 'run_linux', which is woken up by the
> 'Policy_agent' signal handler.
> 
> Regards,
> 
> Sebastian
> 
> P.S. I hope you are porting a driver and not writing one from scratch ;)
> 
> 
> 



signature.asc
Description: OpenPGP digital signature
--
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


Blocking wait for interrupt

2017-07-25 Thread Johannes Kliemann
Hi,

I'm currently writing a dde_linux driver that requires to wait for an
interrupt to be handled.
It basically initializes the hardware and then waits for an event to
occur. This event is usually triggered by the interrupt (respectively
its handler) which occurs after hardware initialization.
My problem is that this interrupt doesn't appear while the function
triggering it didn't return. So when this function blocks to wait for
the interrupt, a deadlock is created. Besides using the timer I tried to
block the execution with a semaphore creating the same problem.
Creating an async version is no option due to the architecture of the
Linux driver.

How are interrupts handled in this case? What causes them to block and
how can I work around this?

Regards,

JK



signature.asc
Description: OpenPGP digital signature
--
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


Mmiotrace for Genode

2017-06-19 Thread Johannes Kliemann
Hi,

I was told that there was a discussion about tracing mmio on the mailing
list but I couldn't find it in the archive.

So is there a tool for Genode that traces mmio accesses (like mmiotrace
for Linux [1])? If not would there be a need for such a tool?

Regards,
JK

[1]: https://www.kernel.org/doc/Documentation/trace/mmiotrace.txt

--
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


Tool chain instructions

2017-06-02 Thread Johannes Kliemann
Hi,

with the new toolchain, the compression has changed from bzip2 to xz.
The toolchain instructions [1] still state to use

> sudo tar xPfj genode-toolchain--.tar.bz2

This doesn't work anymore as `-j` requires bzip2 and fails with the
following error:

> bzip2: (stdin) is not a bzip2 file.
> tar: Child returned status 2
> tar: Error is not recoverable: exiting now

A fix would be omitting `-j`, resulting in

> sudo tar xPf genode-toolchain--.tar.xz

This is also safe since current versions of tar extract bzip2 without
the usage of `-j`.

Regards,
JK

[1]: https://genode.org/download/tool-chain

--
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


C++ condition variable

2017-05-24 Thread Johannes Kliemann
Hi,

does Genode provide something similar to the standard C++ condition
variable? I want to block a function call until a certain event occurs
but I don't want to sleep and check for that event.

Regards,
JK

--
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: Virtual keyboard on Nitpicker

2017-05-23 Thread Johannes Kliemann
Hi Norman,

thanks for your answer!

> I guess that you are already using the input filter to feed the virtual
> keyboard's events back to nitpicker?

We have not yet implemented the input service as we're yet thinking
about the overall architecture but that would have been our approach.

> Nitpicker's focus policy can be configured depending on the client's
> label. Usually, the "click" policy is in effect, which means that a
> click event implicitly changes the focus to the clicked-on client.
> However, this policy is not always desired, like in your case or when
> implementing a global menu. In the latter case, one wants to let the
> menu handle a click yet retain the original focus. To accommodate such
> scenarios, nitpicker supports the so-called "transient" focus policy
> (documentation at [1]). If such a client is clicked-on, it receives the
> press event and all subsequent events until all buttons/keys are released.
> 
> [1]
> https://github.com/genodelabs/genode/blob/staging/repos/os/src/server/nitpicker/README#L105
> 
> I think that the transient focus policy is the right tool for your use
> case if your virtual keyboards delivers its artificial events after the
> release event (otherwise, nitpicker would send the artificial event to
> the virtual keyboard which still has the transient focus).
> 
> For a practical example for configuring the transient focus feature,
> please have a look at the gems/run/launcher.run script.
> 
> I'd be very interested in how this approach works for you. We previously
> discussed on the list [2] that nitpicker's focus handling is still
> somewhat limited. So your experience may give me valuable input for
> possibly refining it.
> 
> [2]
> https://sourceforge.net/p/genode/mailman/genode-main/thread/1a5cd577-1e4c-baea-8e83-8bb67e87bcb1%40nlcsl.com/#msg35798917

Thanks for these sources. The transient policy sounds right for what we
want to do. Sending input events after release might be necessary
anyways if we want to handle longer presses.
I will give feedback when we are in progress with the implementation.

Regards,
JK

--
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


Virtual keyboard on Nitpicker

2017-05-22 Thread Johannes Kliemann
Hi,

we want to create a virtual keyboard for touch screen devices. This
shall be done by letting the keyboard provide an input service.
The problem here is that Nitpicker only provides input to the currently
active client. Since the keyboard needs to receive input events from the
touch screen, with this policy it would also receive its own sent keys.
We need a way to send these keys to another client while still receiving
further touch input.
How can this be done without compromising current security mechanism or
creating unnecessary large pieces of trusted code?

Regards
JK

--
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


Acpica build error

2017-05-15 Thread Johannes Kliemann
Hi,

I tried to play around with the acpica port. I strongly used the code
from `/repos/libports/src/app/acpica/os.cc` as reference. When I compile
my code, I get the following error:

> /.../genode/repos/demo/src/app/acpi_i2c/main.cc: In constructor 
> ‘Acpica::Main::Main(Genode::Env&)’:
> /.../genode/repos/demo/src/app/acpi_i2c/main.cc:54:49: error: no match for 
> call to ‘(Genode::Signal_handler) (Genode::Entrypoint&, 
> Acpica::Main&, void (Acpica::Main::*)())’
>  sci_irq(env.ep(), *this, ::acpi_irq)

at the follwing code:

> struct Acpica::Main {
>  ... 
>   Main(Genode::Env ) : 
>   env(env),
>   sci_irq(env.ep(), *this, ::acpi_irq)
>   { ...

The quite similar code from the file mentioned above compiles without
problems. I cannot see what exactly I need to add/change to fix this.

The code is based of the current master branch, you can view the file at
[1].

Thanks in advance,
JK


[1]:
https://github.com/jklmnn/genode/blob/b99456fb2a293e7e45f3f7f4d25e602ff6a20510/repos/demo/src/app/acpi_i2c/main.cc

--
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: acpica test

2017-05-11 Thread Johannes Kliemann
Thanks, I merged the changes into the current master and it worked.

Am 11.05.2017 um 14:27 schrieb Christian Helmuth:
> Hello Johannes,
> 
> On Thu, May 11, 2017 at 01:10:23PM +0200, Johannes Kliemann wrote:
>> when I try to run `make run/acpica` from [1], I get the following error
>> message:
>>
>>> Genode 17.02-75-g1fcc16420 
>>> 85 MiB RAM assigned to init
>>> [init] Warning: acpi_input: no route to service "RAM"
>>> [init] Error: Uncaught exception of type 'Genode::Parent::Service_denied'
>>> [init] Warning: abort called - thread: ep
>>> child "init" exited with exit value 1
>>
>> How can I fix this?
> 
> This issue is fixed on the master branch already. Please see
> 
>   
> https://github.com/genodelabs/genode/commit/770c7548d8f8dc591f4d0f7540799757c89e9ff2
> 
> for reference.
> 
> Regards
> 

--
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


acpica test

2017-05-11 Thread Johannes Kliemann
Hi,

when I try to run `make run/acpica` from [1], I get the following error
message:

> Genode 17.02-75-g1fcc16420 
> 85 MiB RAM assigned to init
> [init] Warning: acpi_input: no route to service "RAM"
> [init] Error: Uncaught exception of type 'Genode::Parent::Service_denied'
> [init] Warning: abort called - thread: ep
> child "init" exited with exit value 1

How can I fix this?

Regards,
JK

[1]: https://github.com/alex-ab/genode/tree/issue_2242

--
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


Grub2 efi files

2017-05-03 Thread Johannes Kliemann
Hi Alex,

how have you built the efi files for grub2? I tried to build them from
master and from the commit you used in Genode [1].
If I run configure with --with-platform=efi some headers are missing for
the build and if I configure without it grub-mkimage fails with error:
no symbol table.

Regards,

JK

[1]:
https://github.com/alex-ab/genode/commit/de98d57a85c3b1f5fd632f1dd14f2984867fd852

--
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: dde_linux module loading

2017-04-27 Thread Johannes Kliemann
Hallo Josef,

thanks for your tips. I went through the code and found the dwc3 driver
which uses `module_platform_driver`. In the source it gets called with
`module_platform_driver(dwc3_driver)` and the declaration in Genode is
`extern "C" void module_dwc3_driver_init();`.
The efifb framebuffer driver I try to include gets called with
`module_platform_driver(efifb_driver)` so the corresponding declaration
should be `extern "C" void module_efifb_driver_init();`. I tried both
the macros of
'repos/dde_linux/src/lib/usb/include/spec/arm/platform/lx_emul.h' as you
said and of 'repos/dde_linux/src/lib/usb/include/lx_emul.h' (which gets
included by 'repos/dde_linux/src/lib/usb/spec/arndale/platform.cc' which
uses the dwc3 driver.
None of these macros worked, I always got a undefined reference error
from the linker. Did I miss something?

Regards,
JK

Am 26.04.2017 um 15:45 schrieb Josef Söntgen:
> Hello Johannes,
> 
> * Johannes Kliemann <johannes.kliem...@tu-dresden.de> [2017-04-26 15:00:35 
> +0200]:
>> how are modules in dde_linux loaded exactly? For example the i915 driver
>> seems to be loaded with `module_i915_init` which somehow connects to
>> `module_init(i915_init)` but I can't see how this is done.
> 
> Please take a look at 'repos/dde_linux/src/include/lx_emul/module.h'
> which defines the macros used by the vanilla sources. In this case
> we just generated a function that can be called directly.
> 
>> I want to add a new driver which is loaded by
>> `module_platform_driver(...)`. What steps are required to add this
>> driver besides adding the declaration in main.cc?
> 
> Until now the usb_drv on ARM was the only dde_linux driver that needed
> this macro, hence it is defined in its private Linux emulation header
> (see 'repos/dde_linux/src/lib/usb/include/spec/arm/platform/lx_emul.h').
> Normally we only move definitions or rather emulation code to the somewhat
> generic lx_kit/lx_emul locations if used by more than one driver.
> 
> For now I suggest to implement the macro privately in the intel_fb
> driver as well and we will come up with a better solution later on.
> 
> 
> Regards,
> Josef
> 

--
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


dde_linux module loading

2017-04-26 Thread Johannes Kliemann
Hi,

how are modules in dde_linux loaded exactly? For example the i915 driver
seems to be loaded with `module_i915_init` which somehow connects to
`module_init(i915_init)` but I can't see how this is done.

I want to add a new driver which is loaded by
`module_platform_driver(...)`. What steps are required to add this
driver besides adding the declaration in main.cc?

JK

--
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: infradead.org seems to be down

2017-04-11 Thread Johannes Kliemann
I just tried it with the current master which uses the same file and got
the same result.

Am 11.04.2017 um 10:19 schrieb Boris Mulder:
> It could be that this is the case for an older version of Genode, I just
> recalled that I had the same issue some time ago. Johannes, does this
> occur with a newer version too?
> 
> And I didn't know you checked the links that often, so in that case I
> would take back my statement.
> 
> 
> On 11-04-17 10:16, Stefan Kalkowski wrote:
>> Hi,
>>
>>
>> On 04/11/2017 09:57 AM, Boris Mulder wrote:
>>> I temporarily got mine from https://github.com/thom311/libnl/. It seemed
>>> to work, and I believe the hashes were the same, although I recommend
>>> you verify that yourself too.
>>>
>>> Maybe this can be changed in the makefile eventually.
>> we check the port-sources every night to detect dead links. Tonight the
>> dde-linux port check did not fail. Do you experienced the connection
>> problem just this morning or already for a longer time?
>> If it is a temporary problem only, I wouldn't change the port file yet.
>>
>> Regards
>> Stefan
>>
>>> Boris
>>>
>>>
>>> On 11-04-17 09:53, Johannes Kliemann wrote:
>>>> Hi,
>>>>
>>>> while trying to build Genode with dde_linux I noticed that the
>>>> connection to infradead.org timed out, so I'm not able to retrieve
>>>> https://www.infradead.org/~tgr/libnl/files/libnl-3.2.25.tar.gz
>>>>
>>>> Is there any other source for this file?
>>>>
>>>> JK
>>>>
>>>> --
>>>> 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: infradead.org seems to be down

2017-04-11 Thread Johannes Kliemann
Thanks, that also worked for me.

Am 11.04.2017 um 09:57 schrieb Boris Mulder:
> I temporarily got mine from https://github.com/thom311/libnl/. It seemed
> to work, and I believe the hashes were the same, although I recommend
> you verify that yourself too.
> 
> Maybe this can be changed in the makefile eventually.
> 
> Boris
> 
> 
> On 11-04-17 09:53, Johannes Kliemann wrote:
>> Hi,
>>
>> while trying to build Genode with dde_linux I noticed that the
>> connection to infradead.org timed out, so I'm not able to retrieve
>> https://www.infradead.org/~tgr/libnl/files/libnl-3.2.25.tar.gz
>>
>> Is there any other source for this file?
>>
>> JK
>>
>> --
>> 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: Intel fb debug output

2017-04-10 Thread Johannes Kliemann
Stefan Kalkowski, Josef Söntgen, thank you for the quick info.

--
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


Intel fb debug output

2017-04-10 Thread Johannes Kliemann
Hi,

I want to enable the debug output in the Intel framebuffer (to see
messages printed by DRM_DEBUG_KMS). This is usually done by adding the
boot parameter `drm.debug=0xe`.

How would I enable this in Genode with Nova?

JK

--
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