; Initialize PM invocation framework
call pm_init
+%if IS_PXELINUX
+ ; Save derivative-specific data
+ pm_call pm_save_data
+%endif
+
; Decompress PM code to its target location
pm_call pm_decompress
cmp eax,__pm_code_len
; the spillover from the last fractional sector load.
section .uibss write nobits align=16
+ section .savedata write nobits align=16
+
; Symbols from linker script
%macro SECINFO 1
extern __%1_start, __%1_lma, __%1_end
lss esp,[BaseStack]
sti ; Stack set up and ready
-;
-; Move the hardwired DHCP options (if present) to a safe place...
-;
-bdhcp_copy:
- mov cx,[bdhcp_len]
- mov ax,trackbufsize/2
- jcxz .none
- cmp cx,ax
- jbe .oksize
- mov cx,ax
- mov [bdhcp_len],ax
-.oksize:
- mov eax,[bdhcp_offset]
- add eax,_start
- mov si,ax
- and si,000Fh
- shr eax,4
- push ds
- mov ds,ax
- mov di,trackbuf
- add cx,3
- shr cx,2
- rep movsd
- pop ds
-.none:
-
-adhcp_copy:
- mov cx,[adhcp_len]
- mov ax,trackbufsize/2
- jcxz .none
- cmp cx,ax
- jbe .oksize
- mov cx,ax
- mov [adhcp_len],ax
-.oksize:
- mov eax,[adhcp_offset]
- add eax,_start
- mov si,ax
- and si,000Fh
- shr eax,4
- push ds
- mov ds,ax
- mov di,trackbuf+trackbufsize/2
- add cx,3
- shr cx,2
- rep movsd
- pop ds
-.none:
;
; Initialize screen (if we're using one)
auto_boot:
pm_call hello
+;
+; Save hardwired DHCP options. This is done before the C environment
+; is initialized, so it has to be done in assembly.
+;
+%define MAX_DHCP_OPTS 4096
+ bits 32
+
+ section .savedata
+ global bdhcp_data, adhcp_data
+bdhcp_data: resb MAX_DHCP_OPTS
+adhcp_data: resb MAX_DHCP_OPTS
+
+ section .textnr
+pm_save_data:
+ mov eax,MAX_DHCP_OPTS
+ movzx ecx,word [bdhcp_len]
+ cmp ecx,eax
+ jna .oksize
+ mov ecx,eax
+ mov [bdhcp_len],ax
+.oksize:
+ mov esi,[bdhcp_offset]
+ add esi,_start
+ mov edi,bdhcp_data
+ add ecx,3
+ shr ecx,2
+ rep movsd
+
+adhcp_copy:
+ movzx ecx,word [adhcp_len]
+ cmp ecx,eax
+ jna .oksize
+ mov ecx,eax
+ mov [adhcp_len],ax
+.oksize:
+ mov esi,[adhcp_offset]
+ add esi,_start
+ mov edi,adhcp_data
+ add ecx,3
+ shr ecx,2
+ rep movsd
+ ret
+
+ bits 16
+
; As core/ui.inc used to be included here in core/pxelinux.asm, and it's no
; longer used, its global variables that were previously used by
; core/pxelinux.asm are now declared here.
- section .bss16
+ section .bss16
alignb 4
Kernel_EAX resd 1
Kernel_SI resw 1
/* Very large objects which don't need to be zeroed */
+ . = ALIGN(128);
+
__hugebss_vma = .;
__hugebss_lma = .; /* Dummy */
.hugebss (NOLOAD) : AT (__hugebss_lma) {
__hugebss_len = ABSOLUTE(__hugebss_end) - ABSOLUTE(__hugebss_start);
__hugebss_dwords = (__hugebss_len + 3) >> 2;
+ /* Data saved away before bss initialization */
+ . = ALIGN(128);
+
+ __savedata_vma = .;
+ __savedata_lma = .; /* Dummy */
+ .savedata (NOLOAD) : AT (__savedata_lma) {
+ __savedata_start = .;
+ *(.savedata)
+ *(.savedata.*)
+ __savedata_end = .;
+ }
+ __savedata_len = ABSOLUTE(__savedata_end) - ABSOLUTE(__savedata_start);
+ __savedata_dwords = (__savedata_len + 3) >> 2;
/* XXX: This stack should be unified with the COM32 stack */
__stack_vma = .;