[Top][All Lists]

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

Re: Mounting an sdcard on x86?

From: Norbert Lange
Subject: Re: Mounting an sdcard on x86?
Date: Mon, 27 Jan 2020 17:50:02 +0100

Am Mo., 27. Jan. 2020 um 15:37 Uhr schrieb Peter Maydell
> 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

I tried -device sdhci-pci   -device sd-card before, but it doesnt work either,
the trick with id=mydrive,if=none does work nicely however.

> 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.

Luckily the "basic" mmc driver suffices.

> (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.)

Neither '-drive if=sd' nor '-sd file' do work.

> thanks
> -- PMM

Thanks for the quick help,

reply via email to

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