Search code examples
linuxkernelbootqemu

Black screen when emulating Linux kernel


I'am trying to build linux for an arm (versatile board) and emulate it using Qemu:

I folowed the folowing tutorial

After downloading Qemu and the arm-linux-gnueab toolchain the steps are basically:

  • make -C build ARCH=arm distclean

  • make -C build ARCH=arm versatile_defconfig

  • make -C build ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabi-

  • qemu-system-arm -M versatileab -m 256M -kernel build/arch/arm/boot/zImage -append "console=ttyS0" -serial stdio -dtb build/arch/arm/boot/dts/versatile-ab.dtb

What I get is black sreen with a cursor at the top and the following messages:

pulseaudio: set_sink_input_volume() failed
pulseaudio: Reason: Invalid argument
pulseaudio: set_sink_input_mute() failed
pulseaudio: Reason: Invalid argument
Uncompressing Linux... done, booting the kernel.
vpb_sic_write: Bad register offset 0x2c

I'am not sure from where the problem come from: is it from the bad configuration of the kernel ?, the dtb ?; the messages don't really give a lot of informations

So your suggestions are welcome

Qemu version:

qemu-system-arm --version
QEMU emulator version 2.0.0 (Debian 2.0.0+dfsg-2ubuntu1.31), Copyright (c) 2003-2008 Fabrice Bellard

My machine:

uname -a
Linux user-SATELLITE-C855-169 4.2.0-27-generic #32~14.04.1-Ubuntu SMP Fri Jan 22 15:32:26 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux

Solution

  • The device ttyS0 is usually for PC-style 8250/16550 serial ports, whereas QEMU emulates an AMBA PL011 for the versatibleab and versatilepb machines, which use the device name ttyAMA0, so you can try using console=ttyAMA0 instead.

    The framebuffer console may need binding by the kernel during startup, which is controlled by setting FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y in the kernel config, that should allow a console on the tty0 device using console=tty0.

    You can specify multiple console= options so using console=ttyAMA0 console=tty0 should show the kernel boot messages on both the emulated console port (on stdio, with your options) and the framebuffer.