qemu-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Mounting an sdcard on x86?


From: Peter Maydell
Subject: Re: Mounting an sdcard on x86?
Date: Mon, 27 Jan 2020 14:37:31 +0000

On Mon, 27 Jan 2020 at 14:06, Norbert Lange <address@hidden> wrote:
> I am trying to bot a kernel/initramfs combo, the kernel is customized
> for Intels Apollo Lake, and does not contain the normal sata/ide
> kernel modules, as it boots from eMMC.
>
> I cant manage to tell Qemu to hook an SD device to the Emulation,
> closest I got is with
> "-device sd-card -drive file=/tmp/image.bin,format=raw,if=sd"
>
> but that fails: "qemu-system-x86_64: -device sd-card: No 'sd-bus' bus
> found for device 'sd-card'"

That's because 'sd-card' is only an emulation of the card, not
of an SD controller. You need to also tell QEMU to add an
SD controller to the machine, something like:
 -device sdhci-pci -device sd-card,drive=mydrive -drive
id=mydrive,if=none,format=raw,file=/tmp/image.bin

You'll also need your kernel to have support for the PCI
controller and this PCI SD controller card, of course --
so you might find it still doesn't work because your kernel
requires hardware that QEMU simply doesn't have a model of.

(I give there the 'long form' of the command line options,
where we explicitly create separately the SD controller
PCI card, the SD card itself, and the QEMU drive object,
and connect them up to each other. It should also be possible
to use -drive if=sd,... but that just auto-plugs the drive
into the first available sd-card object, I think, so it's
the same effect as specifying the id/drive options with
if=none.)

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]