You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

pxe_extensions 7.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312
  1. FILE OPEN
  2. Op-Code: PXENV_FILE_OPEN (00e0h)
  3. Input: Far pointer to a t_PXENV_FILE_OPEN parameter structure
  4. that has been initialised by the caller.
  5. Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be
  6. returned in AX. The status field in the parameter
  7. structure must be set to one of the values represented
  8. by the PXENV_STATUS_xxx constants.
  9. Description: Opens a file specified by a URL for reading. Multiple
  10. files may be opened and used concurrently.
  11. typedef struct s_PXENV_FILE_OPEN {
  12. PXENV_STATUS Status;
  13. UINT16 FileHandle;
  14. SEGOFF16 FileName;
  15. UINT32 Reserved;
  16. } t_PXENV_FILE_OPEN;
  17. Set before calling API service:
  18. FileName: URL of file to be opened. Null terminated.
  19. Reserved: Must be zero.
  20. Returned from API service:
  21. FileHandle: Handle for use in subsequent PXE FILE API calls.
  22. Status: See PXENV_STATUS_xxx constants.
  23. FILE CLOSE
  24. Op-Code: PXENV_FILE_CLOSE (00e1h)
  25. Input: Far pointer to a t_PXENV_FILE_CLOSE parameter structure
  26. that has been initialised by the caller.
  27. Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be
  28. returned in AX. The status field in the parameter
  29. structure must be set to one of the values represented
  30. by the PXENV_STATUS_xxx constants.
  31. Description: Closes a previously opened file.
  32. typedef struct s_PXENV_FILE_CLOSE {
  33. PXENV_STATUS Status;
  34. UINT16 FileHandle;
  35. } t_PXENV_FILE_CLOSE;
  36. Set before calling API service:
  37. FileHandle: Handle obtained when file was opened.
  38. Returned from API service:
  39. Status: See PXENV_STATUS_xxx constants.
  40. FILE SELECT
  41. Op-Code: PXENV_FILE_SELECT (00e2h)
  42. Input: Far pointer to a t_PXENV_FILE_SELECT parameter structure
  43. that has been initialised by the caller.
  44. Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be
  45. returned in AX. The status field in the parameter
  46. structure must be set to one of the values represented
  47. by the PXENV_STATUS_xxx constants.
  48. Description: Check a previously opened file's readiness for I/O.
  49. typedef struct s_PXENV_FILE_SELECT {
  50. PXENV_STATUS Status;
  51. UINT16 FileHandle;
  52. UINT16 Ready;
  53. #define RDY_READ 0x0001
  54. } t_PXENV_FILE_SELECT;
  55. Set before calling API service:
  56. FileHandle: Handle obtained when file was opened.
  57. Returned from API service:
  58. Ready: Indication of readiness. This can be zero, or more,
  59. of the RDY_xxx constants. Multiple values are
  60. arithmetically or-ed together.
  61. Status: See PXENV_STATUS_xxx constants.
  62. FILE READ
  63. Op-Code: PXENV_FILE_READ (00e3h)
  64. Input: Far pointer to a t_PXENV_FILE_READ parameter structure
  65. that has been initialised by the caller.
  66. Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be
  67. returned in AX. The status field in the parameter
  68. structure must be set to one of the values represented
  69. by the PXENV_STATUS_xxx constants.
  70. This API function is non-blocking. PXENV_EXIT_SUCCESS
  71. and PXENV_STATUS_SUCCESS is returned if a data block
  72. has been transferred into the caller's buffer.
  73. PXENV_EXIT_FAILURE and PXENV_STATUS_TFTP_OPEN is
  74. returned if no data is available to transfer; any
  75. other status code reflects an error.
  76. Description: Read from a previously opened file.
  77. typedef struct s_PXENV_FILE_READ {
  78. PXENV_STATUS Status;
  79. UINT16 FileHandle;
  80. UINT16 BufferSize;
  81. SEGOFF16 Buffer;
  82. } t_PXENV_FILE_READ;
  83. Set before calling API service:
  84. FileHandle: Handle obtained when file was opened.
  85. BufferSize: Maximum number of data bytes that can be copied into
  86. Buffer.
  87. Buffer: Segment:Offset address of data buffer.
  88. Returned from API service:
  89. BufferSize: Number of bytes written to the data buffer. End of
  90. file if this is zero.
  91. Status: See PXENV_STATUS_xxx constants.
  92. GET FILE SIZE
  93. Op-Code: PXENV_GET_FILE_SIZE (00e4h)
  94. Input: Far pointer to a t_PXENV_GET_FILE_SIZE parameter
  95. structure that has been initialised by the caller.
  96. Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be
  97. returned in AX. The status field in the parameter
  98. structure must be set to one of the values represented
  99. by the PXENV_STATUS_xxx constants.
  100. Description: Determine size of a previously opened file.
  101. typedef struct s_PXENV_GET_FILE_SIZE {
  102. PXENV_STATUS Status;
  103. UINT16 FileHandle;
  104. UINT32 FileSize;
  105. } t_PXENV_GET_FILE_SIZE;
  106. Set before calling API service:
  107. FileHandle: Handle obtained when file was opened.
  108. Returned from API service:
  109. FileSize: Size of the file in bytes.
  110. Status: See PXENV_STATUS_xxx constants.
  111. FILE EXEC
  112. Op-Code: PXENV_FILE_EXEC (00e5h)
  113. Input: Far pointer to a t_PXENV_FILE_EXEC parameter
  114. structure that has been initialized by the caller.
  115. Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be
  116. returned in AX. The Status field in the parameter
  117. structure must be set to one of the values represented
  118. by the PXENV_STATUS_xxx constants.
  119. Description: Execute a iPXE command.
  120. typedef struct s_PXENV_FILE_EXEC {
  121. PXENV_STATUS_t Status;
  122. SEGOFF16_t Command;
  123. } t_PXENV_FILE_EXEC;
  124. Set before calling API service:
  125. Command: Command to execute. Null terminated.
  126. Returned from API service:
  127. Status: See PXENV_STATUS_xxx constants.
  128. FILE API CHECK
  129. Op-Code: PXENV_FILE_API_CHECK (00e6h)
  130. Input: Far pointer to a t_PXENV_FILE_CHECK_API parameter
  131. structure that has been initialized by the caller.
  132. On entry, the Magic field should contain the number
  133. 0x91d447b2 or the call will fail.
  134. Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be
  135. returned in AX. The Status field in the parameter
  136. structure must be set to one of the values represented
  137. by the PXENV_STATUS_xxx constants.
  138. If this API is present and the Magic field contains the
  139. proper value on entry, AX will contain PXENV_EXIT_SUCCESS,
  140. the Status field PXENV_STATUS_SUCCESS, and the Magic field
  141. the number 0xe9c17b20. Any other combination should be
  142. considered a failure.
  143. Description: Detect presence of this API.
  144. typedef struct s_PXENV_FILE_CHECK_API {
  145. PXENV_STATUS Status;
  146. UINT16 Size;
  147. UINT32 Magic;
  148. UINT32 Provider;
  149. UINT32 APIMask;
  150. UINT32 Flags;
  151. } t_PXENV_FILE_CHECK_API;
  152. Set before calling API service:
  153. Size: Set to sizeof(t_PXENV_FILE_CHECK_API) (20).
  154. Magic: Set to 0x91d447b2.
  155. Returned from API service:
  156. Size: Set to the number of bytes filled in (20).
  157. Magic: Set to 0xe9c17b20.
  158. Provider: Set to 0x45585067 ("iPXE"). Another implementation of this
  159. API can use another value, e.g. to indicate a different
  160. command set supported by FILE EXEC.
  161. APIMask: Bitmask of supported API functions (one bit for each function
  162. in the range 00e0h to 00ffh).
  163. Flags: Set to zero, reserved for future use.
  164. FILE EXIT HOOK
  165. Op-Code: PXENV_FILE_EXIT_HOOK (00e7h)
  166. Input: Far pointer to a t_PXENV_FILE_EXIT_HOOK parameter
  167. structure that has been initialized by the caller.
  168. Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be
  169. returned in AX. The Status field in the parameter
  170. structure must be set to one of the values represented
  171. by the PXENV_STATUS_xxx constants.
  172. Description: Modify the exit path to jump to the specified code.
  173. Only valid for pxeprefix-based builds.
  174. typedef struct s_PXENV_FILE_EXIT_HOOK {
  175. PXENV_STATUS_t Status;
  176. SEGOFF16_t Hook;
  177. } t_PXENV_FILE_EXIT_HOOK;
  178. Set before calling API service:
  179. Hook: The SEG16:OFF16 of the code to jump to.
  180. Returned from API service:
  181. Status: See PXENV_STATUS_xxx constants.