mbox series

[v4,0/2] Fix output word

Message ID 20180323101530.17490-1-lvivier@redhat.com
Headers show
Series Fix output word | expand

Message

Laurent Vivier March 23, 2018, 10:15 a.m. UTC
This patch fixes the output word, and allow to select the console.
It updates input word in the same way.

For the moment it works well while we don't mix serial port console
with VGA console or virtio-console (there is a special case for VGA
console that overwrite without condition the emit word, see
9b89b28 "Add support for qemu standard VGA". Im' working on this).

You can test it with:

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@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@71000002" output

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

A shortcut for these two commands is:

    " /vdevice/vty@71000002" io

v4:
  - use variables to store stdin and stdout ihandle (rename them)
  - introduce set-stdin and set-stdout
  - update error message

v3:
  - code cleanup and re-order
  - store ihandle and xt handle for input too

v2:
  - resolve ihandle and xt handle in the output command to
    speed up emit function

milliseconds 2000 0 do 41 emit loop milliseconds swap - cr .d cr
original:  770
v1:       4710
v2:       1721

Laurent Vivier (2):
  Fix output word
  resolve ihandle and xt handle in the input command (like for the
    output)

 slof/fs/term-io.fs | 118 ++++++++++++++++++++++++++++++++---------------------
 1 file changed, 72 insertions(+), 46 deletions(-)

Comments

Alexey Kardashevskiy April 5, 2018, 5:40 a.m. UTC | #1
On 23/3/18 9:15 pm, Laurent Vivier wrote:
> This patch fixes the output word, and allow to select the console.
> It updates input word in the same way.
> 
> For the moment it works well while we don't mix serial port console
> with VGA console or virtio-console (there is a special case for VGA
> console that overwrite without condition the emit word, see
> 9b89b28 "Add support for qemu standard VGA". Im' working on this).
> 
> You can test it with:
> 
> 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@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@71000002" output
> 
> but it doesn't work and this patch fixes that.
> 
> A shortcut for these two commands is:
> 
>     " /vdevice/vty@71000002" io
> 
> v4:
>   - use variables to store stdin and stdout ihandle (rename them)
>   - introduce set-stdin and set-stdout
>   - update error message


I have a problem with these patches. They fix the problem and work as
promised, good job, thanks!

However in order to push it out, I need to either understand precisely what
they are doing OR have Thomas and/or Segher's "reviewed-by".

For example, the 1/2 seems to have 2 changes:
- start using the "stdout" variable;
- print to the correct terminal.

2/2 is even bigger (amount of comments gives a hint), and it looks like a
mixture of re-indent and a bugfix.

Is that just me and everybody else can easily read it? :)


> 
> v3:
>   - code cleanup and re-order
>   - store ihandle and xt handle for input too
> 
> v2:
>   - resolve ihandle and xt handle in the output command to
>     speed up emit function
> 
> milliseconds 2000 0 do 41 emit loop milliseconds swap - cr .d cr
> original:  770
> v1:       4710
> v2:       1721
> 
> Laurent Vivier (2):
>   Fix output word
>   resolve ihandle and xt handle in the input command (like for the
>     output)
> 
>  slof/fs/term-io.fs | 118 ++++++++++++++++++++++++++++++++---------------------
>  1 file changed, 72 insertions(+), 46 deletions(-)
>
Laurent Vivier April 6, 2018, 8:47 a.m. UTC | #2
On 05/04/2018 07:40, Alexey Kardashevskiy wrote:
> On 23/3/18 9:15 pm, Laurent Vivier wrote:
>> This patch fixes the output word, and allow to select the console.
>> It updates input word in the same way.
>>
>> For the moment it works well while we don't mix serial port console
>> with VGA console or virtio-console (there is a special case for VGA
>> console that overwrite without condition the emit word, see
>> 9b89b28 "Add support for qemu standard VGA". Im' working on this).
>>
>> You can test it with:
>>
>> 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@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@71000002" output
>>
>> but it doesn't work and this patch fixes that.
>>
>> A shortcut for these two commands is:
>>
>>     " /vdevice/vty@71000002" io
>>
>> v4:
>>   - use variables to store stdin and stdout ihandle (rename them)
>>   - introduce set-stdin and set-stdout
>>   - update error message
> 
> 
> I have a problem with these patches. They fix the problem and work as
> promised, good job, thanks!
> 
> However in order to push it out, I need to either understand precisely what
> they are doing OR have Thomas and/or Segher's "reviewed-by".
> 
> For example, the 1/2 seems to have 2 changes:
> - start using the "stdout" variable;
> - print to the correct terminal.
> 
> 2/2 is even bigger (amount of comments gives a hint), and it looks like a
> mixture of re-indent and a bugfix.
> 
> Is that just me and everybody else can easily read it? :)

I've just sent a new series, trying to make this clearer...

Thanks,
Laurent