[SLOF] [PATCH] Fix output word

Laurent Vivier lvivier at redhat.com
Wed Sep 27 17:39:47 AEST 2017


On 27/09/2017 08:25, Alexey Kardashevskiy wrote:
> On 26/09/17 21:28, Laurent Vivier wrote:
>> We can select the console output, but it does not really work
> 
> Can you please provide a QEMU command line which did not work before and
> does after this applied, just to verify I understand the change? The same
> question about "[PATCH] Use input-device and output-device". Thanks.
> 

Start QEMU with two spapr-vty ports:

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 

Connect on the two ports with "telnet localhost 4441" and "telnet 4442".

Once it is done you will see on the first console the SLOF logs.
Then, in the first console:

    " /vdevice/vty at 71000002" input

Now what you write on second console is written on the first one.

To send the characters to the second one, we should use:

    " /vdevice/vty at 71000002" ouput

but it doesn't work and this patch fixes that.

A shortcut for these two commands is:

    " /vdevice/vty at 71000002" io

Thanks,
Laurent
    
>>
>> Implement term-io-emit, as we have term-io-key to really
>> send characters to the output selected by stdout.
>>
>> Signed-off-by: Laurent Vivier <lvivier at redhat.com>
>> ---
>>  slof/fs/term-io.fs | 14 ++++++++++++++
>>  1 file changed, 14 insertions(+)
>>
>> diff --git a/slof/fs/term-io.fs b/slof/fs/term-io.fs
>> index 52ce12a..a0b0f4b 100644
>> --- a/slof/fs/term-io.fs
>> +++ b/slof/fs/term-io.fs
>> @@ -40,6 +40,20 @@
>>  
>>  1 BUFFER: (term-io-char-buf)
>>  
>> +: term-io-emit ( char -- )
>> +    s" stdout" get-chosen IF
>> +        decode-int nip nip dup 0= IF 0 EXIT THEN
>> +	swap (term-io-char-buf) c!
>> +	>r (term-io-char-buf) 1 s" write" r@ $call-method
>> +	drop
>> +	r> drop
>> +    ELSE
>> +        [ ' emit behavior compile, ]
>> +    THEN
>> +;
>> +
>> +' term-io-emit to emit
>> +
>>  : term-io-key  ( -- char )
>>     s" stdin" get-chosen IF
>>        decode-int nip nip dup 0= IF 0 EXIT THEN
>>
> 
> 



More information about the SLOF mailing list