* [Qemu-devel] CAN device @ 2013-06-28 12:19 Yang Jin 2013-06-28 12:51 ` Andreas Färber 0 siblings, 1 reply; 4+ messages in thread From: Yang Jin @ 2013-06-28 12:19 UTC (permalink / raw) To: qemu-devel [-- Attachment #1: Type: text/plain, Size: 1419 bytes --] Hi, I try to develop a CAN device on QEMU. And I found pci-serial is similar to CAN. Untill now, I have some questions about how to use pci-serial on QEMU. Actually, QEMU use isa-serial as a default serial device. So I try to use isa-serial firstly. Some useful information we can get from docs/qdev-device-use.txt. I know that we should use "-chardev" argument to create a host part, and then use "-device isa-serial,iobase=IOADDR,irq=IRQ,index=IDX" to start a isa-serial. I get those arguments from the source file, the following can work. "-device isa-serial,chardev=isa0,iobase=0x3f8,irq=4,index=0" However, when I try to create a host through "-chardev serial,id=isa0,path=./", error "chardev: opening backend "serial" failed" occurs. When change it to "-chardev serial,id=isa0,path=/dev/ttyS0", it works. Now, I donot know what "path" means? Does it have some relation to the host device? Or it's just a symbol means nothing. And some questions about pci bus. On docs/qdev-device-use.txt, we get Example: device i440FX-pcihost is on the root bus, and provides a PCI bus named pci.0. To put a FOO device into its slot 4, use -device FOO,bus=/i440FX-pcihost/pci.0,addr=4. The abbreviated form bus=pci.0 also works as long as the bus name is unique. So, how can we get the name of the root device which we use now? I searched that for some days, but doesnot get some usefull information. Thanks, Jin yang. [-- Attachment #2: Type: text/html, Size: 1974 bytes --] ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] CAN device 2013-06-28 12:19 [Qemu-devel] CAN device Yang Jin @ 2013-06-28 12:51 ` Andreas Färber 2013-06-30 12:25 ` Yang Jin 0 siblings, 1 reply; 4+ messages in thread From: Andreas Färber @ 2013-06-28 12:51 UTC (permalink / raw) To: Yang Jin; +Cc: qemu-devel Hi, Am 28.06.2013 14:19, schrieb Yang Jin: > I try to develop a CAN device on QEMU. And I found pci-serial is similar > to CAN. > > Untill now, I have some questions about how to use pci-serial on QEMU. > Actually, QEMU use isa-serial as a default serial device. So I try to > use isa-serial firstly. > > Some useful information we can get from docs/qdev-device-use.txt. I know > that we should use "-chardev" argument to create a host part, and then > use "-device isa-serial,iobase=IOADDR,irq=IRQ,index=IDX" to start a > isa-serial. I get those arguments from the source file, the following > can work. > "-device isa-serial,chardev=isa0,iobase=0x3f8,irq=4,index=0" > However, when I try to create a host through "-chardev > serial,id=isa0,path=./", error "chardev: opening backend "serial" > failed" occurs. When change it to "-chardev > serial,id=isa0,path=/dev/ttyS0", it works. Now, I donot know what "path" > means? Does it have some relation to the host device? Or it's just a > symbol means nothing. Searching man qemu for "chardev serial" should answer that question. :) There you will also find alternative chardev backends you can use. > And some questions about pci bus. On docs/qdev-device-use.txt, we get > Example: device i440FX-pcihost is on the root bus, and provides a PCI > bus named pci.0. To put a FOO device into its slot 4, use -device > FOO,bus=/i440FX-pcihost/pci.0,addr=4. The abbreviated form bus=pci.0 > also works as long as the bus name is unique. > So, how can we get the name of the root device which we use now? You can browse the QOM hierarchy using the ./QMP/qom-list script and an appropriate -qmp option (e.g. unix:./qmp-sock,server,nowait). But leaving out the bus= option should work fine just as well. Regards, Andreas > I searched that for some days, but doesnot get some usefull information. > > Thanks, > Jin yang. -- SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] CAN device 2013-06-28 12:51 ` Andreas Färber @ 2013-06-30 12:25 ` Yang Jin 2013-06-30 12:37 ` Andreas Färber 0 siblings, 1 reply; 4+ messages in thread From: Yang Jin @ 2013-06-30 12:25 UTC (permalink / raw) To: Andreas Färber; +Cc: qemu-devel [-- Attachment #1: Type: text/plain, Size: 2649 bytes --] Hi, Thanks, Andreas. It really help me a lot. When I man qemu, I found "path specifies the name of the serial device to open". Does that mean I should have a real serial device or I cannot test it? Can I test it just in a virtual environment? When I try to open a /dev/ttyS0 through "cat /dev/ttyS0", error "Input/output error". I google it, and found many reasons can cause that error. How should I test it? Thanks, Jin Yang. 2013/6/28 Andreas Färber <afaerber@suse.de> > Hi, > > Am 28.06.2013 14:19, schrieb Yang Jin: > > I try to develop a CAN device on QEMU. And I found pci-serial is similar > > to CAN. > > > > Untill now, I have some questions about how to use pci-serial on QEMU. > > Actually, QEMU use isa-serial as a default serial device. So I try to > > use isa-serial firstly. > > > > Some useful information we can get from docs/qdev-device-use.txt. I know > > that we should use "-chardev" argument to create a host part, and then > > use "-device isa-serial,iobase=IOADDR,irq=IRQ,index=IDX" to start a > > isa-serial. I get those arguments from the source file, the following > > can work. > > "-device isa-serial,chardev=isa0,iobase=0x3f8,irq=4,index=0" > > However, when I try to create a host through "-chardev > > serial,id=isa0,path=./", error "chardev: opening backend "serial" > > failed" occurs. When change it to "-chardev > > serial,id=isa0,path=/dev/ttyS0", it works. Now, I donot know what "path" > > means? Does it have some relation to the host device? Or it's just a > > symbol means nothing. > > Searching man qemu for "chardev serial" should answer that question. :) > There you will also find alternative chardev backends you can use. > > > And some questions about pci bus. On docs/qdev-device-use.txt, we get > > Example: device i440FX-pcihost is on the root bus, and provides a PCI > > bus named pci.0. To put a FOO device into its slot 4, use -device > > FOO,bus=/i440FX-pcihost/pci.0,addr=4. The abbreviated form bus=pci.0 > > also works as long as the bus name is unique. > > So, how can we get the name of the root device which we use now? > > You can browse the QOM hierarchy using the ./QMP/qom-list script and an > appropriate -qmp option (e.g. unix:./qmp-sock,server,nowait). > > But leaving out the bus= option should work fine just as well. > > Regards, > Andreas > > > I searched that for some days, but doesnot get some usefull information. > > > > Thanks, > > Jin yang. > > -- > SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany > GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg > [-- Attachment #2: Type: text/html, Size: 3521 bytes --] ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] CAN device 2013-06-30 12:25 ` Yang Jin @ 2013-06-30 12:37 ` Andreas Färber 0 siblings, 0 replies; 4+ messages in thread From: Andreas Färber @ 2013-06-30 12:37 UTC (permalink / raw) To: Yang Jin; +Cc: qemu-devel Hi, Am 30.06.2013 14:25, schrieb Yang Jin: > Thanks, Andreas. It really help me a lot. > > When I man qemu, I found "path specifies the name of the serial device > to open". Does that mean I should have a real serial device or I cannot > test it? Can I test it just in a virtual environment? When I try to open > a /dev/ttyS0 through "cat /dev/ttyS0", error "Input/output error". -chardev serial is for a serial device. If you cannot or don't want to use one, just use a different -chardev parameter. The man page I pointed you to documents quite a few: null, file, pipe, stdio and many more. I cannot guess which one is best for what you are trying to do. ;) Regards, Andreas P.S. Please avoid top-posting on the mailing list. -- SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-06-30 12:37 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2013-06-28 12:19 [Qemu-devel] CAN device Yang Jin 2013-06-28 12:51 ` Andreas Färber 2013-06-30 12:25 ` Yang Jin 2013-06-30 12:37 ` Andreas Färber
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).