I have been playing around with Qemu and was looking to emulate the Exynos4210 SoC from Samsung when I first looked into the Qemu-Linaro toolchain. The guys at Linaro have done a terrific job in keeping with the times and helping the developer community in general. The following steps document the use of Qemu to emulate Samsung’s reference boards for Exynos4210 viz., SMDKC210 and NURI.
I have chosen to emulate NURI, before we begin here is my list of sources
that I have used.
- QEMU – qemu-linaro-1.1.50-2012.08 toolchain
- Linux kernel- linux 3.5
- root filesystem was developed using busybox-1.12.1
- Toolchain suite – arm-linux-gnueabi- gcc version 4.6.1
The Installation procedure is fairly simple, assuming all the parts are in place run the following command
qemu-system-arm -M ?
This should bring up all the machines supported by Qemu, the Nuri and SMDKC210 boards are emulated in qemu-linaro-1.1.50-2012.08.
The Linux Kernel
The kernel compilation is straightforward. The config file exynos4_defconfig compiles for Nuri and SMDKC210 boards, it is a minimal configuration useful for a test scenario like mine. Be sure to use the appropriate toolchain for compilation and the final image to be used is the zImage found at arch/arn/boot folder of the kernel source code.
The Root File-system
the root file system is a rather tricky compilation as the configuration varies based on the final file system being designed.
first, configure busybox to produce a static binary.
next, make busybox and install.
the installed file would by default be in _install folder at the top of the busybox source, cd into it and run the following command.
find . | cpio -o –format=newc > rootfs
The above command will produce a read-only file system. rootfs is now ready to be used in qemu.
The Real Action
Now that we have all our required Images, run the following command to startup the Nuri board emulation.
“./qemu-system-arm -kernel <path/to/your/kernel> -initrd <path/to/Root/Filesystem> -append “console=ttySAC0,115200n8 root=/dev/ram rw rdinit=<init function>” -serial stdio -M <intended_machine> -smp <number of processors if applicable> -m <RAM_size>”
This should start-up the kernel and launch the init program specified in the command line appended to the kernel using the -append flag.