linux-m68k.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Finn Thain <fthain@telegraphics.com.au>
To: Rob Landley <rob@landley.net>
Cc: linux-m68k@vger.kernel.org, Laurent Vivier <Laurent@Vivier.EU>
Subject: Re: Running m68k on qemu with external initramfs?
Date: Sun, 12 Apr 2020 15:29:19 +1000 (AEST)	[thread overview]
Message-ID: <alpine.LNX.2.22.394.2004121508200.50@nippy.intranet> (raw)
In-Reply-To: <0e69cfc4-3bcd-25c3-0d32-665ef50f815c@landley.net>

On Sat, 11 Apr 2020, Rob Landley wrote:

> On 4/11/20 1:12 AM, Finn Thain wrote:
> > On Fri, 10 Apr 2020, Rob Landley wrote:
> > 
> >> I'm adding m68k support to toybox's "make root" target and I have a 
> >> kernel and a rootfs.cpio.gz, but qemu's -initrd option doesn't put the 
> >> rootfs image somewhere the m68k kernel can find it.
> >>
> >> Is this a "modify qemu" problem or a "modify kernel" problem?
> > 
> > It sounds more like a "modify kernel .config" problem. But it could be a 
> > regression; what versions of qemu and kernel did you try?
> 
> "Works for me", got it. I'll keep digging.
> 

If you want to try a kernel binary that works for me, so as to narrow down 
the problem, you can get one from here:
https://sourceforge.net/projects/linux-mac68k/files/

> QEMU is the one Laurent Vivier maintains that's been out of tree for 
> something like 12 years now, the default branch claims to be "q800-dev" 
> and the last commit was in december.

Should be fine. For the last few months I've used mainline QEMU instead.

> It still runs my old aboriginal linux system image from 2014 (boots to a 
> shell prompt).
> 
> Kernel is vanilla v5.6 with the arch configured with:
> 
> QEMU="m68k -M q800" KARCH=m68k KARGS=ttyS0 VMLINUX=vmlinux
> KCONF=MMU,M68040,M68KFPU_EMU,MAC,SCSI_MAC_ESP,MACINTOSH_DRIVERS,ADB,ADB_MACII,NET_CORE,MACSONIC,SERIAL_PMACZILOG,SERIAL_PMACZILOG_TTYS,SERIAL_PMACZILOG_CONSOLE
> 
> Which is top of:
> 
> BASE=EARLY_PRINTK,BINFMT_ELF,BINFMT_SCRIPT,NO_HZ,HIGH_RES_TIMERS,BLK_DEV,BLK_DEV_INITRD,RD_GZIP,BLK_DEV_LOOP,EXT4_FS,EXT4_USE_FOR_EXT2,VFAT_FS,FAT_DEFAULT_UTF8,MISC_FILESYSTEMS,SQUASHFS,SQUASHFS_XATTR,SQUASHFS_ZLIB,DEVTMPFS,DEVTMPFS_MOUNT,TMPFS,TMPFS_POSIX_ACL,NET,PACKET,UNIX,INET,IPV6,NETDEVICES,NET_CORE,NETCONSOLE,ETHERNET
> 
> As interpreted by:
> 
>   sed -E '/^$/d;s/([^,]*)($|,)/CONFIG_\1=y\n/g' <<< "$BASE,$KCONF > mini.conf
>   make ARCH=$KARCH allnoconfig KCONFIG_ALLCONFIG=mini.conf
>   make ARCH=$KARCH CROSS_COMPILE="$CROSS_COMPILE" -j $(nproc)
> 
> Plus of course:
> 
>   echo "qemu-system-$QEMU" '"$@"' -nographic -no-reboot -m 256 \
>        "-kernel $(basename "$VMLINUX") -initrd root.cpio.gz" \
>        "-append \"quiet panic=1 HOST=$TARGET console=$KARGS \$KARGS\"" \
>        ${DTB:+-dtb "$(basename "$DTB")"} > "$OUTPUT/qemu-$TARGET.sh"
> 

That works for me, with a few tweaks:

qemu-system-m68k -M q800 -serial none -serial mon:stdio -nographic 
-no-reboot -m 256 -kernel vmlinux-4.14.167-mac-backport+ 
-initrd sysroot.cpio.gz -append console=ttyS0

> I.E. the usual. 

This is my usual invocation:

qemu-system-m68k -M q800 -m 992M
-serial none -serial mon:stdio -g 800x600x4
-drive file=guest-root,format=raw
-drive file=guest-swap,format=raw
-append "fbcon=font:ProFont6x11 console=tty0 console=ttyS0 root=/dev/sda rw ignore_loglevel"
-kernel vmlinux
-net nic,model=dp83932,addr=00:00:00:01:02:03 -net bridge
-rtc base=localtime

> (I'm trying to add m68k support to 
> https://github.com/landley/toybox/blob/master/scripts/mkroot.sh which 
> already boots armv5l, armv7l, aarch64, i486, i686, x86_64, mips, mipsel, 
> powerpc, s390x, and sh4 to a shell prompt under qemu, although you still 
> have to KARGS=rdinit=/bin/sh because I haven't QUITE got my new shell 
> making it through the end of the init script. Should do in another 
> couple days.)
> 

Nice!

> Rob
> 

  reply	other threads:[~2020-04-12  5:29 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-11  0:50 Running m68k on qemu with external initramfs? Rob Landley
2020-04-11  6:12 ` Finn Thain
2020-04-12  3:36   ` Rob Landley
2020-04-12  5:29     ` Finn Thain [this message]
2020-04-12 12:34       ` Rob Landley
2020-04-12  8:27     ` John Paul Adrian Glaubitz
2020-04-12  8:31       ` Laurent Vivier
2020-04-12 21:48         ` Rob Landley
2020-04-12 23:17           ` Finn Thain
2020-04-11 12:12 ` John Paul Adrian Glaubitz
2020-04-12 12:48   ` Rob Landley
2020-04-12 13:02     ` John Paul Adrian Glaubitz
2020-04-12 21:56       ` Rob Landley
2020-04-12 23:30     ` GCC?, was " Finn Thain
2020-04-13  0:28       ` Rob Landley
2020-04-13  5:17         ` Finn Thain
2020-04-13  7:07           ` Rob Landley
2020-04-13  7:41             ` John Paul Adrian Glaubitz
2020-04-13  8:27             ` Rob Landley
2020-04-13  9:42               ` Geert Uytterhoeven
2020-04-13 23:02                 ` Finn Thain

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=alpine.LNX.2.22.394.2004121508200.50@nippy.intranet \
    --to=fthain@telegraphics.com.au \
    --cc=Laurent@Vivier.EU \
    --cc=linux-m68k@vger.kernel.org \
    --cc=rob@landley.net \
    /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).