vivier / qemu-m68k

Other
40 stars 6 forks source link

Cannot Load -kernel netbsd #29

Open boomer3200 opened 6 years ago

boomer3200 commented 6 years ago

qemu-system-m68k cannot load a current NetBSD 7.1 kernel from the -kernel command line option unlike standard qemu for other architectures.

Using qemu-system-m68k version 2.11.90 I get the following error on an unzipped kernel: "Trying to execute code outside RAM or ROM at 0x00002e00"

Regular qemu allows you to boot NetBSD's kernel directly from the command line on other architectures, such as ARM and x86. The kernel is multiboot compliant.

Supporting NetBSD would be really helpful because the system is currently maintained and has a long history 68k Macs. Hopefully this is not out of scope for qemu-m68k.

vivier commented 6 years ago

Mainstream qemu has missing hardware emulation. Please use branch q800-dev from this repo with "-machine q800"... and let me know what happens.

boomer3200 commented 6 years ago

Thanks, I cloned your repo and rebuilt using the q800-dev branch. I ran the following command line, but got no output on stdio:

qemu-system-m68k -machine q800 -m 128M -drive file=nbsd.img,format=raw -kernel Downloads/netbsd-GENERIC -serial mon:stdio -nographic

I also tried later using the -g option without -nographic and opening a VNC viewer, but there was a blank white screen then.

As a sanity check I made sure that:

I have a Quadra 650 running NetBSD to use as a comparison if that would help.

vivier commented 6 years ago

Try to use the second serial port instead of the first one:

... -serial none -serial mon:stdio ...

QEMU cannot load gzipped kernel.

The loader is based on EMILE and I've never been able to load a BSD kernel with it.

boomer3200 commented 6 years ago

Same results with -serial none -serial mon:stdio.

vivier commented 6 years ago

Could you provide me a link to download the kernel you use?

boomer3200 commented 6 years ago

Link: https://ftp.netbsd.org/pub/NetBSD/NetBSD-7.1.2/mac68k/binary/kernel/netbsd-GENERIC.gz

Here's a sample for loading the i386 version from the -kernel command line. It only works for NetBSD due to the multiboot support in Qemu (Open and FreeBSD do not work).

image

glaubitz commented 6 years ago

the Linux kernel from https://people.debian.org/~glaubitz/vmlinuz-m68k.gz loaded properly (some of the links on the Debian m68k wiki for the 2015 builds no longer work).

Thanks for the heads-up. I will update the links as we have moved the CD images to Debian's official CD image server now.

L-Bouzid commented 3 years ago

Hi vivier , what about this Issue ?

L-Bouzid commented 3 years ago

Is there anything new about the 68k netbsd kernel load.

vivier commented 3 years ago

q800 is now merged in upstream QEMU, but netBSD is not supported.

But I think @mcayland has made some progress to boot BSD kernel that are not merged for the moment.

L-Bouzid commented 3 years ago

Sorry, but after build (https://github.com/mcayland/qemu/tree/q800-dev-mca.nearly) on mingw64, i get

qemu-system-m68k.exe -machine help Supported machines are: an5206Arnewsh 5206 mcf5208evb MCF5208EVB (default) none empty machine

but nothing about Q800 ?

glaubitz commented 3 years ago

The official QEMU repository can be found here: https://git.qemu.org/?p=qemu.git;a=summary

vivier commented 3 years ago

The official QEMU repository can be found here: https://git.qemu.org/?p=qemu.git;a=summary

Mark's work to boot NetBSD has not been upstreamed for now.

Sorry, but after build (https://github.com/mcayland/qemu/tree/q800-dev-mca.nearly) on mingw64, i get

qemu-system-m68k.exe -machine help Supported machines are: an5206Arnewsh 5206 mcf5208evb MCF5208EVB (default) none empty machine

but nothing about Q800 ?

Perhaps you don't execute the good binary, I have:

qemu-system-m68k -M help Supported machines are: an5206 Arnewsh 5206 mcf5208evb MCF5208EVB (default) next-cube NeXT Cube none empty machine q800 Macintosh Quadra 800 virt QEMU 6.0 M68K Virtual Machine (alias of virt-6.0) virt-6.0 QEMU 6.0 M68K Virtual Machine

mcayland commented 3 years ago

I don't think that I've actually tested booting a NetBSD kernel directly via the -kernel option? Assuming that NetBSD is happy with the bootinfo block generated by hw/m68k/q800.c then there is a good chance that it should work with https://github.com/mcayland/qemu/tree/q800-dev-mca.nearly.

mcayland commented 3 years ago

The official QEMU repository can be found here: https://git.qemu.org/?p=qemu.git;a=summary

FWIW QEMU's official repository is now hosted on GitLab at https://gitlab.com/qemu-project/qemu and the old git.qemu.org site now regularly syncs it repository from there (this is why there is now a small delay in commits being pushed to Gitlab appearing on git.qemu.org)

L-Bouzid commented 3 years ago

please, point me, what is the params for booting from floppy disk (Macos7 or 8)

vivier commented 3 years ago

please, point me, what is the params for booting from floppy disk (Macos7 or 8)

floppy is not emulated for now. Use the CDROM.

L-Bouzid commented 3 years ago

I get white screen using theses params :

qemu-system-m68k.exe -m 64 \ -boot d \ -L pc-bios -M q800 -bios Quadra650.rom \ -drive file=pram.img,format=raw,if=mtd \ -device scsi-cd,scsi-id=3,drive=cd0,vendor="MATSHITA",product="CD-ROM CR-8005",ver="1.0k" \ -drive file=MacOS_7.6.1.iso,media=cdrom,if=none,id=cd0

MacOS_7.6.1.iso boot normally with Basilisk II

qemu-system-m68k --version QEMU emulator version 6.1.50 (v6.1.0-151-g0289f62335)

vivier commented 3 years ago

Try a Quadra 800 ROM rather than a Quadra 650 ROM

L-Bouzid commented 3 years ago

I think, it is same ?

https://archive.org/details/mac_rom_archive_-_as_of_8-19-2011 : ... F1ACAD13 - Quadra 610,650,maybe 800.ROM

ps: i try to find it,but no where on the Net.