Linux-RISC-V Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: atish.patra@wdc.com (Atish Patra)
To: linux-riscv@lists.infradead.org
Subject: Risc-V, qemu, and initrd
Date: Thu, 21 Jun 2018 01:11:08 -0700	[thread overview]
Message-ID: <594d0a70-d990-fb0d-466d-e1c4be2e3a7c@wdc.com> (raw)
In-Reply-To: <64d50cba-8215-763c-a5c9-f384b2901d01@roeck-us.net>

On 6/20/18 11:12 PM, Guenter Roeck wrote:
> Hi folks,
> 
> I tried to boot the latest Linux kernel with qemu from https://github.com/riscv/riscv-qemu.git,
> branch qemu-2.13-for-upstream.
> 

Did you try the upstream kernel? That doesn't boot directly. You need 
some additional patches which you can find here.

https://github.com/riscv/riscv-linux/tree/riscv-all


> My command line is something like
> 
>       riscv64-softmmu/qemu-system-riscv64 -machine virt -m 512M -bios bbl -kernel vmlinux \
>           -nographic -monitor none -initrd rootfs.cpio -append "rdinit=/sbin/init"
>

AFAIK, qemu -kernel argument expects the bbl file which as vmlinux 
embedded in it. At least that's what the makefile from freedom-u-sdk says:

https://github.com/sifive/freedom-u-sdk/blob/master/Makefile

Regards,
Atish

> Unfortunately this doesn't work; the image crashes, complaining about a missing
> root file system.
> 
> Loking into the kernel source, I found arch/riscv/kernel/setup.c:setup_initrd().
> Debugging shows that initrd_start and initrd_end is set correctly in
> drivers/of/fdt.c:early_init_dt_check_for_initrd(), but overwritten with the value
> of __initramfs_start / __initramfs_size in setup_initrd(). This doesn't make
> sense to me, since populate_rootfs() tries to populate the root file system
> from both __initramfs_start and initrd_start.
> 
> Has anyone else noticed this problem ? Any idea what I need to do to load an
> initrd with the -initrd option of qemu ?
> 
> Thanks,
> Guenter
> 
> _______________________________________________
> linux-riscv mailing list
> linux-riscv at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-riscv
> 

  reply	other threads:[~2018-06-21  8:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-21  6:11 Risc-V, qemu, and initrd Guenter Roeck
2018-06-21  8:11 ` Atish Patra [this message]
2018-06-21 14:30 ` Andreas Schwab
2018-06-21 14:48   ` Guenter Roeck
2018-06-21 14:52     ` Christoph Hellwig
2018-06-21 16:34       ` Guenter Roeck
2018-06-21 17:33       ` Guenter Roeck
2018-06-21 17:55         ` Christoph Hellwig
2018-06-21 22:08           ` Guenter Roeck
2018-06-22  5:38             ` Christoph Hellwig
2018-06-22 16:34               ` Guenter Roeck

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=594d0a70-d990-fb0d-466d-e1c4be2e3a7c@wdc.com \
    --to=atish.patra@wdc.com \
    --cc=linux-riscv@lists.infradead.org \
    /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