qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* how to extend to load COFF executable image file
@ 2020-05-12  7:40 xiaolei
  2020-05-12  9:31 ` Peter Maydell
  0 siblings, 1 reply; 3+ messages in thread
From: xiaolei @ 2020-05-12  7:40 UTC (permalink / raw)
  To: qemu-devel

Hi all,
  I attempt to add DSP architecture support for some TI processor, based on QEMU 4.2.
  When I work on the executable file loading , I try to load COFF executable  file. Following the ELF file processing scheme, I thought I could write a function similar to :
       rom_add_elf_program(label, mapped_file, data, file_size, mem_size, addr, as);
  But I got lost when I track down the usage to the global variable  :static QTAILQ_HEAD(, Rom) roms;
  I did not get where this 'roms'  is used for program loading, and how the loaded program get to run eventually.  Can someone give me some hints?

  Also, the COFF file format differs from the ELF, there is no program header. I wonder if I could reuse the 'rom' structure like loading a ELF. Or there is a better way to do it.

struct Rom {
    char *name;
    char *path;

    /* datasize is the amount of memory allocated in "data". If datasize is less
     * than romsize, it means that the area from datasize to romsize is filled
     * with zeros.
     */
    size_t romsize;      //?how to fill romsize for coff file 
    size_t datasize;    //?how to fill datasize for coff file 
    uint8_t *data;      //? for coff file 
    MemoryRegion *mr;
    AddressSpace *as;
    int isrom;
    char *fw_dir;
    char *fw_file;
    GMappedFile *mapped_file;
    bool committed;
    hwaddr addr;
    QTAILQ_ENTRY(Rom) next;
}; 
    Any advise would be appreciated!!

regards,

xiaolei cui

^ permalink raw reply	[flat|nested] 3+ messages in thread
[parent not found: <tencent_129CC651BFBFE9CB46B508FB74F1364C170A@qq.com>]

end of thread, other threads:[~2020-05-14  8:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-05-12  7:40 how to extend to load COFF executable image file xiaolei
2020-05-12  9:31 ` Peter Maydell
     [not found] <tencent_129CC651BFBFE9CB46B508FB74F1364C170A@qq.com>
2020-05-14  8:51 ` Peter Maydell

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).