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., 675 Mass Ave, Cambridge, MA 02139, USA.
22 /****************************************************************************
24 ****************************************************************************
26 .section ".text16.data", "aw", @progbits
30 .ascii "!PXE" /* Signature */
31 .byte pxe_length /* StructLength */
32 .byte 0 /* StructCksum */
33 .byte 0 /* StructRev */
34 .byte 0 /* reserved_1 */
35 .word undiheader, 0 /* UNDIROMID */
36 .word 0, 0 /* BaseROMID */
37 .word pxe_entry_sp, 0 /* EntryPointSP */
38 .word pxe_entry_esp, 0 /* EntryPointESP */
39 .word -1, -1 /* StatusCallout */
40 .byte 0 /* reserved_2 */
41 .byte SegDescCnt /* SegDescCnt */
42 .word 0 /* FirstSelector */
44 .word 0, 0, 0, _data16_memsz /* Stack */
45 .word 0, 0, 0, _data16_memsz /* UNDIData */
46 .word 0, 0, 0, _text16_memsz /* UNDICode */
47 .word 0, 0, 0, _text16_memsz /* UNDICodeWrite */
48 .word 0, 0, 0, 0 /* BC_Data */
49 .word 0, 0, 0, 0 /* BC_Code */
50 .word 0, 0, 0, 0 /* BC_CodeWrite */
51 .equ SegDescCnt, ( ( . - pxe_segments ) / 8 )
52 .equ pxe_length, . - ppxe
55 /* Define undiheader=0 as a weak symbol for non-ROM builds */
56 .section ".weak", "a", @nobits
60 /****************************************************************************
62 ****************************************************************************
64 .section ".text16.data", "aw", @progbits
68 .ascii "PXENV+" /* Signature */
69 .word 0x0201 /* Version */
70 .byte pxenv_length /* Length */
71 .byte 0 /* Checksum */
72 .word pxenv_entry, 0 /* RMEntry */
74 .word 0 /* PMSelector */
75 .word 0 /* StackSeg */
76 .word _data16_memsz /* StackSize */
77 .word 0 /* BC_CodeSeg */
78 .word 0 /* BC_CodeSize */
79 .word 0 /* BC_DataSeg */
80 .word 0 /* BC_DataSize */
81 .word 0 /* UNDIDataSeg */
82 .word _data16_memsz /* UNDIDataSize */
83 .word 0 /* UNDICodeSeg */
84 .word _text16_memsz /* UNDICodeSize */
85 .word ppxe, 0 /* PXEPtr */
86 .equ pxenv_length, . - pxenv
87 .size pxenv, . - pxenv
89 /****************************************************************************
90 * pxenv_entry (16-bit far call)
92 * PXE API call PXENV+ entry point
95 * %es:di : Far pointer to PXE parameter structure
98 * %ax : PXE exit status
101 ****************************************************************************
103 /* Wyse Streaming Manager server (WLDRM13.BIN) assumes that
104 * the PXENV+ entry point is at UNDI_CS:0000; apparently,
105 * somebody at Wyse has difficulty distinguishing between the
106 * words "may" and "must"...
108 .section ".text16.null", "ax", @progbits
113 .section ".text16", "ax", @progbits
121 .size pxenv_entry, . - pxenv_entry
123 /****************************************************************************
126 * PXE API call !PXE entry point
129 * stack : Far pointer to PXE parameter structure
130 * stack : PXE API call
132 * %ax : PXE exit status
135 ****************************************************************************
137 .section ".text16", "ax", @progbits
141 /* Preserve original %esp */
143 /* Zero high word of %esp to allow use of common code */
147 /* Preserve %esp to match behaviour of pxe_entry_sp */
150 /* Save PXENV+ API call registers */
154 /* Load !PXE parameters from stack into PXENV+ registers */
155 addr32 movw 18(%esp), %bx
157 addr32 movw 16(%esp), %di
158 addr32 movw 14(%esp), %bx
159 /* Make call as for PXENV+ */
162 /* Restore PXENV+ registers */
166 /* Restore original %esp and return */
169 .size pxe_entry, . - pxe_entry
171 /****************************************************************************
180 * %es:bx : Far pointer to the PXENV+ structure
184 ****************************************************************************
186 .section ".text16", "ax", @progbits
193 /* INT 1A,5650 - PXE installation check */
201 1: /* INT 1A,other - pass through */
203 ljmp *%cs:pxe_int_1a_vector
205 .section ".text16.data", "aw", @progbits
206 .globl pxe_int_1a_vector
207 pxe_int_1a_vector: .long 0