From: Laurent Vivier <laurent@vivier.eu>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>, qemu-devel@nongnu.org
Cc: "Thomas Huth" <huth@tuxfamily.org>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Richard Henderson" <richard.henderson@linaro.org>,
"Aurelien Jarno" <aurelien@aurel32.net>,
"Paolo Bonzini" <pbonzini@redhat.com>
Subject: Re: [PATCH v6 0/5] m68k: add Virtual M68k Machine
Date: Tue, 9 Mar 2021 08:25:21 +0100 [thread overview]
Message-ID: <09398f07-4ae2-d8a7-fc1f-ececef9102ee@vivier.eu> (raw)
In-Reply-To: <c7e31656-b6c0-5f5b-27b7-ac047fc28e70@amsat.org>
Le 08/03/2021 à 23:47, Philippe Mathieu-Daudé a écrit :
> Hi Laurent,
>
> On 3/8/21 10:24 PM, Laurent Vivier wrote:
>> The Quadra 800 machine is very limited to run linux, it manages
>> only 1 GiB of memory and only some specific interfaces.
>>
>> The Virtual M68k Machine is based on Goldfish interfaces defined by Google
>> for Android simulator. It uses Goldfish-rtc (timer and RTC),
>> Goldfish-pic (PIC) and Goldfish-tty (for serial port and early tty).
>>
>> https://android.googlesource.com/platform/external/qemu/+/master/docs/GOLDFIS=
>> H-VIRTUAL-HARDWARE.TXT
>>
>> The machine is created with 128 virtio-mmio busses, and they can
>> be used to add serial console, GPU, disk, NIC, HID, ...
>>
>> This series re-use the goldfish-rtc implemented for RISCV, and
>> adds the two others based on the goldfish specs, the kernel driver
>> and android simulator ones.
>>
>> The machine can manage up to 3.2 GiB of memory, not because of an hardware
>> limitation but because the kernel crashes after this value.
>>
>> Simply configure qemu with:
>>
>> .../configure --target-list=3Dm68k-softmmu
>>
>> To run the machine you need a modified kernel you can find here:
>>
>> https://github.com/vivier/linux/tree/m68k-virt
>>
>> You need to compile the kernel with:
>>
>> make virt_defconfig
>> make vmlinux
>>
>> The disk must be installed using the q800 machine because the debian installer
>> doesn't want to be used with a kernel that is not the one on the ISO.
>>
>> And then you can run the machine with something like:
>>
>> qemu-system-m68k -M virt \
>> -m 3399672K \
>> -chardev stdio,signal=3Doff,mux=3Don,id=3Dchar0 \
>> -mon chardev=3Dchar0,mode=3Dreadline \
>> -kernel vmlinux \
>> -append "console=3Dhvc0 root=3D/dev/vda2" \
>> -blockdev node-name=3Dsystem,driver=3Dfile,filename=3Ddebian-10.0.qcow2 \
>> -blockdev node-name=3Ddrive0,driver=3Dqcow2,file=3Dsystem \
>> -device virtio-blk-device,drive=3Ddrive0 \
>> -serial chardev:char0 \
>> -device virtio-net-device,netdev=3Dhostnet0 \
>> -netdev bridge,id=3Dhostnet0,br=3Dvirbr0 \
>> -device virtio-rng-device \
>> -device virtio-serial-device \
>> -device virtio-gpu-device \
>> -device virtconsole,chardev=3Dchar0 \
>> -device virtio-keyboard-device \
>> -device virtio-mouse-device
>>
>> if you want to use Goldfish-tty for the console rather than virtconsole, you
>> can add "console=3DttyGF".
>>
>> To start the debian-installer, you can try by adding:
>>
>> -device virtio-scsi-device \
>> -blockdev node-name=3Ddebian10,driver=3Dfile,filename=3Ddebian-10.0.0-m68k-=
>> NETINST-1.iso \
>> -blockdev node-name=3Dcdrom0,driver=3Draw,file=3Ddebian10 \
>> -device scsi-cd,drive=3Dcdrom0 \
>> -initrd installer-m68k/20200315/images/cdrom/initrd.gz
>>
>> ISO: https://cdimage.debian.org/cdimage/ports/snapshots/2020-10-12/debian-=
>> 10.0.0-m68k-NETINST-1.iso
>> initrd: https://cdimage.debian.org/cdimage/ports/debian-installer/2020-10-12/=
>> m68k/debian-installer-images_20200315_m68k.tar.gz
>>
>> v6:
>> m68k-virt-ctrl:
>> Renamed to virt-ctrl to be generic
>> Add a simple specs document
>
> Thanks for this document! Series LGTM.
>
> I tested doing:
>
> qemu$ docker run -it --rm -v $PWD:$PWD -w $PWD -v /tmp:/tmp -u 0
> --network host registry.gitlab.com/qemu-project/qemu/qemu/debian-m68k-cross
> # apt-get update
> # apt-get install flex bison libssl-dev
> # git clone https://github.com/vivier/linux.git
> # cd linux
> # git checkout m68k-virt
> # make O=build ARCH=m68k CROSS_COMPILE=m68k-linux-gnu- virt_defconfig
> # make O=build ARCH=m68k CROSS_COMPILE=m68k-linux-gnu- vmlinux -j8
>
> [ 0.000000] Linux version 5.11.0-rc5-00002-g8a00b8b1edb (root@x1w)
> (m68k-linux-gnu-gcc (Debian 8.3.0-2) 8.3.0, GNU ld (GNU Binutils for
> Debian) 2.31.1) #1 Mon Mar 8 22:27:19 UTC 2021
>
> I also tested the Goldfish-tty:
>
> [ 1.390000] printk: console [ttyGF0] enabled
> [ 1.390000] printk: console [ttyGF0] enabled
> [ 1.390000] printk: bootconsole [early_gf_tty0] disabled
> [ 1.390000] printk: bootconsole [early_gf_tty0] disabled
>
> So:
> Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Thank you Philippe.
> Don't you want to share a preinstalled qcow2 image like Aurelien?
>
> https://people.debian.org/~aurel32/qemu/
For the moment, my next move is to have the kernel changes merged.
But I have a qcow2 available here: http://vivier.eu/debian-10.0.qcow2
>
> Also, do you plan to add functional testing later?
Yes, except if someone else does it before me :)
Thanks,
Laurent
prev parent reply other threads:[~2021-03-09 7:27 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-08 21:24 [PATCH v6 0/5] m68k: add Virtual M68k Machine Laurent Vivier
2021-03-08 21:24 ` [PATCH v6 1/5] char: add goldfish-tty Laurent Vivier
2021-03-08 21:24 ` [PATCH v6 2/5] intc: add goldfish-pic Laurent Vivier
2021-03-08 21:24 ` [PATCH v6 3/5] m68k: add an interrupt controller Laurent Vivier
2021-03-08 21:25 ` [PATCH v6 4/5] m68k: add a system controller Laurent Vivier
2021-03-08 22:09 ` Philippe Mathieu-Daudé
2021-03-08 21:25 ` [PATCH v6 5/5] m68k: add Virtual M68k Machine Laurent Vivier
2021-03-08 22:17 ` Philippe Mathieu-Daudé
2021-03-08 22:47 ` [PATCH v6 0/5] " Philippe Mathieu-Daudé
2021-03-09 7:25 ` Laurent Vivier [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=09398f07-4ae2-d8a7-fc1f-ececef9102ee@vivier.eu \
--to=laurent@vivier.eu \
--cc=aurelien@aurel32.net \
--cc=f4bug@amsat.org \
--cc=huth@tuxfamily.org \
--cc=marcandre.lureau@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).