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
19 * You can also choose to distribute this program under the terms of
20 * the Unmodified Binary Distribution Licence (as given in the file
21 * COPYING.UBDL), provided that you have satisfied its requirements.
25 FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL )
29 /****************************************************************************
31 ****************************************************************************
33 .section ".text16.data", "aw", @progbits
37 .ascii "!PXE" /* Signature */
38 .byte pxe_length /* StructLength */
39 .byte 0 /* StructCksum */
40 .byte 0 /* StructRev */
41 .byte 0 /* reserved_1 */
42 .word undiheader, 0 /* UNDIROMID */
43 .word 0, 0 /* BaseROMID */
44 .word pxe_entry_sp, 0 /* EntryPointSP */
45 .word pxe_entry_esp, 0 /* EntryPointESP */
46 .word -1, -1 /* StatusCallout */
47 .byte 0 /* reserved_2 */
48 .byte SegDescCnt /* SegDescCnt */
49 .word 0 /* FirstSelector */
51 .word 0, 0, 0, _data16_memsz /* Stack */
52 .word 0, 0, 0, _data16_memsz /* UNDIData */
53 .word 0, 0, 0, _text16_memsz /* UNDICode */
54 .word 0, 0, 0, _text16_memsz /* UNDICodeWrite */
55 .word 0, 0, 0, 0 /* BC_Data */
56 .word 0, 0, 0, 0 /* BC_Code */
57 .word 0, 0, 0, 0 /* BC_CodeWrite */
58 .equ SegDescCnt, ( ( . - pxe_segments ) / 8 )
59 .equ pxe_length, . - ppxe
62 /* Define undiheader=0 as a weak symbol for non-ROM builds */
63 .section ".weak", "a", @nobits
67 /****************************************************************************
69 ****************************************************************************
71 .section ".text16.data", "aw", @progbits
75 .ascii "PXENV+" /* Signature */
76 .word 0x0201 /* Version */
77 .byte pxenv_length /* Length */
78 .byte 0 /* Checksum */
79 .word pxenv_entry, 0 /* RMEntry */
81 .word 0 /* PMSelector */
82 .word 0 /* StackSeg */
83 .word _data16_memsz /* StackSize */
84 .word 0 /* BC_CodeSeg */
85 .word 0 /* BC_CodeSize */
86 .word 0 /* BC_DataSeg */
87 .word 0 /* BC_DataSize */
88 .word 0 /* UNDIDataSeg */
89 .word _data16_memsz /* UNDIDataSize */
90 .word 0 /* UNDICodeSeg */
91 .word _text16_memsz /* UNDICodeSize */
92 .word ppxe, 0 /* PXEPtr */
93 .equ pxenv_length, . - pxenv
94 .size pxenv, . - pxenv
96 /****************************************************************************
97 * pxenv_entry (16-bit far call)
99 * PXE API call PXENV+ entry point
102 * %es:di : Far pointer to PXE parameter structure
105 * %ax : PXE exit status
108 ****************************************************************************
110 /* Wyse Streaming Manager server (WLDRM13.BIN) assumes that
111 * the PXENV+ entry point is at UNDI_CS:0000; apparently,
112 * somebody at Wyse has difficulty distinguishing between the
113 * words "may" and "must"...
115 .section ".text16.null", "ax", @progbits
120 .section ".text16", "ax", @progbits
128 .size pxenv_entry, . - pxenv_entry
130 /****************************************************************************
133 * PXE API call !PXE entry point
136 * stack : Far pointer to PXE parameter structure
137 * stack : PXE API call
139 * %ax : PXE exit status
142 ****************************************************************************
144 .section ".text16", "ax", @progbits
148 /* Preserve original %esp */
150 /* Zero high word of %esp to allow use of common code */
154 /* Preserve %esp to match behaviour of pxe_entry_sp */
157 /* Save PXENV+ API call registers */
161 /* Load !PXE parameters from stack into PXENV+ registers */
162 addr32 movw 18(%esp), %bx
164 addr32 movw 16(%esp), %di
165 addr32 movw 14(%esp), %bx
166 /* Make call as for PXENV+ */
169 /* Restore PXENV+ registers */
173 /* Restore original %esp and return */
176 .size pxe_entry, . - pxe_entry
178 /****************************************************************************
187 * %es:bx : Far pointer to the PXENV+ structure
188 * %edx : Physical address of the PXENV+ structure
192 ****************************************************************************
194 .section ".text16", "ax", @progbits
201 /* INT 1A,5650 - PXE installation check */
211 andb $~0x01, 8(%bp) /* Clear CF on return */
215 1: /* INT 1A,other - pass through */
217 ljmp *%cs:pxe_int_1a_vector
219 .section ".text16.data", "aw", @progbits
220 .globl pxe_int_1a_vector
221 pxe_int_1a_vector: .long 0