Changes between Version 66 and Version 67 of Developer/Simulators/QEMU/CANEmulation


Ignore:
Timestamp:
Sep 12, 2013, 3:37:55 PM (6 years ago)
Author:
Jinyang
Comment:

/* Step 3: Build a Basic PCI-CAN device in qemu */

Legend:

Unmodified
Added
Removed
Modified
  • Developer/Simulators/QEMU/CANEmulation

    v66 v67  
    436436QEMU use IOhandlder thread to deal with this kind of operation. The main_loop_wait() function in main-loop.c will be always be executed. This actually called main_loop_wait()-main-loop.c => os_host_main_loop_wait()-main-loop.c => select(), which means the system call select() will be called all the time.
    437437
     438So what we should do is like following
     439 *  figure out if we need to read from the real device.
     440 *  wait for reading from the device.
     441 *  read from the device and call the corresponding function.
     442
     443QEMU apply this like following
     444 *  initializing, qemu_set_fd_handler2()-iohandler.c and qemu_chr_add_handlers()-qemu-char.c should be called seperately in can backend and pci-can device.
     445 *  qemu_iohandler_fill()-iohandler.c is called to test if the pci-can device need to read.
     446 *  system call select is called to wait for CAN message.
     447 *  qemu_iohandler_poll()-iohandler.c is called to write the data to pci-can device.
     448
    438449
    439450