/ dev / ttyS0 cannot be opened in Qemu

I work with QEMU 1.1.0, emulating a Versatile Express board with an ARM Cortex-A9. I was able to run a simple "Hello World" example following these instructions:

http://balau82.wordpress.com/2012/03/31/compile-linux-kernel-3-2-for-arm-and-emulate-with-qemu/

but now I want to create a file system myself.

I decided to use buildroot, version 2012.05. and I set it up to create an instrument chain, kernel, and file system image for the ARM Cortex-A9 target.

The kernel version 3.3.7 also does not compress for the file system that I chose as cpio. The initrd argument when calling qemu-system-arm points to

/output/images/rootfs.cpio

When I run the QEMU kernel boot, but then I get this message:

Initializing the random number generator ... done.

Start network ...

cannot open / dev / ttyS 0: no such device or address

cannot open / dev / ttyS 0: no such device or address

cannot open / dev / ttyS 0: no such device or address

...

All I can do is finish QEMU.

I checked the contents of rootfs.cpio as follows:

cpio -t <rootfs.cpio

and saw that there is / dev / ttyS 0.

Am I missing something in configuring the file system? Or should I use the file system in

/ exit / target

to somehow create a device there (Buildroot doesn't), and then rebuild the file system?

I am new to Buildroot, so any hints or suggestions are more than welcome.

+4
source share
1 answer

Extract rootfs and enter ls -all /dev/ttyS0 and check its major and minor . Because if your primary number is optional, it will not invoke the corresponding functionality of the kernel, in which case it will only be a device of unwanted characters.

You can also publish the entire log file (copy all of these dmesg and place them somewhere and provide a link here.)

And if you are sure that / dev / ttyS 0 is there, follow these steps:

  • extracting (unpacking using cpio) rootfs

  • Find out which kernel init file is used as the parent process. If you're lucky, then it will be in the root directory. named init or initrc

  • open the init file in your favorite editor.
  • the beginning of a few lines of your init will look like

    :: respawn: / sbin / getty -L 38400 tty1
    :: respawn: / sbin / getty -L 38400 tty2
    :: respawn: / sbin / getty -L 38400 tty3
    :: respawn: / sbin / getty -L 38400 tty4

  • add ::respawn:/sbin/ls -all /dev and save the file. (We added a list command to see what is inside the / dev directory)

  • reboot your system and check dmesg. See if /dev/ttyS0 really?
+1
source

All Articles