Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 Apr 2003 16:41:14 -0700 (PDT)
From:      Peter Wemm <peter@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 28370 for review
Message-ID:  <200304062341.h36NfEvM091031@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=28370

Change 28370 by peter@peter_overcee on 2003/04/06 16:41:10

	set the direct mappings correctly.  1GB at physical address zero,
	and 1GB at KERNBASE (hardcoded for now).  Remove debug printfs.

Affected files ...

.. //depot/projects/hammer/sys/boot/i386/libi386/elf64_freebsd.c#6 edit

Differences ...

==== //depot/projects/hammer/sys/boot/i386/libi386/elf64_freebsd.c#6 (text+ko) ====

@@ -89,7 +89,6 @@
     bi->bi_symtab = ssym;	/* XXX this is only the primary kernel symtab */
     bi->bi_esymtab = esym;
 
-printf("initializing trampoline, __base=%#x\n", __base);
 #define PG_V	0x001
 #define PG_RW	0x002
 #define PG_U	0x004
@@ -102,23 +101,25 @@
 	PT4[0] = (p4_entry_t)VTOP((uintptr_t)&PT3[0]);
 	PT4[0] |= PG_V | PG_RW | PG_U;
 
-	/* four PDP entries, 1G each */
-	for (i = 0; i < 4; i++) {
-		PT3[i] = (p3_entry_t)VTOP((uintptr_t)&PT2[i * 512]);
-		PT3[i] |= PG_V | PG_RW | PG_U;
-	}
+	/* Direct map 1GB at address zero */
+	PT3[0] = (p3_entry_t)VTOP((uintptr_t)&PT2[0]);
+	PT3[0] |= PG_V | PG_RW | PG_U;
+
+	/* Direct map 1GB at KERNBASE (hardcoded for now) */
+	PT3[1] = (p3_entry_t)VTOP((uintptr_t)&PT2[0]);
+	PT3[1] |= PG_V | PG_RW | PG_U;
 
-	/* 2048 PG_PS (2MB) page mappings */
-	for (i = 0; i < 2048; i++) {
+	/* 512 PG_PS (2MB) page mappings for 1GB of direct mapping */
+	for (i = 0; i < 512; i++) {
 		PT2[i] = i * (2 * 1024 * 1024);
 		PT2[i] |= PG_V | PG_RW | PG_PS | PG_U;
 	}
 
     entry_lo = ehdr->e_entry & 0xffffffff;
     entry_hi = (ehdr->e_entry >> 32) & 0xffffffff;
-    printf("entry_hi: %#x \n", entry_hi);
-    printf("entry_lo: %#x \n", entry_lo);
+#ifdef DEBUG
     printf("Start @ %#llx ...\n", ehdr->e_entry);
+#endif
 
     dev_cleanup();
     __exec((void *)VTOP(x86_64_tramp), boothowto, bootdev, 0, 0, 0, bootinfop, modulep, bi->bi_kernend);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200304062341.h36NfEvM091031>