qemu-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

using xterms for connecting to multiple uarts of the virtual machine


From: Chan Kim
Subject: using xterms for connecting to multiple uarts of the virtual machine
Date: Fri, 14 Oct 2022 11:59:14 +0900

Hello all,

I once asked about this last March but gave it up to solve it to tackle
other problems at that time.
Our FPGA board has two uart ports and I used u-boot to port linux and it
runs ok on real FPGA board including the busybox shell(the uart and linux
output come out to different uart ports).
I used qemu virtual machine to analyze the programs and solve some problems.
My virtual machine (modified from arm virt machine, 6.2.0) also has two uart
ports.
With loading dtb and linux kernel image on DRAM using '-device
loader,file=..,addr=..' option, and using u-boot-spl program in the
'-kernel' option, I can run u-boot program and it switches to linux until
the busybox shell program comes out. 
The problem is, when I enter something in the emulated busybox shell, it
comes out to qemu monitor. I guess this is because of serial port setting in
qemu options.
(But when I provide linux kernel image in -kernel option and use
qemu-generated dtb, the kernel boots ok and shell runs ok too)

Until now, I have been using this option (run running from u-boot).
"-nographic -chardev stdio,mux=on,id=char0 -chardev stdio,mux=on,id=char1
-serial chardev:char0 -serial chardev:char1"

Now I need to solve this one now to be able to do some simple driver
tests(using loadable driver module).
I found
https://stackoverflow.com/questions/39373236/redirect-multiple-uarts-in-qemu
(alexei's answer) and I'm trying to use xterm to connect to my two uart
ports.
I tried xterm -e /bin/sh - 'while true; sleep 100; done' but xterm window
doesn't come up.
So I executed 'xterm &' command 3 times and I can see there are 3 new device
files generated (for example /dev/pts/25, /dev/pts/26 and /dev/pts/27)
And I ran qemu from u-boot and used option "-serial /dev/pts/26 -serial
/dev/pts/27" (no -chardev options) and could see the u-boot program output
in one xterm (I guess /dev/pts/26) and linux output in another xterm (I
guess /dev/pts/27).
So the qemu serial outputs are connected to separate xterm applications but
when I enter something in the linux shell, the input is taken by my ubuntu
host's /bin/sh.
How can I use xterm just to be used by virtual machine's serial ports? Or in
different words, how can I disconnect xterm from my host machine's shell
program?

Thank you for reading.
Chan Kim








reply via email to

[Prev in Thread] Current Thread [Next in Thread]