qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] Help needed to run Exynos 4210 linux kernel on qemu?


From: Igor Mitsyanko
Subject: Re: [Qemu-devel] Help needed to run Exynos 4210 linux kernel on qemu?
Date: Wed, 05 Sep 2012 16:38:56 +0400
User-agent: Mozilla/5.0 (X11; Linux i686; rv:14.0) Gecko/20120714 Thunderbird/14.0

On 09/04/2012 02:13 AM, Jean-Christophe DUBOIS wrote:
Hi,

I am trying to run linux over qemu-system-arm emulating a nuri or
smdkc210 Exynos 4210 based board.

To do this I fetched the last qemu (from git://git.qemu.org/qemu.git)
and built it with "./configure --target-list=arm-softmmu.

Then I fetched the latest linux image for samsung processors (from
git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung.git)
and built it using exynos4_defconfig config file.

Then I tried to run the 2 together:

$ qemu-system-arm -kernel zImage -append "console=ttySAC0,115200n8
root=/dev/ram rw earlyprintk" -serial stdio -M smdkc210 -initrd rootfs.img
smdkc210 board supports only 2 CPU cores. Ignoring smp_cpus value.
VNC server running on `127.0.0.1:5900'
Booting Linux on physical CPU 0
Linux version 3.6.0-rc3 (address@hidden) (gcc version 4.6.3
(Ubuntu/Linaro 4.6.3-1ubuntu5) ) #1 SMP PREEMPT Mon Sep 3 22:44:05 CEST
2012
CPU: ARMv7 Processor [410fc090] revision 0 (ARMv7), cr=10c5387d
CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache
Machine: SMDKC210
bootconsole [earlycon0] enabled
Truncating RAM at 40000000-7fffffff to -6f7fffff (vmalloc region overlap).
Memory policy: ECC disabled, Data cache writealloc

The kernel hangs here because it got a data abort exception while trying
to print the "next" message (which is "CPU EXYNOS4210 (id 0x43210211)").
The data abort is generated somewhere in the console_unlock() function.

I tried the same thing with some less up to date source code of qemu
and/or linux with the same result. I even tried the linaro versions of
qemu and linux without luck.

So there has to be something I am doing wrong. I would really appreciate
it if you could point me in the right direction.

Thanks.

JC



Hello, Jean!

I've just tried to do the same thing you're trying to do, it works for me if I remove earlyprintk from append. Probably this is due to the fact that kernel expects uart0 to be configured by u-boot prior to kernel start execution. Interestingly, if you change default exynos4_defconfig CONFIG_DEBUG_S3C_UART0 to, for example, CONFIG_DEBUG_S3C_UART2 in linux kernel configuration, everything starting to work fine even with earlyprintk.

But using ramdisks is always a pain for me, I would suggest you two different approaches:

1) The most convenient way is to use emulated SD card for rootfs storage. There is no SD card support for exynos4210 in current QEMU master, but you can apply SD host controller patches I attached to this email to get this support. These patches already have been thoroughly reviewed in qemu-devel mailing list and hopefully would be applied to QEMU master soon enough. If you want to use SD card instead of RAMDISK, apply these patches to QEMU master with "git am", and enable MMC/SD support in linux kernel configuration (it is disabled by default in exynos4_defconfig). You need to check CONFIG_MMC, CONFIG_MMC_SDHC, CONFIG_MMC_SDHCI_S3C and ONFIG_MMC_SDHCI_S3C_DMA. Then you can launch QEMU with -sd /path/to/your/rootfs and, for example, append line -append "root=/dev/mmcblk0 rootfstype=ext4 rw rootwait".

2) If you want to work only with what current QEMU master has, you can use network filesystem as rootfs, but only for smdkc210 board (nuri board doesn't have any net devices). You're gonna have to check these options in Linux configuration: CONFIG_NET, CONFIG_PACKET, CONFIG_INET, CONFIG_IP_PNP, CONFIG_IP_PNP_DHCP, CONFIG_NETDEVICES, CONFIG_SMSC911X, CONFIG_NFS_FS, CONFIG_ROOT_NFS. Then, if, for example, you have directory /mnt/nfsroot exported by NFS server on your host machine, you can launch QEMU guest with following command line:

qemu-system-arm -kernel ./zImage -M smdkc210 -append "console=ttySAC0,115200n8 ip=dhcp root=/dev/nfs nfsroot=10.0.2.2:/mnt/nfsroot/ rw" -serial stdio

Also, maybe you noticed, graphic support is disabled in exynos4_defconfig by default. To enable it, check these options in Linux configuration: CONFIG_DRM, CONFIG_DRM_EXYNOS, CONFIG_DRM_EXYNOS_DMABUF, CONFIG_DRM_EXYNOS_FIMD. You can also check CONFIG_LOGO to get a fancy penguins during guest VM startup. And if you need to start X server on your guest VM, you also need to enable UNIX domain sockets in linux kernel CONFIG_UNIX.

Attachment: 0001-hw-introduce-standard-SD-host-controller.patch
Description: Text Data

Attachment: 0002-exynos4210-Added-SD-host-controller-model.patch
Description: Text Data


reply via email to

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