Closed jklmnn closed 6 years ago
I have tested the forking behaviour of ioperm. On Linux forking the process worked without problems.
On Genode I checked the PID. The inb and outb operations are always executed as PID 1 no matter where they're called from. Calling ioperm from the client didn't change anything but calling it directly inside inb and outb made it work.
That makes perfect sense. Obviously everything is proxied through core. If you iopl() in core's main(), does that work?
That works indeed! But how we integrate this optimally into Genode? I'm not sure if a Linux syscall in core is what we want.
But doesn't core have platform-specific code anyway? What should also work is to set iopl() in your init as it should be passed on to core. However, apparently this does not work - we need to investigate why.
As far as I remember this was in a working state so I think we can also close this.
To answer the question above: I added iopl to the platform specific code of core (https://github.com/jklmnn/genode/commit/58be28320e2d0472bfda6a732b4c468be5f54378).
Yep, that matches my memories ;-) IMHO we should create one "Stress testing" issue where we all the hardware-related session (including IRQ) using realistic workloads. This will also reveal potential open issues with IO_PORT and IO_MEM.
I created a test scenario to turn on all keyboard LEDs based on this SO post.
If I run the io port operations from the test program the usual segfault appears. But if I run the commands directly in the constructor of the IO Port session I get the following output:
I tried to test this code on real hardware. When calling these methods from Linux, the keyboard LEDs showed up as expected but only on a native PS/2 keyboard. On Genode nothing happened yet. I also noticed that if the kernel command line
console=tty0 console=ttyS0,115200
was used, the output of /init and Genode only showed up in the serial output. cc @senier