DXE allows you to dynamically load code and data from a file and execute it. Limitations:  you cannot do I/O (and some other functions) directly from a DXE loaded image.  There is a single entry point (subroutine or data block returned).

DXE   ᪨ 㦠     䠩  믮 . ࠭祭:      - 뢮 (  㣨 㭪樨) ।⢥  DXE 㦥 ࠦ.   窠 室 (ணࠬ   ).





There are two parts to DXE - the generator and the loader.

    DXE -   稪.





The DXE generator is a program with the usage:

DXE  - ணࠬ ᯮ:





C:\> dxegen output.dxe symbol input.o [input2.o ... -lgcc -lc]

C:\> dxegen output.dxe symbol input.o [input2.o ... -lgcc -lc]





output.dxe is the name you want to contain your dynamic load code. symbol is the procedure name (or data structure) you want a pointer to, remember to add the initial underscore for most symbols. The input.o is created with GCC from your source.  Additional arguments on the command line (.o and .a files; or other ld options) are passed to ld to resolve references to build your code.

Output.dxe - ,    ᮤঠ  ᪨  㧪.  -  楤 (  ) ன   । 㪠⥫,    砫쭮 ન  設⢠ ᨬ. Input.o ᮧ  GCC  襣 室.  ࠬ   ப (. O . ;  㣨 ld 樨) ।  ld, ⮡  뫪, ⮡ ନ஢  .





The loader only adds around 300 bytes to your image, and the prototype is found in <sys/dxe.h>:

稪 ⮫쪮  300 ⮢  襬 䠩,  ⨯    <sys/dxe.h>:





void *dxe_load(char *filename);

void *dxe_load(char *filename);





It takes a single argument which is the file on disk containing the dynamic execution code.  It returns a pointer to the symbol you specified at DXE generation time.

 楤 ਭ  ࠬ,   䠩  ᪥, ᮤঠ饬 ᪨  믮.  頥 㪠⥫  ᨬ,   ।  DXE    ᮧ.





