[SLOF] [PATCH] Use input-device and output-device

Laurent Vivier lvivier at redhat.com
Wed Sep 27 18:01:54 AEST 2017


On 26/09/2017 18:02, Laurent Vivier wrote:
> QEMU can now set environment variables from the command line (with -prom-env).
> By this means, we can set the output-device and input-device variables,
> and SLOF can read it and set stdout and stdin accordingly.

An example:

qemu-system-ppc64 -nodefaults -nographic \
    -chardev socket,id=serial_id_serial0,host=localhost,port=4441,telnet,server,wait \
    -device spapr-vty,chardev=serial_id_serial0 \
    -chardev socket,id=serial_id_serial1,host=localhost,port=4442,telnet,server,wait \
    -device spapr-vty,chardev=serial_id_serial1 \
    -monitor stdio \
    -prom-env "input-device=/vdevice/vty at 71000002" \
    -prom-env "output-device=/vdevice/vty at 71000002"

Then "telnet localhost 4441" and "telnet localhost 4442" and you will see SLOF 
logs in the second telnet.

> Signed-off-by: Laurent Vivier <lvivier at redhat.com>
> ---
>  board-qemu/slof/OF.fs | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/board-qemu/slof/OF.fs b/board-qemu/slof/OF.fs
> index 0169c35..4e04b84 100644
> --- a/board-qemu/slof/OF.fs
> +++ b/board-qemu/slof/OF.fs
> @@ -257,6 +257,20 @@ romfs-base 400000 0 ' claim CATCH IF ." claim failed!" cr 2drop THEN drop
>              THEN
>          THEN
>      THEN
> +
> +    s" input-device" evaluate dup IF
> +        ." User selected input-device console: " 2dup type cr
> +        input
> +    ELSE
> +        2drop
> +    THEN
> +
> +    s" output-device" evaluate dup IF
> +        ." User selected output-device console: " 2dup type cr
> +        output
> +    ELSE
> +        2drop
> +    THEN
>  ;
>  set-default-console
>  
> 



More information about the SLOF mailing list