|
@@ -40,7 +40,7 @@ static struct tagged_context
|
40
|
40
|
|
41
|
41
|
static sector_t tagged_download(unsigned char *data, unsigned int len, int eof);
|
42
|
42
|
void xstart16 (unsigned long execaddr, segoff_t location,
|
43
|
|
- void *bootp);
|
|
43
|
+ struct bootpd_t *bootp);
|
44
|
44
|
|
45
|
45
|
static inline os_download_t tagged_probe(unsigned char *data, unsigned int len)
|
46
|
46
|
{
|
|
@@ -173,28 +173,29 @@ static sector_t tagged_download(unsigned char *data, unsigned int len, int eof)
|
173
|
173
|
}
|
174
|
174
|
|
175
|
175
|
void xstart16 (unsigned long execaddr, segoff_t location,
|
176
|
|
- void *bootp) {
|
177
|
|
- struct {
|
178
|
|
- segoff_t execaddr;
|
179
|
|
- segoff_t location;
|
180
|
|
- segoff_t bootp;
|
181
|
|
- } PACKED in_stack;
|
|
176
|
+ struct bootpd_t *bootp) {
|
|
177
|
+ uint16_t basemem_bootp;
|
|
178
|
+ int discard_D, discard_S, discard_b;
|
182
|
179
|
|
183
|
180
|
/* AFAICT, execaddr is actually already a segment:offset */
|
184
|
|
- *((unsigned long *)&in_stack.execaddr) = execaddr;
|
185
|
|
- in_stack.location = location;
|
186
|
|
- in_stack.bootp.segment = SEGMENT(bootp);
|
187
|
|
- in_stack.bootp.offset = OFFSET(bootp);
|
188
|
|
-
|
189
|
|
- RM_FRAGMENT(rm_xstart16,
|
190
|
|
- "popl %eax\n\t" /* Calculated lcall */
|
191
|
|
- "pushw %cs\n\t"
|
192
|
|
- "call 1f\n1:\tpopw %bp\n\t"
|
193
|
|
- "leaw (2f-1b)(%bp), %bx\n\t"
|
194
|
|
- "pushw %bx\n\t"
|
195
|
|
- "pushl %eax\n\t"
|
196
|
|
- "lret\n2:\n\t"
|
197
|
|
- );
|
198
|
|
-
|
199
|
|
- real_call ( rm_xstart16, &in_stack, NULL );
|
|
181
|
+ basemem_bootp = BASEMEM_PARAMETER_INIT ( *bootp );
|
|
182
|
+ REAL_EXEC ( rm_xstart16,
|
|
183
|
+ "pushw %%ds\n\t" /* far pointer to bootp data copy */
|
|
184
|
+ "pushw %%bx\n\t"
|
|
185
|
+ "pushl %%esi\n\t" /* location */
|
|
186
|
+ "pushw %%cs\n\t" /* lcall execaddr */
|
|
187
|
+ "call 1f\n\t"
|
|
188
|
+ "jmp 2f\n\t"
|
|
189
|
+ "\n1:\n\t"
|
|
190
|
+ "pushl %%edi\n\t"
|
|
191
|
+ "lret\n\t"
|
|
192
|
+ "\n2:\n\t"
|
|
193
|
+ "addw $8,%%sp\n\t", /* pop location and bootp ptr */
|
|
194
|
+ 3,
|
|
195
|
+ OUT_CONSTRAINTS ( "=D" ( discard_D ), "=S" ( discard_S ),
|
|
196
|
+ "=b" ( discard_b ) ),
|
|
197
|
+ IN_CONSTRAINTS ( "D" ( execaddr ), "S" ( location ),
|
|
198
|
+ "b" ( basemem_bootp ) ),
|
|
199
|
+ CLOBBER ( "eax", "ecx", "edx", "ebp" ) );
|
|
200
|
+ BASEMEM_PARAMETER_DONE ( *bootp );
|
200
|
201
|
}
|