git: 9front

Download patch

ref: 47059e16ce0ea6db952f27555064049b283a18f3
parent: 6297b2a848f3f68b0ce54ceb177466ab9126cfae
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Tue Apr 7 22:50:09 EDT 2015

pc, pc64: extend initial memory map for qemu multiboot data

qemu puts multiboot data after the end of the kernel image, so
to be able to KADDR() that memory early, we extend the initial
identity mapping by 16K. right now we just got lucky with
the pc kernel as it rounds the map to 4MB pages.

--- a/sys/src/9/pc/l.s
+++ b/sys/src/9/pc/l.s
@@ -186,6 +186,9 @@
 
 	MOVL	$PADDR(CPU0PTE), AX		/* first page of page table */
 	MOVL	$end-KZERO(SB), CX
+
+	ADDL	$(16*1024), CX			/* qemu puts multiboot data after the kernel */
+
 	ADDL	$(BY2XPG-1), CX
 	ANDL	$~(BY2XPG-1), CX		/* round to 4MB */
 	MOVL	CX, MemMin-KZERO(SB)		/* see memory.c */
--- a/sys/src/9/pc64/l.s
+++ b/sys/src/9/pc64/l.s
@@ -149,6 +149,9 @@
 	 */
 	ADDL	$PDO(KZERO), AX
 	MOVL	$end-KZERO(SB), CX
+
+	ADDL	$(16*1024), CX			/* qemu puts multiboot data after the kernel */
+
 	ADDL	$(PGLSZ(1)-1), CX
 	ANDL	$~(PGLSZ(1)-1), CX
 	MOVL	CX, MemMin-KZERO(SB)		/* see memory.c */
--