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 )
31
/****************************************************************************
33
****************************************************************************
35
.section ".text16.data", "aw", @progbits
39
.ascii "!PXE" /* Signature */
40
.byte pxe_length /* StructLength */
41
.byte 0 /* StructCksum */
42
.byte 0 /* StructRev */
43
.byte 0 /* reserved_1 */
44
.word undiheader, 0 /* UNDIROMID */
45
.word 0, 0 /* BaseROMID */
46
.word pxe_entry_sp, 0 /* EntryPointSP */
47
.word pxe_entry_esp, 0 /* EntryPointESP */
48
.word -1, -1 /* StatusCallout */
49
.byte 0 /* reserved_2 */
50
.byte SegDescCnt /* SegDescCnt */
51
.word 0 /* FirstSelector */
53
.word 0, 0, 0, _data16_memsz /* Stack */
54
.word 0, 0, 0, _data16_memsz /* UNDIData */
55
.word 0, 0, 0, _text16_memsz /* UNDICode */
56
.word 0, 0, 0, _text16_memsz /* UNDICodeWrite */
57
.word 0, 0, 0, 0 /* BC_Data */
58
.word 0, 0, 0, 0 /* BC_Code */
59
.word 0, 0, 0, 0 /* BC_CodeWrite */
60
.equ SegDescCnt, ( ( . - pxe_segments ) / 8 )
61
.equ pxe_length, . - ppxe
64
/* Define undiheader=0 as a weak symbol for non-ROM builds */
65
.section ".weak", "a", @nobits
69
/****************************************************************************
71
****************************************************************************
73
.section ".text16.data", "aw", @progbits
77
.ascii "PXENV+" /* Signature */
78
.word 0x0201 /* Version */
79
.byte pxenv_length /* Length */
80
.byte 0 /* Checksum */
81
.word pxenv_entry, 0 /* RMEntry */
83
.word 0 /* PMSelector */
84
.word 0 /* StackSeg */
85
.word _data16_memsz /* StackSize */
86
.word 0 /* BC_CodeSeg */
87
.word 0 /* BC_CodeSize */
88
.word 0 /* BC_DataSeg */
89
.word 0 /* BC_DataSize */
90
.word 0 /* UNDIDataSeg */
91
.word _data16_memsz /* UNDIDataSize */
92
.word 0 /* UNDICodeSeg */
93
.word _text16_memsz /* UNDICodeSize */
94
.word ppxe, 0 /* PXEPtr */
95
.equ pxenv_length, . - pxenv
96
.size pxenv, . - pxenv
98
/****************************************************************************
99
* pxenv_entry (16-bit far call)
101
* PXE API call PXENV+ entry point
104
* %es:di : Far pointer to PXE parameter structure
107
* %ax : PXE exit status
110
****************************************************************************
112
/* Wyse Streaming Manager server (WLDRM13.BIN) assumes that
113
* the PXENV+ entry point is at UNDI_CS:0000; apparently,
114
* somebody at Wyse has difficulty distinguishing between the
115
* words "may" and "must"...
117
.section ".text16.null", "ax", @progbits
122
.section ".text16", "ax", @progbits
125
virtcall pxe_api_call
127
.size pxenv_entry, . - pxenv_entry
129
/****************************************************************************
132
* PXE API call !PXE entry point
135
* stack : Far pointer to PXE parameter structure
136
* stack : PXE API call
138
* %ax : PXE exit status
141
****************************************************************************
143
.section ".text16", "ax", @progbits
147
/* Preserve original %esp */
149
/* Zero high word of %esp to allow use of common code */
153
/* Preserve %esp to match behaviour of pxe_entry_sp */
156
/* Save PXENV+ API call registers */
160
/* Load !PXE parameters from stack into PXENV+ registers */
161
addr32 movw 18(%esp), %bx
163
addr32 movw 16(%esp), %di
164
addr32 movw 14(%esp), %bx
165
/* Make call as for PXENV+ */
168
/* Restore PXENV+ registers */
172
/* Restore original %esp and return */
175
.size pxe_entry, . - pxe_entry
177
/****************************************************************************
186
* %es:bx : Far pointer to the PXENV+ structure
187
* %edx : Physical address of the PXENV+ structure
191
****************************************************************************
193
.section ".text16", "ax", @progbits
200
/* INT 1A,5650 - PXE installation check */
210
andb $~0x01, 8(%bp) /* Clear CF on return */
214
1: /* INT 1A,other - pass through */
216
ljmp *%cs:pxe_int_1a_vector
218
.section ".text16.data", "aw", @progbits
219
.globl pxe_int_1a_vector
220
pxe_int_1a_vector: .long 0