qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

how to extend to load COFF executable image file


From: xiaolei
Subject: how to extend to load COFF executable image file
Date: Tue, 12 May 2020 15:40:30 +0800

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

reply via email to

[Prev in Thread] Current Thread [Next in Thread]