qemu-m68k icon indicating copy to clipboard operation
qemu-m68k copied to clipboard

Cannot Load -kernel netbsd

Open boomer3200 opened this issue 6 years ago • 20 comments

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.

boomer3200 avatar Apr 05 '18 01:04 boomer3200

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

vivier avatar Apr 05 '18 07:04 vivier

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.

boomer3200 avatar Apr 05 '18 23:04 boomer3200

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.

vivier avatar Apr 06 '18 06:04 vivier

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

boomer3200 avatar Apr 07 '18 14:04 boomer3200

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

vivier avatar Apr 07 '18 15:04 vivier

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

boomer3200 avatar Apr 07 '18 15:04 boomer3200

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.

glaubitz avatar May 26 '18 14:05 glaubitz

Hi vivier , what about this Issue ?

L-Bouzid avatar Aug 26 '21 03:08 L-Bouzid

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

L-Bouzid avatar Aug 26 '21 03:08 L-Bouzid

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.

vivier avatar Aug 26 '21 12:08 vivier

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 ?

L-Bouzid avatar Aug 26 '21 14:08 L-Bouzid

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

glaubitz avatar Aug 26 '21 14:08 glaubitz

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

vivier avatar Aug 26 '21 15:08 vivier

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 avatar Aug 27 '21 07:08 mcayland

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)

mcayland avatar Aug 27 '21 07:08 mcayland

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

L-Bouzid avatar Aug 27 '21 17:08 L-Bouzid

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

floppy is not emulated for now. Use the CDROM.

vivier avatar Aug 27 '21 17:08 vivier

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)

L-Bouzid avatar Aug 27 '21 17:08 L-Bouzid

Try a Quadra 800 ROM rather than a Quadra 650 ROM

vivier avatar Aug 27 '21 17:08 vivier

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.

L-Bouzid avatar Aug 27 '21 18:08 L-Bouzid