Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1.  
  2. ---
  3. History
  4.  
  5. 0.1     + First realised, kernel load dll.obj at runtime as starting point berfore app startup
  6.           dll.obj process app import table, but not depended librarys, after that app gots control in his starting point
  7.  
  8. 0.2     + Introduced new KX header as extension for current format (see decription below)
  9.         + Add KX header processing
  10.         + Improved import table test logic, no reason to kill app for import absence - skip import processing (tnx ProMiNick)          
  11.  
  12. ---
  13. Purpose
  14.  
  15. Automatically libraries loads and linking imports.       
  16.  
  17. ---
  18. Limitations
  19.  
  20.  
  21. 1) No error messages are issued if the library or symbol in the library is not found or somthing went wrong
  22.  
  23.  
  24. 2) There is no autoloading of dependent libraries (the library format needs to be improved, see intorduction of KX header extension bellow)
  25.  
  26. ---
  27. How to use
  28.  
  29. - in app:
  30. 1) In the version field of a header,  (after MENUET0x) you must specify the number 2
  31. 2) After existing header add KX header extension as descriprion bellow
  32. 3) Specify imported libraries. Currentry format of import table same as in case of using dll.Load
  33. 4) Add code, without connecting dll.inc and, accordingly, without calling dll.Load. The heap initialization function (f. 68.11) does not need to be called either.
  34.  
  35. 5) Compile the app and run. If everything is done correctly, then on startup the debug board will display the message "App header version 2"
  36.    If the DLL.OBJ library is missing, a message will be displayed, incl. via @NOTIFY. If you get a page error make sure you have completed    steps 2 and 3
  37.  
  38. - in lib (obj):
  39. Not supported yet, will be realized later.
  40. 1) Field optHeader of COFF header need set in 8+n*4, where n is count of fields after KX header
  41. 2) After COFF header add KX header extension (in general same as in case for app)
  42.  
  43. ---
  44. Descriprion of KX header extension (alpha).
  45.  
  46. TBD is meaning that this feature to be determined leter, and not supported yet.
  47. By default all offsets and sizes given in bytes, for Flags field offsets and size given in bits.
  48. Offset 4.x meaning offset 4 bit x
  49.  
  50. Fields between offset 8 and at end of KX header may be added later.
  51.  
  52.  Offset Size    Field                   Meaning
  53.  
  54.                 Signature:
  55.  
  56.  0      2       SigMagic                Module identifier with the value "KX"
  57.  
  58.  2      1       SigRevision             This field should be 0.
  59. In the future, it can take on the revision value
  60.                                         (but can't take values higher than 64)
  61.  
  62.  3      1       SigArch                 This field should be 0.
  63.  
  64.  
  65.  4      2       Flags:
  66.  
  67.  4.0    2b      F_ImageType             TBD, this field should be 0            
  68.  
  69.  4.2    1b      F_SectionMode           TBD, this field should be 0
  70.  
  71.  4.3    1b      F_Const                 TBD, this field should be 0
  72.  
  73.  4.4    1b      F_Data                  TBD, this field should be 0
  74.                
  75.  4.5    1b      F_Export                Module has export table, and pointer after header (see below)
  76.  
  77.  4.6    1b      F_Import                Module has import table
  78.  
  79.  4.7    1b      F_Reserved              Reserved, this field should be 0
  80.  
  81.  4.8    1b      F_BoundImport           TBD, this field should be 0
  82.        
  83.  4.9    1b      F_BSS                   TBD, this field should be 0
  84.  
  85.  4.10   1b      F_TLS                   TBD, this field should be 0
  86.  
  87.  1.11   5b      F_Reserved              Reserved, this field should be 0
  88.  
  89.  
  90.  6      2       Reserved                Reserved, this field should be 0       
  91.        
  92.         ...     TBD                     Fields in this place may be added later
  93.  
  94. if(F_Export) {
  95.  ?      4       ExportsHeader           Pointer to export header (exists if F_Export=1), KX style export table not supported yet. Currently                                             by backward compatibility reason used legacy style of export table, this field pointed to it                   
  96. }
  97.  
  98. if(F_Import) {
  99.  ?      4       ImportsHeader           Pointer to imports header (exists if F_Import=1), KX style import table not supported yet. Currently                                            by backward compatibility reason used legacy style of import table, this field pointed to it
  100. }
  101.  
  102.         ...     TBD                     Fields in this place may be added later
  103.  
  104. ---
  105. EOF