* [Buildroot] /dev/ttyS0 in filesystem created by Buildroot can't be opened in Qemu @ 2012-07-09 8:31 Mihajlo Jovanović 2012-07-09 8:41 ` Baruch Siach 0 siblings, 1 reply; 10+ messages in thread From: Mihajlo Jovanović @ 2012-07-09 8:31 UTC (permalink / raw) To: buildroot Hi everyone, I am working with QEMU 1.1.0, emulating Versatile Express board with ARM Cortex-A9. I have managed to launch simple "Hello World" example following this 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 filesystem by myself. I decided to use buildroot, version 2012.05. and I've configured it to create toolchain, kernel and filesystem image for ARM Cortex-A9 target. Kernel is of version 3.3.7 and for the filesystem I've selected to be cpio, non-compressed. The initrd argument in call to qemu-system-arm is pointing to */output/images/rootfs.cpio* When I launch QEMU kernel boots, but then I get this message: *Initializing random number generator... done.* *Starting network...* *can't open /dev/ttyS0: No such device or address* *can't open /dev/ttyS0: No such device or address* *can't open /dev/ttyS0: No such device or address* *...* All I can do is to terminate QEMU. I have checked the contents of rootfs.cpio like this: cpio -t < rootfs.cpio and saw that there is /dev/ttyS0. Have I missed something in configuring the filesystem? Or should I use filesystem in */output/target* to somehow create device(s) there (Buildroot does not do that), and then rebuild the filesystem? I'm new to Buildroot, so any hint or suggestion is more than welcome. Thanks a lot in advance, Mihajlo -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20120709/8ecdc8c1/attachment.html> ^ permalink raw reply [flat|nested] 10+ messages in thread
* [Buildroot] /dev/ttyS0 in filesystem created by Buildroot can't be opened in Qemu 2012-07-09 8:31 [Buildroot] /dev/ttyS0 in filesystem created by Buildroot can't be opened in Qemu Mihajlo Jovanović @ 2012-07-09 8:41 ` Baruch Siach 2012-07-09 14:40 ` Mihajlo Jovanović 0 siblings, 1 reply; 10+ messages in thread From: Baruch Siach @ 2012-07-09 8:41 UTC (permalink / raw) To: buildroot Hi Mihajlo, On Mon, Jul 09, 2012 at 10:31:49AM +0200, Mihajlo Jovanovi? wrote: > Hi everyone, > > I am working with QEMU 1.1.0, emulating Versatile Express board with ARM > Cortex-A9. I have managed to launch simple "Hello World" example following > this 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 filesystem by myself. > > I decided to use buildroot, version 2012.05. and I've configured it to > create toolchain, kernel and filesystem image for ARM Cortex-A9 target. > > Kernel is of version 3.3.7 and for the filesystem I've selected to be cpio, > non-compressed. The initrd argument in call to qemu-system-arm is pointing > to > > */output/images/rootfs.cpio* > > When I launch QEMU kernel boots, but then I get this message: > > *Initializing random number generator... done.* > > *Starting network...* > > *can't open /dev/ttyS0: No such device or address* Versatile systems use the amba-pl011 serial driver, that have its device node at /dev/ttyAMA0 by default. Change "Port to run a getty (login prompt) on" (under "System configuration") to ttyAMA0 and try again. You can also use qemu_arm_vexpress_defconfig as a base for experimentation. Just do: make qemu_arm_vexpress_defconfig This defconfig already includes the right getty port for Versatile Express. baruch > *...* > > All I can do is to terminate QEMU. > > I have checked the contents of rootfs.cpio like this: > > cpio -t < rootfs.cpio > > and saw that there is /dev/ttyS0. > > Have I missed something in configuring the filesystem? Or should I use > filesystem in > > */output/target* > > to somehow create device(s) there (Buildroot does not do that), and then > rebuild the filesystem? > > I'm new to Buildroot, so any hint or suggestion is more than welcome. -- http://baruch.siach.name/blog/ ~. .~ Tk Open Systems =}------------------------------------------------ooO--U--Ooo------------{= - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il - ^ permalink raw reply [flat|nested] 10+ messages in thread
* [Buildroot] /dev/ttyS0 in filesystem created by Buildroot can't be opened in Qemu 2012-07-09 8:41 ` Baruch Siach @ 2012-07-09 14:40 ` Mihajlo Jovanović 2012-07-09 16:16 ` Baruch Siach 0 siblings, 1 reply; 10+ messages in thread From: Mihajlo Jovanović @ 2012-07-09 14:40 UTC (permalink / raw) To: buildroot Hi Baruch, Thanks for this hint. I have rebuilt everything with qemu_arm_vexpress_defconfig configuration file. I have noticed that it created ext2 filesystem, instead of cpio, as I was planning to do, to be as close to tutorial as possible. Nevertheless, I have launched Qemu like this: qemu-system-arm -M vexpress-a9 -kernel zImage -initrd rootfs.ext2 -serial stdio -append "console=ttyAMA0" Where zImage and rootfs.ext2 are kernel image and filesystem created by Buildroot, respectively. Now there are no complaints about missing /dev/ttyS0 any more, but kernel prints the message that it can not mount filesystem: . . . NET: Registered protocol family 17 VFP support v0.3: implementor 41 architecture 3 part 30 variant 9 rev 0 input: ImExPS/2 Generic Explorer Mouse as /devices/mb:kmi1/serio1/input/input1 rtc-pl031 mb:rtc: setting system clock to 2012-07-09 14:10:33 UTC (1341843033) VFS: Cannot open root device "(null)" or unknown-block(0,0) Please append a correct "root=" boot option; here are the available partitions: Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0) [<80014de4>] (unwind_backtrace+0x0/0xf8) from [<8033065c>] (panic+0x88/0x1d8) [<8033065c>] (panic+0x88/0x1d8) from [<80438c64>] (mount_block_root+0x15c/0x210) [<80438c64>] (mount_block_root+0x15c/0x210) from [<80438df0>] (mount_root+0xd8/0xf4) [<80438df0>] (mount_root+0xd8/0xf4) from [<80438f34>] (prepare_namespace+0x128/0x180) [<80438f34>] (prepare_namespace+0x128/0x180) from [<80438918>] (kernel_init+0x13c/0x178) [<80438918>] (kernel_init+0x13c/0x178) from [<8000f388>] (kernel_thread_exit+0x0/0x8) Just for the reference, the complete log is attached to this e-mail. It looks as if I missed to specify root option or something similar. I have tried to specify hard-disk image (-hda option in Qemu) and to append option "root=/dev/sda1", but it ended up more or less the same: qemu-system-arm -M vexpress-a9 -kernel zImage -hda /ARM_hda.img -initrd rootfs.ext2 -serial stdio -append "root=/dev/sda1 console=ttyAMA0" Thanks in advance! Mihajlo 2012/7/9 Baruch Siach <baruch@tkos.co.il> > Hi Mihajlo, > > On Mon, Jul 09, 2012 at 10:31:49AM +0200, Mihajlo Jovanovi? wrote: > > Hi everyone, > > > > I am working with QEMU 1.1.0, emulating Versatile Express board with ARM > > Cortex-A9. I have managed to launch simple "Hello World" example > following > > this 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 filesystem by myself. > > > > I decided to use buildroot, version 2012.05. and I've configured it to > > create toolchain, kernel and filesystem image for ARM Cortex-A9 target. > > > > Kernel is of version 3.3.7 and for the filesystem I've selected to be > cpio, > > non-compressed. The initrd argument in call to qemu-system-arm is > pointing > > to > > > > */output/images/rootfs.cpio* > > > > When I launch QEMU kernel boots, but then I get this message: > > > > *Initializing random number generator... done.* > > > > *Starting network...* > > > > *can't open /dev/ttyS0: No such device or address* > > Versatile systems use the amba-pl011 serial driver, that have its device > node > at /dev/ttyAMA0 by default. Change "Port to run a getty (login prompt) on" > (under "System configuration") to ttyAMA0 and try again. > > You can also use qemu_arm_vexpress_defconfig as a base for experimentation. > Just do: > > make qemu_arm_vexpress_defconfig > > This defconfig already includes the right getty port for Versatile Express. > > baruch > > > *...* > > > > All I can do is to terminate QEMU. > > > > I have checked the contents of rootfs.cpio like this: > > > > cpio -t < rootfs.cpio > > > > and saw that there is /dev/ttyS0. > > > > Have I missed something in configuring the filesystem? Or should I use > > filesystem in > > > > */output/target* > > > > to somehow create device(s) there (Buildroot does not do that), and then > > rebuild the filesystem? > > > > I'm new to Buildroot, so any hint or suggestion is more than welcome. > > > -- > http://baruch.siach.name/blog/ ~. .~ Tk Open > Systems > =}------------------------------------------------ooO--U--Ooo------------{= > - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il - > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20120709/ef969e22/attachment.html> ^ permalink raw reply [flat|nested] 10+ messages in thread
* [Buildroot] /dev/ttyS0 in filesystem created by Buildroot can't be opened in Qemu 2012-07-09 14:40 ` Mihajlo Jovanović @ 2012-07-09 16:16 ` Baruch Siach 2012-07-10 10:22 ` Mihajlo Jovanović 0 siblings, 1 reply; 10+ messages in thread From: Baruch Siach @ 2012-07-09 16:16 UTC (permalink / raw) To: buildroot Hi Mihajlo, On Mon, Jul 09, 2012 at 04:40:52PM +0200, Mihajlo Jovanovi? wrote: > Hi Baruch, > > Thanks for this hint. I have rebuilt everything with > qemu_arm_vexpress_defconfig configuration file. > > I have noticed that it created ext2 filesystem, instead of cpio, as I was > planning to do, to be as close to tutorial as possible. > > Nevertheless, I have launched Qemu like this: > > qemu-system-arm -M vexpress-a9 -kernel zImage -initrd rootfs.ext2 -serial > stdio -append "console=ttyAMA0" > > Where zImage and rootfs.ext2 are kernel image and filesystem created by > Buildroot, respectively. > > Now there are no complaints about missing /dev/ttyS0 any more, but kernel > prints the message that it can not mount filesystem: [...] Quoting board/qemu/arm-vexpress/readme.txt: Run the emulation with: qemu-system-arm -M vexpress-a9 -kernel output/images/zImage -drive file=output/images/rootfs.ext2,if=sd -append "console=ttyAMA0,115200 root=/dev/mmcblk0" -serial stdio -net nic,model=lan9118 -net user The login prompt will appear in the terminal that started Qemu. The graphical window is the framebuffer. baruch -- http://baruch.siach.name/blog/ ~. .~ Tk Open Systems =}------------------------------------------------ooO--U--Ooo------------{= - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il - ^ permalink raw reply [flat|nested] 10+ messages in thread
* [Buildroot] /dev/ttyS0 in filesystem created by Buildroot can't be opened in Qemu 2012-07-09 16:16 ` Baruch Siach @ 2012-07-10 10:22 ` Mihajlo Jovanović 2012-07-10 10:29 ` Baruch Siach 0 siblings, 1 reply; 10+ messages in thread From: Mihajlo Jovanović @ 2012-07-10 10:22 UTC (permalink / raw) To: buildroot Hi Baruch, Thanks for this, I was not browsing through Buildroot directories carefully enough to find that readme. Actually, I had to change the command to qemu-system-arm -M vexpress-a9 -kernel output/images/zImage -drive file=output/images/rootfs.ext2,if=sd -append "console=ttyAMA0,115200 root=/dev/mmcblk0 rw " -serial stdio -net nic,model=lan9118 -net user otherwise ext2 was read only, and I got messages that /dev/null and /dev/ttyAMA0 can not be open. However, now when I launch Qemu it freezes while starting network: Freeing init memory: 172K Starting logging: OK Starting mdev... Starting network... It just waits there until I terminate it. I have recompiled the kernel and deactivate networking as I really don't need it now, but without success. It just printed an additional message that sockets are not implemented. I have used unmodified qemu_arm_vexpress_defconfig file, but maybe something has to be changed in configuration anyway. I am launching Qemu on Ubuntu 12.04 virtual machine under Windows 7, so I'm not sure if that might be causing any problems. My goal is just to get command prompt. After that I would like to rebuild filesystem and to run some DirectFB examples. Best regards, Mihajlo 2012/7/9 Baruch Siach <baruch@tkos.co.il> > Hi Mihajlo, > > On Mon, Jul 09, 2012 at 04:40:52PM +0200, Mihajlo Jovanovi? wrote: > > Hi Baruch, > > > > Thanks for this hint. I have rebuilt everything with > > qemu_arm_vexpress_defconfig configuration file. > > > > I have noticed that it created ext2 filesystem, instead of cpio, as I was > > planning to do, to be as close to tutorial as possible. > > > > Nevertheless, I have launched Qemu like this: > > > > qemu-system-arm -M vexpress-a9 -kernel zImage -initrd rootfs.ext2 -serial > > stdio -append "console=ttyAMA0" > > > > Where zImage and rootfs.ext2 are kernel image and filesystem created by > > Buildroot, respectively. > > > > Now there are no complaints about missing /dev/ttyS0 any more, but kernel > > prints the message that it can not mount filesystem: > > [...] > > Quoting board/qemu/arm-vexpress/readme.txt: > > Run the emulation with: > > qemu-system-arm -M vexpress-a9 -kernel output/images/zImage -drive > file=output/images/rootfs.ext2,if=sd -append "console=ttyAMA0,115200 > root=/dev/mmcblk0" -serial stdio -net nic,model=lan9118 -net user > > The login prompt will appear in the terminal that started Qemu. The > graphical window is the framebuffer. > > baruch > > -- > http://baruch.siach.name/blog/ ~. .~ Tk Open > Systems > =}------------------------------------------------ooO--U--Ooo------------{= > - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il - > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20120710/bf36442a/attachment.html> ^ permalink raw reply [flat|nested] 10+ messages in thread
* [Buildroot] /dev/ttyS0 in filesystem created by Buildroot can't be opened in Qemu 2012-07-10 10:22 ` Mihajlo Jovanović @ 2012-07-10 10:29 ` Baruch Siach 2012-07-10 12:46 ` Thomas Petazzoni 0 siblings, 1 reply; 10+ messages in thread From: Baruch Siach @ 2012-07-10 10:29 UTC (permalink / raw) To: buildroot Hi Mihajlo, On Tue, Jul 10, 2012 at 12:22:02PM +0200, Mihajlo Jovanovi? wrote: > Actually, I had to change the command to > > qemu-system-arm -M vexpress-a9 -kernel output/images/zImage -drive > file=output/images/rootfs.ext2,if=sd -append "console=ttyAMA0,115200 > root=/dev/mmcblk0 rw " -serial stdio -net nic,model=lan9118 -net user > > otherwise ext2 was read only, and I got messages that /dev/null and > /dev/ttyAMA0 can not be open. Whether or not the root filesystem is mounted read-only should not affect the functionality of device nodes. There seems to be some other problem here. > However, now when I launch Qemu it freezes while starting network: > > Freeing init memory: 172K > > Starting logging: OK > > Starting mdev... > > Starting network... > > It just waits there until I terminate it. I have recompiled the kernel and > deactivate networking as I really don't need it now, but without success. > It just printed an additional message that sockets are not implemented. Did you make a clean build after changing the configuration? The Buildroot configuration system can't detect all configuration changes so sometimes you must start from clean. Specifically, make sure that your /etc/inittab has the right getty command with ttyAMA0. baruch -- http://baruch.siach.name/blog/ ~. .~ Tk Open Systems =}------------------------------------------------ooO--U--Ooo------------{= - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il - ^ permalink raw reply [flat|nested] 10+ messages in thread
* [Buildroot] /dev/ttyS0 in filesystem created by Buildroot can't be opened in Qemu 2012-07-10 10:29 ` Baruch Siach @ 2012-07-10 12:46 ` Thomas Petazzoni 2012-07-10 12:54 ` Baruch Siach 0 siblings, 1 reply; 10+ messages in thread From: Thomas Petazzoni @ 2012-07-10 12:46 UTC (permalink / raw) To: buildroot Le Tue, 10 Jul 2012 13:29:11 +0300, Baruch Siach <baruch@tkos.co.il> a ?crit : > Did you make a clean build after changing the configuration? The Buildroot > configuration system can't detect all configuration changes so sometimes you > must start from clean. Specifically, make sure that your /etc/inittab has the > right getty command with ttyAMA0. This specific part (munging the tty used for getty) is actually done as a post-build process, so it's updated as per the configuration at every build, without having to do a make clean. Thomas -- Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com ^ permalink raw reply [flat|nested] 10+ messages in thread
* [Buildroot] /dev/ttyS0 in filesystem created by Buildroot can't be opened in Qemu 2012-07-10 12:46 ` Thomas Petazzoni @ 2012-07-10 12:54 ` Baruch Siach 2012-07-10 15:13 ` Mihajlo Jovanović 0 siblings, 1 reply; 10+ messages in thread From: Baruch Siach @ 2012-07-10 12:54 UTC (permalink / raw) To: buildroot Hi Thomas, On Tue, Jul 10, 2012 at 02:46:10PM +0200, Thomas Petazzoni wrote: > Le Tue, 10 Jul 2012 13:29:11 +0300, > Baruch Siach <baruch@tkos.co.il> a ?crit : > > > Did you make a clean build after changing the configuration? The Buildroot > > configuration system can't detect all configuration changes so sometimes you > > must start from clean. Specifically, make sure that your /etc/inittab has the > > right getty command with ttyAMA0. > > This specific part (munging the tty used for getty) is actually done as > a post-build process, so it's updated as per the configuration at every > build, without having to do a make clean. Thanks for clarifying this. However, the console output that Mihajlo has posted seems to indicate that something is wrong with the getty configuration. baruch -- http://baruch.siach.name/blog/ ~. .~ Tk Open Systems =}------------------------------------------------ooO--U--Ooo------------{= - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il - ^ permalink raw reply [flat|nested] 10+ messages in thread
* [Buildroot] /dev/ttyS0 in filesystem created by Buildroot can't be opened in Qemu 2012-07-10 12:54 ` Baruch Siach @ 2012-07-10 15:13 ` Mihajlo Jovanović 2012-07-13 21:03 ` Thomas Petazzoni 0 siblings, 1 reply; 10+ messages in thread From: Mihajlo Jovanović @ 2012-07-10 15:13 UTC (permalink / raw) To: buildroot Hi Baruch, Thomas, I have managed to launch Qemu after clean build. Configuration file was qemu_arm_vexpress_defconfig. There was no need to specify "rw" to avoid filesystem being read only. I made sure that ttyAMA0 is console output. Qemu window is framebuffer (only Tux is there) and all console input/output is in terminal window where I launched Qemu. I got command prompt. However, just for testing purposes, I have launched qemu with "console=tty1" and then I got correct output in terminal window, whereas in Qemu window there was Tux and outputs were finished with "Starting network...". Probably the reason for that is discrepancy between specifying "tty1" in Qemu invocation, and at the same time selecting "ttyAMA0" in menuconfig Many thanks for your suggestions. I find Buildroot very handy, and in my future work I will continue to use it. I'm sure there will be more questions and it's good to know that there's somebody who can help. Best regards, Mihajlo 2012/7/10 Baruch Siach <baruch@tkos.co.il> > Hi Thomas, > > On Tue, Jul 10, 2012 at 02:46:10PM +0200, Thomas Petazzoni wrote: > > Le Tue, 10 Jul 2012 13:29:11 +0300, > > Baruch Siach <baruch@tkos.co.il> a ?crit : > > > > > Did you make a clean build after changing the configuration? The > Buildroot > > > configuration system can't detect all configuration changes so > sometimes you > > > must start from clean. Specifically, make sure that your /etc/inittab > has the > > > right getty command with ttyAMA0. > > > > This specific part (munging the tty used for getty) is actually done as > > a post-build process, so it's updated as per the configuration at every > > build, without having to do a make clean. > > Thanks for clarifying this. However, the console output that Mihajlo has > posted seems to indicate that something is wrong with the getty > configuration. > > baruch > > -- > http://baruch.siach.name/blog/ ~. .~ Tk Open > Systems > =}------------------------------------------------ooO--U--Ooo------------{= > - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il - > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20120710/7823676f/attachment.html> ^ permalink raw reply [flat|nested] 10+ messages in thread
* [Buildroot] /dev/ttyS0 in filesystem created by Buildroot can't be opened in Qemu 2012-07-10 15:13 ` Mihajlo Jovanović @ 2012-07-13 21:03 ` Thomas Petazzoni 0 siblings, 0 replies; 10+ messages in thread From: Thomas Petazzoni @ 2012-07-13 21:03 UTC (permalink / raw) To: buildroot Le Tue, 10 Jul 2012 17:13:16 +0200, Mihajlo Jovanovi? <jovanovic.mihajlo@gmail.com> a ?crit : > However, just for testing purposes, I have launched qemu with > "console=tty1" and then I got correct output in terminal window, whereas in > Qemu window there was Tux and outputs were finished with "Starting > network...". Probably the reason for that is discrepancy between specifying > "tty1" in Qemu invocation, and at the same time selecting "ttyAMA0" in > menuconfig You're confusing two different things: (1) The console=ttyXX kernel parameter. This tells the kernel were to output its messages, i.e all the messages displayed by kernel drivers and subsystems. (2) The ttyXX on which the getty program is run. getty is the userspace program that implements the login prompt. In Buildroot, it is started directly by Busybox init, as specified in the /etc/inittab file. The option in System configuration -> Port to run getty on adjust this tty. Best regards, Thomas -- Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2012-07-13 21:03 UTC | newest] Thread overview: 10+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2012-07-09 8:31 [Buildroot] /dev/ttyS0 in filesystem created by Buildroot can't be opened in Qemu Mihajlo Jovanović 2012-07-09 8:41 ` Baruch Siach 2012-07-09 14:40 ` Mihajlo Jovanović 2012-07-09 16:16 ` Baruch Siach 2012-07-10 10:22 ` Mihajlo Jovanović 2012-07-10 10:29 ` Baruch Siach 2012-07-10 12:46 ` Thomas Petazzoni 2012-07-10 12:54 ` Baruch Siach 2012-07-10 15:13 ` Mihajlo Jovanović 2012-07-13 21:03 ` Thomas Petazzoni
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox