Commit in reactos on MAIN
hal/halx86/generic/mem.c+42added 1.1
                  /display.c+7-31.1 -> 1.2
hal/halx86/include/hal.h+31.16 -> 1.17
hal/halx86/mp/Makefile+2-11.1 -> 1.2
hal/halx86/up/Makefile+2-11.1 -> 1.2
ntoskrnl/ke/i386/multiboot.S+5-111.30 -> 1.31
+61-16
1 added + 5 modified, total 6 files
Let HAL handle its own mapping of the video frame buffer

reactos/hal/halx86/generic
mem.c added at 1.1
diff -N mem.c
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ mem.c	4 Dec 2004 17:22:46 -0000	1.1
@@ -0,0 +1,42 @@
+/* $Id: mem.c,v 1.1 2004/12/04 17:22:46 gvg Exp $
+ *
+ * COPYRIGHT:       See COPYING in the top level directory
+ * PROJECT:         ReactOS kernel
+ * FILE:            hal/halx86/generic/mem.c
+ * PURPOSE:         Memory mapping functions
+ * PROGRAMMER:      Ge van Geldorp (gvg@reactos.com)
+ * UPDATE HISTORY:
+ *                  Created 2004/12/03
+ */
+
+#include <ddk/ntddk.h>
+
+#define PAGETABLE_MAP     (0xf0000000)
+
+#define ADDR_TO_PTE(v) (PULONG)(PAGETABLE_MAP + ((((ULONG)(v) / 1024))&(~0x3)))
+
+#define VIRT_ADDR 0xff400000
+
+PVOID
+HalpMapPhysMemory(ULONG PhysAddr, ULONG Size)
+{
+  PULONG PageTable;
+  unsigned i;
+
+  PageTable = (PULONG)PAGE_ROUND_DOWN((PVOID)ADDR_TO_PTE(VIRT_ADDR));
+  for (i = 0; i < PAGE_ROUND_UP(Size) / PAGE_SIZE; i++)
+    {
+      PageTable[i] = (PhysAddr | 0x3);
+      PhysAddr += PAGE_SIZE;
+    }
+
+  /* Flush TLB */
+  __asm__ __volatile__(
+    "movl %%cr3,%%eax\n\t"
+    "movl %%eax,%%cr3\n\t"
+    : : : "eax" );
+
+  return (PVOID) VIRT_ADDR;
+}
+
+/* EOF */

reactos/hal/halx86/generic
display.c 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- display.c	3 Dec 2004 20:10:43 -0000	1.1
+++ display.c	4 Dec 2004 17:22:46 -0000	1.2
@@ -16,7 +16,7 @@
  *  along with this program; if not, write to the Free Software
  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  */
-/* $Id: display.c,v 1.1 2004/12/03 20:10:43 gvg Exp $
+/* $Id: display.c,v 1.2 2004/12/04 17:22:46 gvg Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
@@ -126,6 +126,10 @@
 
 #define SCREEN_SYNCHRONIZATION
 
+#define VGA_GRAPH_MEM 0xa0000
+#define VGA_CHAR_MEM  0xb8000
+#define VGA_END_MEM   0xbffff
+
 #define VGA_AC_INDEX            0x3c0
 #define VGA_AC_READ             0x3c1
 #define VGA_AC_WRITE            0x3c0
@@ -577,8 +581,8 @@
       ULONG ScanLines;
       ULONG Data;
 
-      VideoBuffer = (PUSHORT)(0xff3b8000);
-      GraphVideoBuffer = (PUCHAR)(0xff3a0000);
+      GraphVideoBuffer = (PUCHAR) HalpMapPhysMemory(VGA_GRAPH_MEM, VGA_END_MEM - VGA_GRAPH_MEM + 1);
+      VideoBuffer = (PUSHORT) (GraphVideoBuffer + (VGA_CHAR_MEM - VGA_GRAPH_MEM));
 
       /* Set cursor position */
 //      CursorX = LoaderBlock->cursorx;

reactos/hal/halx86/include
hal.h 1.16 -> 1.17
diff -u -r1.16 -r1.17
--- hal.h	3 Dec 2004 20:10:44 -0000	1.16
+++ hal.h	4 Dec 2004 17:22:46 -0000	1.17
@@ -33,6 +33,9 @@
 /* dma.c */
 VOID HalpInitDma (VOID);
 
+/* mem.c */
+PVOID HalpMapPhysMemory(ULONG PhysAddr, ULONG Size);
+
 /* Non-generic initialization */
 VOID HalpInitPhase0 (VOID);
 

reactos/hal/halx86/mp
Makefile 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- Makefile	3 Dec 2004 20:10:44 -0000	1.1
+++ Makefile	4 Dec 2004 17:22:47 -0000	1.2
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.1 2004/12/03 20:10:44 gvg Exp $
+# $Id: Makefile,v 1.2 2004/12/04 17:22:47 gvg Exp $
 
 PATH_TO_TOP = ../../..
 
@@ -48,6 +48,7 @@
 	isa.o \
 	kdbg.o \
 	mca.o \
+	mem.o \
 	misc.o \
 	pci.o \
 	portio.o \

reactos/hal/halx86/up
Makefile 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- Makefile	3 Dec 2004 20:10:45 -0000	1.1
+++ Makefile	4 Dec 2004 17:22:47 -0000	1.2
@@ -1,4 +1,4 @@
-# $Id: Makefile,v 1.1 2004/12/03 20:10:45 gvg Exp $
+# $Id: Makefile,v 1.2 2004/12/04 17:22:47 gvg Exp $
 
 PATH_TO_TOP = ../../..
 
@@ -52,6 +52,7 @@
 	isa.o \
 	kdbg.o \
 	mca.o \
+	mem.o \
 	misc.o \
 	pci.o \
 	portio.o \

reactos/ntoskrnl/ke/i386
multiboot.S 1.30 -> 1.31
diff -u -r1.30 -r1.31
--- multiboot.S	28 Nov 2004 01:31:07 -0000	1.30
+++ multiboot.S	4 Dec 2004 17:22:47 -0000	1.31
@@ -119,6 +119,7 @@
 	movl	$(V2P(apic_pagetable) + 0x3), 0xFEC(%esi)
 #endif /* MP */
 	movl	$(V2P(kpcr_pagetable) + 0x3), 0xFF0(%esi)
+	movl	$(V2P(hal_pagetable) + 0x3), 0xFF4(%esi)
 
 	/*
 	 * Initialize the page table that maps low memory
@@ -174,17 +175,6 @@
 	movl	$0x1003, %eax
 	movl	%eax, (%esi, %edi)
 
-	/*
-	 * Initialize a part of the same pagetable to map the vga frame buffer (at FF3A0000).
-	 */
-	movl	$0xa0003, %eax
-	movl	$0x20, %ecx
-	movl	$0xE80, %edi
-.l9:
-	movl	%eax, (%esi, %edi)
-	add	$4, %edi
-	add	$0x1000, %eax
-	loop	.l9
 
 #ifdef MP
 
@@ -373,6 +363,10 @@
 
 kpcr_pagetable:
 	.fill 4096, 1, 0
+
+/* Reserve a pagetable for HAL to play around with during early boot */
+hal_pagetable:
+	.fill 4096, 1, 0
 _pagetable_end:
 _unmap_me:
 	.fill 4096, 1, 0
CVSspam 0.2.8