summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2009-05-24 19:09:32 -0700
committerH. Peter Anvin <hpa@zytor.com>2009-05-24 19:09:32 -0700
commit476a17a03b9729d4455e7f5516a4bc4c38b83efd (patch)
tree231831ac6077c0fe3a3146efded33856123be16b /core
parent73ab2bf37fb8ebf91fa55e9ece4031840335382d (diff)
downloadsyslinux-476a17a03b9729d4455e7f5516a4bc4c38b83efd.tar.gz
core: load the PM code at 1 MB, COM32R code follows
Load our own (core) PM code at 1 MB; when loading a COM32R module let it follow our own PM code. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'core')
-rw-r--r--core/com32.inc6
-rw-r--r--core/init.inc11
-rw-r--r--core/syslinux.ld8
3 files changed, 11 insertions, 14 deletions
diff --git a/core/com32.inc b/core/com32.inc
index 40c5c034..3dd37b9e 100644
--- a/core/com32.inc
+++ b/core/com32.inc
@@ -28,7 +28,7 @@
; program with an error if run in 16-bit mode.
;
-pm_entry equ 101000h
+ extern com32_entry
section .text16
is_com32_image:
@@ -48,7 +48,7 @@ is_com32_image:
call comboot_setup_api ; Set up the COMBOOT-style API
- mov edi,pm_entry ; Load address
+ mov edi,com32_entry ; Load address
pop eax ; File length
pop si ; File handle
xor dx,dx ; No padding
@@ -83,7 +83,7 @@ com32_start:
push dword command_line ; Command line pointer
push dword 7 ; Argument count
sti ; Interrupts OK now
- call pm_entry ; Run the program...
+ call com32_entry ; Run the program...
; ... on return, fall through to com32_exit ...
com32_exit:
mov bx,.rm
diff --git a/core/init.inc b/core/init.inc
index 5f90b0b0..809fa8ee 100644
--- a/core/init.inc
+++ b/core/init.inc
@@ -57,9 +57,7 @@ common_init:
call adjust_screen
;
-; The code to decompress the PM code. We copy it temporarily to 1 MB;
-; we will probably eventually actually simply run the PM code out of
-; high memory, at which point the extra copy can be dropped.
+; The code to decompress the PM code and initialize other segments.
;
extern _lzo1x_decompress_asm_fast
extern __uibss_auxseg_dwords
@@ -67,16 +65,11 @@ common_init:
section .textnr
bits 32
pm_decompress:
- mov esi,__pm_code_lma
- mov edi,0x100000
- mov ecx,[lzo_data_size]
- call pm_bcopy
-
push 0 ; Space for decompressed size
push esp ; Pointer to previous word
push __pm_code_start ; Target address
push dword [lzo_data_size] ; Compressed size
- push dword 0x100000
+ push dword __pm_code_lma
call _lzo1x_decompress_asm_fast
add esp,16
pop RM_EAX ; Decompressed size
diff --git a/core/syslinux.ld b/core/syslinux.ld
index 26303679..718f2594 100644
--- a/core/syslinux.ld
+++ b/core/syslinux.ld
@@ -194,7 +194,7 @@ SECTIONS
* real-mode segments also allocated.
*/
- . = ALIGN(128);
+ . = 0x100000;
__pm_code_start = .;
@@ -244,6 +244,7 @@ SECTIONS
. = ALIGN(128);
+ /* XXX: This stack should be unified with the COM32 stack */
__stack_vma = .;
.stack : AT(__stack_vma) {
__stack_start = .;
@@ -254,5 +255,8 @@ SECTIONS
__stack_dwords = (__stack_len + 3) >> 2;
_end = .;
- __assert_end = ASSERT(_end <= 0x20000, "pm_code_seg overflow");
+
+ /* COM32R binaries are loaded after our own PM code */
+ . = ALIGN(4096);
+ com32_entry = .;
}