MegaZeux Development VMs

From MZXWiki
Revision as of 04:41, 7 May 2021 by Lachesis (talk | contribs) (Created page with "This page contains VM images for testing MegaZeux (and potentially other software) for non-x86 architectures via [https://www.qemu.org QEMU]. Each image contains a cloned copy...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

This page contains VM images for testing MegaZeux (and potentially other software) for non-x86 architectures via QEMU. Each image contains a cloned copy of the MegaZeux Git repository, all tools required to build a local copy of MegaZeux, and a minimalist window environment (i3) to run MegaZeux in.

The login for all VMs is mzx with the password mzx, and the MegaZeux Git repository is typically located at /megazeux.

This page is currently a work-in-progress. Because of this, they are behind a password; ask Lachesis for it on Discord.

Linux/BSD (main architectures)

These architectures usually correspond to existing or future MegaZeux ports and are fairly well-supported by Linux and/or BSD distributions. The x86_64 and i686 architectures are omitted because there is currently no point in maintaining development VMs for them.

Build times provided were observed using an i7-7700 running QEMU from a hypervisor guest, and are mainly intended to give a sense of scale. These may vary significantly depending on your machine and setup.

Architecture Related Ports Distribution Options make unit testworlds Fails Other Issues Image Links
ARMel
qemu-system-arm
  • Nintendo DS
  • Nintendo 3DS
  • GP2X
ARMhf
qemu-system-arm 5.2.0
  • Android
  • Raspberry Pi
  • PlayStation Vita
  • Pandora
Debian 10.9
-M virt -m 2048 -cpu cortex-a15 -smp 4
-kernel [...] -initrd [...] -append "root=/dev/vda2"
-drive [...]
-device virtio-blk-device,drive=hd0
-netdev user,id=eth0 -device virtio-net-device,netdev=eth0
-nographic
2m01s (-j4) 58s (-j4) 14s FIXME no video. FIXME
ARM64
qemu-system-aarch64 5.2.0
  • Android
  • Nintendo Switch
Debian 10.9
-M virt -m 2048 -cpu cortex-a57 -smp 4
-kernel [...] -initrd [...] -append "root=/dev/vda2"
-drive [...]
-device virtio-blk-device,drive=hd0
-netdev user,id=eth0 -device virtio-net-device,netdev=eth0
-device VGA
-usb -device usb-ehci,id=ehci
-device usb-mouse,bus=ehci.0
-device usb-kbd,bus=ehci.0
2m33s (-j4) 1m13s (-j4) 17s 949MB Debian Wiki (archived)

Blog post with more detailed info. (archived)
Both of these are outdated; the BIOS image seems to be included out of the box in newer QEMU versions.

MIPSeb
qemu-system-mips 5.2.0
Debian 10.9
-M malta -m 512
-kernel [...] -initrd [...]
-append "root=/dev/sda1 console=tty0"
-drive [...]
-device usb-mouse -device usb-kbd
-vga std
~30 minutes ~16 minutes 31s 1.01GB Setup (archived)
MIPSel
qemu-system-mipsel 5.2.0
  • PlayStation Portable
Debian 10.9
-M malta -m 512
-kernel [...] -initrd [...]
-append "root=/dev/sda1 console=tty0"
-device usb-mouse -device usb-kbd
-vga std
~36 minutes ~21 minutes 35s 910MB Setup (archived)
MIPS64el
qemu-system-mips64el 5.2.0
Debian 10.9
-M malta -m 256 -cpu 5KEc
-kernel [...] -initrd [...]
-append "root=/dev/sda1 console=tty0"
-device usb-mouse -device usb-kbd
-vga std
~25 minutes ~14 minutes 30s RAM values above 256M don't work, may be a QEMU 5.2 bug or a kernel bug. 915MB Setup (archived)

More info (archived)

PowerPC
qemu-system-ppc
  • Mac OS X
  • Nintendo Wii
  • Nintendo Wii U
Debian 8.10
PowerPC 64
qemu-system-ppc64
  • Mac OS X
RISC-V RV64GC
qemu-system-riscv64
Fedora Rawhide

Linux/BSD (secondary architectures)

These architectures do not correspond to any current MegaZeux ports (Alpha, m68k, PA-RISC, SPARC) or are generally more effort to get set up than the rest (SH-4). MegaZeux will probably never run on actual hardware several of these architectures.

Architecture Related Ports Distribution Options make unit testworlds Fails Other Issues Image Links
DEC Alpha
qemu-system-alpha
Debian 5.0.10
Motorola 68000
qemu-system-m68k 5.2.0
Debian Unstable 2021-04-17
-M q800 -m 1000M
-kernel [...] -initrd [...]
-append "root/dev/sda1 rw console=ttyS0 console=tty"
-drive [...]
-net nic,model=dp83932 -net user
-g 800x600x16
4m19s 2m30s 22s When sdl_set_video_mode is modified to accept RGB555 and force_bpp=16 is used (shouldn't be necessary), video does not draw correctly. 761M QEMU Wiki (archived)
PA-RISC
qemu-system-hppa
NetBSD 9.0
SPARC
qemu-system-sparc
Debian 4.0 r4a
SPARC64
qemu-system-sparc64
NetBSD 9.0
SuperH SH-4
qemu-system-sh4
  • Sega Dreamcast

Setup

If (for whatever reason) you want to set up your own VM images, this is roughly how all of the VM images above were generated.

  1. Set up initial QEMU disk image.
    qemu-img create -f qcow2 platform.debian10.qcow2 20G
    
  2. Extract installation media vmlinux/initrd from ISO (if needed) and set up initial install.sh script.
  3. Run installer. Leave root password blank, create user mzx with password mzx and sudo access. Do not install a desktop environment.
  4. Set up run.serial.sh script and run.
  5. Set up ~/.Xresources. This is required to make urxvt not look awful.
    # "lumifoo" by gutterslob.
    
    ! special
    *.foreground:   #888a8c
    *.background:   #1e2021
    *.cursorColor:  #888a8c
    
    ! black
    *.color0:       #515151
    *.color8:       #707172
    
    ! red
    *.color1:       #bf6382
    *.color9:       #eaaec2
    
    ! green
    *.color2:       #65a446
    *.color10:      #aed49b
    
    ! yellow
    *.color3:       #ad8a43
    *.color11:      #d4c3a0
    
    ! blue
    *.color4:       #6b85c2
    *.color12:      #afc4e9
    
    ! magenta
    *.color5:       #9e6bb8
    *.color13:      #d2b1e2
    
    ! cyan
    *.color6:       #5c9d88
    *.color14:      #a4d0c1
    
    ! white
    *.color7:       #919191
    *.color15:      #d0d0d0
    
  6. Set up /bin/l (chmod a+x).
    #!/bin/sh
    
    LC_COLLATE="C" \
    ls -la --color=always --group-directories-first "$@"
    
  7. Install packages (Debian assumed, will be different for other platforms):
    sudo apt install git p7zip-full build-essential gdb zlib1g-dev libpng-dev libogg-dev libvorbis-dev libsdl2-dev xorg i3 i3lock i3status suckless-tools xdm lynx
    
  8. Set up MegaZeux repository:
    sudo mkdir /megazeux
    sudo chown mzx:mzx /megazeux
    cd /megazeux
    git clone https://github.com/AliceLR/megazeux .
    
  9. Build MegaZeux:
    ./config.sh --platform unix-devel --enable-fps [any other flags here. release builds are NOT recommended.]
    time make [use -jX with -smp]
    time make unittest [use -jX with -smp]
    time testworlds/run.sh unix-devel
    
  10. Set up run.sh script and make sure the VM can start up with graphics and run MegaZeux with the software renderer. This may take some trial and error to get right, which is why the QEMU options are provided in the above tables.
  11. If preparing a VM tarball, use a compressed copy of the VM image instead of the original:
    qemu-img convert -c -O qcow2 platform.debian10.qcow2 platform.debian10.compressed.qcow2