movw %ax, (init_librm_vector+2)
lcall *init_librm_vector
+ /* Prepare for return to .prefix segment */
+ pushw %cs
+
+ /* Jump to .text16 segment */
+ pushw %ax
+ pushw $1f
+ lret
+ .section ".text16.install_prealloc", "ax", @progbits
+1:
/* Inhibit INT 15,e820 and INT 15,e801 if applicable */
testl %ebp, %ebp
jnz 1f
* ready for the copy to the new location.
*/
progress " relocate\n"
- movw %ax, (prot_call_vector+2)
pushl $relocate
- lcall *prot_call_vector
+ pushw %cs
+ call prot_call
+ /* Jump back to .prefix segment */
+ pushw $1f
+ lret
+ .section ".prefix.install_prealloc", "awx", @progbits
+1:
/* Copy code to new location */
progress " copy\n"
pushl %edi
.word init_librm
.word 0
.size init_librm_vector, . - init_librm_vector
-prot_call_vector:
- .word prot_call
- .word 0
- .size prot_call_vector, . - prot_call_vector
#endif
close_payload_vector:
.word close_payload
pushw %ds
pushw %es
pushw %bx
+
/* ROM segment address to %ds */
pushw %cs
popw %ds
+
/* UNDI loader parameter structure address into %es:%di */
movw %sp, %bx
movw %ss:22(%bx), %di
movw %ss:24(%bx), %es
+
/* Install to specified real-mode addresses */
pushw %di
movw %es:12(%di), %bx
orl $0xffffffff, %ebp /* Allow arbitrary relocation */
call install_prealloc
popw %di
+
+ /* Jump to .text16 segment */
+ pushw %ax
+ pushw $1f
+ lret
+ .section ".text16", "ax", @progbits
+1:
/* Call UNDI loader C code */
pushl $pxe_loader_call
pushw %cs
- pushw $1f
- pushw %ax
- pushw $prot_call
- lret
+ call prot_call
+
1: /* Restore registers and return */
popw %bx
popw %es
popl %edi
popl %esi
lret
- .size undiloader, . - undiloader