2 * Copyright (C) 2006 Michael Brown <mbrown@fensystems.co.uk>.
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation; either version 2 of the
7 * License, or any later version.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21 FILE_LICENCE ( GPL2_OR_LATER )
25 /****************************************************************************
27 ****************************************************************************
29 .section ".text16.data", "aw", @progbits
33 .ascii "!PXE" /* Signature */
34 .byte pxe_length /* StructLength */
35 .byte 0 /* StructCksum */
36 .byte 0 /* StructRev */
37 .byte 0 /* reserved_1 */
38 .word undiheader, 0 /* UNDIROMID */
39 .word 0, 0 /* BaseROMID */
40 .word pxe_entry_sp, 0 /* EntryPointSP */
41 .word pxe_entry_esp, 0 /* EntryPointESP */
42 .word -1, -1 /* StatusCallout */
43 .byte 0 /* reserved_2 */
44 .byte SegDescCnt /* SegDescCnt */
45 .word 0 /* FirstSelector */
47 .word 0, 0, 0, _data16_memsz /* Stack */
48 .word 0, 0, 0, _data16_memsz /* UNDIData */
49 .word 0, 0, 0, _text16_memsz /* UNDICode */
50 .word 0, 0, 0, _text16_memsz /* UNDICodeWrite */
51 .word 0, 0, 0, 0 /* BC_Data */
52 .word 0, 0, 0, 0 /* BC_Code */
53 .word 0, 0, 0, 0 /* BC_CodeWrite */
54 .equ SegDescCnt, ( ( . - pxe_segments ) / 8 )
55 .equ pxe_length, . - ppxe
58 /* Define undiheader=0 as a weak symbol for non-ROM builds */
59 .section ".weak", "a", @nobits
63 /****************************************************************************
65 ****************************************************************************
67 .section ".text16.data", "aw", @progbits
71 .ascii "PXENV+" /* Signature */
72 .word 0x0201 /* Version */
73 .byte pxenv_length /* Length */
74 .byte 0 /* Checksum */
75 .word pxenv_entry, 0 /* RMEntry */
77 .word 0 /* PMSelector */
78 .word 0 /* StackSeg */
79 .word _data16_memsz /* StackSize */
80 .word 0 /* BC_CodeSeg */
81 .word 0 /* BC_CodeSize */
82 .word 0 /* BC_DataSeg */
83 .word 0 /* BC_DataSize */
84 .word 0 /* UNDIDataSeg */
85 .word _data16_memsz /* UNDIDataSize */
86 .word 0 /* UNDICodeSeg */
87 .word _text16_memsz /* UNDICodeSize */
88 .word ppxe, 0 /* PXEPtr */
89 .equ pxenv_length, . - pxenv
90 .size pxenv, . - pxenv
92 /****************************************************************************
93 * pxenv_entry (16-bit far call)
95 * PXE API call PXENV+ entry point
98 * %es:di : Far pointer to PXE parameter structure
101 * %ax : PXE exit status
104 ****************************************************************************
106 /* Wyse Streaming Manager server (WLDRM13.BIN) assumes that
107 * the PXENV+ entry point is at UNDI_CS:0000; apparently,
108 * somebody at Wyse has difficulty distinguishing between the
109 * words "may" and "must"...
111 .section ".text16.null", "ax", @progbits
116 .section ".text16", "ax", @progbits
124 .size pxenv_entry, . - pxenv_entry
126 /****************************************************************************
129 * PXE API call !PXE entry point
132 * stack : Far pointer to PXE parameter structure
133 * stack : PXE API call
135 * %ax : PXE exit status
138 ****************************************************************************
140 .section ".text16", "ax", @progbits
144 /* Preserve original %esp */
146 /* Zero high word of %esp to allow use of common code */
150 /* Preserve %esp to match behaviour of pxe_entry_sp */
153 /* Save PXENV+ API call registers */
157 /* Load !PXE parameters from stack into PXENV+ registers */
158 addr32 movw 18(%esp), %bx
160 addr32 movw 16(%esp), %di
161 addr32 movw 14(%esp), %bx
162 /* Make call as for PXENV+ */
165 /* Restore PXENV+ registers */
169 /* Restore original %esp and return */
172 .size pxe_entry, . - pxe_entry
174 /****************************************************************************
183 * %es:bx : Far pointer to the PXENV+ structure
184 * %edx : Physical address of the PXENV+ structure
188 ****************************************************************************
190 .section ".text16", "ax", @progbits
197 /* INT 1A,5650 - PXE installation check */
207 andb $~0x01, 8(%bp) /* Clear CF on return */
211 1: /* INT 1A,other - pass through */
213 ljmp *%cs:pxe_int_1a_vector
215 .section ".text16.data", "aw", @progbits
216 .globl pxe_int_1a_vector
217 pxe_int_1a_vector: .long 0