From 9aa0337dc1452a911ac52698c833246a618fc9f3 Mon Sep 17 00:00:00 2001 From: Frans Kaashoek Date: Fri, 29 Jul 2011 07:31:27 -0400 Subject: Map kernel high Very important to give qemu memory through PHYSTOP :( --- multiboot.S | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'multiboot.S') diff --git a/multiboot.S b/multiboot.S index 2579b6d..84ab638 100644 --- a/multiboot.S +++ b/multiboot.S @@ -15,6 +15,9 @@ # } #include "asm.h" +#include "memlayout.h" + +#define RELOC(x) ((x) - KERNBASE) // same as V2P, but without casts #define STACK 4096 @@ -42,7 +45,7 @@ multiboot_header: # boot loader - bootasm.S - sets up. .globl multiboot_entry multiboot_entry: - lgdt gdtdesc + lgdt RELOC(gdtdesc) ljmp $(SEG_KCODE<<3), $mbstart32 mbstart32: @@ -65,11 +68,11 @@ spin: .p2align 2 # force 4 byte alignment gdt: SEG_NULLASM # null seg - SEG_ASM(STA_X|STA_R, 0x0, 0xffffffff) # code seg - SEG_ASM(STA_W, 0x0, 0xffffffff) # data seg + SEG_ASM(STA_X|STA_R, -KERNBASE, 0xffffffff) # code seg + SEG_ASM(STA_W, -KERNBASE, 0xffffffff) # data seg gdtdesc: .word (gdtdesc - gdt - 1) # sizeof(gdt) - 1 - .long gdt # address gdt + .long RELOC(gdt) # address gdt .comm stack, STACK -- cgit v1.2.3