1FILE OPEN 2 3Op-Code: PXENV_FILE_OPEN (00e0h) 4 5Input: Far pointer to a t_PXENV_FILE_OPEN parameter structure 6 that has been initialised by the caller. 7 8Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be 9 returned in AX. The status field in the parameter 10 structure must be set to one of the values represented 11 by the PXENV_STATUS_xxx constants. 12 13Description: Opens a file specified by a URL for reading. Multiple 14 files may be opened and used concurrently. 15 16 17typedef struct s_PXENV_FILE_OPEN { 18 PXENV_STATUS Status; 19 UINT16 FileHandle; 20 SEGOFF16 FileName; 21 UINT32 Reserved; 22} t_PXENV_FILE_OPEN; 23 24 25Set before calling API service: 26 27FileName: URL of file to be opened. Null terminated. 28 29Reserved: Must be zero. 30 31 32Returned from API service: 33 34FileHandle: Handle for use in subsequent PXE FILE API calls. 35 36Status: See PXENV_STATUS_xxx constants. 37 38 39 40 41FILE CLOSE 42 43Op-Code: PXENV_FILE_CLOSE (00e1h) 44 45Input: Far pointer to a t_PXENV_FILE_CLOSE parameter structure 46 that has been initialised by the caller. 47 48Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be 49 returned in AX. The status field in the parameter 50 structure must be set to one of the values represented 51 by the PXENV_STATUS_xxx constants. 52 53Description: Closes a previously opened file. 54 55 56typedef struct s_PXENV_FILE_CLOSE { 57 PXENV_STATUS Status; 58 UINT16 FileHandle; 59} t_PXENV_FILE_CLOSE; 60 61 62Set before calling API service: 63 64FileHandle: Handle obtained when file was opened. 65 66 67Returned from API service: 68 69Status: See PXENV_STATUS_xxx constants. 70 71 72 73 74FILE SELECT 75 76Op-Code: PXENV_FILE_SELECT (00e2h) 77 78Input: Far pointer to a t_PXENV_FILE_SELECT parameter structure 79 that has been initialised by the caller. 80 81Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be 82 returned in AX. The status field in the parameter 83 structure must be set to one of the values represented 84 by the PXENV_STATUS_xxx constants. 85 86Description: Check a previously opened file's readiness for I/O. 87 88 89typedef struct s_PXENV_FILE_SELECT { 90 PXENV_STATUS Status; 91 UINT16 FileHandle; 92 UINT16 Ready; 93#define RDY_READ 0x0001 94} t_PXENV_FILE_SELECT; 95 96 97Set before calling API service: 98 99FileHandle: Handle obtained when file was opened. 100 101 102Returned from API service: 103 104Ready: Indication of readiness. This can be zero, or more, 105 of the RDY_xxx constants. Multiple values are 106 arithmetically or-ed together. 107 108Status: See PXENV_STATUS_xxx constants. 109 110 111 112 113FILE READ 114 115Op-Code: PXENV_FILE_READ (00e3h) 116 117Input: Far pointer to a t_PXENV_FILE_READ parameter structure 118 that has been initialised by the caller. 119 120Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be 121 returned in AX. The status field in the parameter 122 structure must be set to one of the values represented 123 by the PXENV_STATUS_xxx constants. 124 125 This API function is non-blocking. PXENV_EXIT_SUCCESS 126 and PXENV_STATUS_SUCCESS is returned if a data block 127 has been transferred into the caller's buffer. 128 PXENV_EXIT_FAILURE and PXENV_STATUS_TFTP_OPEN is 129 returned if no data is available to transfer; any 130 other status code reflects an error. 131 132Description: Read from a previously opened file. 133 134 135typedef struct s_PXENV_FILE_READ { 136 PXENV_STATUS Status; 137 UINT16 FileHandle; 138 UINT16 BufferSize; 139 SEGOFF16 Buffer; 140} t_PXENV_FILE_READ; 141 142 143Set before calling API service: 144 145FileHandle: Handle obtained when file was opened. 146 147BufferSize: Maximum number of data bytes that can be copied into 148 Buffer. 149 150Buffer: Segment:Offset address of data buffer. 151 152 153Returned from API service: 154 155BufferSize: Number of bytes written to the data buffer. End of 156 file if this is zero. 157 158Status: See PXENV_STATUS_xxx constants. 159 160 161 162 163GET FILE SIZE 164 165Op-Code: PXENV_GET_FILE_SIZE (00e4h) 166 167Input: Far pointer to a t_PXENV_GET_FILE_SIZE parameter 168 structure that has been initialised by the caller. 169 170Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be 171 returned in AX. The status field in the parameter 172 structure must be set to one of the values represented 173 by the PXENV_STATUS_xxx constants. 174 175Description: Determine size of a previously opened file. 176 177 178typedef struct s_PXENV_GET_FILE_SIZE { 179 PXENV_STATUS Status; 180 UINT16 FileHandle; 181 UINT32 FileSize; 182} t_PXENV_GET_FILE_SIZE; 183 184 185Set before calling API service: 186 187FileHandle: Handle obtained when file was opened. 188 189 190Returned from API service: 191 192FileSize: Size of the file in bytes. 193 194Status: See PXENV_STATUS_xxx constants. 195 196 197 198 199FILE EXEC 200 201Op-Code: PXENV_FILE_EXEC (00e5h) 202 203Input: Far pointer to a t_PXENV_FILE_EXEC parameter 204 structure that has been initialized by the caller. 205 206Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be 207 returned in AX. The Status field in the parameter 208 structure must be set to one of the values represented 209 by the PXENV_STATUS_xxx constants. 210 211Description: Execute a gPXE command. 212 213typedef struct s_PXENV_FILE_EXEC { 214 PXENV_STATUS_t Status; 215 SEGOFF16_t Command; 216} t_PXENV_FILE_EXEC; 217 218 219Set before calling API service: 220 221Command: Command to execute. Null terminated. 222 223 224Returned from API service: 225 226Status: See PXENV_STATUS_xxx constants. 227 228 229 230 231FILE API CHECK 232 233Op-Code: PXENV_FILE_API_CHECK (00e6h) 234 235Input: Far pointer to a t_PXENV_FILE_CHECK_API parameter 236 structure that has been initialized by the caller. 237 238 On entry, the Magic field should contain the number 239 0x91d447b2 or the call will fail. 240 241Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be 242 returned in AX. The Status field in the parameter 243 structure must be set to one of the values represented 244 by the PXENV_STATUS_xxx constants. 245 246 If this API is present and the Magic field contains the 247 proper value on entry, AX will contain PXENV_EXIT_SUCCESS, 248 the Status field PXENV_STATUS_SUCCESS, and the Magic field 249 the number 0xe9c17b20. Any other combination should be 250 considered a failure. 251 252Description: Detect presence of this API. 253 254 255typedef struct s_PXENV_FILE_CHECK_API { 256 PXENV_STATUS Status; 257 UINT16 Size; 258 UINT32 Magic; 259 UINT32 Provider; 260 UINT32 APIMask; 261 UINT32 Flags; 262} t_PXENV_FILE_CHECK_API; 263 264Set before calling API service: 265 266Size: Set to sizeof(t_PXENV_FILE_CHECK_API) (20). 267Magic: Set to 0x91d447b2. 268 269 270Returned from API service: 271 272Size: Set to the number of bytes filled in (20). 273Magic: Set to 0xe9c17b20. 274Provider: Set to 0x45585067 ("gPXE"). Another implementation of this 275 API can use another value, e.g. to indicate a different 276 command set supported by FILE EXEC. 277APIMask: Bitmask of supported API functions (one bit for each function 278 in the range 00e0h to 00ffh). 279Flags: Set to zero, reserved for future use. 280 281 282 283 284FILE EXIT HOOK 285 286Op-Code: PXENV_FILE_EXIT_HOOK (00e7h) 287 288Input: Far pointer to a t_PXENV_FILE_EXIT_HOOK parameter 289 structure that has been initialized by the caller. 290 291Output: PXENV_EXIT_SUCCESS or PXENV_EXIT_FAILURE must be 292 returned in AX. The Status field in the parameter 293 structure must be set to one of the values represented 294 by the PXENV_STATUS_xxx constants. 295 296Description: Modify the exit path to jump to the specified code. 297 Only valid for pxeprefix-based builds. 298 299typedef struct s_PXENV_FILE_EXIT_HOOK { 300 PXENV_STATUS_t Status; 301 SEGOFF16_t Hook; 302} t_PXENV_FILE_EXIT_HOOK; 303 304 305Set before calling API service: 306 307Hook: The SEG16:OFF16 of the code to jump to. 308 309 310Returned from API service: 311 312Status: See PXENV_STATUS_xxx constants. 313