On 19 April 2017 at 12:09, Peter Maydell <[email protected]> wrote:
> On 19 April 2017 at 11:04, Jiahuan Zhang <[email protected]> wrote: > > Okay. Thank you for pointing this out. > > I would like to make a new serial device based on pl011, > > but containing a buffer for guest-to-host data transfer. > > As I've said, the PL011 is inherently byte at a time. > If you want better than that, I recommend you use virtio-serial, > because it already exists for this purpose. > > thanks > -- PMM > Hi Peter, But from the source code, I found the main characteristic of virtio-serial is that, virtio-serial can create multiple serial ports and each port has a pair of control virt-queues and a pair of guest input/output virt-queues. Its "have_data" callback function enables multi-byte data transfer from guest. And it is not in a tranditional device emulation format. I mean that no exact IO region is emulated for it. Without Linux kernel driver, I don't know how to manipulate it. For the time being, I enable the guest app to send data to the pl011's data register directly via a pointer, as you see that in the code above. This is why I am thinking if adding a transmit buffer in pl011 for guest writing is a feasible alternative. Any suggestion is welcome. Regards, Huan
