summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/src/9/pc/l.s18
1 files changed, 17 insertions, 1 deletions
diff --git a/sys/src/9/pc/l.s b/sys/src/9/pc/l.s
index d3e5f5201..128fde3d3 100644
--- a/sys/src/9/pc/l.s
+++ b/sys/src/9/pc/l.s
@@ -46,12 +46,28 @@ TEXT _multibootheader(SB), $0
LONG $_startKADDR-KZERO(SB) /* load_addr */
LONG $edata-KZERO(SB) /* load_end_addr */
LONG $end-KZERO(SB) /* bss_end_addr */
- LONG $_startKADDR-KZERO(SB) /* entry_addr */
+ LONG $_multibootentry-KZERO(SB) /* entry_addr */
LONG $0 /* mode_type */
LONG $0 /* width */
LONG $0 /* height */
LONG $0 /* depth */
+TEXT _multibootentry(SB), $0
+ MOVL $etext-KZERO(SB), SI
+ MOVL SI, DI
+ ADDL $0xfff, DI
+ ANDL $~0xfff, DI
+ MOVL $edata-KZERO(SB), CX
+ SUBL DI, CX
+ ADDL CX, SI
+ ADDL CX, DI
+ STD
+ REP; MOVSB
+ CLD
+ MOVL $_startPADDR(SB), AX
+ ANDL $~KZERO, AX
+ JMP* AX
+
/*
* In protected mode with paging turned off and segment registers setup
* to linear map all memory. Entered via a jump to PADDR(entry),