diff options
author | Frans Kaashoek <[email protected]> | 2011-07-29 07:31:27 -0400 |
---|---|---|
committer | Frans Kaashoek <[email protected]> | 2011-07-29 07:31:27 -0400 |
commit | 9aa0337dc1452a911ac52698c833246a618fc9f3 (patch) | |
tree | 28e25817d4f7c9f7f1e6988949012f46d6c28fb7 /multiboot.S | |
parent | dccb915282854476ce47752df6631dcce3b8f661 (diff) | |
download | xv6-labs-9aa0337dc1452a911ac52698c833246a618fc9f3.tar.gz xv6-labs-9aa0337dc1452a911ac52698c833246a618fc9f3.tar.bz2 xv6-labs-9aa0337dc1452a911ac52698c833246a618fc9f3.zip |
Map kernel high
Very important to give qemu memory through PHYSTOP :(
Diffstat (limited to 'multiboot.S')
-rw-r--r-- | multiboot.S | 11 |
1 files changed, 7 insertions, 4 deletions
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 |