[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v6 0/5] m68k: add Virtual M68k Machine
From: |
Laurent Vivier |
Subject: |
Re: [PATCH v6 0/5] m68k: add Virtual M68k Machine |
Date: |
Tue, 9 Mar 2021 08:25:21 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 |
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
- [PATCH v6 0/5] m68k: add Virtual M68k Machine, Laurent Vivier, 2021/03/08
- [PATCH v6 1/5] char: add goldfish-tty, Laurent Vivier, 2021/03/08
- [PATCH v6 2/5] intc: add goldfish-pic, Laurent Vivier, 2021/03/08
- [PATCH v6 5/5] m68k: add Virtual M68k Machine, Laurent Vivier, 2021/03/08
- [PATCH v6 3/5] m68k: add an interrupt controller, Laurent Vivier, 2021/03/08
- [PATCH v6 4/5] m68k: add a system controller, Laurent Vivier, 2021/03/08
- Re: [PATCH v6 0/5] m68k: add Virtual M68k Machine, Philippe Mathieu-Daudé, 2021/03/08
- Re: [PATCH v6 0/5] m68k: add Virtual M68k Machine,
Laurent Vivier <=