On Mon, Oct 30, 2017 at 2:45 PM, Player, Timmons <timmons.pla...@spirent.com
> wrote:

> I’ve run into the same issue under VMware on VM’s that lack a serial
> port.  I’ve used the following patch locally with success…
>
>
> From 44320eb6d9bc042ca066073f8c83cda27139b1e6 Mon Sep 17 00:00:00 2001
> From: "Timmons C. Player" <timmons.pla...@spirent.com>
> Date: Mon, 30 Oct 2017 08:39:36 -0400
> Subject: [PATCH] drivers/isa-serial.cc: Prevent spinning under VMWare.
>
> The Line Status Register (LSR) of non-existant serial ports under VMWare
> (and maybe other platforms) returns 0xff.  Ignore this value instead
> of polling for terminal characters that aren't there.
>

Hi.
This patch seems reasonable. I am guessing that there is a more structured
way to check once if the UART exists instead of checking for this 0xFF, but
this workaround seems good enough for me.

So I'll commit your patch. Thanks.



>
> Signed-off-by: Timmons C. Player <timmons.pla...@spirent.com>
> ---
>  drivers/isa-serial.cc | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/isa-serial.cc b/drivers/isa-serial.cc
> index 9b0e737..b20b30f 100644
> --- a/drivers/isa-serial.cc
> +++ b/drivers/isa-serial.cc
> @@ -82,7 +82,9 @@ void isa_serial_console::write(const char *str, size_t
> len)
>  bool isa_serial_console::input_ready()
>  {
>      u8 val = pci::inb(ioport + regs::LSR);
> -    return val & lsr::RECEIVE_DATA_READY;
> +    // On VMWare hosts without a serial port, this register always
> +    // returns 0xff.  Just ignore it instead of spinning incessantly.
> +    return (val != 0xff && (val & lsr::RECEIVE_DATA_READY));
>  }
>
>  char isa_serial_console::readch()
> --
> 2.7.4
>
>
> On 10/30/17, 4:51 AM, "osv-dev@googlegroups.com on behalf of Rick Payne" <
> osv-dev@googlegroups.com on behalf of ri...@rossfell.co.uk> wrote:
>
>
>
>     > On 30 Oct 2017, at 17:40, Rick Payne <ri...@rossfell.co.uk> wrote:
>     >
>     >
>     > Anyone tried this? I took one of my apps, converted it to a raw
> image and dd that into the ProxMox disk container. It boots, but seems to
> get horribly confused by the console - continuously receiving something and
> taking 100% of the CPU.
>
>     If anyone else gets stuck on this, I found the solution was to do this
> on the ProxMox server:
>
>       qm set 101 -serial0 socket
>
>     where 101 is the VM IS.
>
>     Rick
>
>     --
>     You received this message because you are subscribed to the Google
> Groups "OSv Development" group.
>     To unsubscribe from this group and stop receiving emails from it, send
> an email to osv-dev+unsubscr...@googlegroups.com.
>     For more options, visit https://groups.google.com/d/optout.
>
>
>
>
>
>
> Spirent Communications e-mail confidentiality.
> ------------------------------------------------------------------------
> This e-mail contains confidential and / or privileged information
> belonging to Spirent Communications plc, its affiliates and / or
> subsidiaries. If you are not the intended recipient, you are hereby
> notified that any disclosure, copying, distribution and / or the taking of
> any action based upon reliance on the contents of this transmission is
> strictly forbidden. If you have received this message in error please
> notify the sender by return e-mail and delete it from your system.
>
> Spirent Communications plc
> Northwood Park, Gatwick Road, Crawley, West Sussex, RH10 9XN, United
> Kingdom.
> Tel No. +44 (0) 1293 767676
> Fax No. +44 (0) 1293 767677
>
> Registered in England Number 470893
> Registered at Northwood Park, Gatwick Road, Crawley, West Sussex, RH10
> 9XN, United Kingdom.
>
> Or if within the US,
>
> Spirent Communications,
> 27349 Agoura Road, Calabasas, CA, 91301, USA.
> Tel No. 1-818-676- 2300
>
> --
> You received this message because you are subscribed to the Google Groups
> "OSv Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to osv-dev+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "OSv 
Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to osv-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to