]> Devi Nivas Git - cs3210-lab1.git/commitdiff
move the kernel to 0x80000000
authorRobert Morris <rtm@csail.mit.edu>
Wed, 31 Aug 2011 13:48:52 +0000 (09:48 -0400)
committerRobert Morris <rtm@csail.mit.edu>
Wed, 31 Aug 2011 13:48:52 +0000 (09:48 -0400)
bootmain.c
kernel.ld
memlayout.h

index 6c9f1ff6ce59d03f198983e8e5908ef354736e2a..72f39272d7d83af2700552a41ecbc97d8b1c6bd1 100644 (file)
@@ -43,7 +43,7 @@ bootmain(void)
 
   // Call the entry point from the ELF header.
   // Does not return!
-  entry = (void(*)(void))(elf->entry & 0xFFFFFF);
+  entry = (void(*)(void))(elf->entry - KERNBASE);
   entry();
 }
 
index 3726f4e8ccfd2b1f6ffa7355332791a6c422dff2..f13ba61d7d38baf24cd1249725c13408c47e6a7b 100644 (file)
--- a/kernel.ld
+++ b/kernel.ld
@@ -8,7 +8,8 @@ ENTRY(_start)
 SECTIONS
 {
        /* Load the kernel at this address: "." means the current address */
-       . = 0xF0100000;
+        /* Must be equal to KERNLINK */
+       . = 0x80100000;
 
        .text : AT(0x100000) {
                *(.text .stub .text.* .gnu.linkonce.t.*)
index c2879b13ec1b5315071fc5c3f1fce350da5259f3..e155e07d3bbd9b882c4199389132a5a5e6b8e25f 100644 (file)
@@ -5,7 +5,7 @@
 #define DEVSPACE 0xFE000000         // Other devices are at high addresses
 
 // Key addresses for address space layout (see kmap in vm.c for the layout)
-#define KERNBASE 0xF0000000         // First kernel virtual address
+#define KERNBASE 0x80000000         // First kernel virtual address
 #define KERNLINK (KERNBASE+EXTMEM)  // Address where kernel is linked
 
 #ifndef __ASSEMBLER__