Am 18.05.2013 20:24, schrieb Rempel, Cynthia: >>> The RTEMS development community is considering having a Google Summer >>> of Code student test LinCAN on a simulated RTEMS target board using >>> QEMU, and have some questions: >>> >>> 1. What guidelines should the student follow when writing the device > >>> simulation, so the device simulation will be "upstreamed"/accepted by >>> the QEMU project? >>> 2. Is there additional documentation on how to write a device >>> simulation? > >> Unfortunately there is not much documentation. > > Would following the guidance in: > http://lists.gnu.org/archive/html/qemu-devel/2011-07/msg00842.html > increase the probability the device simulation would be committed to qemu?
Unfortunately that is out of date as far as the code goes (QOM is our successor to qdev), but it might serve as a good starting point. I emailed you my KVM Forum slides on QOM with a device skeleton to use as a starting point. One point I would like to point out is that QEMU devices don't simulate their hardware counterpart but instead only emulate them - that is, if you implement, e.g., a Freescale MPC5604B FlexCAN or Renesas RX62N RCAN controller you will deal with register accesses coming from the guest and their abstract concepts like mailboxes and objects rather than actual line-encodings. So if you want, you might get around some of the gory details by implementing the device using an abstract CANBus bus implementation (cf. PCIBus, I2CBus, etc.) and if necessary interfacing with whatever CAN API on the host directly; if you need to externalize this through a -chardev command line option for analysis, it probably requires some more work. Regards, Andreas -- SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg