; "mov ax,0x4cff; int 0x21" in 16-bit mode. This will abort the
; program with an error if run in 16-bit mode.
;
-
- extern com32_entry
+com32_entry equ free_high_memory
section .text16
is_com32_image:
SECINFO pm_code
extern __bss_start, __bss_end, __bss_len, __bss_dwords
+ extern free_high_memory
+
global _start
section .text16
; The prefix is a small structure that prefaces the actual code;
; it gives the compression program necessary information.
;
- extern __pm_code_lma
section .prefix nowrite progbits align=16
pfx_start dd _start ; Start of raw chunk
mov ecx,8000h ; 32K
sub ecx,esi ; Number of bytes to copy
add esi,(real_mode_seg << 4) ; Pointer to source
- mov edi,100000h ; Copy to address 100000h
+ mov edi,free_high_memory ; Copy to free high memory
call bcopy ; Transfer to high memory
push ds ; We need DS == ES == CS here
pop es
+ mov edx,100000h
test byte [LoadFlags],LOAD_HIGH
jnz .loading_high
movzx eax,word [CmdLineEnd]
stosd
inc cx
+ mov edx,10000h ; Revised target address
+ mov bx,9000h ; Revised real mode segment
- mov eax,10000h ; Target address of low kernel
+.loading_high:
+ mov eax,edx ; Target address of kernel
stosd
- mov eax,100000h ; Where currently loaded
+ mov eax,free_high_memory ; Where currently loaded
stosd
neg eax
add eax,[KernelEnd]
stosd
inc cx
- mov bx,9000h ; Revised real mode segment
-
-.loading_high:
-
cmp word [InitRDPtr],0 ; Did we have an initrd?
je .no_initrd