summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/src/9/pc/l.s15
1 files changed, 9 insertions, 6 deletions
diff --git a/sys/src/9/pc/l.s b/sys/src/9/pc/l.s
index 5f40295ef..d9ee95597 100644
--- a/sys/src/9/pc/l.s
+++ b/sys/src/9/pc/l.s
@@ -71,8 +71,7 @@ TEXT _multibootentry(SB), $0
STD
REP; MOVSB
MOVL BX, multibootptr-KZERO(SB)
- MOVL $_startPADDR(SB), AX
- ANDL $~KZERO, AX
+ MOVL $_startPADDR-KZERO(SB), AX
JMP* AX
/* multiboot structure pointer (physical address) */
@@ -98,8 +97,7 @@ TEXT _startPADDR(SB), $0
CLI /* make sure interrupts are off */
/* set up the gdt so we have sane plan 9 style gdts. */
- MOVL $tgdtptr(SB), AX
- ANDL $~KZERO, AX
+ MOVL $tgdtptr-KZERO(SB), AX
MOVL (AX), GDTR
MOVW $1, AX
MOVW AX, MSW
@@ -158,9 +156,11 @@ TEXT m0idtptr(SB), $0
WORD $(256*8-1)
LONG $IDTADDR
-TEXT mode32bit(SB), $0
- /* At this point, the GDT setup is done. */
+TEXT vtgdtptr(SB), $0
+ WORD $(3*8)
+ LONG $tgdt(SB)
+TEXT mode32bit(SB), $0
MOVL $((CPU0END-CPU0PDB)>>2), CX
MOVL $PADDR(CPU0PDB), DI
XORL AX, AX
@@ -231,6 +231,9 @@ _setpte:
* be initialised here.
*/
TEXT _startpg(SB), $0
+ MOVL $vtgdtptr(SB), AX
+ MOVL (AX), GDTR
+
MOVL $0, (PDO(0))(CX) /* undo double-map of KZERO at 0 */
MOVL CX, CR3 /* load and flush the mmu */