Discussion:
Genode/Linux USB Application
Daniel Krefft
2016-07-05 14:47:14 UTC
Permalink
Hi,

I wrote an Genode application for the Pololu Maestro Mini Servo
Controller in Genode
(https://github.com/702nados/genode-pololuServoController).

I'm using the usb_drv (dde_linux) and the usb_terminal (pl2303) for read
and write commands. It runs flawlessly on PandaBoard (foc_panda).

Next, I want to use it with Linux as kernel (linux_x86). If I try to run
no route to service "Platform"
So, is it possible to compile and run the intended application without
modifications?

If I want to use the linux devices (e.g. usb), who can I achieve this in
code?

In general, the following shows the intended architecture:

---------------------
ServoController |
---------------------
Genode |
---------------------
Linux |
---------------------
Hardware |
---------------------

Best regards
Daniel
Norman Feske
2016-07-06 06:56:39 UTC
Permalink
Hi Daniel,
Post by Daniel Krefft
Next, I want to use it with Linux as kernel (linux_x86). If I try to run
no route to service "Platform"
So, is it possible to compile and run the intended application without
modifications?
If I want to use the linux devices (e.g. usb), who can I achieve this in
code?
on base-linux, the USB driver resides in the Linux kernel. Genode's
usb_drv cannot be used. However, your 'ServoController' doesn't actually
need a USB driver but merely a terminal session. Your scenario relies on
the usb_drv + usb_terminal in this respect. On Linux, I would use a
completely different terminal service.

The best approach would be to have a Genode component - let's call it
lx_terminal - that opens a character device on Linux and provides a
terminal service by forwarding all 'read' and 'write' operations to the
Linux device. This component could then be used with any arbitrary Linux
device, on particular your USB-serial device that would normally appear
at /dev/ttyUSB0.

The resulting picture would look like this:

ServoController
---------------------------------
lx_terminal |
-------.-----------'
| | Genode
-------V-------------------------
/dev/ttyUSB0
Linux kernel
---------------------------------
Hardware


Unfortunately, the lx_terminal component does not exist yet. But similar
components for other Genode services exist, which you could use blue print:

* os/src/drivers/nic/spec/linux/
(provides a NIC session via a Linux tap device)

* os/src/server/lx_fs/
(provides a file-system session by accessing the Linux file system)

* os/src/drivers/framebuffer/spec/sdl
(provides a framebuffer and input session via libSDL)

* os/src/drivers/audio/spec/linux
(provides an audio-out session via ALSA)

Actually, when looking at this list, it might be even possible to
emulate the lx_terminal component by combining the lx_fs with the
file_terminal component (gems/src/server/file_terminal). But a dedicated
lx_terminal component would certainly be nicer.

Cheers
Norman

PS: In principle, it would be interesting to use Genode's device drivers
on top of the Linux kernel by facilitating Linux' user-level
device-driver infrastructure. This would clear the way to run your
entire scenario including the USB driver on Linux. We have briefly
documented this idea of "microkernelizing Linux" at
http://genode.org/about/challenges#Platforms
--
Dr.-Ing. Norman Feske
Genode Labs

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

Genode Labs GmbH · Amtsgericht Dresden · HRB 28424 · Sitz Dresden
Geschäftsführer: Dr.-Ing. Norman Feske, Christian Helmuth
Krefft, Daniel
2016-07-06 07:33:58 UTC
Permalink
Hi Norman,

thank you for the fast and detailed response (and the interesting idea :) ).

Best regards
Daniel

--
Daniel Krefft MSc.
Wissenschaftlicher Mitarbeiter

Technische Universitaet Muenchen
Fakultaet fuer Informatik
Lehrstuhl fuer Betriebssysteme

Arcisstrasse 21
80333 Muenchen

Tel. +49 89 289 18791

***@tum.de
www.os.in.tum.de/personen/krefft

________________________________________
Von: Norman Feske <***@genode-labs.com>
Gesendet: Mittwoch, 6. Juli 2016 08:56
An: genode-***@lists.sourceforge.net
Betreff: Re: Genode/Linux USB Application

Hi Daniel,
Post by Daniel Krefft
Next, I want to use it with Linux as kernel (linux_x86). If I try to run
no route to service "Platform"
So, is it possible to compile and run the intended application without
modifications?
If I want to use the linux devices (e.g. usb), who can I achieve this in
code?
on base-linux, the USB driver resides in the Linux kernel. Genode's
usb_drv cannot be used. However, your 'ServoController' doesn't actually
need a USB driver but merely a terminal session. Your scenario relies on
the usb_drv + usb_terminal in this respect. On Linux, I would use a
completely different terminal service.

The best approach would be to have a Genode component - let's call it
lx_terminal - that opens a character device on Linux and provides a
terminal service by forwarding all 'read' and 'write' operations to the
Linux device. This component could then be used with any arbitrary Linux
device, on particular your USB-serial device that would normally appear
at /dev/ttyUSB0.

The resulting picture would look like this:

ServoController
---------------------------------
lx_terminal |
-------.-----------'
| | Genode
-------V-------------------------
/dev/ttyUSB0
Linux kernel
---------------------------------
Hardware


Unfortunately, the lx_terminal component does not exist yet. But similar
components for other Genode services exist, which you could use blue print:

* os/src/drivers/nic/spec/linux/
(provides a NIC session via a Linux tap device)

* os/src/server/lx_fs/
(provides a file-system session by accessing the Linux file system)

* os/src/drivers/framebuffer/spec/sdl
(provides a framebuffer and input session via libSDL)

* os/src/drivers/audio/spec/linux
(provides an audio-out session via ALSA)

Actually, when looking at this list, it might be even possible to
emulate the lx_terminal component by combining the lx_fs with the
file_terminal component (gems/src/server/file_terminal). But a dedicated
lx_terminal component would certainly be nicer.

Cheers
Norman

PS: In principle, it would be interesting to use Genode's device drivers
on top of the Linux kernel by facilitating Linux' user-level
device-driver infrastructure. This would clear the way to run your
entire scenario including the USB driver on Linux. We have briefly
documented this idea of "microkernelizing Linux" at
http://genode.org/about/challenges#Platforms

--
Dr.-Ing. Norman Feske
Genode Labs

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

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

------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
genode-main mailing list
genode-***@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/genode-main

Loading...