From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B0AB2C6FD1D for ; Mon, 20 Mar 2023 18:15:50 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1peK2H-0004Xr-5F; Mon, 20 Mar 2023 14:15:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1peK2F-0004Vd-31 for qemu-devel@nongnu.org; Mon, 20 Mar 2023 14:15:07 -0400 Received: from mail-qt1-x82c.google.com ([2607:f8b0:4864:20::82c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1peK2B-00026l-Q8 for qemu-devel@nongnu.org; Mon, 20 Mar 2023 14:15:05 -0400 Received: by mail-qt1-x82c.google.com with SMTP id bz27so2434239qtb.1 for ; Mon, 20 Mar 2023 11:15:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=drut-io.20210112.gappssmtp.com; s=20210112; t=1679336102; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Hf9hz4NUJdpXs+dw5Khx3qhvNC2im4M463xojKbf3FI=; b=ujG9tY1aTsCivFLbXMQOaEuoDJvy78RPFh6zIMwl+afv01fxQ8VcSde4xm16N7Dzet 3WznHzHGna55wjQ+ZPURVHw8ibdSitkW/e5vYCaRjWZZhXPEiNl5NQ77xcDpSVUZ9n3I OqV3ZUXdWuhV5GuQ+NVFKfV+1GXq2EnslSY0xfXzWSXdekwj6DLHRdndC0md4ZXuKRvT dI72lphxYiQLmiwVsLxqUY+f27dOIXil6VolX61b45K1HjuC+wlAI1bjnAKbvgMZowwl SyRWpugiMQfiKcAo7c+BM41sfBryR/WrAQHMRpa5gULcE0IYVwPpBFfKC1euydntIb31 egrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679336102; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Hf9hz4NUJdpXs+dw5Khx3qhvNC2im4M463xojKbf3FI=; b=rLKWMmZZUnviWVFdGeOibZFe4nvIrwZil0rhnzT7G+FKhHht+nU9TYnLhRvscOFso4 3q6nrgFK16tyxK79OuqE3JCxlcSYKJ9WpVmbv/uDSJJOrzScJZspZV4DxGhdt9tmNewd pyMON10odQmkSGBdnhfUklxwqL6k8KSU7SNn6SfxzWVN8nQdmLRmmbw+XBVmUC3cuaFZ YVcdN4PF/3dGnpTMxbT+Wq2bKHP9eNstvQSmr7J2dDKkTluTydv/r0xZZKo1fG3FT0IK FkynJX1OINq/6JQ4SrxLvtixaezb5Ps+kAellb7IPxI1KRoDS0A4MJOQEpuTxuDJBf3Z hpRA== X-Gm-Message-State: AO0yUKWTj0vEB2h5KMYuU5iOy108VFvgfS4YcWABkCNPHh+wDAxiWcEF kqDQuIt9n1ujlZkzkKJVm4E7XGqeGwGSJ7FzQNCUGz8ditcUd8P+ X-Google-Smtp-Source: AK7set/1w8Ql9IREtRmg3rCW2M9szggNTbeUpxdlb2N3GQMIz68OQ3xZveMfQ0omksQN/VjLivWEPt3dOaDKW0nq4Yw= X-Received: by 2002:ac8:5c91:0:b0:3df:bda6:692f with SMTP id r17-20020ac85c91000000b003dfbda6692fmr29166qta.6.1679336102141; Mon, 20 Mar 2023 11:15:02 -0700 (PDT) MIME-Version: 1.0 References: <87mt4b73sv.fsf@linaro.org> <1f589f04-8d48-36bd-9518-357d3a0cbfd1@kaod.org> In-Reply-To: <1f589f04-8d48-36bd-9518-357d3a0cbfd1@kaod.org> From: Abhishek Singh Dagur Date: Mon, 20 Mar 2023 23:44:50 +0530 Message-ID: Subject: Re: Using QEMU how to redirect serial /dev/ttyS2 output of guest machine to host machine. To: =?UTF-8?Q?C=C3=A9dric_Le_Goater?= Cc: =?UTF-8?B?QWxleCBCZW5uw6ll?= , Srinivas Kodali , qemu-devel@nongnu.org, Anand Moon Content-Type: multipart/alternative; boundary="000000000000d3bb6005f758e760" Received-SPF: pass client-ip=2607:f8b0:4864:20::82c; envelope-from=abhishek@drut.io; helo=mail-qt1-x82c.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org --000000000000d3bb6005f758e760 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Thanks a lot. It's working fine =F0=9F=98=81 now. Abhishek. On Sun, 19 Mar, 2023, 11:27 pm C=C3=A9dric Le Goater, wrote: > Hello Abhishek, > > On 3/18/23 18:55, Abhishek Singh Dagur wrote: > > Hi Alex , C=C3=A9dric, > > we have tried this *option:-serial *pty* -serial *pty* -serial *pty > *-serial *pty *-serial *pty to check the serial output on screen. > > > > Here we are providing 2 scenarios without and with the changes suggeste= d > by @C=C3=A9dric Le Goater . > > In first we are able to get /dev/ttyS4 serial port not /dev/ttyS2 > > In second we are able to get /dev/ttyS2 not /dev/ttyS4 > > > > *Scenario1:****previously with normal qemu build i have tried emulation > as:* > > > > qemu-system-arm -m 512 -M > ast2500-evb,fmc-model=3Dmx66u51235f,spi-model=3Dmx66u51235f -nographic -d= rive > file=3D./pru-1.2.4_dev-rc1.static.mtd,format=3Draw,if=3Dmtd -serial pty -= serial > pty -serial pty -serial pty > > > > which gives us output as. > > > > QEMU 7.2.0 monitor - type 'help' for more information > > (qemu) char device redirected to /dev/pts/15 (label serial0) > > char device redirected to /dev/pts/16 (label serial1) > > char device redirected to /dev/pts/17 (label serial2) > > char device redirected to /dev/pts/18 (label serial3) > > > > so we can use *screen *to interact with the ttyS4 serial port like : > > screen /dev/pts/15 > > In which we have our boot process and shell prompt . > > > > *Scenario2:* *when I am using the newly build image with the changes > *@C=C3=A9dric Le Goater * provided* > > > > With the below command: > > ./qemu-system-arm -m 512 -M > ast2500-evb,uart-default=3Duart2,fmc-model=3Dmx66u51235f,spi-model=3Dmx66= u51235f > -nographic -drive file=3D./pru-1.2.4_dev-rc1.static.mtd,format=3Draw,if= =3Dmtd > -serial pty -serial pty -serial pty -serial pty > > Since the machine expect /dev/ttyS2 to be the boot console, the SoC devic= e > to attach to the first serial is UART3. This command line should output > the console logs in the same terminal : > > ./qemu-system-arm -m 512 -M > ast2500-evb,uart-default=3Duart3,fmc-model=3Dmx66u51235f,spi-model=3Dmx66= u51235f > -net user -nographic -drive > file=3D./pru-1.2.4_dev-rc1.static.mtd,format=3Draw,if=3Dmtd -serial mon:s= tdio > > I have updated the patch in my aspeed-8.0 tree : > > > https://github.com/legoater/qemu/commit/20fe705361dd7ed1d9129747a8a0b6434= 10869e3 > > Please note that in this last version, the machine option is simply "uart= ". > > Thanks, > > C. > --000000000000d3bb6005f758e760 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks a lot. It's working fine =F0=9F=98=81 now.
Abhishek.

On Sun, 19 Mar, 20= 23, 11:27 pm C=C3=A9dric Le Goater, <clg= @kaod.org> wrote:
Hello Ab= hishek,

On 3/18/23 18:55, Abhishek Singh Dagur wrote:
> Hi Alex , C=C3=A9dric,
> we have tried this *option:-serial *pty*=C2=A0-serial *pty*=C2=A0-seri= al *pty *-serial *pty *-serial *pty to check the serial output on screen. >
> Here we are providing 2 scenarios without and with the changes=C2=A0su= ggested by @C=C3=A9dric Le Goater <mailto:clg@kaod.org>=C2=A0.
> In first we are able to get /dev/ttyS4 serial port not /dev/ttyS2
> In second we are able to get /dev/ttyS2 not /dev/ttyS4
>
> *Scenario1:****previously=C2=A0with normal qemu build i have tried emu= lation as:*
>
> qemu-system-arm -m 512 -M ast2500-evb,fmc-model=3Dmx66u51235f,spi-mode= l=3Dmx66u51235f -nographic -drive file=3D./pru-1.2.4_dev-rc1.static.mtd,for= mat=3Draw,if=3Dmtd -serial pty -serial pty -serial pty -serial pty
>
> which gives us output as.
>
> QEMU 7.2.0 monitor - type 'help' for more information
> (qemu) char device redirected to /dev/pts/15 (label serial0)
> char device redirected to /dev/pts/16 (label serial1)
> char device redirected to /dev/pts/17 (label serial2)
> char device redirected to /dev/pts/18 (label serial3)
>
> so we can use *screen *to interact with the ttyS4 serial port like : > screen /dev/pts/15
> In which we have our=C2=A0boot process and shell prompt .
>
> *Scenario2:* *when I am using the newly build image with the changes *= @C=C3=A9dric Le Goater <mailto:clg@kaod.org>*=C2=A0 provided*
>
> With the below command:
> ./qemu-system-arm -m 512 -M ast2500-evb,uart-default=3Duart2,fmc-model= =3Dmx66u51235f,spi-model=3Dmx66u51235f -nographic -drive file=3D./pru-1.2.4= _dev-rc1.static.mtd,format=3Draw,if=3Dmtd -serial pty -serial pty -serial p= ty -serial pty

Since the machine expect /dev/ttyS2 to be the boot console, the SoC device<= br> to attach to the first serial is UART3. This command line should output
the console logs in the same terminal :

=C2=A0 =C2=A0./qemu-system-arm -m 512 -M ast2500-evb,uart-default=3Duart3,f= mc-model=3Dmx66u51235f,spi-model=3Dmx66u51235f -net user -nographic -drive = file=3D./pru-1.2.4_dev-rc1.static.mtd,format=3Draw,if=3Dmtd -serial mon:std= io

I have updated the patch in my aspeed-8.0 tree :

=C2=A0 =C2=A0https://github.com/legoater/qemu/commit/20fe705361dd7ed1d9129747a8a0b64= 3410869e3

Please note that in this last version, the machine option is simply "u= art".

Thanks,

C.
--000000000000d3bb6005f758e760--