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.
20 FILE_LICENCE ( GPL2_OR_LATER )
24 /****************************************************************************
26 ****************************************************************************
28 .section ".text16.data", "aw", @progbits
32 .ascii "!PXE" /* Signature */
33 .byte pxe_length /* StructLength */
34 .byte 0 /* StructCksum */
35 .byte 0 /* StructRev */
36 .byte 0 /* reserved_1 */
37 .word undiheader, 0 /* UNDIROMID */
38 .word 0, 0 /* BaseROMID */
39 .word pxe_entry_sp, 0 /* EntryPointSP */
40 .word pxe_entry_esp, 0 /* EntryPointESP */
41 .word -1, -1 /* StatusCallout */
42 .byte 0 /* reserved_2 */
43 .byte SegDescCnt /* SegDescCnt */
44 .word 0 /* FirstSelector */
46 .word 0, 0, 0, _data16_memsz /* Stack */
47 .word 0, 0, 0, _data16_memsz /* UNDIData */
48 .word 0, 0, 0, _text16_memsz /* UNDICode */
49 .word 0, 0, 0, _text16_memsz /* UNDICodeWrite */
50 .word 0, 0, 0, 0 /* BC_Data */
51 .word 0, 0, 0, 0 /* BC_Code */
52 .word 0, 0, 0, 0 /* BC_CodeWrite */
53 .equ SegDescCnt, ( ( . - pxe_segments ) / 8 )
54 .equ pxe_length, . - ppxe
57 /* Define undiheader=0 as a weak symbol for non-ROM builds */
58 .section ".weak", "a", @nobits
62 /****************************************************************************
64 ****************************************************************************
66 .section ".text16.data", "aw", @progbits
70 .ascii "PXENV+" /* Signature */
71 .word 0x0201 /* Version */
72 .byte pxenv_length /* Length */
73 .byte 0 /* Checksum */
74 .word pxenv_entry, 0 /* RMEntry */
76 .word 0 /* PMSelector */
77 .word 0 /* StackSeg */
78 .word _data16_memsz /* StackSize */
79 .word 0 /* BC_CodeSeg */
80 .word 0 /* BC_CodeSize */
81 .word 0 /* BC_DataSeg */
82 .word 0 /* BC_DataSize */
83 .word 0 /* UNDIDataSeg */
84 .word _data16_memsz /* UNDIDataSize */
85 .word 0 /* UNDICodeSeg */
86 .word _text16_memsz /* UNDICodeSize */
87 .word ppxe, 0 /* PXEPtr */
88 .equ pxenv_length, . - pxenv
89 .size pxenv, . - pxenv
91 /****************************************************************************
92 * pxenv_entry (16-bit far call)
94 * PXE API call PXENV+ entry point
97 * %es:di : Far pointer to PXE parameter structure
100 * %ax : PXE exit status
103 ****************************************************************************
105 /* Wyse Streaming Manager server (WLDRM13.BIN) assumes that
106 * the PXENV+ entry point is at UNDI_CS:0000; apparently,
107 * somebody at Wyse has difficulty distinguishing between the
108 * words "may" and "must"...
110 .section ".text16.null", "ax", @progbits
115 .section ".text16", "ax", @progbits
123 .size pxenv_entry, . - pxenv_entry
125 /****************************************************************************
128 * PXE API call !PXE entry point
131 * stack : Far pointer to PXE parameter structure
132 * stack : PXE API call
134 * %ax : PXE exit status
137 ****************************************************************************
139 .section ".text16", "ax", @progbits
143 /* Preserve original %esp */
145 /* Zero high word of %esp to allow use of common code */
149 /* Preserve %esp to match behaviour of pxe_entry_sp */
152 /* Save PXENV+ API call registers */
156 /* Load !PXE parameters from stack into PXENV+ registers */
157 addr32 movw 18(%esp), %bx
159 addr32 movw 16(%esp), %di
160 addr32 movw 14(%esp), %bx
161 /* Make call as for PXENV+ */
164 /* Restore PXENV+ registers */
168 /* Restore original %esp and return */
171 .size pxe_entry, . - pxe_entry
173 /****************************************************************************
182 * %es:bx : Far pointer to the PXENV+ structure
183 * %edx : Physical address of the PXENV+ structure
187 ****************************************************************************
189 .section ".text16", "ax", @progbits
196 /* INT 1A,5650 - PXE installation check */
206 andb $~0x01, 8(%bp) /* Clear CF on return */
210 1: /* INT 1A,other - pass through */
212 ljmp *%cs:pxe_int_1a_vector
214 .section ".text16.data", "aw", @progbits
215 .globl pxe_int_1a_vector
216 pxe_int_1a_vector: .long 0